Motor Controller Firmware Execution Timing Information

The high dynamic nature of the motor drive circuit imposes a strict requirement on the realtimeness of the firmware. We must ensure that we can run everything within a single FOC commutation loop.

We performed several measurements on the Recoil firmware code running on the motor controller to profile the execution time.

The timing information is measured with a Siglent SDS 1202X-E oscilloscope via a GPIO header on the motor controller board.

The system clock is configured as 160 MHz. The compiler optimization is set to -O2.

Current Control

Entire loop

Encoder reading

The delta time between issuing HAL_I2C_Master_Receive_IT and receiving the interrupt is 78 us.

Hence, the maximum frequency it can run at is 12 kHz.

Clarke transform

Park transform

V_D V_Q target calculation

Overmodulation

Inverse park transformation

SVPWM

Last updated