|
MotorWare f2806x Module API Documentation
|
#include "sw/modules/iqmath/src/32b/IQmathLib.h"#include "sw/modules/clarke/src/32b/clarke.h"#include "sw/modules/park/src/32b/park.h"#include "sw/modules/ipark/src/32b/ipark.h"#include "sw/modules/motor/src/32b/motor.h"#include "sw/modules/offset/src/32b/offset.h"#include "sw/modules/pid/src/32b/pid.h"#include "sw/modules/est/src/32b/est.h"#include "sw/modules/svgen/src/32b/svgen.h"#include "sw/modules/traj/src/32b/traj.h"#include "sw/modules/ctrl/src/32b/ctrl_obj.h"#include "sw/modules/enc/src/32b/enc.h"#include "sw/modules/types/src/types.h"#include "hal_obj.h"Go to the source code of this file.
Functions | |
| bool | CTRL_doCurrentCtrl (CTRL_Handle handle) |
| Determines if the current controllers should be run. More... | |
| uint_least16_t | CTRL_getCount_current (CTRL_Handle handle) |
| Gets the current loop count. More... | |
| uint_least16_t | CTRL_getCount_isr (CTRL_Handle handle) |
| Gets the isr count. More... | |
| uint_least16_t | CTRL_getCount_speed (CTRL_Handle handle) |
| Gets the speed loop count. More... | |
| uint_least32_t | CTRL_getCount_state (CTRL_Handle handle) |
| Gets the state count. More... | |
| uint_least16_t | CTRL_getCount_traj (CTRL_Handle handle) |
| Gets the trajectory loop count. More... | |
| uint_least32_t | CTRL_getCtrlFreq (CTRL_Handle handle) |
| Gets the controller execution frequency. More... | |
| float_t | CTRL_getCtrlPeriod_sec (CTRL_Handle handle) |
| Gets the controller execution period. More... | |
| CTRL_ErrorCode_e | CTRL_getErrorCode (CTRL_Handle handle) |
| Gets the error code from the controller (CTRL) object. More... | |
| EST_Handle | CTRL_getEstHandle (CTRL_Handle handle) |
| Gets the estimator handle for a given controller. More... | |
| bool | CTRL_getFlag_enableCtrl (CTRL_Handle handle) |
| Gets the enable controller flag value from the estimator. More... | |
| bool | CTRL_getFlag_enableDcBusComp (CTRL_Handle handle) |
| Gets the enable DC bus compensation flag value from the estimator. More... | |
| bool | CTRL_getFlag_enablePowerWarp (CTRL_Handle handle) |
| Gets the PowerWarp enable flag value from the estimator. More... | |
| bool | CTRL_getFlag_enableOffset (CTRL_Handle handle) |
| Gets the enable offset flag value from the controller. More... | |
| bool | CTRL_getFlag_enableSpeedCtrl (CTRL_Handle handle) |
| Gets the enable speed control flag value from the controller. More... | |
| bool | CTRL_getFlag_enableUserMotorParams (CTRL_Handle handle) |
| Gets the enable user motor parameters flag value from the controller. More... | |
| void | CTRL_getGains (CTRL_Handle handle, const CTRL_Type_e ctrlType, _iq *pKp, _iq *pKi, _iq *pKd) |
| Gets the gain values for the specified controller. More... | |
| void | CTRL_getIab_filt_pu (CTRL_Handle handle, MATH_vec2 *pIab_filt_pu) |
| Gets the alpha/beta filtered current vector values from the controller. More... | |
| MATH_vec2 * | CTRL_getIab_filt_addr (CTRL_Handle handle) |
| Gets the alpha/beta filtered current vector memory address from the controller. More... | |
| MATH_vec2 * | CTRL_getIab_in_addr (CTRL_Handle handle) |
| Gets the alpha/beta current input vector memory address from the controller. More... | |
| void | CTRL_getIab_in_pu (CTRL_Handle handle, MATH_vec2 *pIab_in_pu) |
| Gets the alpha/beta current input vector values from the controller. More... | |
| _iq | CTRL_getId_in_pu (CTRL_Handle handle) |
| Gets the direct current input value from the controller. More... | |
| _iq | CTRL_getId_ref_pu (CTRL_Handle handle) |
| Gets the direct current (Id) reference value from the controller. More... | |
| MATH_vec2 * | CTRL_getIdq_in_addr (CTRL_Handle handle) |
| Gets the direct/quadrature current input vector memory address from the controller. More... | |
| void | CTRL_getIdq_in_pu (CTRL_Handle handle, MATH_vec2 *pIdq_in_pu) |
| Gets the direct/quadrature current input vector values from the controller. More... | |
| void | CTRL_getIdq_ref_pu (CTRL_Handle handle, MATH_vec2 *pIdq_ref_pu) |
| Gets the direct/quadrature current reference vector values from the controller. More... | |
| _iq | CTRL_getIdRated_pu (CTRL_Handle handle) |
| Gets the Id rated current value from the controller. More... | |
| _iq | CTRL_getIq_in_pu (CTRL_Handle handle) |
| Gets the quadrature current input value from the controller. More... | |
| _iq | CTRL_getIq_ref_pu (CTRL_Handle handle) |
| Gets the quadrature current (Iq) reference value from the controller. More... | |
| _iq | CTRL_getKi (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
| Gets the integral gain (Ki) value from the specified controller. More... | |
| _iq | CTRL_getKd (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
| Gets the derivative gain (Kd) value from the specified controller. More... | |
| _iq | CTRL_getKp (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
| Gets the proportional gain (Kp) value from the specified controller. More... | |
| float_t | CTRL_getLhf (CTRL_Handle handle) |
| Gets the high frequency inductance (Lhf) value from the controller. More... | |
| _iq | CTRL_getMagCurrent_pu (CTRL_Handle handle) |
| Gets the magnetizing current value from the controller. More... | |
| _iq | CTRL_getMaxVsMag_pu (CTRL_Handle handle) |
| Gets the maximum voltage vector. More... | |
| _iq | CTRL_getMaximumSpeed_pu (CTRL_Handle handle) |
| Gets the maximum speed value from the controller. More... | |
| float_t | CTRL_getMotorRatedFlux (CTRL_Handle handle) |
| Gets the motor rated flux from the controller. More... | |
| MOTOR_Type_e | CTRL_getMotorType (CTRL_Handle handle) |
| Gets the motor type from the controller. More... | |
| uint_least16_t | CTRL_getNumCtrlTicksPerCurrentTick (CTRL_Handle handle) |
| Gets the number of controller clock ticks per current controller clock tick. More... | |
| uint_least16_t | CTRL_getNumCtrlTicksPerSpeedTick (CTRL_Handle handle) |
| Gets the number of controller clock ticks per speed controller clock tick. More... | |
| uint_least16_t | CTRL_getNumCtrlTicksPerTrajTick (CTRL_Handle handle) |
| Gets the number of controller clock ticks per trajectory clock tick. More... | |
| uint_least16_t | CTRL_getNumIsrTicksPerCtrlTick (CTRL_Handle handle) |
| Gets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick. More... | |
| _iq | CTRL_getRefValue_pu (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
| Gets the reference value from the specified controller. More... | |
| float_t | CTRL_getRhf (CTRL_Handle handle) |
| Gets the high frequency resistance (Rhf) value from the controller. More... | |
| float_t | CTRL_getRoverL (CTRL_Handle handle) |
| Gets the R/L value from the controller. More... | |
| _iq | CTRL_getSpd_max_pu (CTRL_Handle handle) |
| Gets the maximum speed value from the controller. More... | |
| _iq * | CTRL_getSpd_out_addr (CTRL_Handle handle) |
| Gets the output speed memory address from the controller. More... | |
| _iq | CTRL_getSpd_out_pu (CTRL_Handle handle) |
| Gets the output speed value from the controller. More... | |
| _iq | CTRL_getSpd_ref_pu (CTRL_Handle handle) |
| Gets the output speed reference value from the controller. More... | |
| _iq | CTRL_getSpd_int_ref_pu (CTRL_Handle handle) |
| Gets the output speed intermediate reference value from the controller. More... | |
| CTRL_State_e | CTRL_getState (CTRL_Handle handle) |
| Gets the controller state. More... | |
| uint_least32_t | CTRL_getTrajFreq (CTRL_Handle handle) |
| Gets the trajectory execution frequency. More... | |
| _iq | CTRL_getTrajPeriod_sec (CTRL_Handle handle) |
| Gets the trajectory execution period. More... | |
| void | CTRL_getTrajStep (CTRL_Handle handle) |
| Gets the trajectory step size. More... | |
| _iq | CTRL_getUi (CTRL_Handle handle, const CTRL_Type_e ctrlType) |
| Gets the integrator (Ui) value from the specified controller. More... | |
| MATH_vec2 * | CTRL_getVab_in_addr (CTRL_Handle handle) |
| Gets the alpha/beta voltage input vector memory address from the controller. More... | |
| void | CTRL_getVab_in_pu (CTRL_Handle handle, MATH_vec2 *pVab_in_pu) |
| Gets the alpha/beta voltage input vector values from the controller. More... | |
| MATH_vec2 * | CTRL_getVab_out_addr (CTRL_Handle handle) |
| Gets the alpha/beta voltage output vector memory address from the controller. More... | |
| void | CTRL_getVab_out_pu (CTRL_Handle handle, MATH_vec2 *pVab_out_pu) |
| Gets the alpha/beta voltage output vector values from the controller. More... | |
| _iq * | CTRL_getVd_out_addr (CTRL_Handle handle) |
| Gets the direct voltage output value memory address from the controller. More... | |
| _iq | CTRL_getVd_out_pu (CTRL_Handle handle) |
| Gets the direct voltage output value from the controller. More... | |
| MATH_vec2 * | CTRL_getVdq_out_addr (CTRL_Handle handle) |
| Gets the direct/quadrature voltage output vector memory address from the controller. More... | |
| void | CTRL_getVdq_out_pu (CTRL_Handle handle, MATH_vec2 *pVdq_out_pu) |
| Gets the direct/quadrature voltage output vector values from the controller. More... | |
| void | CTRL_getVersion (CTRL_Handle handle, CTRL_Version *pVersion) |
| Gets the controller version number. More... | |
| _iq * | CTRL_getVq_out_addr (CTRL_Handle handle) |
| Gets the quadrature voltage output value memory address from the controller. More... | |
| _iq | CTRL_getVq_out_pu (CTRL_Handle handle) |
| Gets the quadrature voltage output value from the controller. More... | |
| uint_least32_t | CTRL_getWaitTime (CTRL_Handle handle, const CTRL_State_e ctrlState) |
| Gets the wait time for a given state. More... | |
| void | CTRL_getWaitTimes (CTRL_Handle handle, uint_least32_t *pWaitTimes) |
| Gets the wait times from the estimator. More... | |
| void | CTRL_incrCounter_current (CTRL_Handle handle) |
| Increments the current counter. More... | |
| void | CTRL_incrCounter_isr (CTRL_Handle handle) |
| Increments the isr counter. More... | |
| void | CTRL_incrCounter_speed (CTRL_Handle handle) |
| Increments the speed counter. More... | |
| void | CTRL_incrCounter_state (CTRL_Handle handle) |
| Increments the state counter. More... | |
| void | CTRL_incrCounter_traj (CTRL_Handle handle) |
| Increments the trajectory counter. More... | |
| CTRL_Handle | CTRL_initCtrl (const uint_least8_t estNumber, void *pMemory, const size_t numBytes) |
| Initializes a specified controller. More... | |
| bool | CTRL_isError (CTRL_Handle handle) |
| Determines if there is a controller error. More... | |
| void | CTRL_resetCounter_current (CTRL_Handle handle) |
| Resets the current counter. More... | |
| void | CTRL_resetCounter_isr (CTRL_Handle handle) |
| Resets the isr counter. More... | |
| void | CTRL_resetCounter_speed (CTRL_Handle handle) |
| Resets the speed counter. More... | |
| void | CTRL_resetCounter_state (CTRL_Handle handle) |
| Resets the state counter. More... | |
| void | CTRL_resetCounter_traj (CTRL_Handle handle) |
| Resets the trajectory counter. More... | |
| void | CTRL_run (CTRL_Handle handle, HAL_Handle halHandle, const HAL_AdcData_t *pAdcData, HAL_PwmData_t *pPwmData, uint32_t electricalAngle) |
| Runs the controller. More... | |
| void | CTRL_runTraj (CTRL_Handle handle) |
| Runs the trajectory. More... | |
| void | CTRL_setCtrlFreq_Hz (CTRL_Handle handle, const uint_least32_t ctrlFreq_Hz) |
| Sets the controller frequency. More... | |
| void | CTRL_setCtrlPeriod_sec (CTRL_Handle handle, const float_t ctrlPeriod_sec) |
| Sets the controller execution period. More... | |
| void | CTRL_setErrorCode (CTRL_Handle handle, const CTRL_ErrorCode_e errorCode) |
| Sets the error code in the controller. More... | |
| void | CTRL_setEstParams (EST_Handle estHandle, USER_Params *pUserParams) |
| Sets the default estimator parameters. More... | |
| void | CTRL_setFlag_enableCtrl (CTRL_Handle handle, const bool state) |
| Sets the enable controller flag value in the estimator. More... | |
| void | CTRL_setFlag_enableDcBusComp (CTRL_Handle handle, const bool state) |
| Sets the enable DC bus compensation flag value in the estimator. More... | |
| void | CTRL_setFlag_enablePowerWarp (CTRL_Handle handle, const bool state) |
| Sets the PowerWarp enable flag value in the estimator. More... | |
| void | CTRL_setFlag_enableOffset (CTRL_Handle handle, const bool state) |
| Sets the enable offset flag value in the estimator. More... | |
| void | CTRL_setFlag_enableSpeedCtrl (CTRL_Handle handle, const bool state) |
| Sets the enable speed control value in the estimator. More... | |
| void | CTRL_setFlag_enableUserMotorParams (CTRL_Handle handle, const bool state) |
| Sets the enable user motor parameters flag value in the estimator. More... | |
| void | CTRL_setGains (CTRL_Handle handle, const CTRL_Type_e ctrlType, const _iq Kp, const _iq Ki, const _iq Kd) |
| Sets the gain values for the specified controller. More... | |
| void | CTRL_setIab_in_pu (CTRL_Handle handle, const MATH_vec2 *pIab_in_pu) |
| Sets the alpha/beta current (Iab) input vector values in the controller. More... | |
| void | CTRL_setIab_filt_pu (CTRL_Handle handle, const MATH_vec2 *pIab_filt_pu) |
| Sets the alpha/beta filtered current vector values in the controller. More... | |
| void | CTRL_setId_ref_pu (CTRL_Handle handle, const _iq Id_ref_pu) |
| Sets the direct current (Id) reference value in the controller. More... | |
| void | CTRL_setIdq_in_pu (CTRL_Handle handle, const MATH_vec2 *pIdq_in_pu) |
| Sets the direct/quadrature current (Idq) input vector values in the controller. More... | |
| void | CTRL_setIdq_ref_pu (CTRL_Handle handle, const MATH_vec2 *pIdq_ref_pu) |
| Sets the direct/quadrature current (Idq) reference vector values in the controller. More... | |
| void | CTRL_setIdRated_pu (CTRL_Handle handle, const _iq IdRated_pu) |
| Sets the Id rated current value in the controller. More... | |
| void | CTRL_setIq_ref_pu (CTRL_Handle handle, const _iq IqRef_pu) |
| Sets the quadrature current (Iq) reference value in the controller. More... | |
| void | CTRL_setKd (CTRL_Handle handle, const CTRL_Type_e ctrlType, const _iq Kd) |
| Sets the derivative gain (Kd) value for the specified controller. More... | |
| void | CTRL_setKi (CTRL_Handle handle, const CTRL_Type_e ctrlType, const _iq Ki) |
| Sets the integral gain (Ki) value for the specified controller. More... | |
| void | CTRL_setKp (CTRL_Handle handle, const CTRL_Type_e ctrlType, const _iq Kp) |
| Sets the proportional gain (Kp) value for the specified controller. More... | |
| void | CTRL_setLhf (CTRL_Handle handle, const float_t Lhf) |
| Sets the high frequency inductance (Lhf) value in the controller. More... | |
| void | CTRL_setMagCurrent_pu (CTRL_Handle handle, const _iq magCurrent_pu) |
| Sets the magnetizing current value in the controller. More... | |
| void | CTRL_setMaxVsMag_pu (CTRL_Handle handle, const _iq maxVsMag) |
| Sets the maximum voltage vector in the controller. More... | |
| void | CTRL_setMaxAccel_pu (CTRL_Handle handle, const _iq maxAccel_pu) |
| Sets the maximum acceleration of the speed controller. More... | |
| void | CTRL_setMaximumSpeed_pu (CTRL_Handle handle, const _iq maxSpeed_pu) |
| Sets the maximum speed value in the controller. More... | |
| void | CTRL_setMotorParams (CTRL_Handle handle, const MOTOR_Type_e motorType, const uint_least16_t numPolePairs, const float_t ratedFlux, const float_t Ls_d, const float_t Ls_q, const float_t Rr, const float_t Rs) |
| Sets the parameters for the motor in the controller. More... | |
| void | CTRL_setParams (CTRL_Handle handle, USER_Params *pUserParams) |
| Sets the controller parameters. More... | |
| void | CTRL_setNumCtrlTicksPerCurrentTick (CTRL_Handle handle, const uint_least16_t numCtrlTicksPerCurrentTick) |
| Sets the number of controller clock ticks per current controller clock tick. More... | |
| void | CTRL_setNumCtrlTicksPerSpeedTick (CTRL_Handle handle, const uint_least16_t numCtrlTicksPerSpeedTick) |
| Sets the number of controller clock ticks per speed controller clock tick. More... | |
| void | CTRL_setNumCtrlTicksPerTrajTick (CTRL_Handle handle, const uint_least16_t numCtrlTicksPerTrajTick) |
| Sets the number of controller clock ticks per trajectory clock tick. More... | |
| void | CTRL_setNumIsrTicksPerCtrlTick (CTRL_Handle handle, const uint_least16_t numIsrTicksPerCtrlTick) |
| Sets the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick. More... | |
| void | CTRL_setRhf (CTRL_Handle handle, const float_t Rhf) |
| Sets the high frequency resistance (Rhf) value in the controller. More... | |
| void | CTRL_setRoverL (CTRL_Handle handle, const float_t RoverL) |
| Sets the R/L value in the controller. More... | |
| void | CTRL_setSpd_max_pu (CTRL_Handle handle, const _iq maxSpd_pu) |
| Sets the maximum speed value in the controller. More... | |
| void | CTRL_setSpd_out_pu (CTRL_Handle handle, const _iq spd_out_pu) |
| Sets the output speed value in the controller. More... | |
| void | CTRL_setSpd_ref_pu (CTRL_Handle handle, const _iq spd_ref_pu) |
| Sets the output speed reference value in the controller. More... | |
| void | CTRL_setSpd_ref_krpm (CTRL_Handle handle, const _iq spd_ref_krpm) |
| Sets the output speed reference value in the controller. More... | |
| void | CTRL_setState (CTRL_Handle handle, const CTRL_State_e state) |
| Sets the controller state. More... | |
| void | CTRL_setTrajFreq_Hz (CTRL_Handle handle, const uint_least32_t trajFreq_Hz) |
| Sets the trajectory execution frequency. More... | |
| void | CTRL_setTrajPeriod_sec (CTRL_Handle handle, const _iq trajPeriod_sec) |
| Sets the trajectory execution period. More... | |
| void | CTRL_setUi (CTRL_Handle handle, const CTRL_Type_e ctrlType, const _iq Ui) |
| Sets the integrator (Ui) value in the specified controller. More... | |
| void | CTRL_setupClarke_I (CTRL_Handle handle, uint_least8_t numCurrentSensors) |
| Sets the number of current sensors. More... | |
| void | CTRL_setupClarke_V (CTRL_Handle handle, uint_least8_t numVoltageSensors) |
| Sets the number of voltage sensors. More... | |
| void | CTRL_setupEstIdleState (CTRL_Handle handle) |
| Sets up the controller and trajectory generator for the estimator idle state. More... | |
| void | CTRL_setupEstOnLineState (CTRL_Handle handle) |
| Sets up the controller and trajectory generator for the estimator online state. More... | |
| void | CTRL_setUserMotorParams (CTRL_Handle handle) |
| Sets the controller and estimator with motor parameters from the user.h file. More... | |
| void | CTRL_setVab_in_pu (CTRL_Handle handle, const MATH_vec2 *pVab_in_pu) |
| Sets the alpha/beta voltage input vector values in the controller. More... | |
| void | CTRL_setVab_out_pu (CTRL_Handle handle, const MATH_vec2 *pVab_out_pu) |
| Sets the alpha/beta current output vector values in the controller. More... | |
| void | CTRL_setVdq_out_pu (CTRL_Handle handle, const MATH_vec2 *pVdq_out_pu) |
| Sets the direct/quadrature voltage output vector values in the controller. More... | |
| void | CTRL_setWaitTimes (CTRL_Handle handle, const uint_least32_t *pWaitTimes) |
| Sets the wait times for the controller states. More... | |
| void | CTRL_setup (CTRL_Handle handle) |
| Sets up the controller (CTRL) object and all of the subordinate objects. More... | |
| void | CTRL_setupCtrl (CTRL_Handle handle) |
| Sets up the controllers. More... | |
| void | CTRL_setupEst (CTRL_Handle handle) |
| Sets up the estimator (CTRL) object. More... | |
| void | CTRL_setupTraj (CTRL_Handle handle) |
| Sets up the trajectory (TRAJ) object. More... | |
| bool | CTRL_updateState (CTRL_Handle handle) |
| Updates the controller state. More... | |
| bool | CTRL_useZeroIq_ref (CTRL_Handle handle) |
| Determines if a zero Iq current reference should be used in the controller. More... | |
| void | CTRL_checkForErrors (CTRL_Handle handle) |
| Checks for any controller errors and, if found, sets the controller state to the error state. More... | |
| void | CTRL_computePhasor (const _iq angle_pu, MATH_vec2 *pPhasor) |
| Computes a phasor for a given angle. More... | |
| bool | CTRL_doSpeedCtrl (CTRL_Handle handle) |
| Determines if the speed controller should be executed. More... | |
| void | CTRL_runOffLine (CTRL_Handle handle, HAL_Handle halHandle, const HAL_AdcData_t *pAdcData, HAL_PwmData_t *pPwmData) |
| Runs the offline controller. More... | |
| void | CTRL_setSpdMax (CTRL_Handle handle, const _iq spdMax) |
| Sets maximum speed controller output. More... | |
| _iq | CTRL_angleDelayComp (CTRL_Handle handle, const _iq angle_pu) |
| Runs angle delay compensation. More... | |
| void | CTRL_runOnLine (CTRL_Handle handle, const HAL_AdcData_t *pAdcData, HAL_PwmData_t *pPwmData) |
| Runs the online controller. More... | |
| void | CTRL_runOnLine_User (CTRL_Handle handle, const HAL_AdcData_t *pAdcData, HAL_PwmData_t *pPwmData, uint32_t electricalAngle) |
| Runs the online user controller. More... | |
1.8.9.1