Data Structures | |
struct | _CTRL_Version_ |
Defines the controller (CTRL) version number. More... | |
struct | _CTRL_Obj_ |
Defines the controller (CTRL) object. More... | |
Macros | |
#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... | |
Enumerations | |
enum | CTRL_ErrorCode_e { CTRL_ERRORCODE_NOERROR = 0, CTRL_ERRORCODE_IDCLIP = 1, CTRL_ERRORCODE_ESTERROR = 2, CTRL_NUMERRORCODES = 3 } |
Enumeration for the error codes. More... | |
enum | CTRL_TargetProc_e { CTRL_TARGETPROC_2806X = 0, CTRL_TARGETPROC_2805X = 1, CTRL_TARGETPROC_2803X = 2, CTRL_TARGETPROC_2802X = 3 } |
Enumeration for the target processors. More... | |
enum | CTRL_Type_e { CTRL_TYPE_PI_SPD = 0, CTRL_TYPE_PI_ID = 1, CTRL_TYPE_PI_IQ = 2 } |
Enumeration for the controller (CTRL) types. More... | |
enum | CTRL_State_e { CTRL_STATE_ERROR = 0, CTRL_STATE_IDLE = 1, CTRL_STATE_OFFLINE = 2, CTRL_STATE_ONLINE = 3, CTRL_NUMSTATES = 4 } |
Enumeration for the controller states. More... | |
Functions | |
static void | CTRL_checkForErrors (CTRL_Handle handle) |
Checks for any controller errors and, if found, sets the controller state to the error state. More... | |
static void | CTRL_computePhasor (const float32_t angle_rad, MATH_Vec2 *pPhasor) |
Computes a phasor for a given angle. More... | |
static void | CTRL_disable (CTRL_Handle handle) |
Disables the controller. More... | |
static void | CTRL_enable (CTRL_Handle handle) |
Enables the controller. More... | |
static float32_t | CTRL_getBWc_rps (CTRL_Handle handle) |
Gets the current controller bandwidth. More... | |
static float32_t | CTRL_getBWdelta (CTRL_Handle handle) |
Gets the bandwidth scale factor used to maximize phase margin. More... | |
static float32_t | CTRL_getKctrl_Wb_p_kgm2 (CTRL_Handle handle) |
Gets the speed controller constant. More... | |
static float32_t | CTRL_getVd_sf (CTRL_Handle handle) |
Gets the direct voltage scale factor. More... | |
static float32_t | CTRL_getMaxVsMag_V (CTRL_Handle handle) |
Gets the maximum stator voltage magnitude value. More... | |
static void | CTRL_computeOutputLimits_Id (CTRL_Handle handle, float32_t *outMin, float32_t *outMax) |
Computes the Id controller output limits. More... | |
static void | CTRL_computeOutputLimits_Iq (CTRL_Handle handle, const float32_t Vd_out_V, float32_t *outMin, float32_t *outMax) |
Computes the Iq controller output limits. More... | |
static int16_t | CTRL_getCount_current (CTRL_Handle handle) |
Gets the current loop count. More... | |
static int16_t | CTRL_getCount_isr (CTRL_Handle handle) |
Gets the isr count. More... | |
static int16_t | CTRL_getCount_speed (CTRL_Handle handle) |
Gets the speed loop count. More... | |
static int32_t | CTRL_getCount_state (CTRL_Handle handle) |
Gets the state count. More... | |
static float32_t | CTRL_getCtrlFreq_Hz (CTRL_Handle handle) |
Gets the controller execution frequency. More... | |
static float32_t | CTRL_getCurrentCtrlPeriod_sec (CTRL_Handle handle) |
Gets the current controller period. More... | |
static float32_t | CTRL_getCtrlPeriod_sec (CTRL_Handle handle) |
Gets the controller execution period. More... | |
static CTRL_ErrorCode_e | CTRL_getErrorCode (CTRL_Handle handle) |
Gets the error code from the controller (CTRL) object. More... | |
static bool | CTRL_getFlag_enable (CTRL_Handle handle) |
Gets the enable controller flag value from the controller. More... | |
static bool | CTRL_getFlag_enableCurrentCtrl (CTRL_Handle handle) |
Gets the enable current controllers flag value from the controller. More... | |
static bool | CTRL_getFlag_enableSpeedCtrl (CTRL_Handle handle) |
Gets the enable speed control flag value from the controller. More... | |
static bool | CTRL_getFlag_resetInt_Id (CTRL_Handle handle) |
Gets the reset Id integrator flag value from the controller. More... | |
static bool | CTRL_getFlag_resetInt_Iq (CTRL_Handle handle) |
Gets the reset Iq integrator flag value from the controller. More... | |
static bool | CTRL_getFlag_resetInt_spd (CTRL_Handle handle) |
Gets the reset speed integrator flag value from the controller. More... | |
static bool | CTRL_getFlag_useZeroIq_ref (CTRL_Handle handle) |
Gets the use zero Iq reference flag value from the controller. More... | |
static float32_t | CTRL_getId_A (CTRL_Handle handle) |
Gets the direct current (Id) value from the controller. More... | |
static float32_t * | CTRL_getId_A_addr (CTRL_Handle handle) |
Gets the direct current (Id) memory address from the controller. More... | |
static float32_t | CTRL_getId_offset_A (CTRL_Handle handle) |
Gets the direct offset current (Id_offset) value from the controller. More... | |
static float32_t * | CTRL_getId_offset_A_addr (CTRL_Handle handle) |
Gets the direct offset current (Id_offset) memory address from the controller. More... | |
static float32_t | CTRL_getId_ref_A (CTRL_Handle handle) |
Gets the direct reference current (Id_ref) value from the controller. More... | |
static float32_t * | CTRL_getId_ref_A_addr (CTRL_Handle handle) |
Gets the direct reference current (Id_ref) memory address from the controller. More... | |
static void | CTRL_getIdq_A (CTRL_Handle handle, MATH_Vec2 *pIdq_A) |
Gets the direct/quadrature current vector values from the controller. More... | |
static MATH_Vec2 * | CTRL_getIdq_A_addr (CTRL_Handle handle) |
Gets the direct/quadrature current (Idq) vector memory address from the controller. More... | |
static void | CTRL_getIdq_offset_A (CTRL_Handle handle, MATH_Vec2 *pIdq_offset_A) |
Gets the direct/quadrature offset current (Idq_offset) vector values from the controller. More... | |
static MATH_Vec2 * | CTRL_getIdq_offset_A_addr (CTRL_Handle handle) |
Gets the direct/quadrature offset current (Idq_offset) vector memory address from the controller. More... | |
static void | CTRL_getIdq_ref_A (CTRL_Handle handle, MATH_Vec2 *pIdq_ref_A) |
Gets the direct/quadrature reference current (Idq_ref) vector values from the controller. More... | |
static MATH_Vec2 * | CTRL_getIdq_ref_A_addr (CTRL_Handle handle) |
Gets the direct/quadrature reference current (Idq_ref) vector memory address from the controller. More... | |
static float32_t | CTRL_getIq_A (CTRL_Handle handle) |
Gets the quadrature current (Iq) value from the controller. More... | |
static float32_t * | CTRL_getIq_A_addr (CTRL_Handle handle) |
Gets the quadrature current (Iq) memory address from the controller. More... | |
static float32_t | CTRL_getIq_offset_A (CTRL_Handle handle) |
Gets the quadrature offset current (Iq_offset) value from the controller. More... | |
static float32_t * | CTRL_getIq_offset_A_addr (CTRL_Handle handle) |
Gets the quadrature offset current (Iq_offset) memory address from the controller. More... | |
static float32_t | CTRL_getIq_ref_A (CTRL_Handle handle) |
Gets the quadrature reference current (Iq_ref) value from the controller. More... | |
static float32_t * | CTRL_getIq_ref_A_addr (CTRL_Handle handle) |
Gets the quadrature reference current (Iq_ref) memory address from the controller. More... | |
static float32_t | CTRL_getKi (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
Gets the integral gain (Ki) value from the specified controller. More... | |
static float32_t | CTRL_getKp (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
Gets the proportional gain (Kp) value from the specified controller. More... | |
static void | CTRL_getGains (CTRL_Handle handle, const CTRL_Type_e ctrlType, float32_t *pKp, float32_t *pKi) |
Gets the gain values for the specified controller. More... | |
static MOTOR_Type_e | CTRL_getMotorType (CTRL_Handle handle) |
Gets the motor type. More... | |
static int16_t | CTRL_getNumCtrlTicksPerCurrentTick (CTRL_Handle handle) |
Gets the number of controller clock ticks per current controller clock tick. More... | |
static int16_t | CTRL_getNumCtrlTicksPerSpeedTick (CTRL_Handle handle) |
Gets the number of controller clock ticks per speed controller clock tick. More... | |
static int16_t | CTRL_getNumIsrTicksPerCtrlTick (CTRL_Handle handle) |
Gets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick. More... | |
static float32_t | CTRL_getRefValue (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
Gets the reference value from the specified controller. More... | |
static float32_t | CTRL_getSpeed_fb_Hz (CTRL_Handle handle) |
Gets the feedback speed value from the controller. More... | |
static float32_t | CTRL_getSpeed_out_A (CTRL_Handle handle) |
Gets the output value from the speed controller. More... | |
static float32_t * | CTRL_getSpeed_out_A_addr (CTRL_Handle handle) |
Gets the output value memory address from the speed controller. More... | |
static float32_t | CTRL_getSpeed_outMax_A (CTRL_Handle handle) |
Gets the maximum value for the speed controller. More... | |
static float32_t | CTRL_getSpeed_outMin_A (CTRL_Handle handle) |
Gets the minimum value for the speed controller. More... | |
static float32_t | CTRL_getSpeed_ref_Hz (CTRL_Handle handle) |
Gets the output speed reference value from the controller. More... | |
static float32_t | CTRL_getSpeedCtrlPeriod_sec (CTRL_Handle handle) |
Gets the speed controller period. More... | |
static CTRL_State_e | CTRL_getState (CTRL_Handle handle) |
Gets the controller state. More... | |
static float32_t | CTRL_getUi (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
Gets the integrator (Ui) value from the specified controller. More... | |
static float32_t | CTRL_getVd_V (CTRL_Handle handle) |
Gets the direct voltage (Vd) value from the controller. More... | |
static float32_t * | CTRL_getVd_V_addr (CTRL_Handle handle) |
Gets the direct voltage (Vd) value memory address from the controller. More... | |
static float32_t | CTRL_getVd_offset_V (CTRL_Handle handle) |
Gets the direct offset voltage (Vd_offset) value from the controller. More... | |
static float32_t * | CTRL_getVd_offset_V_addr (CTRL_Handle handle) |
Gets the direct offset voltage (Vd_offset) value memory address from the controller. More... | |
static void | CTRL_getVdq_V (CTRL_Handle handle, MATH_Vec2 *pVdq_V) |
Gets the direct/quadrature voltage (Vdq) vector values from the controller. More... | |
static MATH_Vec2 * | CTRL_getVdq_V_addr (CTRL_Handle handle) |
Gets the direct/quadrature voltage (Vdq) vector memory address from the controller. More... | |
static void | CTRL_getVdq_offset_V (CTRL_Handle handle, MATH_Vec2 *pVdq_offset_V) |
Gets the direct/quadrature offset voltage (Vdq_offset) vector values from the controller. More... | |
static MATH_Vec2 * | CTRL_getVdq_offset_V_addr (CTRL_Handle handle) |
Gets the direct/quadrature offset voltage (Vdq_offset) vector memory address from the controller. More... | |
void | CTRL_getVersion (CTRL_Handle handle, CTRL_Version *pVersion) |
Gets the controller version number. More... | |
static float32_t | CTRL_getVq_V (CTRL_Handle handle) |
Gets the quadrature voltage (Vq) value from the controller. More... | |
static float32_t * | CTRL_getVq_V_addr (CTRL_Handle handle) |
Gets the quadrature voltage (Vq) value memory address from the controller. More... | |
static float32_t | CTRL_getVq_offset_V (CTRL_Handle handle) |
Gets the quadrature offset voltage (Vq_offset) value from the controller. More... | |
static float32_t * | CTRL_getVq_offset_V_addr (CTRL_Handle handle) |
Gets the quadrature offset voltage (Vq_offset) value memory address from the controller. More... | |
static int32_t | CTRL_getWaitTime (CTRL_Handle handle, const CTRL_State_e state) |
Gets the wait time for a given state. More... | |
void | CTRL_getWaitTimes (CTRL_Handle handle, int32_t *pWaitTimes) |
Gets the wait times from the controller. More... | |
static void | CTRL_incrCounter_current (CTRL_Handle handle) |
Increments the current counter. More... | |
static void | CTRL_incrCounter_isr (CTRL_Handle handle) |
Increments the isr counter. More... | |
static void | CTRL_incrCounter_speed (CTRL_Handle handle) |
Increments the speed counter. More... | |
static void | CTRL_incrCounter_state (CTRL_Handle handle) |
Increments the state counter. More... | |
CTRL_Handle | CTRL_init (void *pMemory, const size_t numBytes) |
Initializes the controller. More... | |
static bool | CTRL_isEnabled (CTRL_Handle handle) |
Determines if the controller is enabled. More... | |
static bool | CTRL_isError (CTRL_Handle handle) |
Determines if there is a controller error. More... | |
static bool | CTRL_isIdle (CTRL_Handle handle) |
Determines if the controller is in the idle state. More... | |
static bool | CTRL_isNotIdle (CTRL_Handle handle) |
Determines if the controller is not in the idle state. More... | |
void | CTRL_reset (CTRL_Handle handle) |
Resets the controller. More... | |
static void | CTRL_resetCounter_current (CTRL_Handle handle) |
Resets the current counter. More... | |
static void | CTRL_resetCounter_isr (CTRL_Handle handle) |
Resets the isr counter. More... | |
static void | CTRL_resetCounter_speed (CTRL_Handle handle) |
Resets the speed counter. More... | |
static void | CTRL_resetCounter_state (CTRL_Handle handle) |
Resets the state counter. More... | |
static void | CTRL_setBWc_rps (CTRL_Handle handle, const float32_t BWc_rps) |
Sets the current controller bandwidth. More... | |
static void | CTRL_setBWdelta (CTRL_Handle handle, const float32_t BWdelta) |
Sets the bandwidth scale factor used to maximize phase margin. More... | |
static void | CTRL_setCtrlFreq_Hz (CTRL_Handle handle, const float32_t ctrlFreq_Hz) |
Sets the controller frequency. More... | |
static void | CTRL_setCtrlPeriod_sec (CTRL_Handle handle, const float32_t ctrlPeriod_sec) |
Sets the controller execution period. More... | |
static void | CTRL_setCurrentCtrlPeriod_sec (CTRL_Handle handle, const float32_t currentCtrlPeriod_sec) |
Sets the current controller period value. More... | |
static void | CTRL_setErrorCode (CTRL_Handle handle, const CTRL_ErrorCode_e errorCode) |
Sets the error code in the controller. More... | |
static void | CTRL_setFlag_enable (CTRL_Handle handle, const bool state) |
Sets the enable controller flag value in the controller. More... | |
static void | CTRL_setFlag_enableCurrentCtrl (CTRL_Handle handle, const bool state) |
Sets the enable current controllers flag value in the controller. More... | |
static void | CTRL_setFlag_enableSpeedCtrl (CTRL_Handle handle, const bool state) |
Sets the enable speed control value in the controller. More... | |
static void | CTRL_setFlag_resetInt_Id (CTRL_Handle handle, const bool state) |
Sets the reset Id integrator flag value in the controller. More... | |
static void | CTRL_setFlag_resetInt_Iq (CTRL_Handle handle, const bool state) |
Sets the reset Iq integrator flag value in the controller. More... | |
static void | CTRL_setFlag_resetInt_spd (CTRL_Handle handle, const bool state) |
Sets the reset speed integrator flag value in the controller. More... | |
static void | CTRL_setFlag_useZeroIq_ref (CTRL_Handle handle, const bool state) |
Sets the use zero Iq reference flag value in the controller. More... | |
static void | CTRL_setId_A (CTRL_Handle handle, const float32_t Id_A) |
Sets the direct current (Id) value in the controller. More... | |
static void | CTRL_setId_offset_A (CTRL_Handle handle, const float32_t Id_offset_A) |
Sets the direct current (Id) offset value in the controller. More... | |
static void | CTRL_setId_ref_A (CTRL_Handle handle, const float32_t Id_ref_A) |
Sets the direct current (Id) reference value in the controller. More... | |
static void | CTRL_setIdq_A (CTRL_Handle handle, const MATH_Vec2 *pIdq_A) |
Sets the direct/quadrature current (Idq) vector values in the controller. More... | |
static void | CTRL_setIdq_offset_A (CTRL_Handle handle, const MATH_Vec2 *pIdq_offset_A) |
Sets the direct/quadrature current (Idq) offset vector values in the controller. More... | |
static void | CTRL_setIdq_ref_A (CTRL_Handle handle, const MATH_Vec2 *pIdq_ref_A) |
Sets the direct/quadrature current (Idq) reference vector values in the controller. More... | |
static void | CTRL_setIq_A (CTRL_Handle handle, const float32_t Iq_A) |
Sets the quadrature current (Iq) value in the controller. More... | |
static void | CTRL_setIq_offset_pu (CTRL_Handle handle, const float32_t Iq_offset_A) |
Sets the quadrature current (Iq) offset value in the controller. More... | |
static void | CTRL_setIq_ref_A (CTRL_Handle handle, const float32_t Iq_ref_A) |
Sets the quadrature current (Iq) reference value in the controller. More... | |
static void | CTRL_setKctrl_Wb_p_kgm2 (CTRL_Handle handle, const float32_t Kctrl_Wb_p_kgm2) |
Sets the speed controller constant. More... | |
static void | CTRL_setKi (CTRL_Handle handle, const CTRL_Type_e ctrlType, const float32_t Ki) |
Sets the integral gain (Ki) value for the specified controller. More... | |
static void | CTRL_setKp (CTRL_Handle handle, const CTRL_Type_e ctrlType, const float32_t Kp) |
Sets the proportional gain (Kp) value for the specified controller. More... | |
static void | CTRL_setGains (CTRL_Handle handle, const CTRL_Type_e ctrlType, const float32_t Kp, const float32_t Ki) |
Sets the gain values for the specified controller. More... | |
static void | CTRL_setMaxVsMag_V (CTRL_Handle handle, const float32_t maxVsMag_V) |
Sets the maximum stator voltage magnitude value. More... | |
static void | CTRL_setMotorParams (CTRL_Handle handle, const MOTOR_Type_e motorType, const uint16_t numPolePairs, const float32_t ratedFlux_Wb, const float32_t Ls_d_H, const float32_t Ls_q_H, const float32_t Rs_d_Ohm, const float32_t Rs_q_Ohm, const float32_t Rr_d_Ohm, const float32_t Rr_q_Ohm) |
Sets the parameters for the motor in the controller. More... | |
static void | CTRL_setNumCtrlTicksPerCurrentTick (CTRL_Handle handle, const int16_t numCtrlTicksPerCurrentTick) |
Sets the number of controller clock ticks per current controller clock tick. More... | |
static void | CTRL_setNumCtrlTicksPerSpeedTick (CTRL_Handle handle, const int16_t numCtrlTicksPerSpeedTick) |
Sets the number of controller clock ticks per speed controller clock tick. More... | |
static void | CTRL_setNumIsrTicksPerCtrlTick (CTRL_Handle handle, const int16_t numIsrTicksPerCtrlTick) |
Sets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick. More... | |
void | CTRL_setParams (CTRL_Handle handle, USER_Params *pUserParams) |
Sets the controller parameters. More... | |
static void | CTRL_setSpeed_fb_Hz (CTRL_Handle handle, const float32_t speed_fb_Hz) |
Sets the feedback speed value in the controller. More... | |
static void | CTRL_setSpeed_out_A (CTRL_Handle handle, const float32_t speed_out_A) |
Sets the maximum output value for the speed controller. More... | |
static void | CTRL_setSpeed_outMax_A (CTRL_Handle handle, const float32_t speed_outMax_A) |
Sets the maximum output value for the speed controller. More... | |
static void | CTRL_setSpeed_outMin_A (CTRL_Handle handle, const float32_t speed_outMin_A) |
Sets the minimum output value for the speed controller. More... | |
static void | CTRL_setSpeed_ref_Hz (CTRL_Handle handle, const float32_t speed_ref_Hz) |
Sets the output speed reference value in the controller. More... | |
static void | CTRL_setSpeedCtrlPeriod_sec (CTRL_Handle handle, const float32_t speedCtrlPeriod_sec) |
Sets the speed controller period value. More... | |
static void | CTRL_setState (CTRL_Handle handle, const CTRL_State_e state) |
Sets the controller state. More... | |
static void | CTRL_setUi (CTRL_Handle handle, const CTRL_Type_e ctrlType, const float32_t Ui) |
Sets the integrator (Ui) value in the specified controller. More... | |
static void | CTRL_setVd_sf (CTRL_Handle handle, const float32_t Vd_sf) |
Sets the direct voltage scale factor. More... | |
static void | CTRL_setVdq_V (CTRL_Handle handle, const MATH_Vec2 *pVdq_V) |
Sets the direct/quadrature voltage (Vdq) vector values in the controller. More... | |
static void | CTRL_setVdq_offset_V (CTRL_Handle handle, const MATH_Vec2 *pVdq_offset_V) |
Sets the direct/quadrature offset voltage (Vdq_offset) vector values in the controller. More... | |
void | CTRL_setVersion (CTRL_Handle handle, const CTRL_TargetProc_e targetProc, const uint16_t majorReleaseNumber, const uint16_t minorReleaseNumber) |
Sets the controller version. More... | |
void | CTRL_setWaitTimes (CTRL_Handle handle, const int32_t *pWaitTimes) |
Sets the wait times for the controller states. More... | |
bool | CTRL_updateState (CTRL_Handle handle) |
Updates the controller state. More... | |
static void | CTRL_setup (CTRL_Handle handle, const float32_t speed_ref_Hz, const float32_t speed_fb_Hz, const MATH_Vec2 *pIdq_A, const MATH_Vec2 *pIdq_offset_A, const MATH_Vec2 *pVdq_offset_V, const bool flag_enableSpeedCtrl, const bool flag_enableCurrentCtrl, const bool flag_useZeroIq_ref) |
Sets up the user controller (CTRL) object. More... | |
static void | CTRL_run (CTRL_Handle handle, MATH_Vec2 *pVdq_V) |
Run the controller. More... | |
#define CTRL_MAJOR_RELEASE_NUMBER (2u) |
Defines the major release number.
#define CTRL_MINOR_RELEASE_NUMBER (0u) |
Defines the major release number.
#define CTRL_NUM_CONTROLLERS (2) |
Defines the number of controllers.
typedef struct _CTRL_Version_ CTRL_Version |
Defines the controller (CTRL) version number.
typedef struct _CTRL_Obj_ CTRL_Obj |
Defines the controller (CTRL) object.
typedef struct _CTRL_Obj_* CTRL_Handle |
Defines the CTRL handle.
enum CTRL_ErrorCode_e |
enum CTRL_TargetProc_e |
enum CTRL_Type_e |
enum CTRL_State_e |
|
inlinestatic |
Checks for any controller errors and, if found, sets the controller state to the error state.
[in] | handle | The controller (CTRL) handle |
Computes a phasor for a given angle.
[in] | angle_rad | The angle, rad |
[out] | pPhasor | The pointer to the phasor vector values |
References _MATH_Vec2_::value.
|
inlinestatic |
Disables the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enable.
|
inlinestatic |
Enables the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enable.
|
inlinestatic |
Gets the current controller bandwidth.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::BWc_rps.
|
inlinestatic |
Gets the bandwidth scale factor used to maximize phase margin.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::BWdelta.
|
inlinestatic |
Gets the speed controller constant.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Kctrl_Wb_p_kgm2.
|
inlinestatic |
Gets the direct voltage scale factor.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Vd_sf.
Referenced by CTRL_computeOutputLimits_Id().
|
inlinestatic |
Gets the maximum stator voltage magnitude value.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::maxVsMag_V.
Referenced by CTRL_computeOutputLimits_Id(), and CTRL_computeOutputLimits_Iq().
|
inlinestatic |
Computes the Id controller output limits.
[in] | handle | The controller (CTRL) handle |
[in] | outMin | The pointer to the minimum output value |
[in] | outMax | The pointer to the maximum output value |
References CTRL_getMaxVsMag_V(), and CTRL_getVd_sf().
Referenced by CTRL_run().
|
inlinestatic |
Computes the Iq controller output limits.
[in] | handle | The controller (CTRL) handle |
[in] | Vd_out_V | The Vd output voltage value, V |
[in] | outMin | The pointer to the minimum output value |
[in] | outMax | The pointer to the maximum output value |
References CTRL_getMaxVsMag_V().
Referenced by CTRL_run().
|
inlinestatic |
Gets the current loop count.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_current.
Referenced by CTRL_run().
|
inlinestatic |
Gets the isr count.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_isr.
|
inlinestatic |
Gets the speed loop count.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_speed.
Referenced by CTRL_run().
|
inlinestatic |
Gets the state count.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_state.
|
inlinestatic |
Gets the controller execution frequency.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::ctrlFreq_Hz.
|
inlinestatic |
Gets the current controller period.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::currentCtrlPeriod_sec.
|
inlinestatic |
Gets the controller execution period.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::ctrlPeriod_sec.
|
inlinestatic |
Gets the error code from the controller (CTRL) object.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::errorCode.
|
inlinestatic |
Gets the enable controller flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enable.
|
inlinestatic |
Gets the enable current controllers flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enableCurrentCtrl.
Referenced by CTRL_run().
|
inlinestatic |
Gets the enable speed control flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enableSpeedCtrl.
Referenced by CTRL_run().
|
inlinestatic |
Gets the reset Id integrator flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_resetInt_Id.
Referenced by CTRL_setup().
|
inlinestatic |
Gets the reset Iq integrator flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_resetInt_Iq.
Referenced by CTRL_setup().
|
inlinestatic |
Gets the reset speed integrator flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_resetInt_spd.
Referenced by CTRL_setup().
|
inlinestatic |
Gets the use zero Iq reference flag value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_useZeroIq_ref.
Referenced by CTRL_run().
|
inlinestatic |
Gets the direct current (Id) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Gets the direct current (Id) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct offset current (Id_offset) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Gets the direct offset current (Id_offset) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct reference current (Id_ref) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct reference current (Id_ref) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct/quadrature current vector values from the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pIdq_A | The vector for the direct/quadrature current vector values, A |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct/quadrature current (Idq) vector memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_A.
|
inlinestatic |
Gets the direct/quadrature offset current (Idq_offset) vector values from the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pIdq_offset_A | The vector for the direct/quadrature offset current vector values, A |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct/quadrature offset current (Idq_offset) vector memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_offset_A.
|
inlinestatic |
Gets the direct/quadrature reference current (Idq_ref) vector values from the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pIdq_ref_A | The vector for the direct/quadrature reference current vector values, A |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the direct/quadrature reference current (Idq_ref) vector memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_ref_A.
|
inlinestatic |
Gets the quadrature current (Iq) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Gets the quadrature current (Iq) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the quadrature offset current (Iq_offset) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Gets the quadrature offset current (Iq_offset) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the quadrature reference current (Iq_ref) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the quadrature reference current (Iq_ref) memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Gets the integral gain (Ki) value from the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Ki_Id, _CTRL_Obj_::Ki_Iq, and _CTRL_Obj_::Ki_spd_ApHz.
Referenced by CTRL_getGains(), and CTRL_setup().
|
inlinestatic |
Gets the proportional gain (Kp) value from the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Kp_Id_VpA, _CTRL_Obj_::Kp_Iq_VpA, and _CTRL_Obj_::Kp_spd_ApHz.
Referenced by CTRL_getGains(), and CTRL_setup().
|
inlinestatic |
Gets the gain values for the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
[in] | pKp | The pointer for the Kp value |
[in] | pKi | The pointer for the Ki value |
References CTRL_getKi(), and CTRL_getKp().
|
inlinestatic |
Gets the motor type.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::motorParams, and _MOTOR_Params_::type.
|
inlinestatic |
Gets the number of controller clock ticks per current controller clock tick.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::numCtrlTicksPerCurrentTick.
Referenced by CTRL_run().
|
inlinestatic |
Gets the number of controller clock ticks per speed controller clock tick.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::numCtrlTicksPerSpeedTick.
Referenced by CTRL_run().
|
inlinestatic |
Gets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::numIsrTicksPerCtrlTick.
|
inlinestatic |
Gets the reference value from the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, PI_getRefValue(), _CTRL_Obj_::piHandle_Id, _CTRL_Obj_::piHandle_Iq, and _CTRL_Obj_::piHandle_spd.
|
inlinestatic |
Gets the feedback speed value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_fb_Hz.
Referenced by CTRL_run().
|
inlinestatic |
Gets the output value from the speed controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_out_A.
Referenced by CTRL_run().
|
inlinestatic |
Gets the output value memory address from the speed controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_out_A.
Referenced by CTRL_run().
|
inlinestatic |
Gets the maximum value for the speed controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_outMax_A.
Referenced by CTRL_run().
|
inlinestatic |
Gets the minimum value for the speed controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_outMin_A.
Referenced by CTRL_run().
|
inlinestatic |
Gets the output speed reference value from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speed_ref_Hz.
Referenced by CTRL_run().
|
inlinestatic |
Gets the speed controller period.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::speedCtrlPeriod_sec.
|
inlinestatic |
Gets the controller state.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::state.
Referenced by CTRL_isError(), CTRL_isIdle(), and CTRL_isNotIdle().
|
inlinestatic |
Gets the integrator (Ui) value from the specified controller.
[in] | handle | The controller (CTRL) handle |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Ui_Id_V, _CTRL_Obj_::Ui_Iq_V, and _CTRL_Obj_::Ui_spd_A.
Referenced by CTRL_setup().
|
inlinestatic |
Gets the direct voltage (Vd) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
|
inlinestatic |
Gets the direct voltage (Vd) value memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
|
inlinestatic |
Gets the direct offset voltage (Vd_offset) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
Referenced by CTRL_run().
|
inlinestatic |
Gets the direct offset voltage (Vd_offset) value memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
|
inlinestatic |
Gets the direct/quadrature voltage (Vdq) vector values from the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pVdq_ | The vector for the direct/quadrature voltage vector values, V |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
Referenced by CTRL_run().
|
inlinestatic |
Gets the direct/quadrature voltage (Vdq) vector memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Vdq_V.
|
inlinestatic |
Gets the direct/quadrature offset voltage (Vdq_offset) vector values from the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pVdq_offset_V | The vector for the direct/quadrature offset voltage vector values, V |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
|
inlinestatic |
Gets the direct/quadrature offset voltage (Vdq_offset) vector memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::Vdq_offset_V.
void CTRL_getVersion | ( | CTRL_Handle | handle, |
CTRL_Version * | pVersion | ||
) |
Gets the controller version number.
[in] | handle | The controller (CTRL) handle |
[in] | pVersion | A pointer to the version |
|
inlinestatic |
Gets the quadrature voltage (Vq) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
|
inlinestatic |
Gets the quadrature voltage (Vq) value memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
|
inlinestatic |
Gets the quadrature offset voltage (Vq_offset) value from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
Referenced by CTRL_run().
|
inlinestatic |
Gets the quadrature offset voltage (Vq_offset) value memory address from the controller.
[in] | handle | The controller (CTRL) handle |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
|
inlinestatic |
Gets the wait time for a given state.
[in] | handle | The controller (CTRL) handle |
[in] | state | The controller state |
References _CTRL_Obj_::waitTimes.
void CTRL_getWaitTimes | ( | CTRL_Handle | handle, |
int32_t * | pWaitTimes | ||
) |
Gets the wait times from the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pWaitTimes | A pointer to a vector for the wait times, isr clock counts |
|
inlinestatic |
Increments the current counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_current.
Referenced by CTRL_setup().
|
inlinestatic |
Increments the isr counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_isr.
|
inlinestatic |
Increments the speed counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_speed.
Referenced by CTRL_setup().
|
inlinestatic |
Increments the state counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_state.
Referenced by CTRL_run().
CTRL_Handle CTRL_init | ( | void * | pMemory, |
const size_t | numBytes | ||
) |
Initializes the controller.
[in] | pMemory | A pointer to the memory for the controller object |
[in] | numBytes | The number of bytes allocated for the controller object, bytes |
|
inlinestatic |
Determines if the controller is enabled.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::flag_enable.
|
inlinestatic |
Determines if there is a controller error.
[in] | handle | The controller (CTRL) handle |
References CTRL_getState(), and CTRL_STATE_ERROR.
|
inlinestatic |
Determines if the controller is in the idle state.
[in] | handle | The controller (CTRL) handle |
References CTRL_getState(), and CTRL_STATE_IDLE.
|
inlinestatic |
Determines if the controller is not in the idle state.
[in] | handle | The controller (CTRL) handle |
References CTRL_getState(), and CTRL_STATE_IDLE.
void CTRL_reset | ( | CTRL_Handle | handle | ) |
Resets the controller.
[in] | handle | The controller (CTRL) handle |
|
inlinestatic |
Resets the current counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_current.
Referenced by CTRL_run().
|
inlinestatic |
Resets the isr counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_isr.
|
inlinestatic |
Resets the speed counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_speed.
Referenced by CTRL_run().
|
inlinestatic |
Resets the state counter.
[in] | handle | The controller (CTRL) handle |
References _CTRL_Obj_::counter_state.
|
inlinestatic |
Sets the current controller bandwidth.
[in] | handle | The controller (CTRL) handle |
[in] | BWc_rps | The current controller bandwidth, rad/sec |
References _CTRL_Obj_::BWc_rps.
|
inlinestatic |
Sets the bandwidth scale factor used to maximize phase margin.
[in] | handle | The controller (CTRL) handle |
[in] | BWdelta | The bandwidth scale factor |
References _CTRL_Obj_::BWdelta.
|
inlinestatic |
Sets the controller frequency.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlFreq_Hz | The controller frequency, Hz |
References _CTRL_Obj_::ctrlFreq_Hz.
|
inlinestatic |
Sets the controller execution period.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlPeriod_sec | The controller execution period, sec |
References _CTRL_Obj_::ctrlPeriod_sec.
|
inlinestatic |
Sets the current controller period value.
[in] | handle | The controller (CTRL) handle |
[in] | currentCtrlPeriod_sec | The current controller period value, sec |
References _CTRL_Obj_::currentCtrlPeriod_sec.
|
inlinestatic |
Sets the error code in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | errorCode | The error code |
References _CTRL_Obj_::errorCode.
|
inlinestatic |
Sets the enable controller flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_enable.
|
inlinestatic |
Sets the enable current controllers flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_enableCurrentCtrl.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the enable speed control value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_enableSpeedCtrl.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the reset Id integrator flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_resetInt_Id.
Referenced by CTRL_setUi(), and CTRL_setup().
|
inlinestatic |
Sets the reset Iq integrator flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_resetInt_Iq.
Referenced by CTRL_setUi(), and CTRL_setup().
|
inlinestatic |
Sets the reset speed integrator flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_resetInt_spd.
Referenced by CTRL_setUi(), and CTRL_setup().
|
inlinestatic |
Sets the use zero Iq reference flag value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | state | The desired state |
References _CTRL_Obj_::flag_useZeroIq_ref.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the direct current (Id) value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Id_A | The direct current value, A |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
|
inlinestatic |
Sets the direct current (Id) offset value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Id_offset_A | The direct current offset value, A |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
|
inlinestatic |
Sets the direct current (Id) reference value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Id_ref_A | The direct current reference value, A |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Sets the direct/quadrature current (Idq) vector values in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pIdq_in_A | The vector of the direct/quadrature current vector values, A |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the direct/quadrature current (Idq) offset vector values in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pIdq_offset_A | The vector of the direct/quadrature current offset vector values, A |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the direct/quadrature current (Idq) reference vector values in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pIdq_ref_A | The vector of the direct/quadrature current reference vector values, A |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
|
inlinestatic |
Sets the quadrature current (Iq) value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Id_A | The direct current value, A |
References _CTRL_Obj_::Idq_A, and _MATH_Vec2_::value.
|
inlinestatic |
Sets the quadrature current (Iq) offset value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Iq_offset_A | The quadrature current reference value, A |
References _CTRL_Obj_::Idq_offset_A, and _MATH_Vec2_::value.
|
inlinestatic |
Sets the quadrature current (Iq) reference value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | Iq_ref_A | The quadrature current reference value, A |
References _CTRL_Obj_::Idq_ref_A, and _MATH_Vec2_::value.
Referenced by CTRL_run().
|
inlinestatic |
Sets the speed controller constant.
[in] | handle | The controller (CTRL) handle |
[in] | Kctrl_Wb_p_kgm2 | The speed controller constant, Wb/(kg*m^2) |
References _CTRL_Obj_::Kctrl_Wb_p_kgm2.
|
inlinestatic |
Sets the integral gain (Ki) value for the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
[in] | Ki | The Ki value |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Ki_Id, _CTRL_Obj_::Ki_Iq, and _CTRL_Obj_::Ki_spd_ApHz.
Referenced by CTRL_setGains().
|
inlinestatic |
Sets the proportional gain (Kp) value for the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
[in] | Kp | The Kp value |
References CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Kp_Id_VpA, _CTRL_Obj_::Kp_Iq_VpA, and _CTRL_Obj_::Kp_spd_ApHz.
Referenced by CTRL_setGains().
|
inlinestatic |
Sets the gain values for the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | ctrlType | The controller type |
[in] | Kp | The Kp gain value, pu |
[in] | Ki | The Ki gain value, pu |
References CTRL_setKi(), and CTRL_setKp().
|
inlinestatic |
Sets the maximum stator voltage magnitude value.
[in] | handle | The controller (CTRL) handle |
[in] | maxVsMax_V | The maximum stator voltage magnitude value, V |
References _CTRL_Obj_::maxVsMag_V.
|
inlinestatic |
Sets the parameters for the motor in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | motorType | The motor type |
[in] | numPolePairs | The number of motor pole pairs |
[in] | ratedFlux_Wb | The rated flux value, Wb |
[in] | Ls_d_H | The direct stator inductance, Henry |
[in] | Ls_q_H | The quadrature stator inductance, Henry |
[in] | Rs_d_Ohm | The direct stator resitance, Ohm |
[in] | Rs_q_Ohm | The quadrature stator resitance, Ohm |
[in] | Rr_d_Ohm | The direct rotor resistance, Ohm |
[in] | Rr_q_Ohm | The quadrature rotor resistance, Ohm |
References _MOTOR_Params_::Ls_d_H, _MOTOR_Params_::Ls_q_H, _CTRL_Obj_::motorParams, _MOTOR_Params_::numPolePairs, _MOTOR_Params_::ratedFlux_Wb, _MOTOR_Params_::Rr_d_Ohm, _MOTOR_Params_::Rr_q_Ohm, _MOTOR_Params_::Rs_d_Ohm, _MOTOR_Params_::Rs_q_Ohm, and _MOTOR_Params_::type.
|
inlinestatic |
Sets the number of controller clock ticks per current controller clock tick.
[in] | handle | The controller (CTRL) handle |
[in] | numCtrlTicksPerCurrentTick | The number of controller clock ticks per current controller clock tick |
References _CTRL_Obj_::numCtrlTicksPerCurrentTick.
|
inlinestatic |
Sets the number of controller clock ticks per speed controller clock tick.
[in] | handle | The controller (CTRL) handle |
[in] | numCtrlTicksPerSpeedTick | The number of controller clock ticks per speed clock tick |
References _CTRL_Obj_::numCtrlTicksPerSpeedTick.
|
inlinestatic |
Sets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick.
[in] | handle | The controller (CTRL) handle |
[in] | numIsrTicksPerCtrlTick | The number of Interrupt Service Routine (ISR) clock ticks per controller clock tick |
References _CTRL_Obj_::numIsrTicksPerCtrlTick.
void CTRL_setParams | ( | CTRL_Handle | handle, |
USER_Params * | pUserParams | ||
) |
Sets the controller parameters.
[in] | handle | The controller (CTRL) handle |
[in] | pUserParams | The pointer to the user parameters |
|
inlinestatic |
Sets the feedback speed value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | speed_fb_Hz | The feedback speed value, Hz |
References _CTRL_Obj_::speed_fb_Hz.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the maximum output value for the speed controller.
[in] | handle | The controller (CTRL) handle |
[in] | speed_out_A | The output value from the speed controller |
References _CTRL_Obj_::speed_out_A.
Referenced by CTRL_run().
|
inlinestatic |
Sets the maximum output value for the speed controller.
[in] | handle | The controller (CTRL) handle |
[in] | speed_outMax_A | The maximum speed value, A |
References _CTRL_Obj_::speed_outMax_A.
|
inlinestatic |
Sets the minimum output value for the speed controller.
[in] | handle | The controller (CTRL) handle |
[in] | speed_outMin_A | The minimum speed value, A |
References _CTRL_Obj_::speed_outMin_A.
|
inlinestatic |
Sets the output speed reference value in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | speed_ref_Hz | The output speed reference value, Hz |
References _CTRL_Obj_::speed_ref_Hz.
Referenced by CTRL_setup().
|
inlinestatic |
Sets the speed controller period value.
[in] | handle | The controller (CTRL) handle |
[in] | speedCtrlPeriod_sec | The speed controller period value, sec |
References _CTRL_Obj_::speedCtrlPeriod_sec.
|
inlinestatic |
Sets the controller state.
[in] | handle | The controller (CTRL) handle |
[in] | state | The new state |
References _CTRL_Obj_::prevState, and _CTRL_Obj_::state.
|
inlinestatic |
Sets the integrator (Ui) value in the specified controller.
[in] | handle | The controller (CTRL) handle |
[in] | Ui | The Ui value |
References CTRL_setFlag_resetInt_Id(), CTRL_setFlag_resetInt_Iq(), CTRL_setFlag_resetInt_spd(), CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, _CTRL_Obj_::Ui_Id_V, _CTRL_Obj_::Ui_Iq_V, and _CTRL_Obj_::Ui_spd_A.
|
inlinestatic |
Sets the direct voltage scale factor.
[in] | handle | The controller (CTRL) handle |
[in] | Vd_sf | The direct voltage scale factor |
References _CTRL_Obj_::Vd_sf.
|
inlinestatic |
Sets the direct/quadrature voltage (Vdq) vector values in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pVdq_V | The vector of direct/quadrature voltage vector values, V |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_V.
Referenced by CTRL_run().
|
inlinestatic |
Sets the direct/quadrature offset voltage (Vdq_offset) vector values in the controller.
[in] | handle | The controller (CTRL) handle |
[in] | pVdq_offset_V | The vector of direct/quadrature offset voltage vector values, V |
References _MATH_Vec2_::value, and _CTRL_Obj_::Vdq_offset_V.
Referenced by CTRL_setup().
void CTRL_setVersion | ( | CTRL_Handle | handle, |
const CTRL_TargetProc_e | targetProc, | ||
const uint16_t | majorReleaseNumber, | ||
const uint16_t | minorReleaseNumber | ||
) |
Sets the controller version.
[in] | handle | The controller (CTRL) handle |
[in] | targetProc | The target processor |
[in] | majorReleaseNumber | The major release number |
[in] | minorReleaseNumber | The minor release number |
void CTRL_setWaitTimes | ( | CTRL_Handle | handle, |
const int32_t * | pWaitTimes | ||
) |
Sets the wait times for the controller states.
[in] | handle | The controller (CTRL) handle |
[in] | pWaitTimes | A pointer to a vector of wait times, controller clock counts |
bool CTRL_updateState | ( | CTRL_Handle | handle | ) |
Updates the controller state.
[in] | handle | The controller (CTRL) handle |
|
inlinestatic |
Sets up the user controller (CTRL) object.
[in] | handle | The controller (CTRL) handle |
[in] | speed_ref_Hz | The reference speed value to use for the speed controller, Hz |
[in] | speed_fb_Hz | The feedback speed value to use for the speed controller, Hz |
[in] | pIdq_A | The pointer to the Idq values, A |
[in] | pIdq_offset_A | The pointer to the Idq offset values, A |
[in] | pVdq_offset_V | The pointer to the Vdq offset values, V |
[in] | flag_enableSpeedCtrl | The flag used to enable the speed controller |
[in] | flag_enableCurrentCtrl | The flag used to enable the current controller |
[in] | flag_useZeroIq_ref | The flag used to enable the zero Iq reference input |
References CTRL_getFlag_resetInt_Id(), CTRL_getFlag_resetInt_Iq(), CTRL_getFlag_resetInt_spd(), CTRL_getKi(), CTRL_getKp(), CTRL_getUi(), CTRL_incrCounter_current(), CTRL_incrCounter_speed(), CTRL_setFlag_enableCurrentCtrl(), CTRL_setFlag_enableSpeedCtrl(), CTRL_setFlag_resetInt_Id(), CTRL_setFlag_resetInt_Iq(), CTRL_setFlag_resetInt_spd(), CTRL_setFlag_useZeroIq_ref(), CTRL_setIdq_A(), CTRL_setIdq_offset_A(), CTRL_setSpeed_fb_Hz(), CTRL_setSpeed_ref_Hz(), CTRL_setVdq_offset_V(), CTRL_TYPE_PI_ID, CTRL_TYPE_PI_IQ, CTRL_TYPE_PI_SPD, PI_setKi(), PI_setKp(), PI_setUi(), _CTRL_Obj_::piHandle_Id, _CTRL_Obj_::piHandle_Iq, and _CTRL_Obj_::piHandle_spd.
|
inlinestatic |
Run the controller.
[in] | handle | The controller (CTRL) handle |
[out] | pVdq_V | The pointer to the direct/quadrature voltage vector, V |
References CTRL_computeOutputLimits_Id(), CTRL_computeOutputLimits_Iq(), CTRL_getCount_current(), CTRL_getCount_speed(), CTRL_getFlag_enableCurrentCtrl(), CTRL_getFlag_enableSpeedCtrl(), CTRL_getFlag_useZeroIq_ref(), CTRL_getId_A(), CTRL_getId_offset_A(), CTRL_getIq_A(), CTRL_getIq_offset_A(), CTRL_getNumCtrlTicksPerCurrentTick(), CTRL_getNumCtrlTicksPerSpeedTick(), CTRL_getSpeed_fb_Hz(), CTRL_getSpeed_out_A(), CTRL_getSpeed_out_A_addr(), CTRL_getSpeed_outMax_A(), CTRL_getSpeed_outMin_A(), CTRL_getSpeed_ref_Hz(), CTRL_getVd_offset_V(), CTRL_getVdq_V(), CTRL_getVq_offset_V(), CTRL_incrCounter_state(), CTRL_resetCounter_current(), CTRL_resetCounter_speed(), CTRL_setId_ref_A(), CTRL_setIq_ref_A(), CTRL_setSpeed_out_A(), CTRL_setVdq_V(), PI_run_series(), PI_setMinMax(), _CTRL_Obj_::piHandle_Id, _CTRL_Obj_::piHandle_Iq, _CTRL_Obj_::piHandle_spd, and _MATH_Vec2_::value.