MotorWare f2806x Module API Documentation
Data Structures | Typedefs | Enumerations | Functions
SpinTAC Position Convert

Data Structures

struct  ST_PosConvCfg_t
 Defines the ST_PosConvCfg_t data. More...
 
struct  ST_PosConv_t
 Defines the ST_PosConv_t data. More...
 

Typedefs

typedef struct _ST_POSCONV_Handle_ * ST_POSCONV_Handle
 

Enumerations

enum  ST_PosConvStatus_e { ST_POS_CONV_IDLE =0, ST_POS_CONV_INIT, ST_POS_CONV_BUSY }
 Enumeration for the Position Convert Status states. More...
 

Functions

static void STPOSCONV_setSampleTime_sec (ST_POSCONV_Handle handle, _iq24 sampleTime)
 Sets the Sample Time (cfg.T) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setERevMaximums_erev (ST_POSCONV_Handle handle, _iq24 eRevROMax, _iq24 eRevROMin)
 Sets the Electrical Revolution Maximum (cfg.ERevROMax) & Minimum (cfg.ERevROMin) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setUnitConversion (ST_POSCONV_Handle handle, float_t baseFreq, float_t sampleTime, uint16_t polePairs)
 Sets the Unit Conversions for SpinTAC Position Converter. More...
 
static void STPOSCONV_setMRevMaximum_mrev (ST_POSCONV_Handle handle, _iq24 mRevROMax)
 Sets the Mechanical Revolution Maximum (cfg.ROMax_mrev) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setLowPassFilterTime_tick (ST_POSCONV_Handle handle, int16_t lpfTime)
 Sets the Lowpass Time (cfg.LpfTime_tick) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setupSlipCompensator (ST_POSCONV_Handle handle, float_t sampleTime, float_t baseFreq, float_t rotorResistance, float_t statorInductance)
 Sets up the Slip Compensator (only for ACIM) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setElecAngle_erev (ST_POSCONV_Handle handle, _iq24 posERev)
 Sets the Electrical Angle (Pos_erev) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setCurrentVector (ST_POSCONV_Handle handle, MATH_vec2 *pIdqIn)
 Sets the Current Vector (IdqIn) (only needed for ACIM) for SpinTAC Position Converter. More...
 
static _iq24 STPOSCONV_getVelocity (ST_POSCONV_Handle handle)
 Gets the Velocity (Vel) for SpinTAC Position Converter. More...
 
static _iq24 STPOSCONV_getVelocityFiltered (ST_POSCONV_Handle handle)
 Gets the Velocity Filtered (VelLpf) for SpinTAC Position Converter. More...
 
static _iq24 STPOSCONV_getPosition_mrev (ST_POSCONV_Handle handle)
 Gets the Position (Pos_mrev) for SpinTAC Position Converter. More...
 
static int32_t STPOSCONV_getPositionRollOver (ST_POSCONV_Handle handle)
 Gets the Position RollOver Counts (PosROCounts) for SpinTAC Position Converter. More...
 
static _iq24 STPOSCONV_getSlipVelocity (ST_POSCONV_Handle handle)
 Gets the Slip Velocity (SlipVel) (only for ACIM) for SpinTAC Position Converter. More...
 
static void STPOSCONV_setEnable (ST_POSCONV_Handle handle, bool enb)
 Sets the Enable signal (ENB) for SpinTAC Position Converter. More...
 
static bool STPOSCONV_getEnable (ST_POSCONV_Handle handle)
 Gets the Enable signal (ENB) for SpinTAC Position Converter. More...
 
static ST_PosConvStatus_e STPOSCONV_getStatus (ST_POSCONV_Handle handle)
 Gets the Status value (STATUS) for SpinTAC Position Converter. More...
 
static uint16_t STPOSCONV_getErrorID (ST_POSCONV_Handle handle)
 Gets the Error value (ERR_ID) for SpinTAC Position Converter. More...
 
ST_POSCONV_Handle STPOSCONV_init (void *pMemory, const size_t numBytes)
 Initializes the SpinTAC Position Converter object. More...
 
void STPOSCONV_run (ST_POSCONV_Handle handle)
 Performs Position Roll Over Addition. More...
 

Detailed Description


Data Structure Documentation

struct ST_PosConvCfg_t

Defines the ST_PosConvCfg_t data.

The ST_PosConvCfg_t object contains all configuration parameters of the Position Convert object.

Definition at line 61 of file spintac_pos_conv.h.

Data Fields
_iq24 erev_TO_pu_ps Conversion ratio from electrical revolution to user unit.
int16_t LpfTime_tick Low pass filter ISR ticks { unit: [ticks], value range: [1, 100] }.
_iq24 OneOverFreqTimeConst Scalar value used in the Slip Compensator (only needed for ACIM) { value range: positive _IQ24 value }.
_iq24 PolePairs Conversion ratio from mechanical revolution to electrical revolution { Pole Pairs }.
_iq24 ROMax_erev Maximum bound for electrical revolution { unit: [ERev] }.
_iq24 ROMax_mrev Position Rollover bound { unit: [MRev] }.
_iq24 ROMin_erev Minimum bound for electrical revolution { unit: [ERev] }.
_iq24 SampleTimeOverTimeConst Scalar value used in the Slip Compensator (only needed for ACIM) { value range: positive _IQ24 value }.
_iq24 T_sec Sample Time { unit: [s], value range: (0, 0.01] }.
struct ST_PosConv_t

Defines the ST_PosConv_t data.

The ST_PosConv_t object contains all parameters needed to perform Position Conversion

Definition at line 77 of file spintac_pos_conv.h.

Data Fields
ST_PosConvCfg_t cfg
bool ENB Enable bit { false: disable; true: enable }.
uint16_t ERR_ID Error ID { 0: no error; others: see error code }.
_iq24 Id the Id current (only needed for ACIM) { unit: [PU] }
_iq24 Iq the Iq current (only needed for ACIM) { unit: [PU] }
_iq24 Pos_erev Electrical angle { unit: [ERev] }.
_iq24 Pos_mrev Position { unit: [MRev] }.
int32_t PosROCounts Position rollover counts.
uint32_t s0[19]
_iq24 SlipVel Speed of the magnetic slip (only for ACIM) { unit: [ERev/s] }.
ST_PosConvStatus_e STATUS Status { ST_POS_CONV_IDLE, ST_POS_CONV_INIT,ST_POS_CONV_BUSY }.
_iq24 Vel Speed unfiltered { unit: [pu/s] }.
_iq24 VelLpf Speed filtered { unit: [pu/s] }.

Typedef Documentation

typedef struct _ST_POSCONV_Handle_* ST_POSCONV_Handle

Definition at line 99 of file spintac_pos_conv.h.

Enumeration Type Documentation

Enumeration for the Position Convert Status states.

Enumerator
ST_POS_CONV_IDLE 

Position Converter is in idle state, zero output.

ST_POS_CONV_INIT 

Position Converter is in init state, validating configured parameters.

ST_POS_CONV_BUSY 

Position Converter is in busy state, converting position and velocity signals.

Definition at line 51 of file spintac_pos_conv.h.

Function Documentation

static bool STPOSCONV_getEnable ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Enable signal (ENB) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
bool ENB Enable bit { false: disable; true: enable }

Definition at line 270 of file spintac_pos_conv.h.

References ST_PosConv_t::ENB.

static uint16_t STPOSCONV_getErrorID ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Error value (ERR_ID) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
uint16_t ERR_ID Error ID { 0: no error; others: see error code }

Definition at line 288 of file spintac_pos_conv.h.

References ST_PosConv_t::ERR_ID.

static _iq24 STPOSCONV_getPosition_mrev ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Position (Pos_mrev) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
_iq24 Pos_mrev Position { unit: [MRev] }

Definition at line 232 of file spintac_pos_conv.h.

References ST_PosConv_t::Pos_mrev.

static int32_t STPOSCONV_getPositionRollOver ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Position RollOver Counts (PosROCounts) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
int32_t PosROCounts Position rollover counts

Definition at line 241 of file spintac_pos_conv.h.

References ST_PosConv_t::PosROCounts.

static _iq24 STPOSCONV_getSlipVelocity ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Slip Velocity (SlipVel) (only for ACIM) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
_iq24 SlipVel Speed of the magnetic slip (only for ACIM) { unit: [ERev/s] }

Definition at line 250 of file spintac_pos_conv.h.

References ST_PosConv_t::SlipVel.

static ST_PosConvStatus_e STPOSCONV_getStatus ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Status value (STATUS) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
ST_PosConvStatus_e STATUS Status { ST_POS_CONV_IDLE, ST_POS_CONV_INIT, ST_POS_CONV_BUSY }

Definition at line 279 of file spintac_pos_conv.h.

References ST_PosConv_t::STATUS.

static _iq24 STPOSCONV_getVelocity ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Velocity (Vel) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
_iq24 Vel Speed unfiltered { unit: [pu/s] }

Definition at line 214 of file spintac_pos_conv.h.

References ST_PosConv_t::Vel.

static _iq24 STPOSCONV_getVelocityFiltered ( ST_POSCONV_Handle  handle)
inlinestatic

Gets the Velocity Filtered (VelLpf) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
Returns
_iq24 VelLpf Speed filtered { unit: [pu/s] }

Definition at line 223 of file spintac_pos_conv.h.

References ST_PosConv_t::VelLpf.

ST_POSCONV_Handle STPOSCONV_init ( void *  pMemory,
const size_t  numBytes 
)

Initializes the SpinTAC Position Converter object.

Parameters
[in]*pMemoryPointer to the memory for ST_PosConv_t
[in]numBytesThe number of bytes in the ST_PosConv_t
Returns
ST_POSCONV_Handle handle The handle for the SpinTAC Position Converter Object
void STPOSCONV_run ( ST_POSCONV_Handle  handle)

Performs Position Roll Over Addition.

Parameters
[in]handleThe handle for the Position Converter structure
static void STPOSCONV_setCurrentVector ( ST_POSCONV_Handle  handle,
MATH_vec2 pIdqIn 
)
inlinestatic

Sets the Current Vector (IdqIn) (only needed for ACIM) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]pIdqInThe vector of the direct/quadrature current input vector values { unit: [PU] }

Definition at line 202 of file spintac_pos_conv.h.

References ST_PosConv_t::Id, ST_PosConv_t::Iq, and _MATH_vec2_::value.

static void STPOSCONV_setElecAngle_erev ( ST_POSCONV_Handle  handle,
_iq24  posERev 
)
inlinestatic

Sets the Electrical Angle (Pos_erev) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]posERevElectrical angle { unit: [ERev] }

Definition at line 191 of file spintac_pos_conv.h.

References ST_PosConv_t::Pos_erev.

static void STPOSCONV_setEnable ( ST_POSCONV_Handle  handle,
bool  enb 
)
inlinestatic

Sets the Enable signal (ENB) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]enbEnable bit { false: disable; true: enable }

Definition at line 259 of file spintac_pos_conv.h.

References ST_PosConv_t::ENB.

static void STPOSCONV_setERevMaximums_erev ( ST_POSCONV_Handle  handle,
_iq24  eRevROMax,
_iq24  eRevROMin 
)
inlinestatic

Sets the Electrical Revolution Maximum (cfg.ERevROMax) & Minimum (cfg.ERevROMin) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]eRevROMaxMaximum bound for electrical revolution { unit: [ERev] }
[in]eRevROMinMinimum bound for electrical revolution { unit: [ERev] }

Definition at line 118 of file spintac_pos_conv.h.

References ST_PosConv_t::cfg, ST_PosConvCfg_t::ROMax_erev, ST_PosConvCfg_t::ROMin_erev, ST_POS_CONV_IDLE, and ST_PosConv_t::STATUS.

static void STPOSCONV_setLowPassFilterTime_tick ( ST_POSCONV_Handle  handle,
int16_t  lpfTime 
)
inlinestatic

Sets the Lowpass Time (cfg.LpfTime_tick) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]lpfTimeLow pass filter ISR ticks { unit: [ticks], value range: [1, 100] }

Definition at line 161 of file spintac_pos_conv.h.

References ST_PosConv_t::cfg, ST_PosConvCfg_t::LpfTime_tick, ST_POS_CONV_IDLE, and ST_PosConv_t::STATUS.

static void STPOSCONV_setMRevMaximum_mrev ( ST_POSCONV_Handle  handle,
_iq24  mRevROMax 
)
inlinestatic

Sets the Mechanical Revolution Maximum (cfg.ROMax_mrev) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]mRevROMaxMaximum bound for mechanical revolution { unit: [MRev] }

Definition at line 148 of file spintac_pos_conv.h.

References ST_PosConv_t::cfg, ST_PosConvCfg_t::ROMax_mrev, ST_POS_CONV_IDLE, and ST_PosConv_t::STATUS.

static void STPOSCONV_setSampleTime_sec ( ST_POSCONV_Handle  handle,
_iq24  sampleTime 
)
inlinestatic

Sets the Sample Time (cfg.T) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]sampleTimeSample Time { unit: [s], value range: (0, 0.01] }

Definition at line 104 of file spintac_pos_conv.h.

References ST_PosConv_t::cfg, ST_POS_CONV_IDLE, ST_PosConv_t::STATUS, and ST_PosConvCfg_t::T_sec.

static void STPOSCONV_setUnitConversion ( ST_POSCONV_Handle  handle,
float_t  baseFreq,
float_t  sampleTime,
uint16_t  polePairs 
)
inlinestatic

Sets the Unit Conversions for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]baseFreqThe value that frequency is scaled with in the system { USER_IQ_FULL_SCALE_FREQ_Hz }
[in]sampleTimeSample Time { unit: [s], value range: (0, 0.01] }
[in]polePairsThe number of Pole Pairs in the motor { USER_MOTOR_NUM_POLE_PAIRS }

Definition at line 134 of file spintac_pos_conv.h.

References _IQ24, ST_PosConv_t::cfg, ST_PosConvCfg_t::erev_TO_pu_ps, ST_PosConvCfg_t::PolePairs, ST_POS_CONV_IDLE, and ST_PosConv_t::STATUS.

static void STPOSCONV_setupSlipCompensator ( ST_POSCONV_Handle  handle,
float_t  sampleTime,
float_t  baseFreq,
float_t  rotorResistance,
float_t  statorInductance 
)
inlinestatic

Sets up the Slip Compensator (only for ACIM) for SpinTAC Position Converter.

Parameters
[in]handleThe handle for the SpinTAC Position Converter Object
[in]sampleTimeSample Time (float) { unit: [s], value range: (0, 0.01] }
[in]baseFreqThe value that frequency is scaled with in the system { USER_IQ_FULL_SCALE_FREQ_Hz }
[in]rotorResistanceThe resistance of the motor rotor, estimated by FAST { USER_MOTOR_Rr }
[in]statorInductanceThe inductance of the motor stator, estimated by FAST { USER_MOTOR_Ls_d }

Definition at line 177 of file spintac_pos_conv.h.

References _IQ24, ST_PosConv_t::cfg, ST_PosConvCfg_t::OneOverFreqTimeConst, ST_PosConvCfg_t::SampleTimeOverTimeConst, ST_POS_CONV_IDLE, and ST_PosConv_t::STATUS.