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 STVELPLAN_run(ST_VELPLAN_Handle handle), where handle is a pointer to a specific ST_VelPlan_t object. This function runs SpinTAC Velocity Plan. This function can be run in the main loop of the program.
void STVELPLAN_run(ST_VELPLAN_Handle handle)
Parameters:
No. | Type | Parameters | Description |
---|---|---|---|
1 | ST_VELPLAN_Handle | handle | The pointer to a ST_VelPlan_t object |
The function for SpinTAC Velocity Plan that handles decrementing the state timer is STVELPLAN_runTick(ST_VELPLAN_Handle handle), where handle is a pointer to a specific ST_VelPlan_t object. This function decrements the state times for SpinTAC Velocity Plan. This function must be run at the same rate as SpinTAC Velocity Control.
void STVELPLAN_runTick(ST_VELPLAN_Handle handle)
Parameters:
No. | Type | Parameters | Description |
---|---|---|---|
1 | ST_VELPLAN_Handle | handle | The pointer to a ST_VelPlan_t object |
The SpinTAC Velocity Plan state transition map is shown in Figure 4-10. Note in Figure 4-10, the transitions from state IDLE to INIT, and then to BUSY, happen within one sample time.
The states of SpinTAC Velocity Plan are described in Table 4-10.
From State | To State | Transition Condition(1)(2)(3)(4)(5) | 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 up AND RES == true | Load the configurations of state 0 |
WAIT | HALT state Timer 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-11 lists the functions that can be used to perform operations such as set, get, add, and delete configuration and runtime parameters of SpinTAC Velocity Plan. These functions are described in more detail in Section 4.6.9.
Function Group | Function Name | Description |
---|---|---|
Initialization | STVELPLAN_init | Initialize SpinTAC Velocity Plan |
Configuration | STVELPLAN_setCfg | Set the system and protection parameters |
STVELPLAN_setCfgArray | Setup configuration array | |
STVELPLAN_setCfgHaltState | Set the parameters for the HALT state | |
STVELPLAN_addCfgState | Add a new State | |
STVELPLAN_addCfgVar | Add a new Variable | |
STVELPLAN_addCfgCond | Add a new Condition that compares a Variable against static values | |
STVELPLAN_addCfgVarCond | Add a new Condition that compares two Variables | |
STVELPLAN_addCfgTran | Add a new Transition | |
STVELPLAN_addCfgAct | Add a new Action | |
Runtime | STVELPLAN_run | Run SpinTAC Velocity Plan. Can run from main loop. |
STVELPLAN_runTick | Run SpinTAC Velocity Plan Timer function. Must run from ISR. | |
STVELPLAN_setVar | Set the value of a Variable during runtime | |
STVELPLAN_getVar | Get the value of a Variable during runtime | |
STVELPLAN_reset | Reset SpinTAC Velocity Plan and configuration | |
STVELPLAN_setUnitProfDone | Sets if the currently running profile is done | |
Plan modification and debugging functions (Provide ability to modify SpinTAC Velocity Plan at runtime) | STVELPLAN_getCfgStateNum | Get the number of configured States |
STVELPLAN_getCfgVarNum | Get the number of configured Variables | |
STVELPLAN_getCfgCondNum | Get the number of configured Conditions | |
STVELPLAN_getCfgTranNum | Get the number of configured Transitions | |
STVELPLAN_getCfgActNum | Get the number of configured Actions | |
STVELPLAN_getCfg | Get the system & protection parameters | |
STVELPLAN_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 runtime modification of SpinTAC Velocity Plan. |