MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Macros | Typedefs | Enumerations | Functions
SpinTAC Velocity Control

## Data Structures
struct | ST_VelCtlCfg_t
| Defines the ST_VelCtlCfg_t data. More...
struct | ST_VelCtl_t
| Defines the ST_VelCtl_t data. More...

## Macros
#define | __ST_AXIS_ENUM__
#define | __ST_CTL_STATUS_ENUM__

## Typedefs
typedef struct _ST_VELCTL_Handle_ * | ST_VELCTL_Handle

## Enumerations
enum | ST_Axis_e { ST_AXIS0 =0, ST_AXIS1, ST_AXIS0 =0, ST_AXIS1, ST_AXIS0 =0, ST_AXIS1, ST_AXIS0 =0, ST_AXIS1 }
| Enumeration for the Axis Status states. More...
enum | ST_CtlStatus_e { ST_CTL_IDLE =0, ST_CTL_INIT, ST_CTL_CONF, ST_CTL_BUSY, ST_CTL_IDLE =0, ST_CTL_INIT, ST_CTL_CONF, ST_CTL_BUSY }
| Enumeration for the Control Status states. More...

## Functions
static void | STVELCTL_setAxis (ST_VELCTL_Handle handle, ST_Axis_e axis)
| Sets the Axis (cfg.Axis) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setSampleTime_sec (ST_VELCTL_Handle handle, _iq24 sampleTime)
| Sets the Sample Time (cfg.T_sec) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getOutputMaximum (ST_VELCTL_Handle handle)
| Gets the Maximum Output (cfg.OutMax) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getOutputMinimum (ST_VELCTL_Handle handle)
| Gets the Minimum Output (cfg.OutMin) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setOutputMaximums (ST_VELCTL_Handle handle, _iq24 outMax, _iq24 outMin)
| Sets the Maximum Output (cfg.OutMax) and Minimum Output (cfg.OutMin) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setFilterEnableFlag (ST_VELCTL_Handle handle, bool filterEnable)
| Sets the Feedback Filter Enable Flag (cfg.FiltEN) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setVelocityReference (ST_VELCTL_Handle handle, _iq24 velRef)
| Sets the Velocity Reference (VelRef) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getVelocityReference (ST_VELCTL_Handle handle)
| Gets the Velocity Reference (VelRef) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setAccelerationReference (ST_VELCTL_Handle handle, _iq24 accRef)
| Sets the Acceleration Reference (AccRef) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setVelocityFeedback (ST_VELCTL_Handle handle, _iq24 velFdb)
| Sets the Velocity Feedback (VelFdb) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getVelocityFeedback (ST_VELCTL_Handle handle)
| Gets the Velocity Feedback (VelFdb) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setInertia (ST_VELCTL_Handle handle, _iq24 inertia)
| Sets the Inertia (Inertia) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getInertia (ST_VELCTL_Handle handle)
| Gets the Inertia (Inertia) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setFriction (ST_VELCTL_Handle handle, _iq24 friction)
| Sets the Friction (Friction) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getFriction (ST_VELCTL_Handle handle)
| Gets the Friction (Friction) from SpinTAC Velocity Controller. More...
static void | STVELCTL_setBandwidth_radps (ST_VELCTL_Handle handle, _iq20 bw)
| Sets the Bandwidth (Bw_radps) for SpinTAC Velocity Controller. More...
static _iq20 | STVELCTL_getBandwidth_radps (ST_VELCTL_Handle handle)
| Gets the Bandwidth (Bw_radps) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setEnable (ST_VELCTL_Handle handle, bool enb)
| Sets the Enable signal (ENB) for SpinTAC Velocity Controller. More...
static bool | STVELCTL_getEnable (ST_VELCTL_Handle handle)
| Gets the Enable signal (ENB) for SpinTAC Velocity Controller. More...
static void | STVELCTL_setTorqueReference (ST_VELCTL_Handle handle, _iq24 out)
| Sets the Torque (Iq) Reference (Out) for SpinTAC Velocity Controller. More...
static _iq24 | STVELCTL_getTorqueReference (ST_VELCTL_Handle handle)
| Gets the Torque (Iq) Reference (Out) for SpinTAC Velocity Controller. More...
static ST_CtlStatus_e | STVELCTL_getStatus (ST_VELCTL_Handle handle)
| Gets the Status value (STATUS) for SpinTAC Velocity Controller. More...
static uint16_t | STVELCTL_getErrorID (ST_VELCTL_Handle handle)
| Gets the Error value (ERR_ID) for SpinTAC Velocity Controller. More...
ST_VELCTL_Handle | STVELCTL_init (void *pMemory, const size_t numBytes)
| Initializes the SpinTAC Velocity Controller object. More...
void | STVELCTL_run (ST_VELCTL_Handle handle)
| Runs the SpinTAC Velocity Control Function. More...

## Detailed Description

## Data Structure Documentation

struct ST_VelCtlCfg_t

Defines the ST_VelCtlCfg_t data.

The ST_VelCtlCfg_t object contains all configuration parameters of the Velocity Control component

Definition at line 76 of file spintac_vel_ctl.h.

Data Fields
ST_Axis_e | Axis | Axis ID { ST_AXIS0: axis 0, ST_AXIS1: axis 1}.
bool | FiltEN | Enable low-pass Filter { false: Filter Disabled; true: Filter Enabled }.
_iq24 | OutMax | Control signal upper limit { unit: [PU], value range: (-1.0, 1.0] }.
_iq24 | OutMin | Control signal lower limit { unit: [PU], value range: [-1.0, OutMax) }.
_iq24 | T_sec | Sample time { unit: [s], value range: (0.0, 0.01] }.

struct ST_VelCtl_t

Defines the ST_VelCtl_t data.

The ST_VelCtl_t object contains all parameters needed to perform Velocity Control

Definition at line 89 of file spintac_vel_ctl.h.

Data Fields
_iq24 | AccRef | Feedforward input { unit: [pu/s^2] }.
_iq20 | Bw_radps | Controller Bandwidth {unit: [rad/s], value range: [0.01, min(2000.0, 0.1/T_sec)] }.
ST_VelCtlCfg_t | cfg |
bool | ENB | Enable bit { false: disable; true: enable }.
uint16_t | ERR_ID | Error ID { 0: no error; others: see error code }.
_iq24 | Friction | Friction Coefficient { unit: [PU/(pu/s)], value range: positive _IQ24 value }.
_iq24 | Inertia | System inertia { unit: [PU/(pu/s^2)], value range: positive _IQ24 value }.
_iq24 | Out | Control output { unit: [PU], value range: [cfg.OutMin, cfg.OutMax] }.
uint32_t | s1[10] |
ST_CtlStatus_e | STATUS | Status { ST_CTL_IDLE, ST_CTL_INIT, ST_CTL_CONF, ST_CTL_BUSY }.
_iq24 | VelFdb | Feedback input { unit: [pu/s], value range: [-1.0, 1.0] }.
_iq24 | VelRef | Reference input { unit: [pu/s], value range: [-1.0, 1.0] }.

## Macro Definition Documentation

#define __ST_AXIS_ENUM__

Definition at line 50 of file spintac_vel_ctl.h.

#define __ST_CTL_STATUS_ENUM__

Definition at line 61 of file spintac_vel_ctl.h.

## Typedef Documentation

typedef struct _ST_VELCTL_Handle_* ST_VELCTL_Handle

Definition at line 110 of file spintac_vel_ctl.h.

## Enumeration Type Documentation

enum ST_Axis_e

Enumeration for the Axis Status states.

Enumerator
ST_AXIS0 | First Axis.
ST_AXIS1 | Second Axis.
ST_AXIS0 | First Axis.
ST_AXIS1 | Second Axis.
ST_AXIS0 | First Axis.
ST_AXIS1 | Second Axis.
ST_AXIS0 | First Axis.
ST_AXIS1 | Second Axis.

Definition at line 53 of file spintac_vel_ctl.h.

enum ST_CtlStatus_e

Enumeration for the Control Status states.

Enumerator
ST_CTL_IDLE | ST_CTL in idle state.
ST_CTL_INIT | ST_CTL in init state.
ST_CTL_CONF | ST_CTL in conf state.
ST_CTL_BUSY | ST_CTL in busy state.
ST_CTL_IDLE | ST_CTL in idle state.
ST_CTL_INIT | ST_CTL in init state.
ST_CTL_CONF | ST_CTL in conf state.
ST_CTL_BUSY | ST_CTL in busy state.

Definition at line 64 of file spintac_vel_ctl.h.

## Function Documentation

static _iq20 STVELCTL_getBandwidth_radps | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Bandwidth (Bw_radps) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq20 Bw_radps Controller Bandwidth {unit: [rad/s] }

Definition at line 287 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Bw_radps.

static bool STVELCTL_getEnable | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Enable signal (ENB) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  bool ENB Enable bit { false: disable; true: enable }

Definition at line 307 of file spintac_vel_ctl.h.

References ST_VelCtl_t::ENB.

static uint16_t STVELCTL_getErrorID | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Error value (ERR_ID) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  uint16_t error Error ID { 0: no error; others: see error code }

Definition at line 347 of file spintac_vel_ctl.h.

References ST_VelCtl_t::ERR_ID.

static _iq24 STVELCTL_getFriction | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Friction (Friction) from SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 Friction Friction Coefficient { unit: [PU/(pu/s)], value range: positive _IQ24 value }

Definition at line 267 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Friction.

static _iq24 STVELCTL_getInertia | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Inertia (Inertia) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 Inertia System inertia { unit: [PU/(pu/s^2)], Value range: positive _IQ24 value }

Definition at line 247 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Inertia.

static _iq24 STVELCTL_getOutputMaximum | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Maximum Output (cfg.OutMax) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 OutMax Control signal upper limit { unit: [PU], value range: [-1.0, 1.0] }

Definition at line 141 of file spintac_vel_ctl.h.

References ST_VelCtl_t::cfg, and ST_VelCtlCfg_t::OutMax.

static _iq24 STVELCTL_getOutputMinimum | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Minimum Output (cfg.OutMin) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 OutMin Control signal lower limit { unit: [PU], value range: [-1.0, 1.0] }

Definition at line 150 of file spintac_vel_ctl.h.

References ST_VelCtl_t::cfg, and ST_VelCtlCfg_t::OutMin.

static ST_CtlStatus_e STVELCTL_getStatus | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Status value (STATUS) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  ST_CtlStatus_e STATUS Status { ST_CTL_IDLE, ST_CTL_INIT, ST_CTL_CONF, ST_CTL_BUSY }

Definition at line 337 of file spintac_vel_ctl.h.

References ST_VelCtl_t::STATUS.

static _iq24 STVELCTL_getTorqueReference | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Torque (Iq) Reference (Out) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 Out Control output { unit: [PU], value range: [cfg.OutMin, cfg.OutMax] }

Definition at line 328 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Out.

static _iq24 STVELCTL_getVelocityFeedback | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Velocity Feedback (VelFdb) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 VelFdb Feedback input { unit: [pu/s], value range: [-1.0, 1.0] }

Definition at line 227 of file spintac_vel_ctl.h.

References ST_VelCtl_t::VelFdb.

static _iq24 STVELCTL_getVelocityReference | ( | ST_VELCTL_Handle | handle | ) |
| inline static

Gets the Velocity Reference (VelRef) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object

Returns
  _iq24 VelRef Reference input { unit: [pu/s], value range: [-1.0, 1.0] }

Definition at line 196 of file spintac_vel_ctl.h.

References ST_VelCtl_t::VelRef.

ST_VELCTL_Handle STVELCTL_init | ( | void * | pMemory,
|  | const size_t | numBytes
| ) |  |

Initializes the SpinTAC Velocity Controller object.

Parameters

  [in] | *pMemory | Pointer to the memory for ST_VelCtl_t
  [in] | numBytes | The number of bytes in the ST_VelCtl_t

Returns
  ST_VELCTL_Handle handle The handle for the SpinTAC Velocity Controller Object

void STVELCTL_run | ( | ST_VELCTL_Handle | handle | ) |

Runs the SpinTAC Velocity Control Function.

Parameters

  [in] | handle | The Velocity Controller object handle

static void STVELCTL_setAccelerationReference | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | accRef
| ) |  |
| inline static

Sets the Acceleration Reference (AccRef) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | accRef | Feedforward input { unit: [pu/s^2], _IQ24 value) }

Definition at line 205 of file spintac_vel_ctl.h.

References ST_VelCtl_t::AccRef.

static void STVELCTL_setAxis | ( | ST_VELCTL_Handle | handle,
|  | ST_Axis_e | axis
| ) |  |
| inline static

Sets the Axis (cfg.Axis) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | axis | Axis ID { ST_AXIS0: axis 0, ST_AXIS1: axis 1}

Definition at line 115 of file spintac_vel_ctl.h.

References ST_VelCtlCfg_t::Axis, ST_VelCtl_t::cfg, ST_CTL_IDLE, and ST_VelCtl_t::STATUS.

static void STVELCTL_setBandwidth_radps | ( | ST_VELCTL_Handle | handle,
|  | _iq20 | bw
| ) |  |
| inline static

Sets the Bandwidth (Bw_radps) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | bw | Controller Bandwidth { unit: [rad/s] }

Definition at line 276 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Bw_radps.

static void STVELCTL_setEnable | ( | ST_VELCTL_Handle | handle,
|  | bool | enb
| ) |  |
| inline static

Sets the Enable signal (ENB) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | enb | Enable bit { false: disable; true: enable }

Definition at line 296 of file spintac_vel_ctl.h.

References ST_VelCtl_t::ENB.

static void STVELCTL_setFilterEnableFlag | ( | ST_VELCTL_Handle | handle,
|  | bool | filterEnable
| ) |  |
| inline static

Sets the Feedback Filter Enable Flag (cfg.FiltEN) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | filterEnable | Enable low-pass Filter { false: Filter Disabled; true: Filter Enabled }

Definition at line 172 of file spintac_vel_ctl.h.

References ST_VelCtl_t::cfg, ST_VelCtlCfg_t::FiltEN, ST_CTL_IDLE, and ST_VelCtl_t::STATUS.

static void STVELCTL_setFriction | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | friction
| ) |  |
| inline static

Sets the Friction (Friction) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | friction | Friction Coefficient { unit: [PU/(pu/s)], value range: positive _IQ24 value }

Definition at line 256 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Friction.

static void STVELCTL_setInertia | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | inertia
| ) |  |
| inline static

Sets the Inertia (Inertia) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | inertia | System inertia { unit: [PU/(pu/s^2)], Value range: positive _IQ24 value }

Definition at line 236 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Inertia.

static void STVELCTL_setOutputMaximums | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | outMax,
|  | _iq24 | outMin
| ) |  |
| inline static

Sets the Maximum Output (cfg.OutMax) and Minimum Output (cfg.OutMin) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | outMax | Control signal upper limit { unit: [PU], value range: [-1.0, 1.0] }
  [in] | outMin | Control signal lower limit { unit: [PU], value range: [-1.0, OutMax] }

Definition at line 160 of file spintac_vel_ctl.h.

References ST_VelCtl_t::cfg, ST_VelCtlCfg_t::OutMax, and ST_VelCtlCfg_t::OutMin.

static void STVELCTL_setSampleTime_sec | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | sampleTime
| ) |  |
| inline static

Sets the Sample Time (cfg.T_sec) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | sampleTime | Sample Time { unit: [s], value range: (0.0, 0.01] }

Definition at line 128 of file spintac_vel_ctl.h.

References ST_VelCtl_t::cfg, ST_CTL_IDLE, ST_VelCtl_t::STATUS, and ST_VelCtlCfg_t::T_sec.

static void STVELCTL_setTorqueReference | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | out
| ) |  |
| inline static

Sets the Torque (Iq) Reference (Out) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | out | Control output { unit: [PU], value range: [cfg.OutMin, cfg.OutMax] }

Definition at line 317 of file spintac_vel_ctl.h.

References ST_VelCtl_t::Out.

static void STVELCTL_setVelocityFeedback | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | velFdb
| ) |  |
| inline static

Sets the Velocity Feedback (VelFdb) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | velFdb | Feedback input { unit: [pu/s], value range: [-1.0, 1.0] }

Definition at line 216 of file spintac_vel_ctl.h.

References ST_VelCtl_t::VelFdb.

static void STVELCTL_setVelocityReference | ( | ST_VELCTL_Handle | handle,
|  | _iq24 | velRef
| ) |  |
| inline static

Sets the Velocity Reference (VelRef) for SpinTAC Velocity Controller.

Parameters

  [in] | handle | The handle for the SpinTAC Velocity Controller Object
  [in] | velRef | Reference input { unit: [pu/s], value range: [-1, 1] }

Definition at line 185 of file spintac_vel_ctl.h.

References ST_VelCtl_t::VelRef.