107 pUserParams->
estKappa = USER_EST_KAPPAQ;
112 pUserParams->
motor_Rr = USER_MOTOR_Rr;
113 pUserParams->
motor_Rs = USER_MOTOR_Rs;
128 pUserParams->
maxCurrent = USER_MOTOR_MAX_CURRENT;
133 pUserParams->
IdRated = USER_MOTOR_MAGNETIZING_CURRENT;
149 pUserParams->
estWaitTime[
EST_State_RampUp] = (uint_least32_t)((5.0 + USER_MOTOR_FLUX_EST_FREQ_Hz / USER_MAX_ACCEL_EST_Hzps) * USER_EST_FREQ_Hz);
202 if((USER_IQ_FULL_SCALE_CURRENT_A <= 0.0) ||
203 (USER_IQ_FULL_SCALE_CURRENT_A <= (0.02 * USER_MOTOR_MAX_CURRENT * USER_IQ_FULL_SCALE_FREQ_Hz / 128.0)) ||
204 (USER_IQ_FULL_SCALE_CURRENT_A <= (2.0 * USER_MOTOR_MAX_CURRENT * USER_IQ_FULL_SCALE_FREQ_Hz * USER_CTRL_PERIOD_sec / 128.0)))
209 if((USER_IQ_FULL_SCALE_CURRENT_A < USER_MOTOR_MAGNETIZING_CURRENT) ||
210 (USER_IQ_FULL_SCALE_CURRENT_A < USER_MOTOR_RES_EST_CURRENT) ||
211 (USER_IQ_FULL_SCALE_CURRENT_A < USER_MOTOR_IND_EST_CURRENT) ||
212 (USER_IQ_FULL_SCALE_CURRENT_A < USER_MOTOR_MAX_CURRENT))
217 if((USER_MOTOR_RATED_FLUX > 0.0) && (USER_MOTOR_TYPE ==
MOTOR_Type_Pm))
219 if(USER_IQ_FULL_SCALE_VOLTAGE_V >= ((
float_t)USER_EST_FREQ_Hz * USER_MOTOR_RATED_FLUX * 0.7))
227 if(USER_IQ_FULL_SCALE_VOLTAGE_V >= ((
float_t)USER_EST_FREQ_Hz * USER_MOTOR_RATED_FLUX * 0.05))
233 if((USER_IQ_FULL_SCALE_VOLTAGE_V <= 0.0) ||
234 (USER_IQ_FULL_SCALE_VOLTAGE_V <= (0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps)) ||
235 (USER_IQ_FULL_SCALE_VOLTAGE_V <= (0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_q * USER_VOLTAGE_FILTER_POLE_rps)))
240 if((USER_IQ_FULL_SCALE_FREQ_Hz > (4.0 * USER_VOLTAGE_FILTER_POLE_Hz)) ||
241 (USER_IQ_FULL_SCALE_FREQ_Hz >= ((128.0 * USER_IQ_FULL_SCALE_CURRENT_A) / (0.02 * USER_MOTOR_MAX_CURRENT))) ||
242 (USER_IQ_FULL_SCALE_FREQ_Hz >= ((128.0 * USER_IQ_FULL_SCALE_CURRENT_A) / (2.0 * USER_MOTOR_MAX_CURRENT * USER_CTRL_PERIOD_sec))) ||
243 (USER_IQ_FULL_SCALE_FREQ_Hz >= (128.0 * (
float_t)USER_MOTOR_NUM_POLE_PAIRS * 1000.0 / 60.0)))
248 if((USER_IQ_FULL_SCALE_FREQ_Hz < 50.0) ||
249 (USER_IQ_FULL_SCALE_FREQ_Hz < USER_MOTOR_FLUX_EST_FREQ_Hz) ||
250 (USER_IQ_FULL_SCALE_FREQ_Hz < USER_SPEED_POLE_rps) ||
251 (USER_IQ_FULL_SCALE_FREQ_Hz <= ((
float_t)USER_MOTOR_NUM_POLE_PAIRS * 1000.0 / (60.0 * 128.0))) ||
252 (USER_IQ_FULL_SCALE_FREQ_Hz < (USER_MAX_ACCEL_Hzps / ((
float_t)USER_TRAJ_FREQ_Hz))) ||
253 (USER_IQ_FULL_SCALE_FREQ_Hz < (USER_MAX_ACCEL_EST_Hzps / ((
float_t)USER_TRAJ_FREQ_Hz))) ||
254 (USER_IQ_FULL_SCALE_FREQ_Hz < ((
float_t)USER_R_OVER_L_EST_FREQ_Hz)))
259 if(USER_NUM_PWM_TICKS_PER_ISR_TICK > 3)
264 if(USER_NUM_PWM_TICKS_PER_ISR_TICK < 1)
269 if(USER_NUM_ISR_TICKS_PER_CTRL_TICK < 1)
274 if(USER_NUM_CTRL_TICKS_PER_CURRENT_TICK < 1)
279 if(USER_NUM_CTRL_TICKS_PER_EST_TICK < 1)
284 if((USER_NUM_CTRL_TICKS_PER_SPEED_TICK < 1) ||
285 (USER_NUM_CTRL_TICKS_PER_SPEED_TICK < USER_NUM_CTRL_TICKS_PER_CURRENT_TICK))
290 if(USER_NUM_CTRL_TICKS_PER_TRAJ_TICK < 1)
295 if(USER_NUM_CURRENT_SENSORS > 3)
300 if(USER_NUM_CURRENT_SENSORS < 2)
305 if(USER_NUM_VOLTAGE_SENSORS > 3)
310 if(USER_NUM_VOLTAGE_SENSORS < 3)
315 if(USER_OFFSET_POLE_rps > ((
float_t)USER_CTRL_FREQ_Hz))
320 if(USER_OFFSET_POLE_rps <= 0.0)
325 if(USER_FLUX_POLE_rps > ((
float_t)USER_EST_FREQ_Hz))
330 if(USER_FLUX_POLE_rps <= 0.0)
335 if(USER_ZEROSPEEDLIMIT > 1.0)
340 if(USER_ZEROSPEEDLIMIT <= 0.0)
345 if(USER_FORCE_ANGLE_FREQ_Hz > ((
float_t)USER_EST_FREQ_Hz))
350 if(USER_FORCE_ANGLE_FREQ_Hz <= 0.0)
355 if(USER_MAX_ACCEL_Hzps > ((
float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_FREQ_Hz))
360 if(USER_MAX_ACCEL_Hzps <= 0.0)
365 if(USER_MAX_ACCEL_EST_Hzps > ((
float_t)USER_TRAJ_FREQ_Hz * USER_IQ_FULL_SCALE_FREQ_Hz))
370 if(USER_MAX_ACCEL_EST_Hzps <= 0.0)
375 if(USER_DIRECTION_POLE_rps > ((
float_t)USER_EST_FREQ_Hz))
380 if(USER_DIRECTION_POLE_rps <= 0.0)
385 if((USER_SPEED_POLE_rps > USER_IQ_FULL_SCALE_FREQ_Hz) ||
386 (USER_SPEED_POLE_rps > ((
float_t)USER_EST_FREQ_Hz)))
391 if(USER_SPEED_POLE_rps <= 0.0)
396 if(USER_DCBUS_POLE_rps > ((
float_t)USER_EST_FREQ_Hz))
401 if(USER_DCBUS_POLE_rps <= 0.0)
406 if(USER_FLUX_FRACTION > 1.2)
411 if(USER_FLUX_FRACTION < 0.05)
416 if(USER_SPEEDMAX_FRACTION_FOR_L_IDENT > (USER_IQ_FULL_SCALE_CURRENT_A / USER_MOTOR_MAX_CURRENT))
421 if(USER_SPEEDMAX_FRACTION_FOR_L_IDENT <= 0.0)
426 if(USER_POWERWARP_GAIN > 2.0)
431 if(USER_POWERWARP_GAIN < 1.0)
436 if(USER_SYSTEM_FREQ_MHz > 90.0)
441 if(USER_SYSTEM_FREQ_MHz <= 0.0)
446 if(USER_PWM_FREQ_kHz > (1000.0 * USER_SYSTEM_FREQ_MHz / 100.0))
451 if(USER_PWM_FREQ_kHz < (1000.0 * USER_SYSTEM_FREQ_MHz / 65536.0))
456 if(USER_VOLTAGE_SF >= 128.0)
461 if(USER_VOLTAGE_SF < 0.1)
466 if(USER_CURRENT_SF >= 128.0)
471 if(USER_CURRENT_SF < 0.1)
476 if(USER_VOLTAGE_FILTER_POLE_Hz > ((
float_t)USER_EST_FREQ_Hz /
MATH_PI))
481 if(USER_VOLTAGE_FILTER_POLE_Hz < (USER_IQ_FULL_SCALE_FREQ_Hz / 4.0))
486 if(USER_MAX_VS_MAG_PU > (4.0 / 3.0))
491 if(USER_MAX_VS_MAG_PU <= 0.0)
496 if(USER_EST_KAPPAQ > 1.5)
501 if(USER_EST_KAPPAQ < 1.5)
511 if(USER_MOTOR_NUM_POLE_PAIRS < 1)
516 if((USER_MOTOR_RATED_FLUX != 0.0) && (USER_MOTOR_TYPE ==
MOTOR_Type_Pm))
518 if(USER_MOTOR_RATED_FLUX > (USER_IQ_FULL_SCALE_FREQ_Hz * 65536.0 / (
float_t)USER_EST_FREQ_Hz / 0.7))
523 if(USER_MOTOR_RATED_FLUX < (USER_IQ_FULL_SCALE_VOLTAGE_V / (
float_t)USER_EST_FREQ_Hz / 0.7))
531 if(USER_MOTOR_RATED_FLUX > (USER_IQ_FULL_SCALE_FREQ_Hz * 65536.0 / (
float_t)USER_EST_FREQ_Hz / 0.05))
536 if(USER_MOTOR_RATED_FLUX < (USER_IQ_FULL_SCALE_VOLTAGE_V / (
float_t)USER_EST_FREQ_Hz / 0.05))
544 if(USER_MOTOR_Rr > 0.0)
549 if(USER_MOTOR_Rr < 0.0)
557 if(USER_MOTOR_Rr > (0.7 * 65536.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / USER_IQ_FULL_SCALE_CURRENT_A))
562 if(USER_MOTOR_Rr < (0.7 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * 65536.0)))
568 if(USER_MOTOR_Rs != 0.0)
570 if(USER_MOTOR_Rs > (0.7 * 65536.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / USER_IQ_FULL_SCALE_CURRENT_A))
575 if(USER_MOTOR_Rs < (0.7 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * 65536.0)))
581 if(USER_MOTOR_Ls_d != 0.0)
583 if(USER_MOTOR_Ls_d > (0.7 * 65536.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * USER_VOLTAGE_FILTER_POLE_rps)))
588 if(USER_MOTOR_Ls_d < (0.7 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * USER_VOLTAGE_FILTER_POLE_rps * 65536.0)))
594 if(USER_MOTOR_Ls_q != 0.0)
596 if(USER_MOTOR_Ls_q > (0.7 * 65536.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * USER_VOLTAGE_FILTER_POLE_rps)))
601 if(USER_MOTOR_Ls_q < (0.7 * USER_IQ_FULL_SCALE_VOLTAGE_V / (USER_IQ_FULL_SCALE_CURRENT_A * USER_VOLTAGE_FILTER_POLE_rps * 65536.0)))
607 if(USER_MOTOR_RES_EST_CURRENT > USER_MOTOR_MAX_CURRENT)
612 if(USER_MOTOR_RES_EST_CURRENT < 0.0)
619 if(USER_MOTOR_IND_EST_CURRENT > 0.0)
624 if(USER_MOTOR_IND_EST_CURRENT < (-USER_MOTOR_MAX_CURRENT))
632 if(USER_MOTOR_IND_EST_CURRENT > 0.0)
637 if(USER_MOTOR_IND_EST_CURRENT < 0.0)
643 if(USER_MOTOR_MAX_CURRENT > USER_IQ_FULL_SCALE_CURRENT_A)
648 if(USER_MOTOR_MAX_CURRENT <= 0.0)
653 if(USER_MAX_CURRENT_SLOPE > 1.0)
658 if(USER_MAX_CURRENT_SLOPE <= 0.0)
663 if(USER_MAX_CURRENT_SLOPE_POWERWARP > 1.0)
668 if(USER_MAX_CURRENT_SLOPE_POWERWARP <= 0.0)
675 if(USER_MOTOR_MAGNETIZING_CURRENT > 0.0)
680 if(USER_MOTOR_MAGNETIZING_CURRENT < 0.0)
688 if(USER_MOTOR_MAGNETIZING_CURRENT > USER_MOTOR_MAX_CURRENT)
693 if(USER_MOTOR_MAGNETIZING_CURRENT < 0.0)
701 if(USER_IDRATED_FRACTION_FOR_RATED_FLUX > (USER_IQ_FULL_SCALE_CURRENT_A / (1.2 * USER_MOTOR_MAX_CURRENT)))
706 if(USER_IDRATED_FRACTION_FOR_RATED_FLUX < 0.1)
714 if(USER_IDRATED_FRACTION_FOR_L_IDENT > (USER_IQ_FULL_SCALE_CURRENT_A / USER_MOTOR_MAX_CURRENT))
719 if(USER_IDRATED_FRACTION_FOR_L_IDENT < 0.1)
727 if(USER_IDRATED_DELTA > (USER_IQ_FULL_SCALE_CURRENT_A / ((
float_t)USER_NUM_ISR_TICKS_PER_CTRL_TICK * USER_MOTOR_MAX_CURRENT)))
732 if(USER_IDRATED_DELTA < 0.0)
738 if(USER_MOTOR_FLUX_EST_FREQ_Hz > USER_IQ_FULL_SCALE_FREQ_Hz)
743 if((USER_MOTOR_FLUX_EST_FREQ_Hz < 0.0) ||
744 (USER_MOTOR_FLUX_EST_FREQ_Hz < (USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz)))
749 if(USER_MOTOR_Ls_d != 0.0)
751 if(((
float_t)USER_CTRL_FREQ_Hz >= (128.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / (0.25 * (USER_MOTOR_Ls_d + 1e-9) * USER_IQ_FULL_SCALE_CURRENT_A))))
757 if(USER_MOTOR_Ls_q != 0.0)
759 if(((
float_t)USER_CTRL_FREQ_Hz >= (128.0 * USER_IQ_FULL_SCALE_VOLTAGE_V / (0.25 * (USER_MOTOR_Ls_q + 1e-9) * USER_IQ_FULL_SCALE_CURRENT_A))))
765 if(((
float_t)USER_CTRL_FREQ_Hz < USER_IQ_FULL_SCALE_FREQ_Hz) ||
766 ((
float_t)USER_CTRL_FREQ_Hz < USER_OFFSET_POLE_rps) ||
767 ((
float_t)USER_CTRL_FREQ_Hz < 250.0) ||
768 ((
float_t)USER_CTRL_FREQ_Hz <= (2.0 * USER_IQ_FULL_SCALE_FREQ_Hz * USER_MOTOR_MAX_CURRENT / (128.0 * USER_IQ_FULL_SCALE_CURRENT_A))))
773 if((USER_MOTOR_Rs != 0.0) && (USER_MOTOR_Ls_d != 0.0) && (USER_MOTOR_Ls_q != 0.0))
775 if(((
float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_d + 1e-9))) ||
776 ((
float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_q + 1e-9))))
782 if(((
float_t)USER_EST_FREQ_Hz < USER_FORCE_ANGLE_FREQ_Hz) ||
783 ((
float_t)USER_EST_FREQ_Hz < USER_VOLTAGE_FILTER_POLE_rps) ||
784 ((
float_t)USER_EST_FREQ_Hz < USER_DCBUS_POLE_rps) ||
785 ((
float_t)USER_EST_FREQ_Hz < USER_FLUX_POLE_rps) ||
786 ((
float_t)USER_EST_FREQ_Hz < USER_DIRECTION_POLE_rps) ||
787 ((
float_t)USER_EST_FREQ_Hz < USER_SPEED_POLE_rps) ||
788 ((
float_t)USER_EST_FREQ_Hz < 0.2))
793 if(USER_R_OVER_L_EST_FREQ_Hz > USER_IQ_FULL_SCALE_FREQ_Hz)
798 if(((
float_t)USER_TRAJ_FREQ_Hz < 1.0) ||
799 ((
float_t)USER_TRAJ_FREQ_Hz < USER_MAX_ACCEL_Hzps / USER_IQ_FULL_SCALE_FREQ_Hz) ||
800 ((
float_t)USER_TRAJ_FREQ_Hz < USER_MAX_ACCEL_EST_Hzps / USER_IQ_FULL_SCALE_FREQ_Hz))
805 if(USER_MAX_NEGATIVE_ID_REF_CURRENT_A > 0.0)
810 if(USER_MAX_NEGATIVE_ID_REF_CURRENT_A < (-USER_MOTOR_MAX_CURRENT))
836 float_t fullScaleInductance = USER_IQ_FULL_SCALE_VOLTAGE_V/(USER_IQ_FULL_SCALE_CURRENT_A*USER_VOLTAGE_FILTER_POLE_rps);
838 int_least8_t lShift = ceil(log(obj->
motorParams.
Ls_d_H/(Ls_coarse_max*fullScaleInductance))/log(2.0));
839 uint_least8_t Ls_qFmt = 30 - lShift;
840 float_t L_max = fullScaleInductance * pow(2.0,lShift);
858 float_t fullScaleCurrent = USER_IQ_FULL_SCALE_CURRENT_A;
859 float_t fullScaleVoltage = USER_IQ_FULL_SCALE_VOLTAGE_V;
872 #ifdef __TMS320C28XX_FPU32__
894 Kp_Id =
_IQ((0.25*Ls_d*fullScaleCurrent)/(ctrlPeriod_sec*fullScaleVoltage));
895 Ki_Id =
_IQ(RoverLs_d*ctrlPeriod_sec);
898 Kp_Iq =
_IQ((0.25*Ls_q*fullScaleCurrent)/(ctrlPeriod_sec*fullScaleVoltage));
899 Ki_Iq =
_IQ(RoverLs_q*ctrlPeriod_sec);
920 float_t FullScaleInductance = (USER_IQ_FULL_SCALE_VOLTAGE_V/(USER_IQ_FULL_SCALE_CURRENT_A*USER_VOLTAGE_FILTER_POLE_rps));
921 float_t FullScaleCurrent = (USER_IQ_FULL_SCALE_CURRENT_A);
922 float_t lShift = ceil(log(USER_MOTOR_Ls_d/(0.7*FullScaleInductance))/log(2.0));
924 return(
_IQ(FullScaleInductance*FullScaleCurrent*FullScaleCurrent*USER_MOTOR_NUM_POLE_PAIRS*1.5*pow(2.0,lShift)));
932 float_t FullScaleFlux = (USER_IQ_FULL_SCALE_VOLTAGE_V/(
float_t)USER_EST_FREQ_Hz);
933 float_t FullScaleCurrent = (USER_IQ_FULL_SCALE_CURRENT_A);
935 float_t lShift = -ceil(log(FullScaleFlux/maxFlux)/log(2.0));
937 return(
_IQ(FullScaleFlux/(2.0*
MATH_PI)*FullScaleCurrent*USER_MOTOR_NUM_POLE_PAIRS*1.5*pow(2.0,lShift)));
945 float_t FullScaleFlux = (USER_IQ_FULL_SCALE_VOLTAGE_V/(
float_t)USER_EST_FREQ_Hz);
947 float_t lShift = -ceil(log(FullScaleFlux/maxFlux)/log(2.0));
949 return(
_IQ(FullScaleFlux/(2.0*
MATH_PI)*pow(2.0,lShift)));
957 float_t FullScaleFlux = (USER_IQ_FULL_SCALE_VOLTAGE_V/(
float_t)USER_EST_FREQ_Hz);
959 float_t lShift = -ceil(log(FullScaleFlux/maxFlux)/log(2.0));
961 return(
_IQ(FullScaleFlux*pow(2.0,lShift)));
987 _iq Torque_Nm = Torque_Flux_Iq_Nm + Torque_Ls_Id_Iq_Nm;
1005 _iq Torque_Nm = Torque_Flux_Iq_Nm + Torque_Ls_Id_Iq_Nm;
motor_Rs too high error code
ctrlFreq_Hz too high error code
_iq USER_computeTorque_Ls_Id_Iq_pu_to_Nm_sf(void)
Computes the scale factor needed to convert from torque created by Ld, Lq, Id and Iq...
float_t iqFullScaleVoltage_V
Defines the full scale voltage for the IQ variable, V.
float_t fluxPole_rps
Defines the pole location for the flux estimation, rad/s.
voltageFilterPole_Hz too high error code
IdRatedFraction_ratedFlux too low error code.
float_t fluxFraction
Defines the flux fraction for Id rated current estimation.
the controller error state
_iq EST_getLs_coarse_max_pu(EST_Handle handle)
Gets the maximum stator inductance value during coarse estimation in the stator inductance estimator...
float_t forceAngleFreq_Hz
Defines the force angle frequency, Hz.
motor_numPolePairs too low error code
float_t motor_Ls_q
Defines the quadrature stator inductance, H.
float_t IdRated_delta
Defines the Id rated delta current value, A.
stator inductance estimation state
uint_least32_t estWaitTime[EST_numStates]
Defines the wait times for each estimator state, estimator ticks.
systemFreq_MHz too low error code
static void PID_setKi(PID_Handle handle, const _iq Ki)
Sets the integral gain in the PID controller.
motor_Rs too low error code
pwmFreq_kHz too low error code
numCurrentSensors too low error code
uint_least32_t RsWaitTime[EST_Rs_numStates]
Defines the wait times for each Rs estimator, estimator ticks.
maxAccel_Hzps too high error code
float_t iqFullScaleCurrent_A
Defines the full scale current for the IQ variables, A.
float_t IdRated
Defines the Id rated current value, A.
fluxFraction too high error code
estimate the open loop rated flux
powerWarpGain too low error code
maxAccel_Hzps too low error code
float_t motor_Rr
Defines the rotor resistance, ohm.
ctrlFreq_Hz too low error code
float_t maxAccel_Hzps
Defines the maximum acceleration for the speed profiles, Hz/s.
float_t maxNegativeIdCurrent_a
Defines the maximum negative current that the Id PID is allowed to go to, A.
motor_ratedFlux too high error code
motor_Ls_q too high error code
float_t ctrlPeriod_sec
Defines the controller execution period, sec.
maxCurrentSlope_powerWarp too low error code
uint_least16_t systemFreq_MHz
Defines the system clock frequency, MHz.
offsetPole_rps too high error code
float_t CTRL_getCtrlPeriod_sec(CTRL_Handle handle)
Gets the controller execution period.
uint_least32_t LsWaitTime[EST_Ls_numStates]
Defines the wait times for each Ls estimator, estimator ticks.
forceAngleFreq_Hz too low error code
the controller idle state
iqFullScaleVoltage_V too low error code
PID_Handle pidHandle_Id
the handle for the Id PID controller
void USER_calcPIgains(CTRL_Handle handle)
uint_least32_t ctrlWaitTime[CTRL_numStates]
Defines the wait times for each controller state, estimator ticks.
control Id and estimate the rated flux
Defines the controller (CTRL) object.
Defines a structure for the user parameters.
USER_ErrorCode_e USER_getErrorCode(USER_Params *pUserParams)
uint_least8_t numCurrentSensors
Defines the number of current sensors.
float_t IdRatedFraction_ratedFlux
Defines the fraction of Id rated current to use during rated flux estimation.
motor_Rr too low error code
_iq USER_computeFlux_pu_to_Wb_sf(void)
Computes the scale factor needed to convert from per unit to Wb.
EST_Handle estHandle
the handle for the parameter estimator
uint_least32_t RoverL_estFreq_Hz
Defines the R/L estimation frequency, Hz.
float_t powerWarpGain
Defines the PowerWarp gain for computing Id reference.
the fine estimation state
numCtrlTicksPerCurrentTick too low error code
static _iq PID_getFbackValue(PID_Handle handle)
Gets the feedback value in the PID controller.
float_t maxCurrent
Defines the maximum current value, A.
directionPole_rps too low error code
_iq USER_computeTorque_lbin(CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf)
Computes Torque in Nm.
uint_least16_t numCtrlTicksPerCurrentTick
Defines the number of controller clock ticks per current controller clock tick.
iqFullScaleFreq_Hz too high error code
IdRated_delta too high error code.
#define MATH_PI
Defines pi.
void EST_setLs_qFmt(EST_Handle handle, const uint_least8_t Ls_qFmt)
Sets the stator inductance Q format in the estimator in 8 bit unsigned integer (uint_least8_t).
IdRatedFraction_indEst too low error code.
motor_Ls_q too low error code
maxAccel_est_Hzps too high error code
the coarse estimation state
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.
numPwmTicksPerIsrTick too high error code
the fine estimation state
float_t voltageFilterPole_rps
Defines the analog voltage filter pole location, rad/s.
_iq EST_getLs_d_pu(EST_Handle handle)
Gets the direct stator inductance value in per unit (pu), IQ30.
current_sf too high error code
numCtrlTicksPerEstTick too low error code
motor_Rr too high error code
online parameter estimation
speedPole_rps too high error code
numCtrlTicksPerTrajTick too low error code
float_t EST_getLs_d_H(EST_Handle handle)
Gets the direct stator inductance value in Henries (H).
directionPole_rps too high error code
float_t directionPole_rps
Defines the pole location for the direction filter, rad/s.
forceAngleFreq_Hz too high error code
MOTOR_Type_e motor_type
Defines the motor type.
void USER_softwareUpdate1p6(CTRL_Handle handle)
trajFreq_Hz too low error code
fluxFraction too low error code
iqFullScaleVoltage_V too high error code
float_t voltage_sf
Defines the voltage scale factor for the system.
voltageFilterPole_Hz too low error code
void USER_setParams(USER_Params *pUserParams)
uint_least32_t trajFreq_Hz
Defines the trajectory frequency, Hz.
_iq EST_getFlux_pu(EST_Handle handle)
Gets the flux value in per unit (pu), IQ24.
maxVsMag_pu too high error code
_iq USER_computeFlux_pu_to_VpHz_sf(void)
Computes the scale factor needed to convert from per unit to V/Hz.
uint_least8_t numVoltageSensors
Defines the number of voltage sensors.
float_t EST_getLs_q_H(EST_Handle handle)
Gets the stator inductance value in the quadrature coordinate direction in Henries (H)...
fluxEstFreq_Hz too low error code
estFreq_Hz too low error code
dcBusPole_rps too high error code
the coarse estimation state
float_t offsetPole_rps
Defines the pole location for the voltage and current offset estimation, rad/s.
maxCurrent_resEst too high error code
motor type unknown error code
maxCurrent_indEst too low error code
speedPole_rps too low error code
float_t pwmPeriod_usec
Defines the Pulse Width Modulation (PWM) period, usec.
IdRated too high error code.
the controller online state
maxCurrentSlope_powerWarp too high error code
USER_ErrorCode_e errorCode
float_t zeroSpeedLimit
Defines the low speed limit for the flux integrator, pu.
float_t current_sf
Defines the current scale factor for the system.
fluxPole_rps too high error code
maxCurrent too high error code
current_sf too low error code
closed loop control stage 2
iqFullScaleCurrent_A too low error code
void USER_setErrorCode(USER_Params *pUserParams, const USER_ErrorCode_e errorCode)
dcBusPole_rps too low error code
float_t indEst_speedMaxFraction
Defines the fraction of SpeedMax to use during inductance estimation.
MOTOR_Params motorParams
the motor parameters
float_t fluxEstFreq_Hz
Defines the flux estimation frequency, Hz.
_iq EST_getLs_q_pu(EST_Handle handle)
Gets the stator inductance value in the quadrature coordinate direction in per unit (pu)...
float_t IdRatedFraction_indEst
Defines the fraction of Id rated current to use during inductance estimation.
IdRatedFraction_indEst too high error code.
void USER_checkForErrors(USER_Params *pUserParams)
fluxEstFreq_Hz too high error code
float_t EST_getRs_Ohm(EST_Handle handle)
Gets the stator resistance value in Ohms ( ).
float_t dcBusPole_rps
Defines the pole location for the DC bus filter, rad/s.
float_t Ls_q_H
Defines the quadrature stator inductance, H.
IdRated too low error code.
uint_least16_t numCtrlTicksPerTrajTick
Defines the number of controller clock ticks per trajectory clock tick.
PID_Handle pidHandle_Iq
the handle for the Iq PID controller
uint_least16_t numCtrlTicksPerSpeedTick
Defines the number of controller clock ticks per speed controller clock tick.
numVoltageSensors too high error code
float_t maxCurrent_indEst
Defines the maximum current value for inductance estimation, A.
numPwmTicksPerIsrTick too low error code
maxCurrentSlope too high error code
float_t maxCurrentSlope
Defines the maximum current slope for Id current trajectory.
float_t Ls_d_H
Defines the direct stator inductance, H.
float_t speedPole_rps
Defines the pole location for the speed control filter, rad/s.
float_t motor_Rs
Defines the stator resistance, ohm.
fluxPole_rps too low error code
motor_ratedFlux too low error code
uint_least16_t numIsrTicksPerCtrlTick
Defines the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
RoverL_estFreq_Hz too high error code.
_iq USER_computeTorque_Flux_Iq_pu_to_Nm_sf(void)
Computes the scale factor needed to convert from torque created by flux and Iq, from per unit to Nm...
voltage_sf too high error code
maxCurrent_indEst too high error code
void EST_setLs_q_pu(EST_Handle handle, const _iq Ls_q_pu)
Sets the quadrature stator inductance value in the estimator in per unit (pu), IQ30.
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
numVoltageSensors too low error code
_iq USER_computeTorque_Nm(CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf)
Computes Torque in Nm.
maxVsMag_pu too low error code
indEst_speedMaxFraction too low error code
closed loop control stage 1
uint_least16_t motor_numPolePairs
Defines the number of pole pairs for the motor.
estKappa too low error code
uint_least16_t numCtrlTicksPerEstTick
Defines the number of controller clock ticks per estimator clock tick.
motor_Ls_d too high error code
float_t maxCurrentSlope_powerWarp
Defines the maximum current slope for Id current trajectory during PowerWarp.
pwmFreq_kHz too high error code
USER_ErrorCode_e
Enumeration for the user error codes.
uint_least32_t FluxWaitTime[EST_Flux_numStates]
Defines the wait times for each Ls estimator, estimator ticks.
float_t maxAccel_est_Hzps
Defines the maximum acceleration for the estimation speed profiles, Hz/s.
zeroSpeedLimit too low error code
#define MATH_Nm_TO_lbin_SF
Defines conversion scale factor from N*m to lb*in.
uint_least32_t estFreq_Hz
Defines the estimator frequency, Hz.
maxNegativeIdCurrent_a too high error code
voltage_sf too low error code
motor_Ls_d too low error code
maxCurrentSlope too low error code
rotor resistance estimation state
maxAccel_est_Hzps too low error code
maxNegativeIdCurrent_a too low error code
IdRatedFraction_ratedFlux too high error code.
numIsrTicksPerCtrlTick too low error code
systemFreq_MHz too high error code
float_t estKappa
Defines the convergence factor for the estimator.
maxCurrent too low error code
_iq USER_computeFlux(CTRL_Handle handle, const _iq sf)
Computes Flux in Wb or V/Hz depending on the scale factor sent as parameter.
the controller offline state
indEst_speedMaxFraction too high error code
IdRated_delta too low error code.
estKappa too high error code
powerWarpGain too high error code
numCtrlTicksPerSpeedTick too low error code
numCurrentSensors too high error code
offsetPole_rps too low error code
float_t iqFullScaleFreq_Hz
Defines the full scale frequency for IQ variable, Hz.
void EST_setLs_d_pu(EST_Handle handle, const _iq Ls_d_pu)
Sets the direct stator inductance value in the estimator in per unit (pu), IQ30.
iqFullScaleFreq_Hz too low error code
zeroSpeedLimit too high error code
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
float_t motor_Ls_d
Defines the direct stator inductance, H.
maxCurrent_resEst too low error code
float_t maxCurrent_resEst
Defines the maximum current value for resistance estimation, A.
float_t motor_ratedFlux
Defines the rated flux of the motor, V/Hz.
float_t maxVsMag_pu
Defines the maximum voltage magnitude, pu.