This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: Synchronize 1ms timer with interrupt

Part Number: TMS320F280025C


Hi,

I'm using the universal motor control lab with a 1ms trajectory generator for new reference positions. The problem that occurs now is, that the 1ms timer from the HAL_getCPUTimerStatus() is not synchronized with the

motor1CtrlISR(), and so they shift to each in time and around every 50s the interrupt interrupts the 1ms task and lead in position control mode to audiable noise.

Now, what I have tried is to trigger the 1ms task from the ISR itself, but then is a constant and random shift in time between the ISR and the 1ms task and in around 1% of the cases they intersect and lead to constant audiable noise. My question is, how can I make a synchronized 1ms task, that always has the same constant time shift to the ISR routine (the ISR should never interrupt the 1ms task, which takes around 10us and so they should have a constant phase shift to each other)?

Phaseshift is non-zero --> perfect:

Phaseshift is zero --> Noise:

  • Hi,

    For synchronizing your 1ms task to the motor1CtrlISR(), I have the suggestions below. There isn't a direct sync signal between the CPU timer and ePWM peripherals.

    1. Reset the CPU timer periodically in the motor1CtrlISR()
    2. Use a ePWM module instead of CPU timer to trigger your task.
    Now, what I have tried is to trigger the 1ms task from the ISR itself, but then is a constant and random shift in time between the ISR and the 1ms task and in around 1% of the cases they intersect and lead to constant audiable noise.

    How did you go about triggering your 1ms task in the motor1CtrlISR() itself? You have it run within the ISR every Nth cycle, or something else?

    Does your 1ms task take a long time to execute? Maybe longer than the motor1CtrlISR() trigger frequency?

    Best,

    Kevin