MotorWare f2806x Module API Documentation
fast/src/32b/userParams.h
Go to the documentation of this file.
1 #ifndef _USERPARAMS_H_
2 #define _USERPARAMS_H_
3 /* --COPYRIGHT--,BSD
4  * Copyright (c) 2012, Texas Instruments Incorporated
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  *
14  * * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  *
18  * * Neither the name of Texas Instruments Incorporated nor the names of
19  * its contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
24  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
26  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  * --/COPYRIGHT--*/
34 
39 
40 
41 // **************************************************************************
42 // the includes
43 
44 // modules
47 
52 
54 
55 
60 
61 
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
67 
68 // **************************************************************************
69 // the defines
70 
71 
72 
73 
74 // **************************************************************************
75 // the typedefs
76 
79 typedef enum
80 {
189 
190 
193 typedef struct _USER_Params_
194 {
198 
199  uint_least16_t numIsrTicksPerCtrlTick;
200  uint_least16_t numCtrlTicksPerCurrentTick;
201  uint_least16_t numCtrlTicksPerEstTick;
202  uint_least16_t numCtrlTicksPerSpeedTick;
203  uint_least16_t numCtrlTicksPerTrajTick;
204  uint_least8_t numCurrentSensors;
205  uint_least8_t numVoltageSensors;
206 
219 
220  uint_least16_t systemFreq_MHz;
221 
228 
230  uint_least16_t motor_numPolePairs;
231 
247 
248  uint_least32_t ctrlWaitTime[CTRL_numStates];
249  uint_least32_t estWaitTime[EST_numStates];
251  uint_least32_t LsWaitTime[EST_Ls_numStates];
252  uint_least32_t RsWaitTime[EST_Rs_numStates];
253  uint_least32_t ctrlFreq_Hz;
254  uint_least32_t estFreq_Hz;
255  uint_least32_t RoverL_estFreq_Hz;
256  uint_least32_t trajFreq_Hz;
257 
259 
261 
263 } USER_Params;
264 
265 
266 // **************************************************************************
267 // the functions
268 
269 
270 #ifdef __cplusplus
271 }
272 #endif // extern "C"
273 
275 #endif // end of _USERPARAMS_H_ definition
RoverL_estFreq_Hz too low error code.
motor_Rs too high error code
ctrlFreq_Hz too high error code
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.
float_t forceAngleFreq_Hz
Defines the force angle frequency, Hz.
motor_numPolePairs too low error code
numCtrlTicksPerSpeedTick too high 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.
uint_least32_t estWaitTime[EST_numStates]
Defines the wait times for each estimator state, estimator ticks.
Contains the public interface to the types definitions.
systemFreq_MHz too low error code
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
Contains the states for the flux estimator (EST_Flux) module routines.
numIsrTicksPerCtrlTick too high error code
powerWarpGain too low error code
maxAccel_Hzps too low error code
float_t motor_Rr
Defines the rotor resistance, ohm.
struct _USER_Params_ USER_Params
Defines a structure for the user parameters.
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.
the number of controller states
Definition: ctrl_states.h:39
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
uint_least32_t LsWaitTime[EST_Ls_numStates]
Defines the wait times for each Ls estimator, estimator ticks.
forceAngleFreq_Hz too low error code
iqFullScaleVoltage_V too low error code
numCtrlTicksPerCurrentTick too high error code
uint_least32_t ctrlWaitTime[CTRL_numStates]
Defines the wait times for each controller state, estimator ticks.
Defines a structure for the user parameters.
the number of estimator states
Definition: est_states.h:70
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
ctrlPeriod_sec too high error code
uint_least32_t RoverL_estFreq_Hz
Defines the R/L estimation frequency, Hz.
float_t powerWarpGain
Defines the PowerWarp gain for computing Id reference.
numCtrlTicksPerCurrentTick too low error code
float_t maxCurrent
Defines the maximum current value, A.
directionPole_rps too low error code
uint_least16_t numCtrlTicksPerCurrentTick
Defines the number of controller clock ticks per current controller clock tick.
iqFullScaleFreq_Hz too high error code
Contains the states for the estimator (EST) module routines.
IdRated_delta too high error code.
IdRatedFraction_indEst too low error code.
motor_Ls_q too low error code
Contains the states for the stator inductance estimator (EST_Ls) module routines. ...
maxAccel_est_Hzps too high error code
numPwmTicksPerIsrTick too high error code
float_t voltageFilterPole_rps
Defines the analog voltage filter pole location, rad/s.
current_sf too high error code
numCtrlTicksPerEstTick too low error code
motor_Rr too high error code
speedPole_rps too high error code
numCtrlTicksPerTrajTick too low error code
ctrlPeriod_sec too low error code
directionPole_rps too high error code
float_t directionPole_rps
Defines the pole location for the direction filter, rad/s.
MOTOR_Type_e
Enumeration for the motor types.
Definition: 32b/motor.h:71
forceAngleFreq_Hz too high error code
MOTOR_Type_e motor_type
Defines the motor type.
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
uint_least32_t trajFreq_Hz
Defines the trajectory frequency, Hz.
maxVsMag_pu too high error code
uint_least8_t numVoltageSensors
Defines the number of voltage sensors.
the number of stator inductance estimator states
Definition: est_Ls_states.h:54
fluxEstFreq_Hz too low error code
numCtrlTicksPerTrajTick too high error code
the number of user error codes
estFreq_Hz too low error code
dcBusPole_rps too high error code
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.
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
iqFullScaleCurrent_A too low error code
dcBusPole_rps too low error code
float_t indEst_speedMaxFraction
Defines the fraction of SpeedMax to use during inductance estimation.
float_t fluxEstFreq_Hz
Defines the flux estimation frequency, Hz.
float_t IdRatedFraction_indEst
Defines the fraction of Id rated current to use during inductance estimation.
IdRatedFraction_indEst too high error code.
fluxEstFreq_Hz too high error code
float_t dcBusPole_rps
Defines the pole location for the DC bus filter, rad/s.
IdRated too low error code.
uint_least16_t numCtrlTicksPerTrajTick
Defines the number of controller clock ticks per trajectory clock tick.
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.
trajFreq_Hz too high error code
numPwmTicksPerIsrTick too low error code
maxCurrentSlope too high error code
Contains the public interface to the stator resistance estimator (EST_Rs) module routines.
float_t maxCurrentSlope
Defines the maximum current slope for Id current trajectory.
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.
voltage_sf too high error code
maxCurrent_indEst too high error code
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
numVoltageSensors too low error code
maxVsMag_pu too low error code
indEst_speedMaxFraction too low error code
numCtrlTicksPerEstTick too high error code
uint_least16_t motor_numPolePairs
Defines the number of pole pairs for the motor.
motor_numPolePairs too high error code
estKappa too low error code
uint_least16_t numCtrlTicksPerEstTick
Defines the number of controller clock ticks per estimator clock tick.
iqFullScaleCurrent_A too high error code
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
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
the number of stator resistance estimator states
Definition: est_Rs_states.h:43
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
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
the number of flux estimator states
float_t iqFullScaleFreq_Hz
Defines the full scale frequency for IQ variable, Hz.
iqFullScaleFreq_Hz too low error code
zeroSpeedLimit too high error code
estFreq_Hz too high error code
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
Definition: types.h:121
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.