MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

Data Structures | Macros | Typedefs | Enumerations
CTRL_OBJ

## Data Structures
struct | _CTRL_Version_
| Defines the controller (CTRL) version number. More...
struct | _CTRL_Obj_
| Defines the controller (CTRL) object. More...

## Macros
#define | CTRL_NUM_CONTROLLERS (2)
| Defines the maximum number of controllers that are instantiated into ROM. More...
#define | CTRL_MAJOR_RELEASE_NUMBER (2u)
| Defines the major release number. More...
#define | CTRL_MINOR_RELEASE_NUMBER (0u)
| Defines the major release number. More...
#define | CTRL_NUM_CONTROLLERS (2)
| Defines the number of controllers. More...

## Typedefs
typedef struct _CTRL_Version_ | CTRL_Version
| Defines the controller (CTRL) version number. More...
typedef struct _CTRL_Obj_ | CTRL_Obj
| Defines the controller (CTRL) object. More...
typedef struct _CTRL_Obj_ * | CTRL_Handle
| Defines the CTRL handle. More...
typedef struct _CTRL_Version_ | CTRL_Version
| Defines the controller (CTRL) version number. More...
typedef struct _CTRL_Obj_ | CTRL_Obj
| Defines the controller (CTRL) object. More...
typedef struct _CTRL_Obj_ * | CTRL_Handle
| Defines the CTRL handle. More...

## Enumerations
enum | CTRL_ErrorCode_e { CTRL_ErrorCode_NoError =0, CTRL_ErrorCode_IdClip, CTRL_ErrorCode_EstError, CTRL_numErrorCodes, CTRL_ErrorCode_NoError =0, CTRL_ErrorCode_IdClip, CTRL_ErrorCode_EstError, CTRL_numErrorCodes }
| Enumeration for the error codes. More...
enum | CTRL_TargetProc_e { CTRL_TargetProc_2806x =0, CTRL_TargetProc_2805x, CTRL_TargetProc_2803x, CTRL_TargetProc_2802x, CTRL_TargetProc_Unknown, CTRL_TargetProc_2806x =0, CTRL_TargetProc_2805x, CTRL_TargetProc_2803x, CTRL_TargetProc_2802x }
| Enumeration for the target processors. More...
enum | CTRL_Type_e { CTRL_Type_PID_spd =0, CTRL_Type_PID_Id, CTRL_Type_PID_Iq, CTRL_Type_PI_spd =0, CTRL_Type_PI_Id, CTRL_Type_PI_Iq }
| Enumeration for the controller (CTRL) types. More...
enum | CTRL_ErrorCode_e { CTRL_ErrorCode_NoError =0, CTRL_ErrorCode_IdClip, CTRL_ErrorCode_EstError, CTRL_numErrorCodes, CTRL_ErrorCode_NoError =0, CTRL_ErrorCode_IdClip, CTRL_ErrorCode_EstError, CTRL_numErrorCodes }
| Enumeration for the error codes. More...
enum | CTRL_TargetProc_e { CTRL_TargetProc_2806x =0, CTRL_TargetProc_2805x, CTRL_TargetProc_2803x, CTRL_TargetProc_2802x, CTRL_TargetProc_Unknown, CTRL_TargetProc_2806x =0, CTRL_TargetProc_2805x, CTRL_TargetProc_2803x, CTRL_TargetProc_2802x }
| Enumeration for the target processors. More...
enum | CTRL_Type_e { CTRL_Type_PID_spd =0, CTRL_Type_PID_Id, CTRL_Type_PID_Iq, CTRL_Type_PI_spd =0, CTRL_Type_PI_Id, CTRL_Type_PI_Iq }
| Enumeration for the controller (CTRL) types. More...

## Detailed Description

## Data Structure Documentation

struct _CTRL_Version_

Defines the controller (CTRL) version number.

Definition at line 131 of file 32b/ctrl_obj.h.

Data Fields
uint16_t | major | the major release number
uint16_t | minor | the minor release number
uint16_t | rsvd | reserved value
uint16_t | targetProc | the target processor
CTRL_TargetProc_e | targetProc | the target processor

struct _CTRL_Obj_

Defines the controller (CTRL) object.

The controller object implements all of the FOC algorithms and the estimator functions.

Definition at line 144 of file 32b/ctrl_obj.h.

Data Fields
_iq | angle_pu | the angle value, pu
float_t | BWc_rps | the bandwidth of the current controllers, rad/sec
float_t | BWdelta | the bandwidth scaling to maximize phase margin
CLARKE_Obj | clarke_I | the current Clarke transform object
CLARKE_Obj | clarke_V | the voltage Clarke transform object
CLARKE_Handle | clarkeHandle_I | the handle for the current Clarke transform
CLARKE_Handle | clarkeHandle_V | the handle for the voltage Clarke transform
int_least16_t | counter_current | the isr counter
uint_least16_t | counter_current | the isr counter
int_least16_t | counter_isr | the isr counter
uint_least16_t | counter_isr | the isr counter
int_least16_t | counter_speed | the speed counter
uint_least16_t | counter_speed | the speed counter
int_least32_t | counter_state | the state counter
uint_least32_t | counter_state | the state counter
uint_least16_t | counter_traj | the traj counter
float_t | ctrlFreq_Hz | Defines the controller frequency, Hz.
uint_least32_t | ctrlFreq_Hz | Defines the controller frequency, Hz.
float_t | ctrlPeriod_sec | Defines the controller period, sec.
float_t | currentCtrlPeriod_sec | the period at which the current controller runs, sec
CTRL_ErrorCode_e | errorCode | the error code for the controller
EST_Handle | estHandle | the handle for the parameter estimator
bool | flag_enable | a flag to enable the controller
bool | flag_enableCtrl | a flag to enable the controller
bool | flag_enableCurrentCtrl | a flag to enable the current controllers
bool | flag_enableDcBusComp | a flag to enable the DC bus compensation in the controller
bool | flag_enableOffset | a flag to enable offset estimation after idle state
bool | flag_enablePowerWarp | a flag to enable PowerWarp
bool | flag_enableSpeedCtrl | a flag to enable the speed controller
bool | flag_enableUserMotorParams | a flag to use known motor parameters from user.h file
bool | flag_resetInt_Id | a flag to reset the Id integrator
bool | flag_resetInt_Iq | a flag to reset the Iq integrator
bool | flag_resetInt_spd | a flag to reset the speed integrator
bool | flag_useZeroIq_ref | a flag to force a Iq = 0 reference value
MATH_vec2 | Iab_filt | the Iab filtered values
MATH_vec2 | Iab_in | the Iab input values
MATH_vec2 | Idq_A | the Idq values, A
MATH_vec2 | Idq_in | the Idq input values
MATH_vec2 | Idq_offset_A | the Idq offset values, A
MATH_vec2 | Idq_offset_pu | the Idq offset values, pu
MATH_vec2 | Idq_ref | the Idq reference values, pu
MATH_vec2 | Idq_ref_A | the Idq reference values, A
_iq | IdRated | the Id rated current, pu
IPARK_Obj | ipark | the inverse Park transform object
IPARK_Handle | iparkHandle | the handle for the inverse Park transform
float_t | Kctrl_Wb_p_kgm2 | the controller constant, Wb/(kg*m^2)
_iq | Kd_Id | the desired Kd_Id value
_iq | Kd_Iq | the desired Kd_Iq value
_iq | Kd_spd | the desired Kd_spd value
float_t | Ki_Id | the desired Ki_Id value, unitless
_iq | Ki_Id | the desired Ki_Id value
float_t | Ki_Iq | the desired Ki_Iq value, unitless
_iq | Ki_Iq | the desired Ki_Iq value
_iq | Ki_spd | the desired Ki_spd value
float_t | Ki_spd_ApHz | the desired Ki_spd value, A/Hz
_iq | Kp_Id | the desired Kp_Id value
float_t | Kp_Id_VpA | the desired Kp_Id value, V/A
_iq | Kp_Iq | the desired Kp_Iq value
float_t | Kp_Iq_VpA | the desired Kp_Iq value, V/A
_iq | Kp_spd | the desired Kp_spd value
float_t | Kp_spd_ApHz | the desired Kp_spd value, A/Hz
float_t | Lhf | the Lhf value
_iq | maxVsMag_pu | the maximum voltage vector that is allowed, pu
float_t | maxVsMag_V | the maximum stator voltage magnitude value, V
MOTOR_Params | motorParams | the motor parameters
int_least16_t | numCtrlTicksPerCurrentTick | Defines the number of controller clock ticks per current controller clock tick.
uint_least16_t | numCtrlTicksPerCurrentTick | Defines the number of controller clock ticks per current controller clock tick.
int_least16_t | numCtrlTicksPerSpeedTick | Defines the number of controller clock ticks per speed controller clock tick.
uint_least16_t | numCtrlTicksPerSpeedTick | Defines the number of controller clock ticks per speed controller clock tick.
uint_least16_t | numCtrlTicksPerTrajTick | Defines the number of controller clock ticks per trajectory clock tick.
int_least16_t | numIsrTicksPerCtrlTick | Defines the number of isr clock ticks per controller clock tick.
uint_least16_t | numIsrTicksPerCtrlTick | Defines the number of isr clock ticks per controller clock tick.
PARK_Obj | park | the Park transform object
PARK_Handle | parkHandle | the handle for the Park object
PI_Obj | pi_Id | the Id PI controller object
PI_Obj | pi_Iq | the Iq PI controller object
PI_Obj | pi_spd | the speed PI controller object
PID_Obj | pid_Id | the Id PID controller object
PID_Obj | pid_Iq | the Iq PID controller object
PID_Obj | pid_spd | the speed PID controller object
PID_Handle | pidHandle_Id | the handle for the Id PID controller
PID_Handle | pidHandle_Iq | the handle for the Iq PID controller
PID_Handle | pidHandle_spd | the handle for the speed PID controller
PI_Handle | piHandle_Id | the handle for the Id PI controller
PI_Handle | piHandle_Iq | the handle for the Iq PI controller
PI_Handle | piHandle_spd | the handle for the speed PI controller
CTRL_State_e | prevState | the previous state of the controller
float_t | Rhf | the Rhf value
float_t | RoverL | the R/L value
_iq | spd_max | the maximum speed, pu
_iq | spd_out | the speed output value
_iq | spd_ref | the speed reference, pu
float_t | speed_fb_Hz | the feedback speed value, Hz
_iq | speed_fb_pu | the feedback speed value, pu
float_t | speed_out_A | the output value from the speed controller, A
float_t | speed_outMax_A | the maximum output value for the speed controller, A
_iq | speed_outMax_pu | the maximum output of the speed PI control, pu
float_t | speed_outMin_A | the minimum output value for the speed controller, A
float_t | speed_ref_Hz | the reference speed value, Hz
_iq | speed_ref_pu | the speed reference, pu
float_t | speedCtrlPeriod_sec | the period at which the speed controller runs, sec
CTRL_State_e | state | the current state of the controller
SVGEN_Obj | svgen | the space vector generator object
SVGEN_Handle | svgenHandle | the handle for the space vector generator
TRAJ_Obj | traj_Id | the Id trajectory generator object
TRAJ_Obj | traj_spd | the speed trajectory generator object
TRAJ_Obj | traj_spdMax | the maximum speed trajectory generator object
uint_least32_t | trajFreq_Hz | Defines the trajectory frequency, Hz.
TRAJ_Handle | trajHandle_Id | the handle for the Id trajectory generator
TRAJ_Handle | trajHandle_spd | the handle for the speed trajectory generator
TRAJ_Handle | trajHandle_spdMax | the handle for the maximum speed trajectory generator
_iq | trajPeriod_sec | Defines the trajectory period, sec.
_iq | Ui_Id | the desired Ui_Id value
float_t | Ui_Id_V | the start integrator value for the Id controller, V
_iq | Ui_Iq | the desired Ui_Iq value
float_t | Ui_Iq_V | the start integrator value for the Iq controller, V
_iq | Ui_spd | the desired Ui_spd value
float_t | Ui_spd_A | the start integrator value for the speed controller, A
MATH_vec2 | Vab_in | the Vab input values
MATH_vec2 | Vab_out | the Vab output values
float_t | Vd_sf | the Vd scale factor
MATH_vec2 | Vdq_offset_pu | the Vdq offset values, pu
MATH_vec2 | Vdq_offset_V | the Vdq offset values, V
MATH_vec2 | Vdq_out | the Vdq output values
MATH_vec2 | Vdq_V | the Vdq values, V
CTRL_Version | version | the controller version
int_least32_t | waitTimes[CTRL_numStates] | an array of wait times for each state, isr clock counts
uint_least32_t | waitTimes[CTRL_numStates] | an array of wait times for each state, estimator clock counts

## Macro Definition Documentation

#define CTRL_MAJOR_RELEASE_NUMBER (2u)

Defines the major release number.

Definition at line 44 of file float/ctrl_obj.h.

Referenced by CTRL_init().

#define CTRL_MINOR_RELEASE_NUMBER (0u)

Defines the major release number.

Definition at line 49 of file float/ctrl_obj.h.

Referenced by CTRL_init().

#define CTRL_NUM_CONTROLLERS (2)

Defines the number of controllers.

Definition at line 54 of file float/ctrl_obj.h.

#define CTRL_NUM_CONTROLLERS (2)

Defines the maximum number of controllers that are instantiated into ROM.

Definition at line 79 of file 32b/ctrl_obj.h.

## Typedef Documentation

typedef struct _CTRL_Obj_* CTRL_Handle

Defines the CTRL handle.

Definition at line 198 of file float/ctrl_obj.h.

typedef struct _CTRL_Obj_* CTRL_Handle

Defines the CTRL handle.

Definition at line 283 of file 32b/ctrl_obj.h.

typedef struct _CTRL_Obj_ CTRL_Obj

Defines the controller (CTRL) object.

typedef struct _CTRL_Obj_ CTRL_Obj

Defines the controller (CTRL) object.

The controller object implements all of the FOC algorithms and the estimator functions.

typedef struct _CTRL_Version_ CTRL_Version

Defines the controller (CTRL) version number.

typedef struct _CTRL_Version_ CTRL_Version

Defines the controller (CTRL) version number.

## Enumeration Type Documentation

enum CTRL_ErrorCode_e

Enumeration for the error codes.

Enumerator
CTRL_ErrorCode_NoError | no error error code
CTRL_ErrorCode_IdClip | Id clip error code.
CTRL_ErrorCode_EstError | estimator error code
CTRL_numErrorCodes | the number of controller error codes
CTRL_ErrorCode_NoError | no error error code
CTRL_ErrorCode_IdClip | Id clip error code.
CTRL_ErrorCode_EstError | estimator error code
CTRL_numErrorCodes | the number of controller error codes

Definition at line 62 of file float/ctrl_obj.h.

enum CTRL_ErrorCode_e

Enumeration for the error codes.

Enumerator
CTRL_ErrorCode_NoError | no error error code
CTRL_ErrorCode_IdClip | Id clip error code.
CTRL_ErrorCode_EstError | estimator error code
CTRL_numErrorCodes | the number of controller error codes
CTRL_ErrorCode_NoError | no error error code
CTRL_ErrorCode_IdClip | Id clip error code.
CTRL_ErrorCode_EstError | estimator error code
CTRL_numErrorCodes | the number of controller error codes

Definition at line 98 of file 32b/ctrl_obj.h.

enum CTRL_TargetProc_e

Enumeration for the target processors.

Enumerator
CTRL_TargetProc_2806x | 2806x processor
CTRL_TargetProc_2805x | 2805x processor
CTRL_TargetProc_2803x | 2803x processor
CTRL_TargetProc_2802x | 2802x processor
CTRL_TargetProc_Unknown | Unknown processor.
CTRL_TargetProc_2806x | 2806x processor
CTRL_TargetProc_2805x | 2805x processor
CTRL_TargetProc_2803x | 2803x processor
CTRL_TargetProc_2802x | 2802x processor

Definition at line 73 of file float/ctrl_obj.h.

enum CTRL_TargetProc_e

Enumeration for the target processors.

Enumerator
CTRL_TargetProc_2806x | 2806x processor
CTRL_TargetProc_2805x | 2805x processor
CTRL_TargetProc_2803x | 2803x processor
CTRL_TargetProc_2802x | 2802x processor
CTRL_TargetProc_Unknown | Unknown processor.
CTRL_TargetProc_2806x | 2806x processor
CTRL_TargetProc_2805x | 2805x processor
CTRL_TargetProc_2803x | 2803x processor
CTRL_TargetProc_2802x | 2802x processor

Definition at line 109 of file 32b/ctrl_obj.h.

enum CTRL_Type_e

Enumeration for the controller (CTRL) types.

Enumerator
CTRL_Type_PID_spd | PID Speed controller.
CTRL_Type_PID_Id | PID Id controller.
CTRL_Type_PID_Iq | PID Iq controller.
CTRL_Type_PI_spd | PI Speed controller.
CTRL_Type_PI_Id | PI Id controller.
CTRL_Type_PI_Iq | PI Iq controller.

Definition at line 84 of file float/ctrl_obj.h.

enum CTRL_Type_e

Enumeration for the controller (CTRL) types.

Enumerator
CTRL_Type_PID_spd | PID Speed controller.
CTRL_Type_PID_Id | PID Id controller.
CTRL_Type_PID_Iq | PID Iq controller.
CTRL_Type_PI_spd | PI Speed controller.
CTRL_Type_PI_Id | PI Id controller.
CTRL_Type_PI_Iq | PI Iq controller.

Definition at line 121 of file 32b/ctrl_obj.h.