13 #ifdef __TMS320C28XX_CLA__
78 #ifdef __TMS320C28XX_CLA__
79 pPhasor->
value[0] = CLAcos_inline(angle_rad);
80 pPhasor->
value[1] = CLAsin_inline(angle_rad);
178 float_t tmp = Vd_sf * maxVsMag_V;
198 #ifdef __TMS320C28XX_CLA__
199 float_t tmp = CLAsqrt_inline((maxVsMag_V * maxVsMag_V) - (Vd_out_V * Vd_out_V));
201 float_t tmp = (
float_t)sqrt((maxVsMag_V * maxVsMag_V) - (Vd_out_V * Vd_out_V));
463 return(&(obj->
Idq_A));
918 return(&(obj->
Vdq_V));
1027 if(count == INT_LEAST16_MAX)
1051 if(count == INT_LEAST16_MAX)
1075 if(count == INT_LEAST16_MAX)
1099 if(count == INT_LEAST32_MAX)
1153 bool result =
false;
1637 const uint_least16_t numPolePairs,
1666 const int_least16_t numCtrlTicksPerCurrentTick)
1680 const int_least16_t numCtrlTicksPerSpeedTick)
1694 const int_least16_t numIsrTicksPerCtrlTick)
1887 const uint16_t majorReleaseNumber,
1888 const uint16_t minorReleaseNumber);
1919 const bool flag_enableSpeedCtrl,
1920 const bool flag_enableCurrentCtrl,
1921 const bool flag_useZeroIq_ref)
2012 if(count >= numCtrlTicksPerSpeedTick)
2043 if(count >= numCtrlTicksPerCurrentTick)
2126 pVdq_V->
value[0] = 0.0;
2127 pVdq_V->
value[1] = 0.0;
2144 #endif // extern "C"
2148 #endif // end of _CTRL_H_ definition
static float_t * CTRL_getIq_A_addr(CTRL_Handle handle)
Gets the quadrature current (Iq) memory address from the controller.
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...
static void CTRL_setIq_ref_A(CTRL_Handle handle, const float_t Iq_ref_A)
Sets the quadrature current (Iq) reference value in the controller.
float_t speed_outMin_A
the minimum output value for the speed controller, A
Defines the controller (CTRL) version number.
static float_t CTRL_getId_ref_A(CTRL_Handle handle)
Gets the direct reference current (Id_ref) value from the controller.
CTRL_ErrorCode_e errorCode
the error code for the controller
the controller error state
void CTRL_incrCounter_isr(CTRL_Handle handle)
Increments the isr counter.
static float_t CTRL_getIq_offset_A(CTRL_Handle handle)
Gets the quadrature offset current (Iq_offset) value from the controller.
static void CTRL_setNumCtrlTicksPerSpeedTick(CTRL_Handle handle, const int_least16_t numCtrlTicksPerSpeedTick)
Sets the number of controller clock ticks per speed controller clock tick.
static float_t CTRL_getCurrentCtrlPeriod_sec(CTRL_Handle handle)
Gets the current controller period.
float_t speedCtrlPeriod_sec
the period at which the speed controller runs, sec
Contains the public interface to the types definitions.
uint_least16_t numCtrlTicksPerSpeedTick
Defines the number of controller clock ticks per speed controller clock tick.
bool flag_enable
a flag to enable the controller
_iq Ki_Iq
the desired Ki_Iq value
static float_t * CTRL_getId_ref_A_addr(CTRL_Handle handle)
Gets the direct reference current (Id_ref) memory address from the controller.
MATH_vec2 Idq_offset_A
the Idq offset values, A
static void CTRL_setFlag_enableCurrentCtrl(CTRL_Handle handle, const bool state)
Sets the enable current controllers flag value in the controller.
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.
static bool CTRL_getFlag_resetInt_Id(CTRL_Handle handle)
Gets the reset Id integrator flag value from the controller.
void CTRL_resetCounter_state(CTRL_Handle handle)
Resets the state counter.
void CTRL_setWaitTimes(CTRL_Handle handle, const int_least32_t *pWaitTimes)
Sets the wait times for the controller states.
static void CTRL_computePhasor(const float_t angle_rad, MATH_vec2 *pPhasor)
Computes a phasor for a given angle.
MOTOR_Type_e type
Defines the motor type.
static float_t CTRL_getMaxVsMag_V(CTRL_Handle handle)
Gets the maximum stator voltage magnitude value.
float_t maxVsMag_V
the maximum stator voltage magnitude value, V
float_t currentCtrlPeriod_sec
the period at which the current controller runs, sec
CTRL_ErrorCode_e CTRL_getErrorCode(CTRL_Handle handle)
Gets the error code from the controller (CTRL) object.
static float_t CTRL_getCtrlFreq_Hz(CTRL_Handle handle)
Gets the controller execution frequency.
_iq CTRL_getUi(CTRL_Handle handle, const CTRL_Type_e ctrlType)
Gets the integrator (Ui) value from the specified controller.
PI_Handle piHandle_Id
the handle for the Id PI controller
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.
float_t Rs_d_Ohm
Defines the direct stator resistance, Ohm.
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.
_iq Ki_Id
the desired Ki_Id value
float_t Ui_spd_A
the start integrator value for the speed controller, A
float_t Ki_spd_ApHz
the desired Ki_spd value, A/Hz
Defines a two element vector.
static void CTRL_setIq_A(CTRL_Handle handle, const float_t Iq_A)
Sets the quadrature current (Iq) value in the controller.
static void CTRL_setCtrlFreq_Hz(CTRL_Handle handle, const float_t ctrlFreq_Hz)
Sets the controller frequency.
static float_t CTRL_getVd_sf(CTRL_Handle handle)
Gets the direct voltage scale factor.
float_t Vd_sf
the Vd scale factor
float_t Ui_Id_V
the start integrator value for the Id controller, V
static float_t CTRL_getBWc_rps(CTRL_Handle handle)
Gets the current controller bandwidth.
static void CTRL_setId_A(CTRL_Handle handle, const float_t Id_A)
Sets the direct current (Id) value in the controller.
static float_t CTRL_getBWdelta(CTRL_Handle handle)
Gets the bandwidth scale factor used to maximize phase margin.
void CTRL_incrCounter_current(CTRL_Handle handle)
Increments the current counter.
float_t Kctrl_Wb_p_kgm2
the controller constant, Wb/(kg*m^2)
static _iq PI_getRefValue(PI_Handle handle)
Gets the reference value in the PI controller.
void CTRL_getWaitTimes(CTRL_Handle handle, int_least32_t *pWaitTimes)
Gets the wait times from the controller.
bool CTRL_isError(CTRL_Handle handle)
Determines if there is a controller error.
float_t CTRL_getCtrlPeriod_sec(CTRL_Handle handle)
Gets the controller execution period.
bool flag_resetInt_Id
a flag to reset the Id integrator
static void PI_setUi(PI_Handle handle, const _iq Ui)
Sets the integrator start value in the PI controller.
uint_least16_t CTRL_getNumIsrTicksPerCtrlTick(CTRL_Handle handle)
Gets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
static void CTRL_setBWdelta(CTRL_Handle handle, const float_t BWdelta)
Sets the bandwidth scale factor used to maximize phase margin.
Defines the structures for the CTRL object.
the controller idle state
CTRL_ErrorCode_e
Enumeration for the error codes.
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.
float_t ctrlPeriod_sec
Defines the controller period, sec.
static void CTRL_setSpeed_outMax_A(CTRL_Handle handle, const float_t speed_outMax_A)
Sets the maximum output value for the speed controller.
Defines the controller (CTRL) object.
Defines a structure for the user parameters.
static float_t CTRL_getSpeedCtrlPeriod_sec(CTRL_Handle handle)
Gets the speed controller period.
bool flag_resetInt_spd
a flag to reset the speed integrator
static float_t * CTRL_getVd_V_addr(CTRL_Handle handle)
Gets the direct voltage (Vd) value memory address from the controller.
static void CTRL_setup(CTRL_Handle handle, const float_t speed_ref_Hz, const float_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.
PI_Handle piHandle_Iq
the handle for the Iq PI controller
static void CTRL_getGains(CTRL_Handle handle, const CTRL_Type_e ctrlType, float_t *pKp, float_t *pKi)
Gets the gain values for the specified controller.
static void CTRL_setBWc_rps(CTRL_Handle handle, const float_t BWc_rps)
Sets the current controller bandwidth.
static float_t CTRL_getIq_ref_A(CTRL_Handle handle)
Gets the quadrature reference current (Iq_ref) value from the controller.
static void CTRL_run(CTRL_Handle handle, MATH_vec2 *pVdq_V)
Run the controller.
static void CTRL_setSpeed_ref_Hz(CTRL_Handle handle, const float_t speed_ref_Hz)
Sets the output speed reference value in the controller.
float_t Rs_q_Ohm
Defines the quadrature stator resistance, Ohm.
CTRL_TargetProc_e
Enumeration for the target processors.
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.
void CTRL_setFlag_enableSpeedCtrl(CTRL_Handle handle, const bool state)
Sets the enable speed control value in the estimator.
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...
uint_least32_t CTRL_getWaitTime(CTRL_Handle handle, const CTRL_State_e ctrlState)
Gets the wait time for a given state.
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...
void CTRL_reset(CTRL_Handle handle)
Resets the controller.
static void PI_setKp(PI_Handle handle, const _iq Kp)
Sets the proportional gain in the PI controller.
static void CTRL_computeOutputLimits_Iq(CTRL_Handle handle, const float_t Vd_out_V, float_t *outMin, float_t *outMax)
Computes the Iq controller output limits.
bool flag_resetInt_Iq
a flag to reset the Iq integrator
static void PI_setKi(PI_Handle handle, const _iq Ki)
Sets the integral gain in the PI controller.
void CTRL_resetCounter_current(CTRL_Handle handle)
Resets the current counter.
uint_least16_t CTRL_getCount_isr(CTRL_Handle handle)
Gets the isr count.
static void CTRL_setId_offset_A(CTRL_Handle handle, const float_t Id_offset_A)
Sets the direct current (Id) offset value in the controller.
bool flag_enableCurrentCtrl
a flag to enable the current controllers
static void CTRL_setSpeed_fb_Hz(CTRL_Handle handle, const float_t speed_fb_Hz)
Sets the feedback speed value in the controller.
static void CTRL_setUi(CTRL_Handle handle, const CTRL_Type_e ctrlType, const float_t Ui)
Sets the integrator (Ui) value in the specified controller.
static void CTRL_setId_ref_A(CTRL_Handle handle, const float_t Id_ref_A)
Sets the direct current (Id) reference value in the controller.
static bool CTRL_isIdle(CTRL_Handle handle)
Determines if the controller is in the idle state.
void CTRL_setState(CTRL_Handle handle, const CTRL_State_e state)
Sets the controller state.
static float_t * CTRL_getIq_offset_A_addr(CTRL_Handle handle)
Gets the quadrature offset current (Iq_offset) memory address from the controller.
float_t speed_out_A
the output value from the speed controller, A
static MATH_vec2 * CTRL_getVdq_V_addr(CTRL_Handle handle)
Gets the direct/quadrature voltage (Vdq) vector memory address from the controller.
static MATH_vec2 * CTRL_getIdq_A_addr(CTRL_Handle handle)
Gets the direct/quadrature current (Idq) vector memory address from the controller.
CTRL_Handle CTRL_init(void *pMemory, const size_t numBytes)
Initializes the controller.
static float_t CTRL_getVq_offset_V(CTRL_Handle handle)
Gets the quadrature offset voltage (Vq_offset) value from the controller.
static void CTRL_setFlag_resetInt_Id(CTRL_Handle handle, const bool state)
Sets the reset Id integrator flag value in the controller.
uint_least16_t numPolePairs
Defines the number of pole pairs.
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.
MOTOR_Type_e
Enumeration for the motor types.
uint_least32_t counter_state
the state counter
void CTRL_setParams(CTRL_Handle handle, USER_Params *pUserParams)
Sets the controller parameters.
bool CTRL_getFlag_enableSpeedCtrl(CTRL_Handle handle)
Gets the enable speed control flag value from the controller.
static bool CTRL_getFlag_useZeroIq_ref(CTRL_Handle handle)
Gets the use zero Iq reference flag value from the controller.
CTRL_State_e state
the current state of the controller
uint_least16_t counter_isr
the isr counter
void CTRL_incrCounter_speed(CTRL_Handle handle)
Increments the speed counter.
void CTRL_resetCounter_isr(CTRL_Handle handle)
Resets the isr counter.
static void CTRL_setMotorParams(CTRL_Handle handle, const MOTOR_Type_e motorType, const uint_least16_t numPolePairs, const float_t ratedFlux_Wb, const float_t Ls_d_H, const float_t Ls_q_H, const float_t Rs_d_Ohm, const float_t Rs_q_Ohm, const float_t Rr_d_Ohm, const float_t Rr_q_Ohm)
Sets the parameters for the motor in the controller.
static void CTRL_setFlag_enable(CTRL_Handle handle, const bool state)
Sets the enable controller flag value in the controller.
static void CTRL_setKi(CTRL_Handle handle, const CTRL_Type_e ctrlType, const float_t Ki)
Sets the integral gain (Ki) value for the specified controller.
void CTRL_incrCounter_state(CTRL_Handle handle)
Increments the state counter.
static float_t CTRL_getKctrl_Wb_p_kgm2(CTRL_Handle handle)
Gets the speed controller constant.
static float_t CTRL_getSpeed_ref_Hz(CTRL_Handle handle)
Gets the output speed reference value from the controller.
CTRL_State_e prevState
the previous state of the controller
float_t Kp_Id_VpA
the desired Kp_Id value, V/A
CTRL_State_e CTRL_getState(CTRL_Handle handle)
Gets the controller state.
float_t BWdelta
the bandwidth scaling to maximize phase margin
static void CTRL_setSpeed_out_A(CTRL_Handle handle, const float_t speed_out_A)
Sets the maximum output value for the speed controller.
static void CTRL_setNumCtrlTicksPerCurrentTick(CTRL_Handle handle, const int_least16_t numCtrlTicksPerCurrentTick)
Sets the number of controller clock ticks per current controller clock tick.
void CTRL_setCtrlPeriod_sec(CTRL_Handle handle, const float_t ctrlPeriod_sec)
Sets the controller execution period.
float_t ratedFlux_Wb
Defines the rated flux, Wb.
MATH_vec2 Vdq_offset_V
the Vdq offset values, V
uint_least16_t counter_current
the isr counter
static float_t * CTRL_getVd_offset_V_addr(CTRL_Handle handle)
Gets the direct offset voltage (Vd_offset) value memory address from the controller.
static void CTRL_setFlag_resetInt_Iq(CTRL_Handle handle, const bool state)
Sets the reset Iq integrator flag value in the controller.
uint_least32_t waitTimes[CTRL_numStates]
an array of wait times for each state, estimator clock counts
_iq CTRL_getKp(CTRL_Handle handle, const CTRL_Type_e ctrlType)
Gets the proportional gain (Kp) value from the specified controller.
static void CTRL_setFlag_useZeroIq_ref(CTRL_Handle handle, const bool state)
Sets the use zero Iq reference flag value in the controller.
static float_t CTRL_getVd_V(CTRL_Handle handle)
Gets the direct voltage (Vd) value from the controller.
CTRL_State_e
Enumeration for the controller states.
static bool CTRL_isEnabled(CTRL_Handle handle)
Determines if the controller is enabled.
static float_t CTRL_getSpeed_out_A(CTRL_Handle handle)
Gets the output value from the speed controller.
static bool CTRL_getFlag_resetInt_spd(CTRL_Handle handle)
Gets the reset speed integrator flag value from the controller.
static float_t CTRL_getSpeed_outMin_A(CTRL_Handle handle)
Gets the minimum value for the speed controller.
float_t speed_outMax_A
the maximum output value for the speed controller, A
static float_t * CTRL_getId_offset_A_addr(CTRL_Handle handle)
Gets the direct offset current (Id_offset) memory address from the controller.
MOTOR_Params motorParams
the motor parameters
static float_t CTRL_getVd_offset_V(CTRL_Handle handle)
Gets the direct offset voltage (Vd_offset) value from the controller.
uint_least16_t counter_speed
the speed counter
void CTRL_setErrorCode(CTRL_Handle handle, const CTRL_ErrorCode_e errorCode)
Sets the error code in the controller.
float_t Ls_q_H
Defines the quadrature stator inductance, H.
float_t speed_fb_Hz
the feedback speed value, Hz
static float_t CTRL_getIq_A(CTRL_Handle handle)
Gets the quadrature current (Iq) value from the controller.
static bool CTRL_getFlag_enable(CTRL_Handle handle)
Gets the enable controller flag value from the controller.
static bool CTRL_isNotIdle(CTRL_Handle handle)
Determines if the controller is not in the idle state.
static float_t * CTRL_getId_A_addr(CTRL_Handle handle)
Gets the direct current (Id) memory address from the controller.
bool CTRL_updateState(CTRL_Handle handle)
Updates the controller state.
float_t Ui_Iq_V
the start integrator value for the Iq controller, V
CTRL_Type_e
Enumeration for the controller (CTRL) types.
static float_t CTRL_getId_A(CTRL_Handle handle)
Gets the direct current (Id) value from the controller.
_iq CTRL_getKi(CTRL_Handle handle, const CTRL_Type_e ctrlType)
Gets the integral gain (Ki) value from the specified controller.
bool flag_useZeroIq_ref
a flag to force a Iq = 0 reference value
float_t Ls_d_H
Defines the direct stator inductance, H.
static float_t CTRL_getSpeed_outMax_A(CTRL_Handle handle)
Gets the maximum value for the speed controller.
float_t Kp_spd_ApHz
the desired Kp_spd value, A/Hz
static float_t CTRL_getSpeed_fb_Hz(CTRL_Handle handle)
Gets the feedback speed value from the controller.
static void CTRL_setIdq_A(CTRL_Handle handle, const MATH_vec2 *pIdq_A)
Sets the direct/quadrature current (Idq) vector values in the controller.
float_t speed_ref_Hz
the reference speed value, Hz
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
static void CTRL_setVdq_V(CTRL_Handle handle, const MATH_vec2 *pVdq_V)
Sets the direct/quadrature voltage (Vdq) vector values in the controller.
float_t Rr_q_Ohm
Defines the quadrature rotor resistance, Ohm.
float_t Rr_d_Ohm
Defines the direct rotor resistance, Ohm.
static void CTRL_setSpeed_outMin_A(CTRL_Handle handle, const float_t speed_outMin_A)
Sets the minimum output value for the speed controller.
static void CTRL_setFlag_resetInt_spd(CTRL_Handle handle, const bool state)
Sets the reset speed integrator flag value in the controller.
MATH_vec2 Vdq_V
the Vdq values, V
uint_least16_t CTRL_getCount_speed(CTRL_Handle handle)
Gets the speed loop count.
static void CTRL_setNumIsrTicksPerCtrlTick(CTRL_Handle handle, const int_least16_t numIsrTicksPerCtrlTick)
Sets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
uint_least16_t CTRL_getCount_current(CTRL_Handle handle)
Gets the current loop count.
static void PI_setMinMax(PI_Handle handle, const _iq outMin, const _iq outMax)
Sets the minimum and maximum output value allowed in the PI controller.
static bool CTRL_getFlag_resetInt_Iq(CTRL_Handle handle)
Gets the reset Iq integrator flag value from the controller.
void CTRL_resetCounter_speed(CTRL_Handle handle)
Resets the speed counter.
static void CTRL_setCurrentCtrlPeriod_sec(CTRL_Handle handle, const float_t currentCtrlPeriod_sec)
Sets the current controller period value.
static void CTRL_setGains(CTRL_Handle handle, const CTRL_Type_e ctrlType, const float_t Kp, const float_t Ki)
Sets the gain values for the specified controller.
void CTRL_checkForErrors(CTRL_Handle handle)
Checks for any controller errors and, if found, sets the controller state to the error state...
MATH_vec2 Idq_A
the Idq values, A
static void CTRL_getIdq_A(CTRL_Handle handle, MATH_vec2 *pIdq_A)
Gets the direct/quadrature current vector values from the controller.
float_t BWc_rps
the bandwidth of the current controllers, rad/sec
uint_least16_t CTRL_getNumCtrlTicksPerSpeedTick(CTRL_Handle handle)
Gets the number of controller clock ticks per speed controller clock tick.
void CTRL_getVersion(CTRL_Handle handle, CTRL_Version *pVersion)
Gets the controller version number.
uint_least16_t numCtrlTicksPerCurrentTick
Defines the number of controller clock ticks per current controller clock tick.
static void CTRL_setMaxVsMag_V(CTRL_Handle handle, const float_t maxVsMag_V)
Sets the maximum stator voltage magnitude value.
Contains the public interface to the Proportional-Integral (PI) controller module routines...
void CTRL_setVersion(CTRL_Handle handle, const CTRL_TargetProc_e targetProc, const uint16_t majorReleaseNumber, const uint16_t minorReleaseNumber)
Sets the controller version.
uint_least32_t CTRL_getCount_state(CTRL_Handle handle)
Gets the state count.
static void CTRL_enable(CTRL_Handle handle)
Enables the controller.
static float_t CTRL_getId_offset_A(CTRL_Handle handle)
Gets the direct offset current (Id_offset) value from the controller.
static float_t * CTRL_getVq_V_addr(CTRL_Handle handle)
Gets the quadrature voltage (Vq) value memory address from the controller.
static void CTRL_disable(CTRL_Handle handle)
Disables the controller.
uint_least16_t numIsrTicksPerCtrlTick
Defines the number of isr clock ticks per controller clock tick.
MOTOR_Type_e CTRL_getMotorType(CTRL_Handle handle)
Gets the motor type from the controller.
Contains the user related definitions.
static float_t * CTRL_getSpeed_out_A_addr(CTRL_Handle handle)
Gets the output value memory address from the speed controller.
static void CTRL_getVdq_V(CTRL_Handle handle, MATH_vec2 *pVdq_V)
Gets the direct/quadrature voltage (Vdq) vector values from the controller.
static float_t * CTRL_getIq_ref_A_addr(CTRL_Handle handle)
Gets the quadrature reference current (Iq_ref) memory address from the controller.
PI_Handle piHandle_spd
the handle for the speed PI controller
static void CTRL_setSpeedCtrlPeriod_sec(CTRL_Handle handle, const float_t speedCtrlPeriod_sec)
Sets the speed controller period value.
float_t Kp_Iq_VpA
the desired Kp_Iq value, V/A
static float_t * CTRL_getVq_offset_V_addr(CTRL_Handle handle)
Gets the quadrature offset voltage (Vq_offset) value memory address from the controller.
static void CTRL_setVd_sf(CTRL_Handle handle, const float_t Vd_sf)
Sets the direct voltage scale factor.
static void CTRL_setIq_offset_pu(CTRL_Handle handle, const float_t Iq_offset_A)
Sets the quadrature current (Iq) offset value in the controller.
bool flag_enableSpeedCtrl
a flag to enable the speed controller
static void CTRL_setKctrl_Wb_p_kgm2(CTRL_Handle handle, const float_t Kctrl_Wb_p_kgm2)
Sets the speed controller constant.
static float_t CTRL_getVq_V(CTRL_Handle handle)
Gets the quadrature voltage (Vq) value from the controller.
uint_least16_t CTRL_getNumCtrlTicksPerCurrentTick(CTRL_Handle handle)
Gets the number of controller clock ticks per current controller clock tick.
bool CTRL_getFlag_enableCurrentCtrl(CTRL_Handle handle)
Gets the enable current controllers flag value from the controller.
static void PI_run_series(PI_Handle handle, const _iq refValue, const _iq fbackValue, const _iq ffwdValue, _iq *pOutValue)
Runs the series form of the PI controller.
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
static float_t CTRL_getRefValue(CTRL_Handle handle, const CTRL_Type_e ctrlType)
Gets the reference value from the specified controller.
static void CTRL_computeOutputLimits_Id(CTRL_Handle handle, float_t *outMin, float_t *outMax)
Computes the Id controller output limits.
MATH_vec2 Idq_ref_A
the Idq reference values, A
static void CTRL_setKp(CTRL_Handle handle, const CTRL_Type_e ctrlType, const float_t Kp)
Sets the proportional gain (Kp) value for the specified controller.