SPRUHJ1I January 2013 – October 2021 TMS320F2802-Q1 , TMS320F28026-Q1 , TMS320F28026F , TMS320F28027-Q1 , TMS320F28027F , TMS320F28027F-Q1 , TMS320F28052-Q1 , TMS320F28052F , TMS320F28052F-Q1 , TMS320F28052M , TMS320F28052M-Q1 , TMS320F28054-Q1 , TMS320F28054F , TMS320F28054F-Q1 , TMS320F28054M , TMS320F28054M-Q1 , TMS320F2806-Q1 , TMS320F28062-Q1 , TMS320F28062F , TMS320F28062F-Q1 , TMS320F28068F , TMS320F28068M , TMS320F28069-Q1 , TMS320F28069F , TMS320F28069F-Q1 , TMS320F28069M , TMS320F28069M-Q1
The primary function is STPOSPLAN_run(ST_POSPLAN_Handle handle), where handle is a pointer to a specific ST_PosPlan_t object, this handle needs to be established by the initialize function ST_POSPLAN_init. This function can be called from the main-loop of the project.
void STPOSPLAN_run(ST_POSPLAN_Handle handle)
Parameters:
No. | Type | Parameters | Description |
---|---|---|---|
1 | ST_POSPLAN_Handle | handle | The pointer to a ST_PosPlan_t object |
The ISR function is STPOSPLAN_runTick(ST_POSPLAN_Handle handle), where handle is a pointer to a specific ST_PosPlan_t object. This function handles the time-critical code of ST_PosPlan. This function must be called in the main ISR of the project.
void STPOSPLAN_runTick(ST_POSPLAN_Handle handle)
Parameters:
No. | Type | Parameters | Description |
---|---|---|---|
1 | ST_POSPLAN_Handle | handle | The pointer to a ST_PosPlan_t object |
The ST_PosPlan state transition map is the same as ST_VelPlan, as shown in Figure 4-10.
The states of ST_PosPlan are described in Table 4-21.
From State | To State | Transition Condition(1)(2)(3)(4) | Action |
---|---|---|---|
IDLE | Keep IDLE status
|
||
INIT | RES == false AND ENB is on rising edge | ||
INIT | BUSY | Parameter validation
|
|
BUSY | Operate the plan | ||
IDLE | RES == false AND ENB == True AND DON == true | Set ENB = false | |
HALT | RES == true OR ENB == false | Load the halt state profile configurations | |
HALT | IDLE | HALT state Timer times up AND RES == true | Load the configurations of state 0 |
WAIT | HALT state Timer times up AND RES == false | ||
WAIT | IDLE | RES == true | Load the configurations of state 0 |
HALT | ENB == true | Load the configurations of the last state |
Table 4-22 lists the functions that can be used to do operations like set, get, add, and delete configuration and runtime parameters of SpinTAC Position Plan. These functions are described in more detail in Section 4.6.9.
Function Group | Function Name | Description |
---|---|---|
Initialization | STPOSPLAN_init | Initialize SpinTAC Position Plan |
Configuration | STPOSPLAN_setCfgArray | Set the array that SpinTAC Position Plan will use to store the configuration |
STPOSPLAN_setCfg | Set the system parameters, protection parameters | |
STPOSPLAN_setCfgHaltState | Set the parameters for the HALT state | |
STPOSPLAN_addCfgState | Add a new State | |
STPOSPLAN_addCfgVar | Add a new Variable | |
STPOSPLAN_addCfgCond | Add a new Condition that compares a Variable against static values | |
STPOSPLAN_addCfgVarCond | Add a new Condition that compares two Variables | |
STPOSPLAN_addCfgTran | Add a new Transition | |
STPOSPLAN_addCfgAct | Add a new Action | |
Runtime | STPOSPLAN_run | Run SpinTAC Position Plan. Can run from main loop. |
STPOSPLAN_runTick | Run SpinTAC Position Plan Timer. Must run from main ISR | |
STPOSPLAN_setVar | Set the value of a Variable during runtime | |
STPOSPLAN_getVar | Get the value of a Variable during runtime | |
STPOSPLAN_reset | Reset SpinTAC Position Plan and configuration | |
STPOSPLAN_setUnitProfDone | Sets if the currently running profile is done | |
Plan modification and debugging functions (Provide runtime modification ability of Plan) | STPOSPLAN_getCfgStateNum | Get the number of configured States |
STPOSPLAN_getCfgVarNum | Get the number of configured Variables | |
STPOSPLAN_getCfgCondNum | Get the number of configured Conditions | |
STPOSPLAN_getCfgTranNum | Get the number of configured Transitions | |
STPOSPLAN_getCfgActNum | Get the number of configured Actions | |
STPOSPLAN_getCfg | Get the system & protection parameters | |
STPOSPLAN_getCfgHaltState | Get the parameters for the HALT state | |
Each function with a suffix -add has three other functions: -del, -set, and -get to delete the item, to set the item, and to get the item respectively. These functions allow online SpinTAC Position Plan modification. |