SPRUHW1A June 2014 – October 2021 TMS320F28052-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054M , TMS320F28054M-Q1
Figure 7-1 illustrates the options available to the designer to manage the real-time scheduling of each of the major software functions.
Table 7-1 indicates CPU cycle utilization of SpinTAC components running out of ROM on the 28054M and 28052M devices. Note that this data is for the SpinTAC components only, and does include InstaSPIN-FOC. For InstaSPIN-FOC CPU utilization and memory footprints, see the TMS320F2805xF InstaSPIN-FOC™ Software Technical Reference Manual.
The Speed Count is used to calculate the SpinTAC sample time. SpinTAC is called from main ISR but can be decimated using the same decimation rate used to run the speed controller. The correct decimation rate can be calculated by multiplying the USER_NUM_ISR_TICKS_PER_CTRL_TICK by the USER_NUM_CTRL_TICKS_PER_SPEED_TICK.
Function Name(1)(2) | CPU Cycles(3)(4) | Executed From | |||||
---|---|---|---|---|---|---|---|
Min | Avg | Max | ROM | RAM | FLASH | ||
STVELCTL_run (Velocity Control) | |||||||
RES = 1, ENB = 0 | 189 | 189 | 189 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 614 | 614 | 614 | ||||
First call after ENB = 1 | 1077 | 1077 | 1077 | ||||
Change Bandwidth | 842 | 842 | 842 | ||||
Change Inertia parameter | 842 | 842 | 842 | ||||
RES = 1, ENB = 1 | 347 | 347 | 347 | ||||
STVELMOVE_run (Velocity Move) | |||||||
RES = 1, ENB = 0 | 220 | 220 | 220 | ✓ | × | ✓ | |
stcurve | RES = 0, ENB = 1 | 724 | 759 | 1468 | |||
scurve | RES = 0, ENB = 1 | 687 | 724 | 1435 | |||
trap | RES = 0, ENB = 1 | 561 | 636 | 1167 | |||
RES = 1, ENB = 1 | 494 | 494 | 494 | ||||
STVELPLAN_run (Velocity Plan) | |||||||
RES = 1, ENB = 0 | 183 | 183 | 183 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 238 | 238 | 238 | ||||
First call after ENB = 1 | 333 | 333 | 333 | ||||
STAY FSM State | 238 | 238 | 238 | ||||
Transiation FSM State Calculation must be done for each State |
436 (fixed) + 320 * Number of Transitions + 388 * Number of EXIT Actions |
||||||
Condition FSM State Calculation must be done for each State |
283 (fixed) + 438 * Number of ENTER Actions |
||||||
STVELPLAN_runTick (ISR function) | 76 | 100 | 100 | ||||
STVELID_run (Velocity Identify) | |||||||
RES = 1, ENB = 0 | 198 | 198 | 198 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 256 | 278 | 723 | ||||
First call after ENB = 1 | 1196 | 1196 | 1196 | ||||
RES = 1, ENB = 1 | 292 | 292 | 292 | ||||
STPOSCOV_run (Position Converter) | |||||||
RES = 1, ENB = 0 | 127 | 127 | 127 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 391 | 398 | 400 | ||||
First call after ENB = 1 | 1209 | 1209 | 1209 | ||||
RES = 1, ENB = 1 | 140 | 140 | 140 | ||||
STPOSCTL_run (Position Control) | |||||||
RES = 0, ENB =0 | 201 | 201 | 201 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 1207 | 1212 | 1225 | ||||
First call after ENB = 1 | 2043 | 2043 | 2043 | ||||
Change Bandwidth parameter | 1729 | 1729 | 1729 | ||||
Change Inertia parameter | 1729 | 1729 | 1729 | ||||
RES = 1, ENB = 1 | 449 | 449 | 449 | ||||
STPOSMOVE_run (Position Move) | |||||||
RES = 0, ENB = 0 | 520 | 520 | 520 | ✓ | × | ✓ | |
stcurve | RES = 0, ENB = 1 | 790 | 1611 | 3630 | |||
Velocity Controlled Profile | 1467 | 1588 | 2778 | ||||
scurve | RES = 0, ENB = 1 | 790 | 1564 | 3205 | |||
Velocity Controlled Profile | 1415 | 1551 | 2734 | ||||
trap | RES = 0, ENB = 1 | 790 | 1501 | 3130 | |||
Velocity Controlled Profile | 1540 | 1903 | 2438 | ||||
RES = 1, ENB = 1 | 996 | 996 | 996 | ||||
STPOSPLAN_run (Position Plan) | |||||||
RES = 1, ENB = 0 | 202 | 202 | 20 | ✓ | × | ✓ | |
RES = 0, ENB = 1 | 255 | 255 | 255 | ||||
First call after ENB = 1 | 373 | 373 | 373 | ||||
STAY FSM State | 255 | 255 | 255 | ||||
Condition FSM State Calculation must be done for each State |
501 (fixed) + 323 * Number of Transitions + 382 * Number of EXIT Actions |
||||||
Transition FSM State Calculation must be done for each State |
301 (fixed) + 432 * Number of ENTER Actions |
||||||
STPOSPLAN_runTick (ISR function) | 86 | 115 | 115 |