MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

user/src/float/userParams.h
Go to the documentation of this file.
1 #ifndef _USERPARAMS_H_
2 #define _USERPARAMS_H_
3
8
9
10 // **************************************************************************
11 // the includes
12
13 // modules
14 #include "sw/modules/types/src/types.h"
15 #include "sw/modules/math/src/float/math.h"
16 #include "sw/modules/motor/src/float/motor.h"
17 #include "sw/modules/cal/src/cal_states.h"
18 #include "sw/modules/ctrl/src/ctrl_states.h"
19 #include "sw/modules/est/src/est_Flux_states.h"
20 #include "sw/modules/est/src/est_Ls_states.h"
21 #include "sw/modules/est/src/est_Rr_states.h"
22 #include "sw/modules/est/src/est_Rs_states.h"
23 #include "sw/modules/est/src/est_Traj_states.h"
24 #include "sw/modules/est/src/est_states.h"
25
26
27 // platforms
28
29
34
35
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41
42 // **************************************************************************
43 // the defines
44
45
46 // **************************************************************************
47 // the typedefs
48
51 typedef struct _USER_Params_
52 {
53 float_t dcBus_nominal_V;
54
55 int_least16_t numIsrTicksPerCtrlTick;
56 int_least16_t numIsrTicksPerEstTick;
57 int_least16_t numIsrTicksPerTrajTick;
58
59 int_least16_t numCtrlTicksPerCurrentTick;
60 int_least16_t numCtrlTicksPerSpeedTick;
61
62 uint_least8_t numCurrentSensors;
63 uint_least8_t numVoltageSensors;
64
65 float_t systemFreq_MHz;
66
67 float_t pwmPeriod_usec;
68
69 float_t voltage_sf;
70
71 float_t current_sf;
72
73 float_t dcBusPole_rps;
74
75 float_t offsetPole_rps;
76
77 float_t speedPole_rps;
78
79 float_t voltageFilterPole_rps;
80
81 float_t maxDutyCycle;
82
83 MOTOR_Type_e motor_type;
84
85 uint_least16_t motor_numPolePairs;
86 uint_least16_t motor_numEncSlots;
87
88 float_t motor_ratedFlux_Wb;
89
90 float_t motor_Rr_d_Ohm;
91 float_t motor_Rr_q_Ohm;
92
93 float_t motor_Rs_a_Ohm;
94 float_t motor_Rs_b_Ohm;
95
96 float_t motor_Rs_d_Ohm;
97 float_t motor_Rs_q_Ohm;
98
99 float_t motor_Ls_d_H;
100 float_t motor_Ls_q_H;
101
102 float_t maxCurrent_A;
103
104 float_t IdRated_A;
105
106 float_t Vd_sf;
107 float_t maxVsMag_V;
108
109 float_t BWc_rps;
110 float_t BWdelta;
111 float_t Kctrl_Wb_p_kgm2;
112
113 float_t angleDelayed_sf_sec;
114
115 float_t fluxExcFreq_Hz;
116
117 int_least32_t calWaitTime[CAL_numStates];
118
119 int_least32_t ctrlWaitTime[CTRL_numStates];
120
121 int_least32_t estWaitTime[EST_numStates];
122
123 int_least32_t FluxWaitTime[EST_Flux_numStates];
124
125 int_least32_t LsWaitTime[EST_Ls_numStates];
126
127 int_least32_t RrWaitTime[EST_Rr_numStates];
128
129 int_least32_t RsWaitTime[EST_Rs_numStates];
130
131 int_least32_t trajWaitTime[EST_Traj_numStates];
132
133 float_t ctrlFreq_Hz;
134
135 float_t estFreq_Hz;
136
137 float_t RoverL_excFreq_Hz;
138
139 float_t trajFreq_Hz;
140
141 float_t ctrlPeriod_sec;
142
143 float_t maxAccel_Hzps;
144
145 float_t maxCurrent_resEst_A;
146 float_t maxCurrent_indEst_A;
147
148 float_t maxCurrentDelta_A;
149 float_t maxCurrentDelta_pw_A;
150
151 float_t IdRated_delta_A;
152
153 float_t forceAngleFreq_Hz;
154
155 float_t indEst_speedMaxFraction;
156
157 float_t IdRatedFraction_indEst;
158
159 float_t pwGain;
160
161 float_t Kp_min_VpA;
162 float_t Kp_max_VpA;
163
164 float_t RoverL_Kp_sf;
165 float_t RoverL_min_rps;
166 float_t RoverL_max_rps;
167
168 float_t oneOverDcBus_min_invV;
169 float_t oneOverDcBus_max_invV;
170
171 float_t Ls_d_H;
172 float_t Ls_q_H;
173 float_t Ls_coarseDelta_H;
174 float_t Ls_fineDelta_H;
175 float_t Ls_min_H;
176 float_t Ls_max_H;
177
178 float_t Rr_Ohm;
179 float_t Rr_coarseDelta_Ohm;
180 float_t Rr_fineDelta_Ohm;
181 float_t Rr_min_Ohm;
182 float_t Rr_max_Ohm;
183
184 float_t Rs_Ohm;
185 float_t Rs_coarseDelta_Ohm;
186 float_t Rs_fineDelta_Ohm;
187 float_t Rs_min_Ohm;
188 float_t Rs_max_Ohm;
189
190 float_t RsOnLine_DeltaInc_Ohm;
191 float_t RsOnLine_DeltaDec_Ohm;
192 float_t RsOnLine_min_Ohm;
193 float_t RsOnLine_max_Ohm;
194
195 float_t RsOnLine_angleDelta_rad;
196 float_t RsOnLine_pole_rps;
197
198 bool flag_bypassMotorId;
199
200 float_t Reserved[20];
201
202 } USER_Params;
203
204
205 // **************************************************************************
206 // the functions
207
208
209 #ifdef __cplusplus
210 }
211 #endif // extern "C"
212
214 #endif // end of _USERPARAMS_H_ definition
215
_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
_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
_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
types.h
Contains the public interface to the types definitions.
_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
_USER_Params_::numCtrlTicksPerSpeedTick
int_least16_t numCtrlTicksPerSpeedTick
Defines the number of controller clock ticks per speed controller clock tick.
Definition: user/src/float/userParams.h:60
est_Flux_states.h
Contains the states for the flux estimator (EST_Flux) module routines.
ctrl_states.h
_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
est_Traj_states.h
Contains the states for the flux estimator (EST_Flux) module routines.
_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
math.h
Contains the public interface to the math (MATH) module routines.
USER_Params
struct _USER_Params_ USER_Params
Defines a structure for the user parameters.
_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
_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
CTRL_numStates
the number of controller states
Definition: ctrl_states.h:39
_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_::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
_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
_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
EST_numStates
the number of estimator states
Definition: est_states.h:70
_USER_Params_::numCurrentSensors
uint_least8_t numCurrentSensors
Defines the number of current sensors.
Definition: fast/src/32b/userParams.h:204
_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
est_states.h
Contains the states for the estimator (EST) module routines.
_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
_USER_Params_::Rr_Ohm
float_t Rr_Ohm
Defines the default rotor resistance value, Ohm.
Definition: user/src/float/userParams.h:178
est_Ls_states.h
Contains the states for the stator inductance estimator (EST_Ls) module routines. ...
_USER_Params_::voltageFilterPole_rps
float_t voltageFilterPole_rps
Defines the analog voltage filter pole location, rad/s.
Definition: fast/src/32b/userParams.h:225
_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
_USER_Params_::maxVsMag_V
float_t maxVsMag_V
Defines the maximum stator voltage magnitude, V.
Definition: user/src/float/userParams.h:107
_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
_USER_Params_::numCtrlTicksPerCurrentTick
int_least16_t numCtrlTicksPerCurrentTick
Defines the number of controller clock ticks per current controller clock tick.
Definition: user/src/float/userParams.h:59
MOTOR_Type_e
MOTOR_Type_e
Enumeration for the motor types.
Definition: 32b/motor.h:71
_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_::ctrlFreq_Hz
float_t ctrlFreq_Hz
Defines the controller frequency, Hz.
Definition: user/src/float/userParams.h:133
_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
_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_::Reserved
float_t Reserved[20]
Reserved Section.
Definition: user/src/float/userParams.h:200
_USER_Params_::maxDutyCycle
float_t maxDutyCycle
Defines the maximum duty cycle.
Definition: user/src/float/userParams.h:81
_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_numStates
the number of stator inductance estimator states
Definition: est_Ls_states.h:54
_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
_USER_Params_::trajFreq_Hz
float_t trajFreq_Hz
Defines the trajectory frequency, Hz.
Definition: user/src/float/userParams.h:139
_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
_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
_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_Rr_numStates
the number of stator resistance estimator states
Definition: est_Rr_states.h:42
_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_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
est_Rr_states.h
Contains the public interface to the rotor resistance estimator (EST_Rr) module routines.
_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_Rs_states.h
Contains the public interface to the stator resistance estimator (EST_Rs) module routines.
_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
_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
_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
EST_Traj_numStates
the number of trajectory generator states
Definition: est_Traj_states.h:51
_USER_Params_::estFreq_Hz
float_t estFreq_Hz
Defines the estimator frequency, Hz.
Definition: user/src/float/userParams.h:135
_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
_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
_USER_Params_::numIsrTicksPerCtrlTick
int_least16_t numIsrTicksPerCtrlTick
Defines the number of Interrupt Service Routine (ISR) clock ticks per controller clock tick...
Definition: user/src/float/userParams.h:55
_USER_Params_::systemFreq_MHz
float_t systemFreq_MHz
Defines the system clock frequency, MHz.
Definition: user/src/float/userParams.h:65
_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
_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
cal_states.h
Contains the public interface to the calibration (CAL) module routines.
_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
_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
motor.h
_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_Rs_numStates
the number of stator resistance estimator states
Definition: est_Rs_states.h:43
_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
CAL_numStates
the total number of states
Definition: cal_states.h:52
_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_Flux_numStates
the number of flux estimator states
Definition: est_Flux_states.h:54
_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