MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

float/user.c
Go to the documentation of this file.
1
6
7 // **************************************************************************
8 // the includes
9
10 #include "user.h"
11
12
13 // **************************************************************************
14 // the defines
15 #ifdef __TMS320C28XX_CLA__
16 #pragma CODE_SECTION(USER_setParams,"Cla1Prog2");
17 #endif
18
19
20 // **************************************************************************
21 // the typedefs
22
23
24 // **************************************************************************
25 // the functions
26
27
28 void USER_setParams(USER_Params *pUserParams)
29 {
30 pUserParams->dcBus_nominal_V = USER_NOMINAL_DC_BUS_VOLTAGE_V;
31
32 pUserParams->numIsrTicksPerCtrlTick = USER_NUM_ISR_TICKS_PER_CTRL_TICK;
33 pUserParams->numIsrTicksPerEstTick = USER_NUM_ISR_TICKS_PER_EST_TICK;
34 pUserParams->numIsrTicksPerTrajTick = USER_NUM_ISR_TICKS_PER_TRAJ_TICK;
35
36 pUserParams->numCtrlTicksPerCurrentTick = USER_NUM_CTRL_TICKS_PER_CURRENT_TICK;
37 pUserParams->numCtrlTicksPerSpeedTick = USER_NUM_CTRL_TICKS_PER_SPEED_TICK;
38
39 pUserParams->numCurrentSensors = USER_NUM_CURRENT_SENSORS;
40 pUserParams->numVoltageSensors = USER_NUM_VOLTAGE_SENSORS;
41
42 pUserParams->systemFreq_MHz = USER_SYSTEM_FREQ_MHz;
43
44 pUserParams->pwmPeriod_usec = USER_PWM_PERIOD_usec;
45
46 pUserParams->voltage_sf = USER_VOLTAGE_SF;
47
48 pUserParams->current_sf = USER_CURRENT_SF;
49
50 pUserParams->dcBusPole_rps = USER_DCBUS_POLE_rps;
51
52 pUserParams->offsetPole_rps = USER_OFFSET_POLE_rps;
53
54 pUserParams->speedPole_rps = USER_SPEED_POLE_rps;
55
56 pUserParams->voltageFilterPole_rps = USER_VOLTAGE_FILTER_POLE_rps;
57
58 pUserParams->maxDutyCycle = USER_MAX_DUTY_CYCLE;
59
60 pUserParams->motor_type = USER_MOTOR_TYPE;
61
62 pUserParams->motor_numPolePairs = USER_MOTOR_NUM_POLE_PAIRS;
63 pUserParams->motor_numEncSlots = USER_MOTOR_NUM_ENC_SLOTS;
64
65 pUserParams->motor_ratedFlux_Wb = USER_MOTOR_RATED_FLUX_VpHz / MATH_TWO_PI;
66
67 pUserParams->motor_Rr_d_Ohm = USER_MOTOR_Rr_Ohm;
68 pUserParams->motor_Rr_q_Ohm = USER_MOTOR_Rr_Ohm;
69
70 pUserParams->motor_Rs_a_Ohm = USER_MOTOR_Rs_Ohm;
71 pUserParams->motor_Rs_b_Ohm = USER_MOTOR_Rs_Ohm;
72
73 pUserParams->motor_Rs_d_Ohm = USER_MOTOR_Rs_Ohm;
74 pUserParams->motor_Rs_q_Ohm = USER_MOTOR_Rs_Ohm;
75
76 pUserParams->motor_Ls_d_H = USER_MOTOR_Ls_d_H;
77 pUserParams->motor_Ls_q_H = USER_MOTOR_Ls_q_H;
78
79 pUserParams->maxCurrent_A = USER_MOTOR_MAX_CURRENT_A;
80
81 pUserParams->IdRated_A = USER_MOTOR_MAGNETIZING_CURRENT_A;
82
83 pUserParams->Vd_sf = USER_VD_SF;
84 pUserParams->maxVsMag_V = USER_NOMINAL_DC_BUS_VOLTAGE_V;
85
86 /*LDRA_INSPECTED 139 S MR12 14.3 ""Its a compile time flag providing user a choice to use or bypass motor identification; so OK"*/
87 if(USER_BYPASS_MOTOR_ID == 1)
88 {
89 // Marathon 56H17T2001
90 // pUserParams->BWc_rps = MATH_TWO_PI * 100.0;
91 // pUserParams->BWdelta = (float_t)4.0;
92 // pUserParams->Kctrl_Wb_p_kgm2 = 3.0 * pUserParams->motor_numPolePairs * 0.1 / (2.0 * 0.0001); // 3.0 * numPolesPairs * rotorFlux_Wb / (2.0 * J_kg_m2);
93
94 // Estun
95 // pUserParams->BWc_rps = MATH_TWO_PI * 40.0;
96 // pUserParams->BWdelta = (float_t)4.0;
97 // pUserParams->Kctrl_Wb_p_kgm2 = 3.0 * pUserParams->motor_numPolePairs * 0.0625 / (2.0 * 0.000031); // 3.0 * numPolesPairs * rotorFlux_Wb / (2.0 * J_kg_m2);
98
99 // Anaheim
100 pUserParams->BWc_rps = MATH_TWO_PI * (float_t)100.0;
101 pUserParams->BWdelta = (float_t)4.0;
102 pUserParams->Kctrl_Wb_p_kgm2 = (float_t)3.0 * pUserParams->motor_numPolePairs * pUserParams->motor_ratedFlux_Wb /(float_t) (2.0 * 0.000004802); // 3.0 * pUserParams->motor_numPolePairs * 0.1 / (2.0 * 0.00001);
103
104 // nidec_fan
105 // pUserParams->BWc_rps = MATH_TWO_PI * (float_t)4000.0;
106 // pUserParams->BWdelta = (float_t)4.0;
107 // pUserParams->Kctrl_Wb_p_kgm2 = (float_t)3.0 * pUserParams->motor_numPolePairs * pUserParams->motor_ratedFlux_Wb /(float_t) (2.0 * 0.000004802); // 3.0 * pUserParams->motor_numPolePairs * 0.1 / (2.0 * 0.00001);
108 }
109 else
110 {
111 pUserParams->BWc_rps = MATH_TWO_PI * (float_t)100.0;
112 pUserParams->BWdelta = (float_t)10.0;
113 pUserParams->Kctrl_Wb_p_kgm2 = (float_t)3.0 * pUserParams->motor_numPolePairs * (float_t)(0.001) / (float_t)(2.0 * 0.000001); // 3.0 * pUserParams->motor_numPolePairs * 0.1 / (2.0 * 0.00001);
114 }
115
116 pUserParams->angleDelayed_sf_sec = (float_t)0.5 * USER_CTRL_PERIOD_sec;
117
118 pUserParams->fluxExcFreq_Hz = USER_MOTOR_FLUX_EXC_FREQ_Hz;
119
120 pUserParams->calWaitTime[CAL_State_Error] = 0;
121 pUserParams->calWaitTime[CAL_State_Idle] = 0;
122 pUserParams->calWaitTime[CAL_State_AdcOffset] = (int_least32_t)( 5.0 * USER_CTRL_FREQ_Hz);
123 pUserParams->calWaitTime[CAL_State_Done] = 0;
124
125 pUserParams->ctrlWaitTime[CTRL_State_Error] = 0;
126 pUserParams->ctrlWaitTime[CTRL_State_Idle] = 0;
127 pUserParams->ctrlWaitTime[CTRL_State_OnLine] = 0;
128
129 pUserParams->estWaitTime[EST_State_Error] = 0;
130 pUserParams->estWaitTime[EST_State_Idle] = 0;
131 pUserParams->estWaitTime[EST_State_RoverL] = (int_least32_t)( 5.0 * USER_EST_FREQ_Hz);
132 pUserParams->estWaitTime[EST_State_Rs] = 0;
133 pUserParams->estWaitTime[EST_State_RampUp] = (int_least32_t)((USER_MOTOR_FLUX_EXC_FREQ_Hz / USER_MAX_ACCEL_Hzps + (float_t)1.0) * USER_EST_FREQ_Hz);
134 pUserParams->estWaitTime[EST_State_ConstSpeed] = (int_least32_t)( 1.0 * USER_EST_FREQ_Hz);
135 pUserParams->estWaitTime[EST_State_IdRated] = (int_least32_t)(20.0 * USER_EST_FREQ_Hz);
136 pUserParams->estWaitTime[EST_State_RatedFlux_OL] = (int_least32_t)( 1.0 * USER_EST_FREQ_Hz);
137 pUserParams->estWaitTime[EST_State_RatedFlux] = 0;
138 pUserParams->estWaitTime[EST_State_RampDown] = (int_least32_t)( 0.0 * USER_EST_FREQ_Hz);
139 pUserParams->estWaitTime[EST_State_LockRotor] = 0;
140 pUserParams->estWaitTime[EST_State_Ls] = 0;
141 pUserParams->estWaitTime[EST_State_Rr] = (int_least32_t)( 5.0 * USER_EST_FREQ_Hz);
142 pUserParams->estWaitTime[EST_State_MotorIdentified] = 0;
143 pUserParams->estWaitTime[EST_State_OnLine] = 0;
144
145 pUserParams->FluxWaitTime[EST_Flux_State_Error] = 0;
146 pUserParams->FluxWaitTime[EST_Flux_State_Idle] = 0;
147 pUserParams->FluxWaitTime[EST_Flux_State_CL1] = (int_least32_t)(10.0 * USER_EST_FREQ_Hz);
148 pUserParams->FluxWaitTime[EST_Flux_State_CL2] = (int_least32_t)( 0.2 * USER_EST_FREQ_Hz);
149 pUserParams->FluxWaitTime[EST_Flux_State_Fine] = (int_least32_t)(20.0 * USER_EST_FREQ_Hz);
150 pUserParams->FluxWaitTime[EST_Flux_State_Done] = 0;
151
152 pUserParams->LsWaitTime[EST_Ls_State_Error] = 0;
153 pUserParams->LsWaitTime[EST_Ls_State_Idle] = 0;
154 pUserParams->LsWaitTime[EST_Ls_State_RampUp] = (int_least32_t)(10.0 * USER_EST_FREQ_Hz);
155 pUserParams->LsWaitTime[EST_Ls_State_Coarse] = (int_least32_t)(30.0 * USER_EST_FREQ_Hz);
156 pUserParams->LsWaitTime[EST_Ls_State_Fine] = (int_least32_t)(30.0 * USER_EST_FREQ_Hz);
157 pUserParams->LsWaitTime[EST_Ls_State_Done] = 0;
158
159 pUserParams->RrWaitTime[EST_Rr_State_Error] = 0;
160 pUserParams->RrWaitTime[EST_Rr_State_Idle] = 0;
161 pUserParams->RrWaitTime[EST_Rr_State_RampUp] = (int_least32_t)( 1.0 * USER_EST_FREQ_Hz);
162 pUserParams->RrWaitTime[EST_Rr_State_Coarse] = (int_least32_t)(10.0 * USER_EST_FREQ_Hz);
163 pUserParams->RrWaitTime[EST_Rr_State_Fine] = (int_least32_t)(30.0 * USER_EST_FREQ_Hz);
164 pUserParams->RrWaitTime[EST_Rr_State_Done] = 0;
165
166 pUserParams->RsWaitTime[EST_Rs_State_Error] = 0;
167 pUserParams->RsWaitTime[EST_Rs_State_Idle] = 0;
168 pUserParams->RsWaitTime[EST_Rs_State_RampUp] = (int_least32_t)( 1.0 * USER_EST_FREQ_Hz);
169 pUserParams->RsWaitTime[EST_Rs_State_Coarse] = (int_least32_t)( 2.0 * USER_EST_FREQ_Hz);
170 pUserParams->RsWaitTime[EST_Rs_State_Fine] = (int_least32_t)(10.0 * USER_EST_FREQ_Hz);
171 pUserParams->RsWaitTime[EST_Rs_State_Done] = 0;
172
173 pUserParams->trajWaitTime[EST_Traj_State_Error] = 0;
174 pUserParams->trajWaitTime[EST_Traj_State_Idle] = 0;
175 pUserParams->trajWaitTime[EST_Traj_State_Est] = 0;
176 pUserParams->trajWaitTime[EST_Traj_State_OnLine] = 0;
177
178 pUserParams->ctrlFreq_Hz = USER_CTRL_FREQ_Hz;
179
180 pUserParams->estFreq_Hz = USER_EST_FREQ_Hz;
181
182 pUserParams->RoverL_excFreq_Hz = USER_R_OVER_L_EXC_FREQ_Hz;
183
184 pUserParams->trajFreq_Hz = USER_TRAJ_FREQ_Hz;
185
186 pUserParams->ctrlPeriod_sec = USER_CTRL_PERIOD_sec;
187
188 pUserParams->maxAccel_Hzps = USER_MAX_ACCEL_Hzps;
189
190 pUserParams->maxCurrent_resEst_A = USER_MOTOR_RES_EST_CURRENT_A;
191 pUserParams->maxCurrent_indEst_A = USER_MOTOR_IND_EST_CURRENT_A;
192
193 pUserParams->maxCurrentDelta_A = USER_MAX_CURRENT_DELTA_A;
194 pUserParams->maxCurrentDelta_pw_A = USER_MAX_CURRENT_DELTA_PW_A;
195
196 pUserParams->IdRated_delta_A = USER_IDRATED_DELTA_A;
197
198 pUserParams->forceAngleFreq_Hz = USER_FORCE_ANGLE_FREQ_Hz;
199
200 pUserParams->indEst_speedMaxFraction = USER_SPEEDMAX_FRACTION_FOR_L_IDENT;
201
202 pUserParams->IdRatedFraction_indEst = USER_IDRATED_FRACTION_FOR_L_IDENT;
203
204 pUserParams->pwGain = USER_PW_GAIN;
205
206 pUserParams->Kp_min_VpA = (float_t)0.001;
207 pUserParams->Kp_max_VpA = (float_t)1000.0;
208
209 pUserParams->RoverL_Kp_sf = USER_R_OVER_L_KP_SF;
210 pUserParams->RoverL_min_rps = MATH_TWO_PI * (float_t)5.0;
211 pUserParams->RoverL_max_rps = MATH_TWO_PI * (float_t)5000.0;
212
213 pUserParams->oneOverDcBus_min_invV = (float_t)1.0 / (float_t)400.0;
214 pUserParams->oneOverDcBus_max_invV = (float_t)1.0 / (float_t)10.0;
215
216 pUserParams->Ls_d_H = (float_t)1.0e-6;
217 pUserParams->Ls_q_H = (float_t)1.0e-6;
218 pUserParams->Ls_coarseDelta_H = (float_t)0.0000001;
219 pUserParams->Ls_fineDelta_H = (float_t)0.00000001;
220 pUserParams->Ls_min_H = (float_t)0.000001;
221 pUserParams->Ls_max_H = (float_t)100.0;
222
223 pUserParams->Rr_Ohm = (float_t)0.0;
224 pUserParams->Rr_coarseDelta_Ohm = (float_t)0.0001;
225 pUserParams->Rr_fineDelta_Ohm = (float_t)0.00001;
226 pUserParams->Rr_min_Ohm = (float_t)0.0;
227 pUserParams->Rr_max_Ohm = (float_t)1000.0;
228
229 pUserParams->Rs_Ohm = (float_t)0.0;
230 pUserParams->Rs_coarseDelta_Ohm = (float_t)0.01;
231 pUserParams->Rs_fineDelta_Ohm = (float_t)0.00001;
232 pUserParams->Rs_min_Ohm = (float_t)0.001;
233 pUserParams->Rs_max_Ohm = (float_t)1000.0;
234
235 pUserParams->RsOnLine_DeltaInc_Ohm = (float_t)0.00001;
236 pUserParams->RsOnLine_DeltaDec_Ohm = (float_t)0.00001;
237 pUserParams->RsOnLine_min_Ohm = (float_t)0.001;
238 pUserParams->RsOnLine_max_Ohm = (float_t)1000.0;
239
240 pUserParams->RsOnLine_angleDelta_rad = (float_t)0.00001;
241 pUserParams->RsOnLine_pole_rps = MATH_TWO_PI * (float_t)0.2;
242
243 pUserParams->flag_bypassMotorId = USER_BYPASS_MOTOR_ID;
244
245 return;
246 } // end of USER_setParams() function
247
248 // end of file
249
_USER_Params_::fluxExcFreq_Hz
float_t fluxExcFreq_Hz
Defines the flux excitation frequency, Hz.
Definition: user/src/float/userParams.h:115
_USER_Params_::angleDelayed_sf_sec
float_t angleDelayed_sf_sec
Defines the scale factor for computing the angle considering system delay, sec.
Definition: user/src/float/userParams.h:113
_USER_Params_::Rr_min_Ohm
float_t Rr_min_Ohm
Defines the minimum rotor resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:181
CTRL_State_Error
the controller error state
Definition: ctrl_states.h:35
_USER_Params_::motor_numEncSlots
uint_least16_t motor_numEncSlots
Defines the number of encoder slots if quadrature encoder is connected.
Definition: user/src/float/userParams.h:86
_USER_Params_::forceAngleFreq_Hz
float_t forceAngleFreq_Hz
Defines the force angle frequency, Hz.
Definition: fast/src/32b/userParams.h:210
EST_State_LockRotor
lock the rotor
Definition: est_states.h:65
EST_State_Ls
stator inductance estimation state
Definition: est_states.h:66
_USER_Params_::estWaitTime
uint_least32_t estWaitTime[EST_numStates]
Defines the wait times for each estimator state, estimator ticks.
Definition: fast/src/32b/userParams.h:249
EST_Ls_State_Idle
idle
Definition: est_Ls_states.h:48
_USER_Params_::RsWaitTime
uint_least32_t RsWaitTime[EST_Rs_numStates]
Defines the wait times for each Rs estimator, estimator ticks.
Definition: fast/src/32b/userParams.h:252
EST_Rr_State_Coarse
the coarse estimation state
Definition: est_Rr_states.h:39
EST_State_ConstSpeed
constant speed after ramp up
Definition: est_states.h:59
EST_Flux_State_Idle
idle state
Definition: est_Flux_states.h:49
EST_State_MotorIdentified
motor identified state
Definition: est_states.h:68
EST_State_RatedFlux_OL
estimate the open loop rated flux
Definition: est_states.h:62
_USER_Params_::motor_Rs_d_Ohm
float_t motor_Rs_d_Ohm
Defines the direct stator resistance, Ohm.
Definition: user/src/float/userParams.h:96
_USER_Params_::Rr_coarseDelta_Ohm
float_t Rr_coarseDelta_Ohm
Defines the delta resistance value during coarse rotor resistance estimation, Ohm.
Definition: user/src/float/userParams.h:179
EST_Ls_State_RampUp
the ramp up state
Definition: est_Ls_states.h:49
_USER_Params_::maxAccel_Hzps
float_t maxAccel_Hzps
Defines the maximum acceleration for the speed profiles, Hz/s.
Definition: fast/src/32b/userParams.h:211
EST_Rs_State_Done
the done state
Definition: est_Rs_states.h:42
_USER_Params_::motor_Rs_a_Ohm
float_t motor_Rs_a_Ohm
Defines the alpha stator resistance, Ohm.
Definition: user/src/float/userParams.h:93
MATH_TWO_PI
#define MATH_TWO_PI
Defines 2*pi.
Definition: 32b/math.h:109
_USER_Params_::BWc_rps
float_t BWc_rps
Defines the bandwidth of the current controllers, rad/sec.
Definition: user/src/float/userParams.h:109
_USER_Params_::ctrlPeriod_sec
float_t ctrlPeriod_sec
Defines the controller execution period, sec.
Definition: fast/src/32b/userParams.h:258
_USER_Params_::maxCurrent_A
float_t maxCurrent_A
Defines the maximum current value, A.
Definition: user/src/float/userParams.h:102
_USER_Params_::systemFreq_MHz
uint_least16_t systemFreq_MHz
Defines the system clock frequency, MHz.
Definition: fast/src/32b/userParams.h:220
_USER_Params_::LsWaitTime
uint_least32_t LsWaitTime[EST_Ls_numStates]
Defines the wait times for each Ls estimator, estimator ticks.
Definition: fast/src/32b/userParams.h:251
_USER_Params_::Kp_max_VpA
float_t Kp_max_VpA
Defines the maximum Kp value for the current controller, V/A.
Definition: user/src/float/userParams.h:162
CTRL_State_Idle
the controller idle state
Definition: ctrl_states.h:36
_USER_Params_::Rs_min_Ohm
float_t Rs_min_Ohm
Defines the minimum stator resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:187
_USER_Params_::ctrlWaitTime
uint_least32_t ctrlWaitTime[CTRL_numStates]
Defines the wait times for each controller state, estimator ticks.
Definition: fast/src/32b/userParams.h:248
EST_State_IdRated
control Id and estimate the rated flux
Definition: est_states.h:61
_USER_Params_::pwGain
float_t pwGain
Defines the power warp gain for computing Id reference.
Definition: user/src/float/userParams.h:159
_USER_Params_::motor_Rs_q_Ohm
float_t motor_Rs_q_Ohm
Defines the quadrature stator resistance, Ohm.
Definition: user/src/float/userParams.h:97
_USER_Params_
Defines a structure for the user parameters.
Definition: fast/src/32b/userParams.h:193
_USER_Params_::numCurrentSensors
uint_least8_t numCurrentSensors
Defines the number of current sensors.
Definition: fast/src/32b/userParams.h:204
EST_Flux_State_Error
error state
Definition: est_Flux_states.h:48
EST_Rs_State_Fine
the fine estimation state
Definition: est_Rs_states.h:41
CAL_State_Error
error state
Definition: cal_states.h:48
EST_Flux_State_Done
done state
Definition: est_Flux_states.h:53
_USER_Params_::Rr_max_Ohm
float_t Rr_max_Ohm
Defines the maximum rotor resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:182
_USER_Params_::Kp_min_VpA
float_t Kp_min_VpA
Defines the minimum Kp value for the current controller, V/A.
Definition: user/src/float/userParams.h:161
_USER_Params_::Ls_max_H
float_t Ls_max_H
Defines the maximum stator inductance value allowed, H.
Definition: user/src/float/userParams.h:176
_USER_Params_::numCtrlTicksPerCurrentTick
uint_least16_t numCtrlTicksPerCurrentTick
Defines the number of controller clock ticks per current controller clock tick.
Definition: fast/src/32b/userParams.h:200
_USER_Params_::Ls_d_H
float_t Ls_d_H
Defines the default stator inductance in the direct direction, H.
Definition: user/src/float/userParams.h:171
EST_State_RatedFlux
estimate the rated flux
Definition: est_states.h:63
EST_Rr_State_Fine
the fine estimation state
Definition: est_Rr_states.h:40
_USER_Params_::Rr_Ohm
float_t Rr_Ohm
Defines the default rotor resistance value, Ohm.
Definition: user/src/float/userParams.h:178
EST_Rs_State_Coarse
the coarse estimation state
Definition: est_Rs_states.h:40
EST_State_Rs
Rs estimation state.
Definition: est_states.h:56
EST_Ls_State_Fine
the fine estimation state
Definition: est_Ls_states.h:52
_USER_Params_::voltageFilterPole_rps
float_t voltageFilterPole_rps
Defines the analog voltage filter pole location, rad/s.
Definition: fast/src/32b/userParams.h:225
EST_State_RampDown
ramp down the speed
Definition: est_states.h:64
_USER_Params_::RrWaitTime
int_least32_t RrWaitTime[EST_Rr_numStates]
Defines the wait times for each Rr estimator state, estimator ticks.
Definition: user/src/float/userParams.h:127
EST_Rr_State_Done
the done state
Definition: est_Rr_states.h:41
EST_State_OnLine
online parameter estimation
Definition: est_states.h:69
EST_Rs_State_RampUp
the Id ramp up state
Definition: est_Rs_states.h:39
_USER_Params_::maxVsMag_V
float_t maxVsMag_V
Defines the maximum stator voltage magnitude, V.
Definition: user/src/float/userParams.h:107
EST_Rr_State_Idle
idle
Definition: est_Rr_states.h:37
_USER_Params_::RsOnLine_pole_rps
float_t RsOnLine_pole_rps
Defines the filter pole for online stator resistance estimation, rad/sec.
Definition: user/src/float/userParams.h:196
_USER_Params_::RoverL_excFreq_Hz
float_t RoverL_excFreq_Hz
Defines the R/L excitation frequency, Hz.
Definition: user/src/float/userParams.h:137
EST_Traj_State_Error
the trajectory generator error state
Definition: est_Traj_states.h:47
_USER_Params_::motor_type
MOTOR_Type_e motor_type
Defines the motor type.
Definition: fast/src/32b/userParams.h:229
_USER_Params_::Rs_max_Ohm
float_t Rs_max_Ohm
Defines the maximum stator resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:188
_USER_Params_::Ls_q_H
float_t Ls_q_H
Defines the default stator inductance in the quadrature direction, H.
Definition: user/src/float/userParams.h:172
EST_Rr_State_RampUp
the Id ramp up state
Definition: est_Rr_states.h:38
_USER_Params_::voltage_sf
float_t voltage_sf
Defines the voltage scale factor for the system.
Definition: fast/src/32b/userParams.h:223
_USER_Params_::BWdelta
float_t BWdelta
Defines the bandwidth scaling to maximize phase margin.
Definition: user/src/float/userParams.h:110
_USER_Params_::maxDutyCycle
float_t maxDutyCycle
Defines the maximum duty cycle.
Definition: user/src/float/userParams.h:81
_USER_Params_::trajFreq_Hz
uint_least32_t trajFreq_Hz
Defines the trajectory frequency, Hz.
Definition: fast/src/32b/userParams.h:256
_USER_Params_::RoverL_Kp_sf
float_t RoverL_Kp_sf
Defines the Kp scale factor used during R/L, pu.
Definition: user/src/float/userParams.h:164
_USER_Params_::Ls_fineDelta_H
float_t Ls_fineDelta_H
Defines the delta inductance value during the fine stator inductance estimation, H.
Definition: user/src/float/userParams.h:174
_USER_Params_::numVoltageSensors
uint_least8_t numVoltageSensors
Defines the number of voltage sensors.
Definition: fast/src/32b/userParams.h:205
_USER_Params_::Vd_sf
float_t Vd_sf
Defines the Vd scale factor to prevent a Vd only component for the Vdq vector.
Definition: user/src/float/userParams.h:106
_USER_Params_::Rr_fineDelta_Ohm
float_t Rr_fineDelta_Ohm
Defines the delta resistance value during fine rotor resistance estimation, Ohm.
Definition: user/src/float/userParams.h:180
EST_Ls_State_Error
error
Definition: est_Ls_states.h:47
EST_Ls_State_Coarse
the coarse estimation state
Definition: est_Ls_states.h:51
_USER_Params_::offsetPole_rps
float_t offsetPole_rps
Defines the pole location for the voltage and current offset estimation, rad/s.
Definition: fast/src/32b/userParams.h:207
_USER_Params_::RsOnLine_min_Ohm
float_t RsOnLine_min_Ohm
Defines the minimum online stator resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:192
_USER_Params_::maxCurrent_indEst_A
float_t maxCurrent_indEst_A
Defines the maximum current value for inductance estimation, A.
Definition: user/src/float/userParams.h:146
_USER_Params_::trajWaitTime
int_least32_t trajWaitTime[EST_Traj_numStates]
Defines the wait times for each trajectory state, isr ticks.
Definition: user/src/float/userParams.h:131
EST_Traj_State_Est
the trajectory generator parameter estimation state
Definition: est_Traj_states.h:49
EST_State_RampUp
ramp up the speed
Definition: est_states.h:57
_USER_Params_::RsOnLine_max_Ohm
float_t RsOnLine_max_Ohm
Defines the maximum online stator resistance value allowed, Ohm.
Definition: user/src/float/userParams.h:193
_USER_Params_::pwmPeriod_usec
float_t pwmPeriod_usec
Defines the Pulse Width Modulation (PWM) period, usec.
Definition: fast/src/32b/userParams.h:222
CAL_State_Idle
idle state
Definition: cal_states.h:49
CTRL_State_OnLine
the controller online state
Definition: ctrl_states.h:38
_USER_Params_::Kctrl_Wb_p_kgm2
float_t Kctrl_Wb_p_kgm2
Defines the speed controller constant, Wb/(kg*m^2)
Definition: user/src/float/userParams.h:111
_USER_Params_::RsOnLine_DeltaDec_Ohm
float_t RsOnLine_DeltaDec_Ohm
Defines the delta resistance decrement value during online stator resistance estimation, Ohm.
Definition: user/src/float/userParams.h:191
EST_Traj_State_Idle
the trajectory generator idle state
Definition: est_Traj_states.h:48
EST_Rr_State_Error
error
Definition: est_Rr_states.h:36
_USER_Params_::current_sf
float_t current_sf
Defines the current scale factor for the system.
Definition: fast/src/32b/userParams.h:224
_USER_Params_::flag_bypassMotorId
bool flag_bypassMotorId
A flag to bypass motor identification and use the motor parameters.
Definition: user/src/float/userParams.h:198
EST_Flux_State_CL2
closed loop control stage 2
Definition: est_Flux_states.h:51
_USER_Params_::indEst_speedMaxFraction
float_t indEst_speedMaxFraction
Defines the fraction of SpeedMax to use during inductance estimation.
Definition: fast/src/32b/userParams.h:217
_USER_Params_::RsOnLine_angleDelta_rad
float_t RsOnLine_angleDelta_rad
Defines the delta angle value during online stator resistance estimation, rad.
Definition: user/src/float/userParams.h:195
_USER_Params_::IdRatedFraction_indEst
float_t IdRatedFraction_indEst
Defines the fraction of Id rated current to use during inductance estimation.
Definition: fast/src/32b/userParams.h:243
_USER_Params_::dcBusPole_rps
float_t dcBusPole_rps
Defines the pole location for the DC bus filter, rad/s.
Definition: fast/src/32b/userParams.h:215
USER_setParams
void USER_setParams(USER_Params *pUserParams)
Definition: float/user.c:28
_USER_Params_::RsOnLine_DeltaInc_Ohm
float_t RsOnLine_DeltaInc_Ohm
Defines the delta resistance increment value during online stator resistance estimation, Ohm.
Definition: user/src/float/userParams.h:190
_USER_Params_::numCtrlTicksPerSpeedTick
uint_least16_t numCtrlTicksPerSpeedTick
Defines the number of controller clock ticks per speed controller clock tick.
Definition: fast/src/32b/userParams.h:202
_USER_Params_::IdRated_delta_A
float_t IdRated_delta_A
Defines the Id rated delta current value, A.
Definition: user/src/float/userParams.h:151
_USER_Params_::Ls_min_H
float_t Ls_min_H
Defines the minimum stator inductance value allowed, H.
Definition: user/src/float/userParams.h:175
_USER_Params_::Ls_coarseDelta_H
float_t Ls_coarseDelta_H
Defines the delta inductance value during the coarse stator inductance estimation, H.
Definition: user/src/float/userParams.h:173
EST_State_Error
error
Definition: est_states.h:53
EST_Rs_State_Idle
idle
Definition: est_Rs_states.h:38
_USER_Params_::speedPole_rps
float_t speedPole_rps
Defines the pole location for the speed control filter, rad/s.
Definition: fast/src/32b/userParams.h:214
EST_State_Idle
idle
Definition: est_states.h:54
_USER_Params_::numIsrTicksPerCtrlTick
uint_least16_t numIsrTicksPerCtrlTick
Defines the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
Definition: fast/src/32b/userParams.h:199
_USER_Params_::motor_Rr_q_Ohm
float_t motor_Rr_q_Ohm
Defines the quadrature rotor resistance, Ohm.
Definition: user/src/float/userParams.h:91
_USER_Params_::Rs_Ohm
float_t Rs_Ohm
Defines the default stator resistance value, Ohm.
Definition: user/src/float/userParams.h:184
EST_State_RoverL
R/L estimation.
Definition: est_states.h:55
_USER_Params_::motor_ratedFlux_Wb
float_t motor_ratedFlux_Wb
Defines the rated flux of the motor, Wb.
Definition: user/src/float/userParams.h:88
_USER_Params_::Rs_coarseDelta_Ohm
float_t Rs_coarseDelta_Ohm
Defines the delta resistance value during coarse stator resistance estimation, Ohm.
Definition: user/src/float/userParams.h:185
_USER_Params_::ctrlFreq_Hz
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
Definition: fast/src/32b/userParams.h:253
_USER_Params_::motor_Rr_d_Ohm
float_t motor_Rr_d_Ohm
Defines the direct rotor resistance, Ohm.
Definition: user/src/float/userParams.h:90
_USER_Params_::RoverL_min_rps
float_t RoverL_min_rps
Defines the minimum estimated R/L value allowed, rad/sec.
Definition: user/src/float/userParams.h:165
_USER_Params_::numIsrTicksPerTrajTick
int_least16_t numIsrTicksPerTrajTick
Defines the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
Definition: user/src/float/userParams.h:57
EST_Flux_State_CL1
closed loop control stage 1
Definition: est_Flux_states.h:50
_USER_Params_::dcBus_nominal_V
float_t dcBus_nominal_V
Defines the nominal DC bus voltage, V.
Definition: user/src/float/userParams.h:53
_USER_Params_::motor_numPolePairs
uint_least16_t motor_numPolePairs
Defines the number of pole pairs for the motor.
Definition: fast/src/32b/userParams.h:230
EST_Ls_State_Done
the done state
Definition: est_Ls_states.h:53
_USER_Params_::maxCurrentDelta_pw_A
float_t maxCurrentDelta_pw_A
Defines the maximum current delta for Id current trajectory during power warp mode.
Definition: user/src/float/userParams.h:149
_USER_Params_::maxCurrentDelta_A
float_t maxCurrentDelta_A
Defines the maximum current delta for Id current trajectory.
Definition: user/src/float/userParams.h:148
_USER_Params_::motor_Rs_b_Ohm
float_t motor_Rs_b_Ohm
Defines the beta stator resistance, Ohm.
Definition: user/src/float/userParams.h:94
CAL_State_AdcOffset
ADC offset calibration state.
Definition: cal_states.h:50
_USER_Params_::FluxWaitTime
uint_least32_t FluxWaitTime[EST_Flux_numStates]
Defines the wait times for each Ls estimator, estimator ticks.
Definition: fast/src/32b/userParams.h:250
EST_Traj_State_OnLine
the trajectory generator online state
Definition: est_Traj_states.h:50
CAL_State_Done
done state
Definition: cal_states.h:51
_USER_Params_::estFreq_Hz
uint_least32_t estFreq_Hz
Defines the estimator frequency, Hz.
Definition: fast/src/32b/userParams.h:254
_USER_Params_::oneOverDcBus_min_invV
float_t oneOverDcBus_min_invV
Defines the minimum estimated 1/dcBus value allowed, 1/V.
Definition: user/src/float/userParams.h:168
EST_State_Rr
rotor resistance estimation state
Definition: est_states.h:67
_USER_Params_::Rs_fineDelta_Ohm
float_t Rs_fineDelta_Ohm
Defines the delta resistance value during fine stator resistance estimation, Ohm. ...
Definition: user/src/float/userParams.h:186
_USER_Params_::maxCurrent_resEst_A
float_t maxCurrent_resEst_A
Defines the maximum current value for resistance estimation, A.
Definition: user/src/float/userParams.h:145
EST_Flux_State_Fine
fine estimate of flux
Definition: est_Flux_states.h:52
_USER_Params_::IdRated_A
float_t IdRated_A
Defines the Id rated current value, A.
Definition: user/src/float/userParams.h:104
_USER_Params_::RoverL_max_rps
float_t RoverL_max_rps
Defines the maximum estimated R/L value allowed, rad/sec.
Definition: user/src/float/userParams.h:166
_USER_Params_::motor_Ls_d_H
float_t motor_Ls_d_H
Defines the direct stator inductance, H.
Definition: user/src/float/userParams.h:99
_USER_Params_::motor_Ls_q_H
float_t motor_Ls_q_H
Defines the quadrature stator inductance, H.
Definition: user/src/float/userParams.h:100
EST_Rs_State_Error
error
Definition: est_Rs_states.h:37
_USER_Params_::oneOverDcBus_max_invV
float_t oneOverDcBus_max_invV
Defines the maximum estimated 1/dcBus value allowed, 1/V.
Definition: user/src/float/userParams.h:169
_USER_Params_::calWaitTime
int_least32_t calWaitTime[CAL_numStates]
Defines the wait times for each calibrator state, isr ticks.
Definition: user/src/float/userParams.h:117
float_t
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
Definition: types.h:121
_USER_Params_::numIsrTicksPerEstTick
int_least16_t numIsrTicksPerEstTick
Defines the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
Definition: user/src/float/userParams.h:56