instaspin_foc
|
Macros | |
#define | USER_IQ_FULL_SCALE_FREQ_Hz (800.0) |
CURRENTS AND VOLTAGES. More... | |
#define | USER_IQ_FULL_SCALE_VOLTAGE_V (24.0) |
Defines full scale value for the IQ30 variable of Voltage inside the system. More... | |
#define | USER_ADC_FULL_SCALE_VOLTAGE_V (44.30) |
Defines the maximum voltage at the input to the AD converter. More... | |
#define | USER_VOLTAGE_SF ((float_t)((USER_ADC_FULL_SCALE_VOLTAGE_V)/(USER_IQ_FULL_SCALE_VOLTAGE_V))) |
Defines the voltage scale factor for the system. More... | |
#define | USER_IQ_FULL_SCALE_CURRENT_A (20.0) |
Defines the full scale current for the IQ variables, A. More... | |
#define | USER_ADC_FULL_SCALE_CURRENT_A (47.14) |
Defines the maximum current at the AD converter. More... | |
#define | USER_CURRENT_SF ((float_t)((USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A))) |
Defines the current scale factor for the system. More... | |
#define | USER_NUM_CURRENT_SENSORS (3) |
Defines the number of current sensors used. More... | |
#define | USER_NUM_VOLTAGE_SENSORS (3) |
Defines the number of voltage (phase) sensors. More... | |
#define | I_A_offset (1.210729778) |
ADC current offsets for A, B, and C phases. More... | |
#define | I_B_offset (1.209441483) |
#define | I_C_offset (1.209092796) |
#define | V_A_offset (0.5084558129) |
ADC voltage offsets for A, B, and C phases. More... | |
#define | V_B_offset (0.5074239969) |
#define | V_C_offset (0.5065535307) |
#define | USER_SYSTEM_FREQ_MHz (60.0) |
CLOCKS & TIMERS. More... | |
#define | USER_PWM_FREQ_kHz (45.0) |
Defines the Pulse Width Modulation (PWM) frequency, kHz. More... | |
#define | USER_MAX_VS_MAG_PU (2.0/3.0) |
Defines the maximum Voltage vector (Vs) magnitude allowed. This value sets the maximum magnitude for the output of the. More... | |
#define | USER_EST_HANDLE_ADDRESS (0x600) |
Defines the address of estimator handle. More... | |
#define | USER_VD_SF (0.95) |
Defines the direct voltage (Vd) scale factor. More... | |
#define | USER_PWM_PERIOD_usec (1000.0/USER_PWM_FREQ_kHz) |
Defines the Pulse Width Modulation (PWM) period, usec. More... | |
#define | USER_ISR_FREQ_Hz ((float_t)USER_PWM_FREQ_kHz * 1000.0 / (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK) |
Defines the Interrupt Service Routine (ISR) frequency, Hz. More... | |
#define | USER_ISR_PERIOD_usec (USER_PWM_PERIOD_usec * (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK) |
Defines the Interrupt Service Routine (ISR) period, usec. More... | |
#define | USER_NUM_PWM_TICKS_PER_ISR_TICK (3) |
DECIMATION. More... | |
#define | USER_NUM_ISR_TICKS_PER_CTRL_TICK (1) |
Defines the number of isr ticks (hardware) per controller clock tick (software) More... | |
#define | USER_NUM_CTRL_TICKS_PER_CURRENT_TICK (1) |
Defines the number of controller clock ticks per current controller clock tick. More... | |
#define | USER_NUM_CTRL_TICKS_PER_EST_TICK (1) |
Defines the number of controller clock ticks per estimator clock tick. More... | |
#define | USER_NUM_CTRL_TICKS_PER_SPEED_TICK (15) |
Defines the number of controller clock ticks per speed controller clock tick. More... | |
#define | USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (15) |
Defines the number of controller clock ticks per trajectory clock tick. More... | |
#define | USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK) |
Defines the controller frequency, Hz. More... | |
#define | USER_EST_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_EST_TICK) |
Defines the estimator frequency, Hz. More... | |
#define | USER_TRAJ_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK) |
Defines the trajectory frequency, Hz. More... | |
#define | USER_CTRL_PERIOD_usec (USER_ISR_PERIOD_usec * USER_NUM_ISR_TICKS_PER_CTRL_TICK) |
Defines the controller execution period, usec. More... | |
#define | USER_CTRL_PERIOD_sec ((float_t)USER_CTRL_PERIOD_usec/(float_t)1000000.0) |
Defines the controller execution period, sec. More... | |
#define | USER_MAX_NEGATIVE_ID_REF_CURRENT_A (-0.5 * USER_MOTOR_MAX_CURRENT) |
LIMITS. More... | |
#define | USER_ZEROSPEEDLIMIT (0.5 / USER_IQ_FULL_SCALE_FREQ_Hz) |
Defines the low speed limit for the flux integrator, pu. More... | |
#define | USER_FORCE_ANGLE_FREQ_Hz (2.0 * USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz) |
Defines the force angle frequency, Hz. More... | |
#define | USER_MAX_CURRENT_SLOPE_POWERWARP (0.3*USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) |
Defines the maximum current slope for Id trajectory during PowerWarp. More... | |
#define | USER_MAX_ACCEL_Hzps (20.0) |
Defines the starting maximum acceleration AND deceleration for the speed profiles, Hz/s. More... | |
#define | USER_MAX_ACCEL_EST_Hzps (5.0) |
Defines maximum acceleration for the estimation speed profiles, Hz/s. More... | |
#define | USER_MAX_CURRENT_SLOPE (USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) |
Defines the maximum current slope for Id trajectory during estimation. More... | |
#define | USER_IDRATED_FRACTION_FOR_RATED_FLUX (1.0) |
Defines the fraction of IdRated to use during rated flux estimation. More... | |
#define | USER_IDRATED_FRACTION_FOR_L_IDENT (1.0) |
Defines the fraction of IdRated to use during inductance estimation. More... | |
#define | USER_IDRATED_DELTA (0.00002) |
Defines the IdRated delta to use during estimation. More... | |
#define | USER_SPEEDMAX_FRACTION_FOR_L_IDENT (1.0) |
Defines the fraction of SpeedMax to use during inductance estimation. More... | |
#define | USER_FLUX_FRACTION (1.0) |
Defines flux fraction to use during inductance identification. More... | |
#define | USER_POWERWARP_GAIN (1.0) |
Defines the PowerWarp gain for computing Id reference. More... | |
#define | USER_R_OVER_L_EST_FREQ_Hz (300) |
Defines the R/L estimation frequency, Hz. More... | |
#define | USER_VOLTAGE_FILTER_POLE_Hz (344.62) |
POLES. More... | |
#define | USER_VOLTAGE_FILTER_POLE_rps (2.0 * MATH_PI * USER_VOLTAGE_FILTER_POLE_Hz) |
Defines the analog voltage filter pole location, rad/s. More... | |
#define | USER_OFFSET_POLE_rps (20.0) |
Defines the software pole location for the voltage and current offset estimation, rad/s. More... | |
#define | USER_FLUX_POLE_rps (100.0) |
Defines the software pole location for the flux estimation, rad/s. More... | |
#define | USER_DIRECTION_POLE_rps (6.0) |
Defines the software pole location for the direction filter, rad/s. More... | |
#define | USER_SPEED_POLE_rps (100.0) |
Defines the software pole location for the speed control filter, rad/s. More... | |
#define | USER_DCBUS_POLE_rps (100.0) |
Defines the software pole location for the DC bus filter, rad/s. More... | |
#define | USER_EST_KAPPAQ (1.5) |
Defines the convergence factor for the estimator. More... | |
#define | Estun_EMJ_04APB22 101 |
USER MOTOR & ID SETTINGS. More... | |
#define | Anaheim_BLY172S 102 |
#define | My_Motor 104 |
#define | hobby_3p5T 105 |
#define | hobby_4p5T 106 |
#define | small_hobby 107 |
#define | teknic_2310P 108 |
#define | hobbywing_ezrun_8p5T 109 |
#define | eflite_helicopter_420 110 |
#define | Bodine_34B3FEBL 114 |
#define | Pittman_elcom_5233B599 115 |
#define | medical_instrument 117 |
#define | Test_Motor 118 |
#define | Belt_Drive_Washer_IPM 201 |
#define | Marathon_5K33GN2A 301 |
#define | Kinetek_YDQ1p3_4 302 |
#define | LPKF_CAD_CAM 303 |
#define | USER_MOTOR Anaheim_BLY172S |
Uncomment the motor which should be included at compile. More... | |
#define | USER_MOTOR_TYPE MOTOR_Type_Pm |
#define | USER_MOTOR_NUM_POLE_PAIRS (4) |
#define | USER_MOTOR_Rr (NULL) |
#define | USER_MOTOR_Rs (0.3968007) |
#define | USER_MOTOR_Ls_d (0.0006708066) |
#define | USER_MOTOR_Ls_q (0.0006708066) |
#define | USER_MOTOR_RATED_FLUX (0.03433958) |
#define | USER_MOTOR_MAGNETIZING_CURRENT (NULL) |
#define | USER_MOTOR_RES_EST_CURRENT (1.0) |
#define | USER_MOTOR_IND_EST_CURRENT (-1.0) |
#define | USER_MOTOR_MAX_CURRENT (5.0) |
#define | USER_MOTOR_FLUX_EST_FREQ_Hz (20.0) |
Functions | |
void | USER_setParams (USER_Params *pUserParams) |
Sets the user parameter values. More... | |
void | USER_checkForErrors (USER_Params *pUserParams) |
Checks for errors in the user parameter values. More... | |
USER_ErrorCode_e | USER_getErrorCode (USER_Params *pUserParams) |
Gets the error code in the user parameters. More... | |
void | USER_setErrorCode (USER_Params *pUserParams, const USER_ErrorCode_e errorCode) |
Sets the error code in the user parameters. More... | |
void | USER_softwareUpdate1p6 (CTRL_Handle handle) |
Recalculates Inductances with the correct Q Format. More... | |
void | USER_calcPIgains (CTRL_Handle handle) |
Updates Id and Iq PI gains. More... | |
_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, from per unit to Nm. More... | |
_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. More... | |
_iq | USER_computeFlux_pu_to_Wb_sf (void) |
Computes the scale factor needed to convert from per unit to Wb. More... | |
_iq | USER_computeFlux_pu_to_VpHz_sf (void) |
Computes the scale factor needed to convert from per unit to V/Hz. More... | |
_iq | USER_computeFlux (CTRL_Handle handle, const _iq sf) |
Computes Flux in Wb or V/Hz depending on the scale factor sent as parameter. More... | |
_iq | USER_computeTorque_Nm (CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf) |
Computes Torque in Nm. More... | |
_iq | USER_computeTorque_lbin (CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf) |
Computes Torque in lbin. More... | |
#define Estun_EMJ_04APB22 101 |
#define I_A_offset (1.210729778) |
ADC current offsets for A, B, and C phases.
One-time hardware dependent, though the calibration can be done at run-time as well After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
Definition at line 125 of file user.h.
Referenced by main().
#define USER_ADC_FULL_SCALE_CURRENT_A (47.14) |
#define USER_ADC_FULL_SCALE_VOLTAGE_V (44.30) |
#define USER_CTRL_FREQ_Hz (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK) |
#define USER_CTRL_PERIOD_sec ((float_t)USER_CTRL_PERIOD_usec/(float_t)1000000.0) |
Defines the controller execution period, sec.
Compile time calculation
Definition at line 231 of file user.h.
Referenced by recalcKpKi(), and recalcKpKiPmsm().
#define USER_CTRL_PERIOD_usec (USER_ISR_PERIOD_usec * USER_NUM_ISR_TICKS_PER_CTRL_TICK) |
#define USER_CURRENT_SF ((float_t)((USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A))) |
#define USER_DCBUS_POLE_rps (100.0) |
#define USER_DIRECTION_POLE_rps (6.0) |
#define USER_EST_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_EST_TICK) |
#define USER_EST_HANDLE_ADDRESS (0x600) |
#define USER_EST_KAPPAQ (1.5) |
#define USER_FLUX_FRACTION (1.0) |
#define USER_FLUX_POLE_rps (100.0) |
#define USER_FORCE_ANGLE_FREQ_Hz (2.0 * USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz) |
#define USER_IDRATED_DELTA (0.00002) |
#define USER_IDRATED_FRACTION_FOR_L_IDENT (1.0) |
#define USER_IDRATED_FRACTION_FOR_RATED_FLUX (1.0) |
#define USER_IQ_FULL_SCALE_CURRENT_A (20.0) |
Defines the full scale current for the IQ variables, A.
All currents are converted into (pu) based on the ratio to this value WARNING: this value MUST be larger than the maximum current readings that you are expecting from the motor or the reading will roll over to 0, creating a control issue
Definition at line 102 of file user.h.
Referenced by CTRL_calcMax_Ls_qFmt(), main(), mainISR(), recalcKpKi(), recalcKpKiPmsm(), runFieldWeakening(), runRsOnLine(), softwareUpdate1p6(), updateGlobalVariables(), updateGlobalVariables_motor(), and updateIqRef().
#define USER_IQ_FULL_SCALE_FREQ_Hz (800.0) |
CURRENTS AND VOLTAGES.
Defines the full scale frequency for IQ variable, Hz All frequencies are converted into (pu) based on the ratio to this value this value MUST be larger than the maximum speed that you are expecting from the motor
Definition at line 78 of file user.h.
Referenced by angleDelayComp(), main(), recalcKpKiPmsm(), and updateGlobalVariables().
#define USER_IQ_FULL_SCALE_VOLTAGE_V (24.0) |
Defines full scale value for the IQ30 variable of Voltage inside the system.
All voltages are converted into (pu) based on the ratio to this value WARNING: this value MUST meet the following condition: USER_IQ_FULL_SCALE_VOLTAGE_V > 0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps, WARNING: otherwise the value can saturate and roll-over, causing an inaccurate value WARNING: this value is OFTEN greater than the maximum measured ADC value, especially with high Bemf motors operating at higher than rated speeds WARNING: if you know the value of your Bemf constant, and you know you are operating at a multiple speed due to field weakening, be sure to set this value higher than the expected Bemf voltage It is recommended to start with a value ~3x greater than the USER_ADC_FULL_SCALE_VOLTAGE_V and increase to 4-5x if scenarios where a Bemf calculation may exceed these limits This value is also used to calculate the minimum flux value: USER_IQ_FULL_SCALE_VOLTAGE_V/USER_EST_FREQ_Hz/0.7
Definition at line 88 of file user.h.
Referenced by CTRL_calcMax_Ls_qFmt(), main(), recalcKpKi(), recalcKpKiPmsm(), softwareUpdate1p6(), updateGlobalVariables(), and updateGlobalVariables_motor().
#define USER_ISR_FREQ_Hz ((float_t)USER_PWM_FREQ_kHz * 1000.0 / (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK) |
#define USER_ISR_PERIOD_usec (USER_PWM_PERIOD_usec * (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK) |
#define USER_MAX_ACCEL_EST_Hzps (5.0) |
#define USER_MAX_ACCEL_Hzps (20.0) |
#define USER_MAX_CURRENT_SLOPE (USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) |
#define USER_MAX_CURRENT_SLOPE_POWERWARP (0.3*USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz) |
#define USER_MAX_NEGATIVE_ID_REF_CURRENT_A (-0.5 * USER_MOTOR_MAX_CURRENT) |
LIMITS.
Defines the maximum negative current to be applied in Id reference Used in field weakening only, this is a safety setting (e.g. to protect against demagnetization) User must also be aware that overall current magnitude [sqrt(Id^2 + Iq^2)] should be kept below any machine design specifications
Definition at line 239 of file user.h.
Referenced by main().
#define USER_MAX_VS_MAG_PU (2.0/3.0) |
Defines the maximum Voltage vector (Vs) magnitude allowed. This value sets the maximum magnitude for the output of the.
Id and Iq PI current controllers. The Id and Iq current controller outputs are Vd and Vq. The relationship between Vs, Vd, and Vq is: Vs = sqrt(Vd^2 + Vq^2). In this FOC controller, the Vd value is set equal to USER_MAX_VS_MAG*USER_VD_MAG_FACTOR. Vq = sqrt(USER_MAX_VS_MAG^2 - Vd^2). Set USER_MAX_VS_MAG = 0.5 for a pure sinewave with a peak at SQRT(3)/2 = 86.6% duty cycle. No current reconstruction is needed for this scenario. Set USER_MAX_VS_MAG = 1/SQRT(3) = 0.5774 for a pure sinewave with a peak at 100% duty cycle. Current reconstruction will be needed for this scenario (Lab10a-x). Set USER_MAX_VS_MAG = 2/3 = 0.6666 to create a trapezoidal voltage waveform. Current reconstruction will be needed for this scenario (Lab10a-x). For space vector over-modulation, see lab 10 for details on system requirements that will allow the SVM generator to go all the way to trapezoidal.
#define USER_MOTOR Anaheim_BLY172S |
Uncomment the motor which should be included at compile.
These motor ID settings and motor parameters are then available to be used by the control system Once your ideal settings and parameters are identified update the motor section here so it is available in the binary code
#define USER_MOTOR_Ls_d (0.0006708066) |
Definition at line 401 of file user.h.
Referenced by main(), and softwareUpdate1p6().
#define USER_MOTOR_Ls_q (0.0006708066) |
Definition at line 402 of file user.h.
Referenced by main(), and softwareUpdate1p6().
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL) |
#define USER_MOTOR_MAX_CURRENT (5.0) |
Definition at line 407 of file user.h.
Referenced by main(), and recalcKpKiPmsm().
#define USER_MOTOR_NUM_POLE_PAIRS (4) |
Definition at line 398 of file user.h.
Referenced by getAbsMechAngle(), mainISR(), and updateGlobalVariables().
#define USER_MOTOR_RES_EST_CURRENT (1.0) |
Definition at line 405 of file user.h.
Referenced by main(), and recalcKpKiPmsm().
#define USER_MOTOR_TYPE MOTOR_Type_Pm |
#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK (1) |
#define USER_NUM_CTRL_TICKS_PER_EST_TICK (1) |
Defines the number of controller clock ticks per estimator clock tick.
Relationship of controller clock rate to estimator (FAST) rate Depends on needed dynamic performance, FAST provides very good results as low as 1 KHz while more dynamic or high speed applications may require up to 15 KHz
#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK (15) |
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (15) |
#define USER_NUM_CURRENT_SENSORS (3) |
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1) |
Defines the number of isr ticks (hardware) per controller clock tick (software)
Controller clock tick (CTRL) is the main clock used for all timing in the software Typically the PWM Frequency triggers (can be decimated by the ePWM hardware for less overhead) an ADC SOC ADC SOC triggers an ADC Conversion Done ADC Conversion Done triggers ISR This relates the hardware ISR rate to the software controller rate Typcially want to consider some form of decimation (ePWM hardware, CURRENT or EST) over 16KHz ISR to insure interrupt completes and leaves time for background tasks
#define USER_NUM_PWM_TICKS_PER_ISR_TICK (3) |
DECIMATION.
Defines the number of pwm clock ticks per isr clock tick Note: Valid values are 1, 2 or 3 only
Definition at line 184 of file user.h.
Referenced by angleDelayComp(), and updateCPUusage().
#define USER_NUM_VOLTAGE_SENSORS (3) |
#define USER_OFFSET_POLE_rps (20.0) |
#define USER_POWERWARP_GAIN (1.0) |
#define USER_PWM_FREQ_kHz (45.0) |
Defines the Pulse Width Modulation (PWM) frequency, kHz.
PWM frequency can be set directly here up to 30 KHz safely (60 KHz MAX in some cases) For higher PWM frequencies (60 KHz+ typical for low inductance, high current ripple motors) it is recommended to use the ePWM hardware and adjustable ADC SOC to decimate the ADC conversion done interrupt to the control system, or to use the software Que example. Otherwise you risk missing interrupts and disrupting the timing of the control state machine
Definition at line 147 of file user.h.
Referenced by angleDelayComp().
#define USER_PWM_PERIOD_usec (1000.0/USER_PWM_FREQ_kHz) |
#define USER_R_OVER_L_EST_FREQ_Hz (300) |
#define USER_SPEED_POLE_rps (100.0) |
#define USER_SPEEDMAX_FRACTION_FOR_L_IDENT (1.0) |
#define USER_SYSTEM_FREQ_MHz (60.0) |
#define USER_TRAJ_FREQ_Hz (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK) |
#define USER_VD_SF (0.95) |
#define USER_VOLTAGE_FILTER_POLE_Hz (344.62) |
#define USER_VOLTAGE_FILTER_POLE_rps (2.0 * MATH_PI * USER_VOLTAGE_FILTER_POLE_Hz) |
Defines the analog voltage filter pole location, rad/s.
Compile time calculation from Hz to rad/s
Definition at line 305 of file user.h.
Referenced by CTRL_calcMax_Ls_qFmt(), and softwareUpdate1p6().
#define USER_VOLTAGE_SF ((float_t)((USER_ADC_FULL_SCALE_VOLTAGE_V)/(USER_IQ_FULL_SCALE_VOLTAGE_V))) |
#define USER_ZEROSPEEDLIMIT (0.5 / USER_IQ_FULL_SCALE_FREQ_Hz) |
Defines the low speed limit for the flux integrator, pu.
This is the speed range (CW/CCW) at which the ForceAngle object is active, but only if Enabled Outside of this speed - or if Disabled - the ForcAngle will NEVER be active and the angle is provided by FAST only
Definition at line 244 of file user.h.
Referenced by setFeLimitZero().
#define V_A_offset (0.5084558129) |
ADC voltage offsets for A, B, and C phases.
One-time hardware dependent, though the calibration can be done at run-time as well After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
Definition at line 132 of file user.h.
Referenced by main().
void USER_calcPIgains | ( | CTRL_Handle | handle | ) |
void USER_checkForErrors | ( | USER_Params * | pUserParams | ) |
Checks for errors in the user parameter values.
[in] | pUserParams | The pointer to the user param structure |
Referenced by main().
_iq USER_computeFlux | ( | CTRL_Handle | handle, |
const _iq | sf | ||
) |
Computes Flux in Wb or V/Hz depending on the scale factor sent as parameter.
[in] | handle | The controller (CTRL) handle |
[in] | sf | The scale factor to convert flux from per unit to Wb or V/Hz |
Referenced by updateGlobalVariables_motor().
_iq USER_computeFlux_pu_to_VpHz_sf | ( | void | ) |
Computes the scale factor needed to convert from per unit to V/Hz.
Referenced by main().
_iq USER_computeFlux_pu_to_Wb_sf | ( | void | ) |
Computes the scale factor needed to convert from per unit to Wb.
Referenced by main().
_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.
Referenced by main().
_iq USER_computeTorque_lbin | ( | CTRL_Handle | handle, |
const _iq | torque_Flux_sf, | ||
const _iq | torque_Ls_sf | ||
) |
Computes Torque in lbin.
[in] | handle | The controller (CTRL) handle |
[in] | torque_Flux_sf | The scale factor to convert torque from (Ld - Lq) * Id * Iq from per unit to lbin |
[in] | torque_Ls_sf | The scale factor to convert torque from Flux * Iq from per unit to lbin |
_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, from per unit to Nm.
Referenced by main().
_iq USER_computeTorque_Nm | ( | CTRL_Handle | handle, |
const _iq | torque_Flux_sf, | ||
const _iq | torque_Ls_sf | ||
) |
Computes Torque in Nm.
[in] | handle | The controller (CTRL) handle |
[in] | torque_Flux_sf | The scale factor to convert torque from (Ld - Lq) * Id * Iq from per unit to Nm |
[in] | torque_Ls_sf | The scale factor to convert torque from Flux * Iq from per unit to Nm |
Referenced by updateGlobalVariables_motor().
USER_ErrorCode_e USER_getErrorCode | ( | USER_Params * | pUserParams | ) |
Gets the error code in the user parameters.
[in] | pUserParams | The pointer to the user param structure |
Referenced by main().
void USER_setErrorCode | ( | USER_Params * | pUserParams, |
const USER_ErrorCode_e | errorCode | ||
) |
Sets the error code in the user parameters.
[in] | pUserParams | The pointer to the user param structure |
[in] | errorCode | The error code |
void USER_setParams | ( | USER_Params * | pUserParams | ) |
Sets the user parameter values.
[in] | pUserParams | The pointer to the user param structure |
Referenced by main().
void USER_softwareUpdate1p6 | ( | CTRL_Handle | handle | ) |
Recalculates Inductances with the correct Q Format.
[in] | handle | The controller (CTRL) handle |
Referenced by main().