MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

spintac_pos_move.h
Go to the documentation of this file.
1 #ifndef __SPINTAC_POS_MOVE_H__
2 #define __SPINTAC_POS_MOVE_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
49 #ifndef __ST_AXIS_ENUM__
50 #define __ST_AXIS_ENUM__
51 typedef enum
54 {
55 ST_AXIS0=0,
56 ST_AXIS1
57 } ST_Axis_e;
58 #endif //__ST_AXIS_ENUM__
59
60 #ifndef __ST_MOVE_CURVE_TYPE_ENUM__
61 #define __ST_MOVE_CURVE_TYPE_ENUM__
62 typedef enum
65 {
66 ST_MOVE_CUR_TRAP=0,
67 ST_MOVE_CUR_SCRV,
68 ST_MOVE_CUR_STCRV
69 } ST_MoveCurveType_e;
70 #endif //__ST_MOVE_CURVE_TYPE_ENUM__
71
74 typedef enum
75 {
76 ST_POS_MOVE_VEL_TYPE=0,
77 ST_POS_MOVE_POS_TYPE
78 } ST_PosMoveProfileType_e;
79
80 #ifndef __ST_MOVE_STATUS_ENUM__
81 #define __ST_MOVE_STATUS_ENUM__
82 typedef enum
85 {
86 ST_MOVE_IDLE=0,
87 ST_MOVE_INIT,
88 ST_MOVE_CONF,
89 ST_MOVE_BUSY,
90 ST_MOVE_HALT
91 } ST_MoveStatus_e;
92 #endif //__ST_MOVE_STATUS_ENUM__
93
97 typedef struct {
98 //System config parameters: Can be set only once at system startup
99 ST_Axis_e Axis;
100 _iq24 T_sec;
101 _iq24 ROMax_mrev;
102 _iq24 mrev_TO_pu;
103 _iq24 HaltAccLim;
104 _iq20 HaltJrkLim;
105 // Config parameters that may be modified
106 ST_PosMoveProfileType_e ProfileType;
107 ST_MoveCurveType_e CurveType;
108 _iq24 VelStart;
109 _iq24 PosStart_mrev;
110 } ST_PosMoveCfg_t; // Structure for SpinTAC Move-Position configuration
111
112
116 typedef struct {
117 uint32_t ProTime_tick;
118 uint32_t ProTime_mtick;
119 _iq24 ActualVelLim;
120 _iq24 ActualAccLim;
121 _iq24 ActualDecLim;
122 _iq20 ActualJrkLim;
123 } ST_PosMoveMsg_t; // Structure for SpinTAC Move-Position information
124
128 typedef struct {
129 /* Configuration Variables */
130 ST_PosMoveCfg_t cfg;
131 /* Input Variables */
132 int32_t PosStepInt_mrev;
133 _iq24 PosStepFrac_mrev;
134 _iq24 VelLim;
135 _iq24 AccLim;
137 _iq24 DecLim;
138 _iq20 JrkLim;
139 _iq24 VelEnd;
140 // Control bits
141 bool ENB;
142 bool TST;
143 /* Output Variables */
144 int32_t PosRollOver;
145 _iq24 PosRef_mrev;
146 _iq24 VelRef;
147 _iq24 AccRef;
148 _iq20 JrkRef;
149 // Information structure
150 ST_PosMoveMsg_t msg;
151 // Information variables
152 ST_MoveStatus_e STATUS;
153 uint16_t ERR_ID;
154 /* Internal Variables */
155 uint32_t s4[66];
156 } ST_PosMove_t; // Structure for SpinTAC Position Move
157
158 typedef struct _ST_POSMOVE_Handle_ *ST_POSMOVE_Handle; // SpinTAC Position Move Handle
159
163 static inline void STPOSMOVE_setAxis(ST_POSMOVE_Handle handle, ST_Axis_e axis) {
164 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
165
166 if(obj->STATUS == ST_MOVE_IDLE) {
167 obj->cfg.Axis = axis;
168 }
169
170 return;
171 } // end of STPOSMOVE_setAxis function
172
176 static inline void STPOSMOVE_setProfileType(ST_POSMOVE_Handle handle, ST_PosMoveProfileType_e profileType) {
177 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
178
179 if(obj->STATUS == ST_MOVE_IDLE) {
180 obj->cfg.ProfileType = profileType;
181 }
182
183 return;
184 } // end of STPOSMOVE_setProfileType function
185
189 static inline void STPOSMOVE_setCurveType(ST_POSMOVE_Handle handle, ST_MoveCurveType_e curveType) {
190 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
191
192 obj->cfg.CurveType = curveType;
193
194 return;
195 } // end of STPOSMOVE_setCurveType function
196
200 static inline void STPOSMOVE_setSampleTime_sec(ST_POSMOVE_Handle handle, _iq24 sampleTime) {
201 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
202
203 if(obj->STATUS == ST_MOVE_IDLE) {
204 obj->cfg.T_sec = sampleTime;
205 }
206
207 return;
208 } // end of STPOSMOVE_setSampleTime_sec function
209
213 static inline void STPOSMOVE_setMRevMaximum_mrev(ST_POSMOVE_Handle handle, _iq24 mRevROMax) {
214 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
215
216 if(obj->STATUS == ST_MOVE_IDLE) {
217 obj->cfg.ROMax_mrev = mRevROMax;
218 }
219
220 return;
221 } // end of STPOSMOVE_setMRevMaximum_mrev function
222
227 static inline void STPOSMOVE_setUnitConversion(ST_POSMOVE_Handle handle, float_t baseFreq, uint16_t polePairs) {
228 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
229
230 if(obj->STATUS == ST_MOVE_IDLE) {
231 obj->cfg.mrev_TO_pu = _IQ24(((float_t)polePairs) / baseFreq);
232 }
233
234 return;
235 } // end of STPOSCONV_setUnitConversion function
236
241 static inline void STPOSMOVE_setHaltLimits(ST_POSMOVE_Handle handle, _iq24 haltAccLim, _iq20 haltJrkLim) {
242 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
243
244 if(obj->STATUS == ST_MOVE_IDLE) {
245 obj->cfg.HaltAccLim = haltAccLim;
246 obj->cfg.HaltJrkLim = haltJrkLim;
247 }
248
249 return;
250 } // end of STPOSMOVE_setHaltLimits function
251
255 static inline void STPOSMOVE_setVelocityStart(ST_POSMOVE_Handle handle, _iq24 velStart) {
256 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
257
258 if(obj->STATUS == ST_MOVE_IDLE) {
259 obj->cfg.VelStart = velStart;
260 }
261
262 return;
263 } // end of STPOSMOVE_setVelocityStart function
264
268 static inline _iq24 STPOSMOVE_getVelocityStart(ST_POSMOVE_Handle handle) {
269 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
270
271 return(obj->cfg.VelStart);
272 } // end of STPOSMOVE_getVelocityStart function
273
277 static inline void STPOSMOVE_setPositionStart_mrev(ST_POSMOVE_Handle handle, _iq24 posStart) {
278 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
279
280 if(obj->STATUS == ST_MOVE_IDLE) {
281 obj->cfg.PosStart_mrev = posStart;
282 }
283
284 return;
285 } // end of STPOSMOVE_setPositionStart_mrev function
286
290 static inline _iq24 STPOSMOVE_getPositionStart_mrev(ST_POSMOVE_Handle handle) {
291 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
292
293 return(obj->cfg.PosStart_mrev);
294 } // end of STPOSMOVE_getPositionStart_mrev function
295
300 static inline void STPOSMOVE_getProfileTime_tick(ST_POSMOVE_Handle handle, uint32_t *ProTime_tick, uint32_t *ProTime_mtick) {
301 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
302 *ProTime_tick = obj->msg.ProTime_tick;
303 *ProTime_mtick = obj->msg.ProTime_mtick;
304 return;
305 } // end of STPOSMOVE_getProfileTime_tick function
306
310 static inline _iq24 STPOSMOVE_getActualVelocity(ST_POSMOVE_Handle handle) {
311 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
312
313 return(obj->msg.ActualVelLim);
314 } // end of STPOSMOVE_getActualVelocity function
315
319 static inline _iq24 STPOSMOVE_getActualAcceleration(ST_POSMOVE_Handle handle) {
320 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
321
322 return(obj->msg.ActualAccLim);
323 } // end of STPOSMOVE_getActualAcceleration function
324
328 static inline _iq24 STPOSMOVE_getActualDeceleration(ST_POSMOVE_Handle handle) {
329 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
330
331 return(obj->msg.ActualDecLim);
332 } // end of STPOSMOVE_getActualDeceleration function
333
337 static inline _iq20 STPOSMOVE_getActualJerk(ST_POSMOVE_Handle handle) {
338 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
339
340 return(obj->msg.ActualJrkLim);
341 } // end of STPOSMOVE_getActualJerk function
342
347 static inline void STPOSMOVE_setPositionStep_mrev(ST_POSMOVE_Handle handle, int32_t posStepInt, _iq24 posStepFrac) {
348 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
349 obj->PosStepInt_mrev = posStepInt;
350 obj->PosStepFrac_mrev = posStepFrac;
351
352 return;
353 } // end of STPOSMOVE_getPositionStep_mrev function
354
359 static inline void STPOSMOVE_getPositionStep_mrev(ST_POSMOVE_Handle handle, int32_t *posStepInt, _iq24 *posStepFrac) {
360 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
361 *posStepInt = obj->PosStepInt_mrev;
362 *posStepFrac = obj->PosStepFrac_mrev;
363
364 return;
365 } // end of STPOSMOVE_getPositionStep_mrev function
366
370 static inline void STPOSMOVE_setVelocityLimit(ST_POSMOVE_Handle handle, _iq24 velLim) {
371 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
372
373 obj->VelLim = velLim;
374
375 return;
376 } // end of STPOSMOVE_setVelocityLimit function
377
381 static inline void STPOSMOVE_setAccelerationLimit(ST_POSMOVE_Handle handle, _iq24 accLim) {
382 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
383
384 obj->AccLim = accLim;
385
386 return;
387 } // end of STPOSMOVE_setAccelerationLimit function
388
392 static inline void STPOSMOVE_setDecelerationLimit(ST_POSMOVE_Handle handle, _iq24 decLim) {
393 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
394
395 obj->DecLim = decLim;
396
397 return;
398 } // end of STPOSMOVE_setDecelerationLimit function
399
403 static inline void STPOSMOVE_setJerkLimit(ST_POSMOVE_Handle handle, _iq20 jrkLim) {
404 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
405
406 obj->JrkLim = jrkLim;
407
408 return;
409 } // end of STPOSMOVE_setJerkLimit function
410
414 static inline void STPOSMOVE_setVelocityEnd(ST_POSMOVE_Handle handle, _iq24 velEnd) {
415 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
416
417 obj->VelEnd = velEnd;
418
419 return;
420 } // end of STPOSMOVE_setVelocityEnd function
421
425 static inline _iq24 STPOSMOVE_getVelocityEnd(ST_POSMOVE_Handle handle) {
426 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
427
428 return(obj->VelEnd);
429 } // end of STPOSMOVE_getVelocityEnd function
430
434 static inline void STPOSMOVE_setPositionRollOver(ST_POSMOVE_Handle handle, int32_t posRollOver) {
435 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
436
437 obj->PosRollOver = posRollOver;
438
439 return;
440 } // end of STPOSMOVE_setPositionRollOver function
441
445 static inline int32_t STPOSMOVE_getPositionRollOver(ST_POSMOVE_Handle handle) {
446 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
447
448 return(obj->PosRollOver);
449 } // end of STPOSMOVE_getPositionReference function
450
454 static inline _iq24 STPOSMOVE_getPositionReference_mrev(ST_POSMOVE_Handle handle) {
455 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
456
457 return(obj->PosRef_mrev);
458 } // end of STPOSMOVE_getPositionReference_mrev function
459
463 static inline _iq24 STPOSMOVE_getVelocityReference(ST_POSMOVE_Handle handle) {
464 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
465
466 return(obj->VelRef);
467 } // end of STPOSMOVE_getVelocityReference function
468
472 static inline _iq24 STPOSMOVE_getAccelerationReference(ST_POSMOVE_Handle handle) {
473 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
474
475 return(obj->AccRef);
476 } // end of STPOSMOVE_getAccelerationReference function
477
481 static inline _iq20 STPOSMOVE_getJerkReference(ST_POSMOVE_Handle handle) {
482 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
483
484 return(obj->JrkRef);
485 } // end of STPOSMOVE_getJerkReference function
486
490 static inline void STPOSMOVE_setEnable(ST_POSMOVE_Handle handle, bool enb) {
491 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
492
493 obj->ENB = enb;
494
495 return;
496 } // end of STPOSMOVE_setEnable function
497
501 static inline bool STPOSMOVE_getEnable(ST_POSMOVE_Handle handle) {
502 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
503
504 return (obj->ENB);
505 } // end of STPOSMOVE_getEnable function
506
510 static inline void STPOSMOVE_setTest(ST_POSMOVE_Handle handle, bool tst) {
511 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
512
513 obj->TST = tst;
514
515 return;
516 } // end of STPOSMOVE_setTest function
517
521 static inline bool STPOSMOVE_getTest(ST_POSMOVE_Handle handle) {
522 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
523
524 return (obj->TST);
525 } // end of STPOSMOVE_getTest function
526
530 static inline ST_MoveStatus_e STPOSMOVE_getStatus(ST_POSMOVE_Handle handle) {
531 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
532
533 return (obj->STATUS);
534 } // end of STPOSMOVE_getStatus function
535
539 static inline uint16_t STPOSMOVE_getErrorID(ST_POSMOVE_Handle handle) {
540 ST_PosMove_t *obj = (ST_PosMove_t *)handle;
541
542 return (obj->ERR_ID);
543 } // end of STPOSMOVE_getErrorID function
544
549 ST_POSMOVE_Handle STPOSMOVE_init(void *pMemory, const size_t numBytes);
550
553 void STPOSMOVE_run(ST_POSMOVE_Handle handle);
554
556 #endif //__SPINTAC_POS_MOVE_H__
STPOSMOVE_getStatus
static ST_MoveStatus_e STPOSMOVE_getStatus(ST_POSMOVE_Handle handle)
Gets the Status value (STATUS) for SpinTAC Position Move.
Definition: spintac_pos_move.h:530
ST_PosMove_t::ERR_ID
uint16_t ERR_ID
Error ID { 0: no error; others: see error code }.
Definition: spintac_pos_move.h:153
STPOSMOVE_run
void STPOSMOVE_run(ST_POSMOVE_Handle handle)
Runs the SpinTAC Position Move ISR Function.
ST_PosMoveCfg_t::mrev_TO_pu
_iq24 mrev_TO_pu
Conversion ratio from mechanical revolution to pu { value range: [0.002, 1.0]) }. ...
Definition: spintac_pos_move.h:102
STPOSMOVE_setJerkLimit
static void STPOSMOVE_setJerkLimit(ST_POSMOVE_Handle handle, _iq20 jrkLim)
Sets the Jerk Limit (JrkLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:403
STPOSMOVE_setVelocityStart
static void STPOSMOVE_setVelocityStart(ST_POSMOVE_Handle handle, _iq24 velStart)
Sets the Velocity Start (cfg.VelStart) for SpinTAC Position Move.
Definition: spintac_pos_move.h:255
ST_PosMove_t
Defines the ST_PosMove_t data.
Definition: spintac_pos_move.h:128
ST_MOVE_HALT
Move is in busy state, ramping velocity to zero.
Definition: spintac_pos_move.h:90
STPOSMOVE_getActualAcceleration
static _iq24 STPOSMOVE_getActualAcceleration(ST_POSMOVE_Handle handle)
Gets the Actual Acceleration (msg.ActualAccLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:319
ST_MOVE_CONF
Move is in conf state, determining the curves.
Definition: spintac_pos_move.h:88
STPOSMOVE_setSampleTime_sec
static void STPOSMOVE_setSampleTime_sec(ST_POSMOVE_Handle handle, _iq24 sampleTime)
Sets the Sample Time (cfg.T_sec) for SpinTAC Position Move.
Definition: spintac_pos_move.h:200
STPOSMOVE_setAxis
static void STPOSMOVE_setAxis(ST_POSMOVE_Handle handle, ST_Axis_e axis)
Sets the Axis (cfg.Axis) for SpinTAC Position Move.
Definition: spintac_pos_move.h:163
ST_PosMoveCfg_t::T_sec
_iq24 T_sec
Sample time { unit: [s], value range: (0, 0.01] }.
Definition: spintac_pos_move.h:100
ST_PosMove_t::PosStepInt_mrev
int32_t PosStepInt_mrev
Position Step value integer part { unit: [MRev], value range: (-2^31, 2^31) }.
Definition: spintac_pos_move.h:132
STPOSMOVE_setPositionRollOver
static void STPOSMOVE_setPositionRollOver(ST_POSMOVE_Handle handle, int32_t posRollOver)
Sets the Position RollOver Counts (PosRollOver) for SpinTAC Position Move.
Definition: spintac_pos_move.h:434
ST_PosMoveMsg_t::ActualDecLim
_iq24 ActualDecLim
Actual maximum deceleration of the profile { unit: [pu/s^2], value range: (0.0, DecLim] }...
Definition: spintac_pos_move.h:121
ST_PosMove_t::JrkLim
_iq20 JrkLim
Jerk Limit { unit: [pu/s^3], value range: [0.0005, 2000.0] }.
Definition: spintac_pos_move.h:138
STPOSMOVE_getAccelerationReference
static _iq24 STPOSMOVE_getAccelerationReference(ST_POSMOVE_Handle handle)
Gets the Acceleration Reference (AccRef) for SpinTAC Position Move.
Definition: spintac_pos_move.h:472
ST_PosMove_t::PosRef_mrev
_iq24 PosRef_mrev
Sawtooth Position profile { unit: [MRev], value range [-ROMax_mrev, ROMax_mrev) }.
Definition: spintac_pos_move.h:145
ST_PosMoveMsg_t::ProTime_tick
uint32_t ProTime_tick
Profile time in sub-million ticks { unit: [tick], value range: (0, 1000000) }.
Definition: spintac_pos_move.h:117
STPOSMOVE_getVelocityEnd
static _iq24 STPOSMOVE_getVelocityEnd(ST_POSMOVE_Handle handle)
Gets the Velocity End (VelEnd) for SpinTAC Position Move.
Definition: spintac_pos_move.h:425
STPOSMOVE_setTest
static void STPOSMOVE_setTest(ST_POSMOVE_Handle handle, bool tst)
Sets the Test signal (TST) for SpinTAC Position Move.
Definition: spintac_pos_move.h:510
ST_PosMoveCfg_t::Axis
ST_Axis_e Axis
Axis ID { ST_AXIS0: axis 0, ST_AXIS1: axis 1}.
Definition: spintac_pos_move.h:99
ST_PosMoveMsg_t::ActualJrkLim
_iq20 ActualJrkLim
Actual maximum jerk of the profile { unit: [pu/s^3], value range: (0.0, JrkLim] }.
Definition: spintac_pos_move.h:122
ST_MOVE_IDLE
Move is in idle state, holding position.
Definition: spintac_pos_move.h:86
STPOSMOVE_getTest
static bool STPOSMOVE_getTest(ST_POSMOVE_Handle handle)
Gets the Test signal (TST) for SpinTAC Position Move.
Definition: spintac_pos_move.h:521
STPOSMOVE_getEnable
static bool STPOSMOVE_getEnable(ST_POSMOVE_Handle handle)
Gets the Enable signal (ENB) for SpinTAC Position Move.
Definition: spintac_pos_move.h:501
ST_MOVE_CUR_TRAP
Trapezoidal curve.
Definition: spintac_pos_move.h:66
STPOSMOVE_getJerkReference
static _iq20 STPOSMOVE_getJerkReference(ST_POSMOVE_Handle handle)
Gets the Jerk Reference (JrkRef) for SpinTAC Position Move.
Definition: spintac_pos_move.h:481
_IQ24
#define _IQ24(A)
Definition: 32b/IQmathLib.h:275
ST_PosMoveMsg_t
Defines the ST_PosMoveMsg_t data.
Definition: spintac_pos_move.h:116
ST_PosMoveMsg_t::ActualVelLim
_iq24 ActualVelLim
Actual maximum velocity of the profile { unit: [pu/s], value range: (0.0, VelLim] }...
Definition: spintac_pos_move.h:119
ST_PosMoveMsg_t::ProTime_mtick
uint32_t ProTime_mtick
Profile time in million ticks increments { unit: [million tick], value range: (0, uint32_t max] }...
Definition: spintac_pos_move.h:118
STPOSMOVE_getVelocityReference
static _iq24 STPOSMOVE_getVelocityReference(ST_POSMOVE_Handle handle)
Gets the Velocity Reference (VelRef) for SpinTAC Position Move.
Definition: spintac_pos_move.h:463
STPOSMOVE_init
ST_POSMOVE_Handle STPOSMOVE_init(void *pMemory, const size_t numBytes)
Initializes the SpinTAC Position Move object.
ST_POS_MOVE_POS_TYPE
position-determined position profile
Definition: spintac_pos_move.h:77
ST_PosMove_t::VelRef
_iq24 VelRef
Velocity profile { unit: [pu/s] }.
Definition: spintac_pos_move.h:146
STPOSMOVE_setVelocityEnd
static void STPOSMOVE_setVelocityEnd(ST_POSMOVE_Handle handle, _iq24 velEnd)
Sets the Velocity End (VelEnd) for SpinTAC Position Move.
Definition: spintac_pos_move.h:414
ST_Axis_e
ST_Axis_e
Enumeration for the Axis Status states.
Definition: spintac_pos_move.h:53
STPOSMOVE_getProfileTime_tick
static void STPOSMOVE_getProfileTime_tick(ST_POSMOVE_Handle handle, uint32_t *ProTime_tick, uint32_t *ProTime_mtick)
Gets the Profile Time (msg.ProTime_tick) for SpinTAC Position Move.
Definition: spintac_pos_move.h:300
ST_PosMoveCfg_t::PosStart_mrev
_iq24 PosStart_mrev
Position Start value { unit: [MRev], value range: [-ROMax, ROMax) }.
Definition: spintac_pos_move.h:109
ST_PosMoveProfileType_e
ST_PosMoveProfileType_e
Enumeration for the Profile Mode states.
Definition: spintac_pos_move.h:74
STPOSMOVE_getActualVelocity
static _iq24 STPOSMOVE_getActualVelocity(ST_POSMOVE_Handle handle)
Gets the Actual Velocity (msg.ActualVelLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:310
ST_POS_MOVE_VEL_TYPE
velocity-determined position profile
Definition: spintac_pos_move.h:76
STPOSMOVE_setAccelerationLimit
static void STPOSMOVE_setAccelerationLimit(ST_POSMOVE_Handle handle, _iq24 accLim)
Sets the Acceleration Limit (AccLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:381
ST_PosMoveCfg_t::CurveType
ST_MoveCurveType_e CurveType
Curve mode { ST_MOVE_CUR_TRAP: Trap; ST_MOVE_CUR_SCRV: s-Curve; ST_MOVE_CUR_STCRV: st-Curve }...
Definition: spintac_pos_move.h:107
STPOSMOVE_setPositionStep_mrev
static void STPOSMOVE_setPositionStep_mrev(ST_POSMOVE_Handle handle, int32_t posStepInt, _iq24 posStepFrac)
Sets the Position Step (posStepInt_mrev, posStepFrac_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:347
ST_AXIS1
Second Axis.
Definition: spintac_pos_move.h:56
ST_PosMoveCfg_t::ROMax_mrev
_iq24 ROMax_mrev
Position Rollover bound { unit: [MRev], value range: [2, 100] }.
Definition: spintac_pos_move.h:101
ST_MOVE_BUSY
Move is in busy state, providing the curves.
Definition: spintac_pos_move.h:89
STPOSMOVE_setVelocityLimit
static void STPOSMOVE_setVelocityLimit(ST_POSMOVE_Handle handle, _iq24 velLim)
Sets the Velocity Limit (VelLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:370
ST_PosMoveMsg_t::ActualAccLim
_iq24 ActualAccLim
Actual maximum acceleration of the profile { unit: [pu/s^2], value range: (0.0, AccLim] }...
Definition: spintac_pos_move.h:120
STPOSMOVE_getPositionRollOver
static int32_t STPOSMOVE_getPositionRollOver(ST_POSMOVE_Handle handle)
Gets the Position RollOver Counts (PosRollOver) for SpinTAC Position Move.
Definition: spintac_pos_move.h:445
STPOSMOVE_getActualJerk
static _iq20 STPOSMOVE_getActualJerk(ST_POSMOVE_Handle handle)
Gets the Actual Jerk (msg.ActualJrkLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:337
_iq24
long _iq24
Definition: 32b/IQmathLib.h:230
STPOSMOVE_getVelocityStart
static _iq24 STPOSMOVE_getVelocityStart(ST_POSMOVE_Handle handle)
Gets the Velocity Start (cfg.VelStart) for SpinTAC Position Move.
Definition: spintac_pos_move.h:268
ST_PosMoveCfg_t
Defines the ST_PosMoveCfg_t data.
Definition: spintac_pos_move.h:97
STPOSMOVE_setCurveType
static void STPOSMOVE_setCurveType(ST_POSMOVE_Handle handle, ST_MoveCurveType_e curveType)
Sets the Curve Type (cfg.CurveType) for SpinTAC Position Move.
Definition: spintac_pos_move.h:189
STPOSMOVE_setHaltLimits
static void STPOSMOVE_setHaltLimits(ST_POSMOVE_Handle handle, _iq24 haltAccLim, _iq20 haltJrkLim)
Sets the Halt Limits (cfg.HaltAccLim & cfg.HaltJrkLim) for SpinTAC Position Move. ...
Definition: spintac_pos_move.h:241
ST_MOVE_INIT
Move is in init state, validating configured parameters.
Definition: spintac_pos_move.h:87
ST_PosMove_t::TST
bool TST
Profile test bit { false: Not Testing; true: Testing Mode }.
Definition: spintac_pos_move.h:142
ST_Axis_e
ST_Axis_e
Enumeration for the Axis Status states.
Definition: spintac_pos_ctl.h:53
ST_PosMove_t::cfg
ST_PosMoveCfg_t cfg
Definition: spintac_pos_move.h:130
STPOSMOVE_getActualDeceleration
static _iq24 STPOSMOVE_getActualDeceleration(ST_POSMOVE_Handle handle)
Gets the Actual Deceleration (msg.ActualDecLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:328
ST_PosMoveCfg_t::VelStart
_iq24 VelStart
Velocity Start value { unit: [pu/s], value range: [-1.0, 1.0]) }.
Definition: spintac_pos_move.h:108
ST_PosMove_t::PosStepFrac_mrev
_iq24 PosStepFrac_mrev
Position Step value fraction part { unit: [MRev], value range: (-1.0, 1.0) }.
Definition: spintac_pos_move.h:133
ST_POSMOVE_Handle
struct _ST_POSMOVE_Handle_ * ST_POSMOVE_Handle
Definition: spintac_pos_move.h:158
ST_MOVE_CUR_SCRV
S-Curve.
Definition: spintac_pos_move.h:67
spintac_version.h
Public interface, object, and function definitions related to the SpinTAC Version object...
ST_PosMove_t::AccRef
_iq24 AccRef
Acceleration profile { unit: [pu/s^2] }.
Definition: spintac_pos_move.h:147
ST_PosMove_t::VelEnd
_iq24 VelEnd
Velocity End value { unit: [pu/s], value range: [-1.0, 1.0] }.
Definition: spintac_pos_move.h:139
ST_PosMove_t::JrkRef
_iq20 JrkRef
Jerk profile { unit:; [pu /s^3] }.
Definition: spintac_pos_move.h:148
ST_PosMoveCfg_t::ProfileType
ST_PosMoveProfileType_e ProfileType
Sets the profile type { ST_POS_MOVE_VEL_TYPE: velocity; ST_POS_MOVE_POS_TYPE: position }...
Definition: spintac_pos_move.h:106
ST_MOVE_CUR_STCRV
ST-Curve.
Definition: spintac_pos_move.h:68
ST_AXIS0
First Axis.
Definition: spintac_pos_move.h:55
STPOSMOVE_getPositionReference_mrev
static _iq24 STPOSMOVE_getPositionReference_mrev(ST_POSMOVE_Handle handle)
Gets the Position Reference (PosRef_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:454
ST_PosMoveCfg_t::HaltJrkLim
_iq20 HaltJrkLim
Jerk Limit during Halt State { unit: [pu/s^3], value range: [0.0005, 2000.0] }.
Definition: spintac_pos_move.h:104
STPOSMOVE_setUnitConversion
static void STPOSMOVE_setUnitConversion(ST_POSMOVE_Handle handle, float_t baseFreq, uint16_t polePairs)
Sets the Unit Conversions for SpinTAC Position Move.
Definition: spintac_pos_move.h:227
ST_PosMove_t::DecLim
_iq24 DecLim
Deceleration Limit { unit: [pu/s^2], value range: [0.001, 120.0] }.
Definition: spintac_pos_move.h:137
ST_PosMove_t::ENB
bool ENB
Enable bit { false: disabled; true: enabled }.
Definition: spintac_pos_move.h:141
ST_PosMove_t::PosRollOver
int32_t PosRollOver
Position rollover counts.
Definition: spintac_pos_move.h:144
ST_MoveStatus_e
ST_MoveStatus_e
Enumeration for the Move Status states.
Definition: spintac_pos_move.h:84
ST_PosMove_t::VelLim
_iq24 VelLim
Note: VelLim values < 0.001 pu/s may work, but are not guaranteed.
Definition: spintac_pos_move.h:134
_iq20
long _iq20
Definition: 32b/IQmathLib.h:234
ST_PosMove_t::STATUS
ST_MoveStatus_e STATUS
Profile generator status { ST_MOVE_IDLE, ST_MOVE_INIT, ST_MOVE_CONF, ST_MOVE_BUSY, ST_MOVE_HALT }.
Definition: spintac_pos_move.h:152
STPOSMOVE_setProfileType
static void STPOSMOVE_setProfileType(ST_POSMOVE_Handle handle, ST_PosMoveProfileType_e profileType)
Sets the Profile Type (cfg.ProfileType) for SpinTAC Position Move.
Definition: spintac_pos_move.h:176
ST_MoveCurveType_e
ST_MoveCurveType_e
Enumeration for the Move Curve Mode states.
Definition: spintac_pos_move.h:64
STPOSMOVE_setEnable
static void STPOSMOVE_setEnable(ST_POSMOVE_Handle handle, bool enb)
Sets the Enable signal (ENB) for SpinTAC Position Move.
Definition: spintac_pos_move.h:490
ST_PosMove_t::msg
ST_PosMoveMsg_t msg
Definition: spintac_pos_move.h:150
STPOSMOVE_getPositionStep_mrev
static void STPOSMOVE_getPositionStep_mrev(ST_POSMOVE_Handle handle, int32_t *posStepInt, _iq24 *posStepFrac)
Gets the Position Step (posStepInt_mrev, posStepFrac_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:359
STPOSMOVE_getErrorID
static uint16_t STPOSMOVE_getErrorID(ST_POSMOVE_Handle handle)
Gets the Error value (ERR_ID) for SpinTAC Position Move.
Definition: spintac_pos_move.h:539
ST_PosMoveCfg_t::HaltAccLim
_iq24 HaltAccLim
Acceleration Limit during Halt State { unit: [pu/s^2], value range: [0.001, 120.0] }...
Definition: spintac_pos_move.h:103
STPOSMOVE_setPositionStart_mrev
static void STPOSMOVE_setPositionStart_mrev(ST_POSMOVE_Handle handle, _iq24 posStart)
Sets the Position Start (cfg.PosStart_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:277
STPOSMOVE_getPositionStart_mrev
static _iq24 STPOSMOVE_getPositionStart_mrev(ST_POSMOVE_Handle handle)
Gets the Position Start (cfg.PosStart_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:290
STPOSMOVE_setMRevMaximum_mrev
static void STPOSMOVE_setMRevMaximum_mrev(ST_POSMOVE_Handle handle, _iq24 mRevROMax)
Sets the Mechanical Revolution Maximum (cfg.ROMax_mrev) for SpinTAC Position Move.
Definition: spintac_pos_move.h:213
STPOSMOVE_setDecelerationLimit
static void STPOSMOVE_setDecelerationLimit(ST_POSMOVE_Handle handle, _iq24 decLim)
Sets the Deceleration Limit (DecLim) for SpinTAC Position Move.
Definition: spintac_pos_move.h:392
float_t
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
Definition: types.h:121
ST_PosMove_t::AccLim
_iq24 AccLim
Acceleration Limit { unit: [pu/s^2], value range: [0.001, 120.0] }.
Definition: spintac_pos_move.h:136