SPRAD32 May 2022 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
This section presents benchmarks of major functions in FOC ISR. They are visualized in Figure 2-1, Figure 2-2, Figure 2-3 and Figure 2-4. The order of items, top to bottom, in Bar Charts at Figure 2-3 and Figure 2-4 follows the execution flow. The Sunburst Charts in Figure 2-3 and Figure 2-4 are organized to have execution time from long to short in a clockwise direction. More details are summarized in Table 2-1. From Figure 2-4, the FOC ISR with TI R5F math library takes 3.9us from PWM time base counting Zero to PWM duty cycle updated. As shown in Figure 2-2, among the 3.9 µs, hardware interface costs 40% or 1.565 µs, and computation consumes 60% or 2.335 µs. Within the computation time, trigonometric functions take 26% or 600 ns. The Field Oriented Control excluding trigonometric functions and hardware operation is less than 1 µs, roughly 42% of computation time. The software resolver example without trigonometric functions requires 150 ns, 7% of computation time. The rest 25% computation time is spent on processing feedback and generating control reference in demo logic. The log function at the end of ISR is not counted in this benchmark as it is part of debug function.
Field Oriented Control Interrupt Service Routine | Description | Operation Type | Execution Time (ns) |
---|---|---|---|
ADC Acquisition and Conversion |
|
Hardware Interface | 300 |
ISR Entry |
|
Hardware Interface | 600 |
Read Feedback |
|
Hardware Interface | 440 |
Process Feedback | Remove effects, adjust scales, and filter noises | Computation | 300 |
Run Trigonometric Functions - Option 1, Standard C Library | Run 3 times of sinf() and cosf() from libc.a
|
Computation | 2400 |
Run Trigonometric Functions - Option 2, TI R5F Math | Run 3 times of ti_r5fmath_sincos() from TI R5F Math
|
Computation | 600 |
Get Rotor Position with Software Resolver | resolver_run() is given as an example to take resolver feedback at the excitation frequency | Computation | 150 |
Update PWM | Write PWM Duty Cycle | Hardware Interface | 225 |
Field Oriented Control |
|
Computation | 985 |
Demo Logic |
|
Computation | 300 |
Total | From PWM time base count Zero to PWM duty cycle update | Hardware Interface and Computation | 3900 |