MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

spintac_vel_plan.h
Go to the documentation of this file.
1 #ifndef __SPINTAC_VEL_PLAN_H__
2 #define __SPINTAC_VEL_PLAN_H__
3 /* --COPYRIGHT--,BSD
4 * Copyright (c) 2012, LineStream Technologies Incorporated
5 * Copyright (c) 2012, Texas Instruments Incorporated
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * * Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * * Neither the names of Texas Instruments Incorporated, LineStream
20 * Technologies Incorporated, nor the names of its contributors may be
21 * used to endorse or promote products derived from this software without
22 * specific prior written permission.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
28 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
31 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
32 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
34 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 * --/COPYRIGHT--*/
36
43
45
46
47 #include "spintac_version.h"
48
51 #define ST_VEL_PLAN_ACT_DWORDS (5)
52 #define ST_VEL_PLAN_COND_DWORDS (3)
54 #define ST_VEL_PLAN_VAR_DWORDS (2)
56 #define ST_VEL_PLAN_TRAN_DWORDS (5)
58 #define ST_VEL_PLAN_STATE_DWORDS (6)
60
61
62 #ifndef __ST_PLAN_ENUM__
63 #define __ST_PLAN_ENUM__
64 typedef enum {
67 ST_PLAN_IDLE=0,
68 ST_PLAN_INIT,
69 ST_PLAN_BUSY,
70 ST_PLAN_HALT,
71 ST_PLAN_WAIT
72 } ST_PlanStatus_e;
73
76 typedef enum {
77 ST_COND_NC=0,
78 ST_COND_FC,
79 ST_COND_AND,
80 ST_COND_OR
81 } ST_PlanCond_e;
82
85 typedef enum {
86 ST_COMP_NA=0,
87 ST_COMP_EQ,
88 ST_COMP_NEQ,
89 ST_COMP_GT,
90 ST_COMP_EGT,
91 ST_COMP_LW,
92 ST_COMP_ELW,
93 ST_COMP_In,
94 ST_COMP_EIn,
95 ST_COMP_InE,
96 ST_COMP_EInE,
97 ST_COMP_Out,
98 ST_COMP_EOut,
99 ST_COMP_OutE,
100 ST_COMP_EOutE
101 } ST_PlanComp_e;
102
105 typedef enum {
106 ST_ACT_EQ=0,
107 ST_ACT_ADD
108 } ST_PlanActOptn_e;
109
112 typedef enum {
113 ST_ACT_ENTR=0,
114 ST_ACT_EXIT
115 } ST_PlanActTrgr_e;
116
119 typedef enum {
120 ST_FSM_STATE_STAY=0,
121 ST_FSM_STATE_COND,
122 ST_FSM_STATE_TRAN
123 } ST_PlanFsmState_e;
124
127 typedef enum {
128 ST_VAR_INOUT=0,
129 ST_VAR_IN,
130 ST_VAR_OUT
131 } ST_PlanVar_e;
132 #endif //__ST_PLAN_ENUM__
133
134 #ifndef __ST_PLAN_ERROR__
135 #define __ST_PLAN_ERROR__
136 typedef struct {
140 uint16_t ERR_idx;
141 uint16_t ERR_code;
142 } ST_PlanError_t; // Structure for SpinTAC Plan Error
143 #endif //__ST_PLAN_ERROR__
144
148 typedef struct {
149 /* Input variables */
150 // Control bits
151 bool ENB;
152 bool RES;
153 /* Output variables */
154 _iq24 VelEnd;
155 _iq24 AccLim;
156 _iq20 JrkLim;
157 // Information variables
158 ST_PlanStatus_e STATUS;
159 uint16_t CurState;
160 uint16_t CurTran;
161 ST_PlanFsmState_e FsmState;
162 int32_t Timer_tick;
163 uint16_t ERR_ID;
164 ST_PlanError_t CfgError;
165 /* Internal variables */
166 uint32_t s0[26];
167 } ST_VelPlan_t; // Structure for SpinTAC Velocity Plan
168
169 typedef struct _ST_VELPLAN_Handle_ *ST_VELPLAN_Handle; // SpinTAC Velocity Plan Handle
170
174 static inline _iq24 STVELPLAN_getVelocitySetpoint(ST_VELPLAN_Handle handle) {
175 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
176
177 return(obj->VelEnd);
178 } // end of STVELPLAN_getVelocitySetpoint function
179
183 static inline _iq24 STVELPLAN_getAccelerationLimit(ST_VELPLAN_Handle handle) {
184 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
185
186 return(obj->AccLim);
187 } // end of STVELPLAN_getAccelerationLimit function
188
192 static inline _iq20 STVELPLAN_getJerkLimit(ST_VELPLAN_Handle handle) {
193 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
194
195 return(obj->JrkLim);
196 } // end of STVELPLAN_getJerkLimit function
197
201 static inline void STVELPLAN_setEnable(ST_VELPLAN_Handle handle, bool enb) {
202 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
203
204 obj->ENB = enb;
205
206 return;
207 } // end of STVELPLAN_setEnable function
208
212 static inline bool STVELPLAN_getEnable(ST_VELPLAN_Handle handle) {
213 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
214
215 return (obj->ENB);
216 } // end of STVELPLAN_getEnable function
217
221 static inline void STVELPLAN_setReset(ST_VELPLAN_Handle handle, bool res) {
222 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
223
224 obj->RES = res;
225
226 return;
227 } // end of STVELPLAN_setReset function
228
232 static inline bool STVELPLAN_getReset(ST_VELPLAN_Handle handle) {
233 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
234
235 return (obj->RES);
236 } // end of STVELPLAN_getReset function
237
241 static inline ST_PlanStatus_e STVELPLAN_getStatus(ST_VELPLAN_Handle handle) {
242 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
243
244 return (obj->STATUS);
245 } // end of STVELPLAN_getStatus function
246
247
251 static inline uint16_t STVELPLAN_getCurrentState(ST_VELPLAN_Handle handle) {
252 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
253
254 return(obj->CurState);
255 } // end of STVELPLAN_getCurrentState function
256
260 static inline uint16_t STVELPLAN_getCurrentTransition(ST_VELPLAN_Handle handle) {
261 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
262
263 return(obj->CurTran);
264 } // end of STVELPLAN_getCurrentTransition function
265
269 static inline ST_PlanFsmState_e STVELPLAN_getFsmState(ST_VELPLAN_Handle handle) {
270 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
271
272 return(obj->FsmState);
273 } // end of STVELPLAN_getFsmState function
274
278 static inline int32_t STVELPLAN_getCurrentTimerValue_tick(ST_VELPLAN_Handle handle) {
279 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
280
281 return(obj->Timer_tick);
282 } // end of STVELPLAN_getCurrentTimerValue_tick function
283
289 static inline uint16_t STVELPLAN_getCfgError(ST_VELPLAN_Handle handle, uint16_t *ERR_idx, uint16_t *ERR_code) {
290 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
291
292 *ERR_idx = obj->CfgError.ERR_idx;
293 *ERR_code = obj->CfgError.ERR_code;
294
295 return (obj->ERR_ID);
296 } // end of STVELPLAN_getCfgError function
297
301 static inline uint16_t STVELPLAN_getErrorID(ST_VELPLAN_Handle handle) {
302 ST_VelPlan_t *obj = (ST_VelPlan_t *)handle;
303
304 return (obj->ERR_ID);
305 } // end of STVELPLAN_getErrorID function
306
310 void STVELPLAN_getCfgStateNum(ST_VELPLAN_Handle handle, uint16_t *StateNum);
311
315 void STVELPLAN_getCfgVarNum(ST_VELPLAN_Handle handle, uint16_t *VarNum);
316
320 void STVELPLAN_getCfgCondNum(ST_VELPLAN_Handle handle, uint16_t *CondNum);
321
325 void STVELPLAN_getCfgTranNum(ST_VELPLAN_Handle handle, uint16_t *TranNum);
326
330 void STVELPLAN_getCfgActNum(ST_VELPLAN_Handle handle, uint16_t *ActNum);
331
338 void STVELPLAN_addCfgCond(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2);
339
343 void STVELPLAN_delCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx);
344
352 void STVELPLAN_setCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2);
353
361 void STVELPLAN_getCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx, ST_PlanComp_e *Comp, _iq24 *Value1, _iq24 *Value2);
362
368 void STVELPLAN_addCfgVarCond(ST_VELPLAN_Handle handle, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp);
369
373 void STVELPLAN_delCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx);
374
381 void STVELPLAN_setCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp);
382
389 void STVELPLAN_getCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx1, uint16_t *VarIdx2, ST_PlanComp_e *Comp);
390
400 void STVELPLAN_addCfgTran(ST_VELPLAN_Handle handle, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 AccLim, _iq20 JrkLim);
401
405 void STVELPLAN_delCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx);
406
417 void STVELPLAN_setCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 AccLim, _iq20 JrkLim);
418
429 void STVELPLAN_getCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx, uint16_t *FromState, uint16_t *ToState, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, _iq24 *AccLim, _iq20 *JrkLim);
430
441 void STVELPLAN_addCfgAct(ST_VELPLAN_Handle handle, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit);
442
446 void STVELPLAN_delCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx);
447
459 void STVELPLAN_setCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit);
460
472 void STVELPLAN_getCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx, uint16_t *State, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, uint16_t *VarIdx, ST_PlanActOptn_e *Opt, _iq24 *Value, ST_PlanActTrgr_e *EnterExit);
473
478 void STVELPLAN_addCfgVar(ST_VELPLAN_Handle handle, ST_PlanVar_e Type, _iq24 Value);
479
483 void STVELPLAN_delCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx);
484
490 void STVELPLAN_setCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e Type, _iq24 Value);
491
497 void STVELPLAN_getCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e *Type, _iq24 *Value);
498
503 void STVELPLAN_setVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, _iq24 Value);
504
509 void STVELPLAN_getVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, _iq24 *Value);
510
514 void STVELPLAN_setUnitProfDone(ST_VELPLAN_Handle handle, bool ProDON);
515
520 void STVELPLAN_setCfg(ST_VELPLAN_Handle handle, _iq24 T_sec, bool LoopENB);
521
526 void STVELPLAN_getCfg(ST_VELPLAN_Handle handle, _iq24 *T_sec, bool *LoopENB);
527
534 void STVELPLAN_setCfgHaltState(ST_VELPLAN_Handle handle, _iq24 VelEnd, _iq24 AccLim, _iq20 JrkLim, int32_t Timer_tick);
535
542 void STVELPLAN_getCfgHaltState(ST_VELPLAN_Handle handle, _iq24 *VelEnd, _iq24 *AccLim, _iq20 *JrkLim, int32_t *Timer_tick);
543
548 void STVELPLAN_addCfgState(ST_VELPLAN_Handle handle, _iq24 VelEnd, int32_t Timer_tick);
549
553 void STVELPLAN_delCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx);
554
560 void STVELPLAN_setCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx, _iq24 VelEnd, int32_t Timer_tick);
561
567 void STVELPLAN_getCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx, _iq24 *VelEnd, int32_t *Timer_tick);
568
571 void STVELPLAN_reset(ST_VELPLAN_Handle handle);
572
577 ST_VELPLAN_Handle STVELPLAN_init(void *pMemory, const size_t numBytes);
578
581 void STVELPLAN_run(ST_VELPLAN_Handle handle);
582
585 void STVELPLAN_runTick(ST_VELPLAN_Handle handle);
586
596 void STVELPLAN_setCfgArray(ST_VELPLAN_Handle handle, uint32_t *cfgArray, const size_t numBytes, uint16_t MaxActNum,uint16_t MaxCondNum, uint16_t MaxVarNum, uint16_t MaxTranNum, uint16_t MaxStateNum);
597
599 #endif /*__SPINTAC_VEL_PLAN_H__*/
STVELPLAN_getReset
static bool STVELPLAN_getReset(ST_VELPLAN_Handle handle)
Gets the Reset signal (RES) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:232
STVELPLAN_getCfgVarNum
void STVELPLAN_getCfgVarNum(ST_VELPLAN_Handle handle, uint16_t *VarNum)
Returns the number of configured Variables in SpinTAC Velocity Plan.
ST_PlanCond_e
ST_PlanCond_e
Enumeration for the Plan Condition options.
Definition: spintac_pos_plan.h:76
ST_PlanError_t::ERR_idx
uint16_t ERR_idx
Plan component index that caused the error.
Definition: spintac_pos_plan.h:140
ST_PlanComp_e
ST_PlanComp_e
Enumeration for the Plan Compare options.
Definition: spintac_pos_plan.h:85
STVELPLAN_getCfgVarCond
void STVELPLAN_getCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx1, uint16_t *VarIdx2, ST_PlanComp_e *Comp)
Returns a Variable Condition from the SpinTAC Velocity Plan configuration.
ST_COMP_EGT
Compares, VarIdx >= Value1 OR VarIdx1 >= VarIdx2.
Definition: spintac_vel_plan.h:90
ST_COND_OR
Transition/Action with either condition satisfied.
Definition: spintac_vel_plan.h:80
STVELPLAN_delCfgVar
void STVELPLAN_delCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx)
Deletes a Variable from the SpinTAC Velocity Plan configuration.
ST_VelPlan_t::ENB
bool ENB
Enable bit { false: disabled; true: enabled }.
Definition: spintac_vel_plan.h:151
STVELPLAN_getCfgTran
void STVELPLAN_getCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx, uint16_t *FromState, uint16_t *ToState, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, _iq24 *AccLim, _iq20 *JrkLim)
Return a Transition from the SpinTAC Velocity Plan configuration.
STVELPLAN_setCfgAct
void STVELPLAN_setCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit)
Modifies an action in the SpinTAC Velocity Plan configuration.
STVELPLAN_setCfgVarCond
void STVELPLAN_setCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp)
Modifies a Varaible Condition to the SpinTAC Velocity Plan configuration.
STVELPLAN_addCfgCond
void STVELPLAN_addCfgCond(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2)
Adds a Condition to the SpinTAC Velocity Plan configuration.
STVELPLAN_init
ST_VELPLAN_Handle STVELPLAN_init(void *pMemory, const size_t numBytes)
Initializes the SpinTAC Velocity Plan component.
STVELPLAN_getCfgStateNum
void STVELPLAN_getCfgStateNum(ST_VELPLAN_Handle handle, uint16_t *StateNum)
Returns the number of configured States in SpinTAC Velocity Plan.
STVELPLAN_getFsmState
static ST_PlanFsmState_e STVELPLAN_getFsmState(ST_VELPLAN_Handle handle)
Gets the State Machine State (FsmState) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:269
STVELPLAN_addCfgState
void STVELPLAN_addCfgState(ST_VELPLAN_Handle handle, _iq24 VelEnd, int32_t Timer_tick)
Adds a State to the SpinTAC Velocity Plan configuration.
ST_PlanVar_e
ST_PlanVar_e
Enumeration for the Plan variable types.
Definition: spintac_pos_plan.h:127
STVELPLAN_setCfgTran
void STVELPLAN_setCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 AccLim, _iq20 JrkLim)
Modifies a Transition in the SpinTAC Velocity Plan configuration.
STVELPLAN_setCfgVar
void STVELPLAN_setCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e Type, _iq24 Value)
Modifies a variable in the SpinTAC Velocity Plan configuration.
STVELPLAN_run
void STVELPLAN_run(ST_VELPLAN_Handle handle)
Runs SpinTAC Velocity Plan calculation.
STVELPLAN_delCfgState
void STVELPLAN_delCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx)
Deletes a state from the SpinTAC Velocity Plan configuration.
ST_COMP_In
Compares, Value1 <= VarIdx <= Value2.
Definition: spintac_vel_plan.h:93
ST_PlanStatus_e
ST_PlanStatus_e
Enumeration for the Plan Status States.
Definition: spintac_pos_plan.h:66
ST_PLAN_WAIT
wait state, holding the speed reference in idle state
Definition: spintac_vel_plan.h:71
STVELPLAN_setCfg
void STVELPLAN_setCfg(ST_VELPLAN_Handle handle, _iq24 T_sec, bool LoopENB)
Configures SpinTAC Velocity Plan.
STVELPLAN_addCfgVarCond
void STVELPLAN_addCfgVarCond(ST_VELPLAN_Handle handle, uint16_t VarIdx1, uint16_t VarIdx2, ST_PlanComp_e Comp)
Adds a Variable Condition to the SpinTAC Velocity Plan configuration.
ST_FSM_STATE_COND
Plan is waiting for a transition condition to be true.
Definition: spintac_vel_plan.h:121
STVELPLAN_getCfgError
static uint16_t STVELPLAN_getCfgError(ST_VELPLAN_Handle handle, uint16_t *ERR_idx, uint16_t *ERR_code)
Gets the Configuration Error for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:289
ST_VelPlan_t::CurTran
uint16_t CurTran
Current transition of the state machine.
Definition: spintac_vel_plan.h:160
STVELPLAN_delCfgTran
void STVELPLAN_delCfgTran(ST_VELPLAN_Handle handle, uint16_t TranIdx)
Deletes a Transition from the SpinTAC Velocity Plan configuration.
ST_COMP_NEQ
Compares, VarIdx != Value1 OR VarIdx1 != VarIdx2.
Definition: spintac_vel_plan.h:88
ST_VelPlan_t::STATUS
ST_PlanStatus_e STATUS
Plan status { ST_PLAN_IDLE, ST_PLAN_INIT, ST_PLAN_BUSY, ST_PLAN_HALT, ST_PLAN_WAIT}.
Definition: spintac_vel_plan.h:158
STVELPLAN_delCfgAct
void STVELPLAN_delCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx)
Deletes an action from the SpinTAC Velocity Plan configuration.
ST_COMP_EOutE
Compares, Value1 > VarIdx > Value2.
Definition: spintac_vel_plan.h:100
STVELPLAN_runTick
void STVELPLAN_runTick(ST_VELPLAN_Handle handle)
Updates the SpinTAC Velocity Plan Timer.
STVELPLAN_getCfgCondNum
void STVELPLAN_getCfgCondNum(ST_VELPLAN_Handle handle, uint16_t *CondNum)
Returns the number of configured Conditions in SpinTAC Velocity Plan.
STVELPLAN_delCfgCond
void STVELPLAN_delCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx)
Deletes a Condition from the SpinTAC Velocity Plan configuration.
STVELPLAN_getAccelerationLimit
static _iq24 STVELPLAN_getAccelerationLimit(ST_VELPLAN_Handle handle)
Gets the Acceleration Limit (AccLim) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:183
ST_VAR_OUT
Variable type output.
Definition: spintac_vel_plan.h:130
STVELPLAN_setCfgHaltState
void STVELPLAN_setCfgHaltState(ST_VELPLAN_Handle handle, _iq24 VelEnd, _iq24 AccLim, _iq20 JrkLim, int32_t Timer_tick)
Configures the SpinTAC Velocity Plan Halt state.
ST_COMP_ELW
Compares, VarIdx <= Value1 OR VarIdx1 <= VarIdx2.
Definition: spintac_vel_plan.h:92
ST_PlanCond_e
ST_PlanCond_e
Enumeration for the Plan Condition options.
Definition: spintac_vel_plan.h:76
ST_PlanComp_e
ST_PlanComp_e
Enumeration for the Plan Compare options.
Definition: spintac_vel_plan.h:85
STVELPLAN_getCfg
void STVELPLAN_getCfg(ST_VELPLAN_Handle handle, _iq24 *T_sec, bool *LoopENB)
Gets the SpinTAC Velocity Plan configuration.
ST_COMP_EInE
Compares, Value1 < VarIdx < Value2.
Definition: spintac_vel_plan.h:96
ST_PLAN_HALT
halt state, return to the speed reference in idle state
Definition: spintac_vel_plan.h:70
STVELPLAN_reset
void STVELPLAN_reset(ST_VELPLAN_Handle handle)
Resets the Velocity Plan component.
STVELPLAN_addCfgTran
void STVELPLAN_addCfgTran(ST_VELPLAN_Handle handle, uint16_t FromState, uint16_t ToState, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, _iq24 AccLim, _iq20 JrkLim)
Adds a Transition to the SpinTAC Velocity Plan configuration.
ST_PlanActOptn_e
ST_PlanActOptn_e
Enumeration for the Plan Action Options.
Definition: spintac_vel_plan.h:105
ST_COND_NC
Transition/Action with no conditions satisfied.
Definition: spintac_vel_plan.h:77
ST_VelPlan_t::FsmState
ST_PlanFsmState_e FsmState
State of the state machine.
Definition: spintac_vel_plan.h:161
ST_PlanError_t::ERR_code
uint16_t ERR_code
Function specific condition that caused the error.
Definition: spintac_pos_plan.h:141
ST_COMP_EOut
Compares, Value1 > VarIdx >= Value2.
Definition: spintac_vel_plan.h:98
STVELPLAN_setUnitProfDone
void STVELPLAN_setUnitProfDone(ST_VELPLAN_Handle handle, bool ProDON)
Sets a flag in SpinTAC Velocity Plan to indicate if the unit profile is complete. ...
ST_VELPLAN_Handle
struct _ST_VELPLAN_Handle_ * ST_VELPLAN_Handle
Definition: spintac_vel_plan.h:169
ST_VAR_IN
Variable type input.
Definition: spintac_vel_plan.h:129
STVELPLAN_getCfgVar
void STVELPLAN_getCfgVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, ST_PlanVar_e *Type, _iq24 *Value)
Returns a variable from the SpinTAC Velocity Plan configuration.
ST_PlanFsmState_e
ST_PlanFsmState_e
Enumeration for the Plan FSM states.
Definition: spintac_pos_plan.h:119
STVELPLAN_addCfgAct
void STVELPLAN_addCfgAct(ST_VELPLAN_Handle handle, uint16_t State, ST_PlanCond_e AndOr, uint16_t CondIdx1, uint16_t CondIdx2, uint16_t VarIdx, ST_PlanActOptn_e Opt, _iq24 Value, ST_PlanActTrgr_e EnterExit)
Adds an action to the SpinTAC Velocity Plan configuration.
ST_VelPlan_t::ERR_ID
uint16_t ERR_ID
Error ID { 0: no error; others: see error code }.
Definition: spintac_vel_plan.h:163
STVELPLAN_getCfgActNum
void STVELPLAN_getCfgActNum(ST_VELPLAN_Handle handle, uint16_t *ActNum)
Returns the number of configured Actions in SpinTAC Velocity Plan.
ST_COMP_EQ
Compares, VarIdx == Value1 OR VarIdx1 == VarIdx2.
Definition: spintac_vel_plan.h:87
STVELPLAN_getCfgCond
void STVELPLAN_getCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t *VarIdx, ST_PlanComp_e *Comp, _iq24 *Value1, _iq24 *Value2)
Returns a Condition from the SpinTAC Velocity Plan configuration.
ST_COND_AND
Transition/Action with both conditions satisfied.
Definition: spintac_vel_plan.h:79
STVELPLAN_setEnable
static void STVELPLAN_setEnable(ST_VELPLAN_Handle handle, bool enb)
Sets the Enable signal (ENB) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:201
_iq24
long _iq24
Definition: 32b/IQmathLib.h:230
ST_COMP_Out
Compares, Value1 >= VarIdx >= Value2.
Definition: spintac_vel_plan.h:97
ST_PlanActTrgr_e
ST_PlanActTrgr_e
Enumeration for the Plan Action trigger point types.
Definition: spintac_pos_plan.h:112
ST_ACT_EXIT
Action will be considered when exiting the state.
Definition: spintac_vel_plan.h:114
ST_COMP_LW
Compares, VarIdx < Value1 OR VarIdx1 < VarIdx2.
Definition: spintac_vel_plan.h:91
STVELPLAN_getCurrentState
static uint16_t STVELPLAN_getCurrentState(ST_VELPLAN_Handle handle)
Gets the Current State (CurState) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:251
ST_VelPlan_t::CfgError
ST_PlanError_t CfgError
Error decoding structure.
Definition: spintac_vel_plan.h:164
STVELPLAN_setVar
void STVELPLAN_setVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, _iq24 Value)
Sets the value of a SpinTAC Velocity Plan variable.
ST_PlanVar_e
ST_PlanVar_e
Enumeration for the Plan variable types.
Definition: spintac_vel_plan.h:127
ST_COMP_EIn
Compares, Value1 < VarIdx <= Value2.
Definition: spintac_vel_plan.h:94
spintac_version.h
Public interface, object, and function definitions related to the SpinTAC Version object...
ST_VelPlan_t::AccLim
_iq24 AccLim
Acceleration limit { unit: [pu/s^2], value range: [0.001, 120.0] }.
Definition: spintac_vel_plan.h:155
ST_COMP_OutE
Compares, Value1 >= VarIdx > Value2.
Definition: spintac_vel_plan.h:99
ST_VelPlan_t::Timer_tick
int32_t Timer_tick
State Timer { unit: [tick] }.
Definition: spintac_vel_plan.h:162
ST_PlanStatus_e
ST_PlanStatus_e
Enumeration for the Plan Status States.
Definition: spintac_vel_plan.h:66
ST_VelPlan_t::VelEnd
_iq24 VelEnd
Velocity setpoint { unit: [pu/s], value range: [-1.0, 1.0] }.
Definition: spintac_vel_plan.h:154
ST_VelPlan_t
Defines the ST_VelPlan_t data.
Definition: spintac_vel_plan.h:148
ST_ACT_ENTR
Action will be considered when entering the state.
Definition: spintac_vel_plan.h:113
STVELPLAN_addCfgVar
void STVELPLAN_addCfgVar(ST_VELPLAN_Handle handle, ST_PlanVar_e Type, _iq24 Value)
Adds a variable to the SpinTAC Velocity Plan configuration.
ST_VelPlan_t::JrkLim
_iq20 JrkLim
Jerk Limit { unit: [pu/s^3], value range: [0.0005, 2000.0] }.
Definition: spintac_vel_plan.h:156
ST_ACT_EQ
Action will set the variable equal to a value.
Definition: spintac_vel_plan.h:106
STVELPLAN_setCfgArray
void STVELPLAN_setCfgArray(ST_VELPLAN_Handle handle, uint32_t *cfgArray, const size_t numBytes, uint16_t MaxActNum, uint16_t MaxCondNum, uint16_t MaxVarNum, uint16_t MaxTranNum, uint16_t MaxStateNum)
Prepares SpinTAC Velocity Plan configuration array.
ST_PlanActTrgr_e
ST_PlanActTrgr_e
Enumeration for the Plan Action trigger point types.
Definition: spintac_vel_plan.h:112
ST_ACT_ADD
Action will add a value to the variable.
Definition: spintac_vel_plan.h:107
STVELPLAN_getCfgTranNum
void STVELPLAN_getCfgTranNum(ST_VELPLAN_Handle handle, uint16_t *TranNum)
Returns the number of configured Transitions in SpinTAC Velocity Plan.
STVELPLAN_getEnable
static bool STVELPLAN_getEnable(ST_VELPLAN_Handle handle)
Gets the Enable signal (ENB) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:212
ST_PLAN_INIT
init state, initialize internal states
Definition: spintac_vel_plan.h:68
ST_FSM_STATE_TRAN
Plan is in transition with a motion profile.
Definition: spintac_vel_plan.h:122
ST_COMP_GT
Compares, VarIdx > Value1 OR VarIdx1 > VarIdx2.
Definition: spintac_vel_plan.h:89
ST_COND_FC
Transition/Action with first condition satisfied.
Definition: spintac_vel_plan.h:78
ST_PlanActOptn_e
ST_PlanActOptn_e
Enumeration for the Plan Action Options.
Definition: spintac_pos_plan.h:105
STVELPLAN_setCfgCond
void STVELPLAN_setCfgCond(ST_VELPLAN_Handle handle, uint16_t CondIdx, uint16_t VarIdx, ST_PlanComp_e Comp, _iq24 Value1, _iq24 Value2)
Modifies a Condition in the SpinTAC Velocity Plan configuration.
STVELPLAN_getErrorID
static uint16_t STVELPLAN_getErrorID(ST_VELPLAN_Handle handle)
Gets the Error ID for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:301
STVELPLAN_setReset
static void STVELPLAN_setReset(ST_VELPLAN_Handle handle, bool res)
Sets the Reset signal (RES) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:221
_iq20
long _iq20
Definition: 32b/IQmathLib.h:234
STVELPLAN_getCfgHaltState
void STVELPLAN_getCfgHaltState(ST_VELPLAN_Handle handle, _iq24 *VelEnd, _iq24 *AccLim, _iq20 *JrkLim, int32_t *Timer_tick)
Gets the SpinTAC Velocity Plan Halt state configuration.
STVELPLAN_getVelocitySetpoint
static _iq24 STVELPLAN_getVelocitySetpoint(ST_VELPLAN_Handle handle)
Gets the Velocity Setpoint (VelEnd) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:174
ST_VelPlan_t::RES
bool RES
Reset bit { false: not reset; true: reset }.
Definition: spintac_vel_plan.h:152
ST_PlanFsmState_e
ST_PlanFsmState_e
Enumeration for the Plan FSM states.
Definition: spintac_vel_plan.h:119
STVELPLAN_getJerkLimit
static _iq20 STVELPLAN_getJerkLimit(ST_VELPLAN_Handle handle)
Gets the Jerk Limit (JrkLim) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:192
STVELPLAN_getVar
void STVELPLAN_getVar(ST_VELPLAN_Handle handle, uint16_t VarIdx, _iq24 *Value)
Gets the value of a SpinTAC Velocity Plan variable.
ST_PLAN_IDLE
idle state, holding velocity
Definition: spintac_vel_plan.h:67
ST_VAR_INOUT
Variable type input/output.
Definition: spintac_vel_plan.h:128
STVELPLAN_setCfgState
void STVELPLAN_setCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx, _iq24 VelEnd, int32_t Timer_tick)
Modifies a state in the SpinTAC Velocity Plan configuration.
ST_COMP_InE
Compares, Value1 <= VarIdx < Value2.
Definition: spintac_vel_plan.h:95
STVELPLAN_getStatus
static ST_PlanStatus_e STVELPLAN_getStatus(ST_VELPLAN_Handle handle)
Gets the Status value (STATUS) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:241
STVELPLAN_getCurrentTransition
static uint16_t STVELPLAN_getCurrentTransition(ST_VELPLAN_Handle handle)
Gets the Current Transition (CurTran) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:260
ST_PLAN_BUSY
busy state, running state machine
Definition: spintac_vel_plan.h:69
STVELPLAN_getCfgState
void STVELPLAN_getCfgState(ST_VELPLAN_Handle handle, uint16_t StateIdx, _iq24 *VelEnd, int32_t *Timer_tick)
Returns a state from the SpinTAC Velocity Plan configuration.
STVELPLAN_delCfgVarCond
void STVELPLAN_delCfgVarCond(ST_VELPLAN_Handle handle, uint16_t CondIdx)
Deletes a Variable Condition from the SpinTAC Velocity Plan configuration.
STVELPLAN_getCurrentTimerValue_tick
static int32_t STVELPLAN_getCurrentTimerValue_tick(ST_VELPLAN_Handle handle)
Gets the Current Time Value (Timer_tick) for SpinTAC Velocity Plan.
Definition: spintac_vel_plan.h:278
ST_COMP_NA
No comparison.
Definition: spintac_vel_plan.h:86
STVELPLAN_getCfgAct
void STVELPLAN_getCfgAct(ST_VELPLAN_Handle handle, uint16_t ActIdx, uint16_t *State, ST_PlanCond_e *AndOr, uint16_t *CondIdx1, uint16_t *CondIdx2, uint16_t *VarIdx, ST_PlanActOptn_e *Opt, _iq24 *Value, ST_PlanActTrgr_e *EnterExit)
Returns an action from the SpinTAC Velocity Plan configuration.
ST_VelPlan_t::CurState
uint16_t CurState
Current state of the state machine.
Definition: spintac_vel_plan.h:159
ST_FSM_STATE_STAY
Plan is staying in a state until the timer is up.
Definition: spintac_vel_plan.h:120
ST_PlanError_t
Defines the ST_PlanError_t data.
Definition: spintac_pos_plan.h:139