MotorWare f2806x Module API Documentation

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

user/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
45 #include "sw/modules/types/src/types.h"
46
47
52
53
54
55 #ifdef __cplusplus
56 extern "C" {
57 #endif
58
59
60
61
62 // **************************************************************************
63 // the typedefs
64
67 typedef struct _USER_Params_
68 {
69 float_t iqFullScaleCurrent_A;
70 float_t iqFullScaleVoltage_V;
71 float_t iqFullScaleFreq_Hz;
72
73 uint_least16_t numIsrTicksPerCtrlTick;
74 uint_least16_t numCtrlTicksPerCurrentTick;
75 uint_least16_t numCtrlTicksPerEstTick;
76 uint_least16_t numCtrlTicksPerSpeedTick;
77 uint_least16_t numCtrlTicksPerTrajTick;
78 uint_least8_t numCurrentSensors;
79 uint_least8_t numVoltageSensors;
80
81 float_t offsetPole_rps;
82 float_t fluxPole_rps;
83 float_t zeroSpeedLimit;
84 float_t forceAngleFreq_Hz;
85 float_t maxAccel_Hzps;
86 float_t maxAccel_est_Hzps;
87 float_t directionPole_rps;
88 float_t speedPole_rps;
89 float_t dcBusPole_rps;
90 float_t fluxFraction;
91 float_t indEst_speedMaxFraction;
92 float_t eplGain;
93
94 uint_least16_t systemFreq_MHz;
95
96 float_t pwmPeriod_usec;
97 float_t voltage_sf;
98 float_t current_sf;
99 float_t voltageFilterPole_rps;
100 float_t maxVsMag_pu;
101 float_t estKappa;
102
103 MOTOR_Type_e motor_type;
104 uint_least16_t motor_numPolePairs;
105
106 float_t motor_ratedFlux;
107 float_t motor_Rr;
108 float_t motor_Rs;
109 float_t motor_Ls_d;
110 float_t motor_Ls_q;
111 float_t maxCurrent;
112 float_t maxCurrent_resEst;
113 float_t maxCurrent_indEst;
114 float_t maxCurrentSlope;
115 float_t maxCurrentSlope_epl;
116 float_t IdRated;
117 float_t IdRatedFraction_indEst;
118 float_t IdRatedFraction_ratedFlux;
119 float_t IdRated_delta;
120 float_t fluxEstFreq_Hz;
121
122 uint_least32_t ctrlWaitTime[CTRL_numStates];
123 uint_least32_t estWaitTime[EST_numStates];
124 uint_least32_t FluxWaitTime[EST_Flux_numStates];
125 uint_least32_t LsWaitTime[EST_Ls_numStates];
126 uint_least32_t RsWaitTime[EST_Rs_numStates];
127 uint_least32_t ctrlFreq_Hz;
128 uint_least32_t estFreq_Hz;
129 uint_least32_t RoverL_estFreq_Hz;
130 uint_least32_t trajFreq_Hz;
131
132 float_t ctrlPeriod_sec;
133
134 float_t maxNegativeIdCurrent_a;
135 } USER_Params;
136
137
138 #ifdef __cplusplus
139 }
140 #endif // extern "C"
141
143 #endif // end of _USERPARAMS_H_ definition
_USER_Params_::iqFullScaleVoltage_V
float_t iqFullScaleVoltage_V
Defines the full scale voltage for the IQ variable, V.
Definition: fast/src/32b/userParams.h:196
_USER_Params_::fluxPole_rps
float_t fluxPole_rps
Defines the pole location for the flux estimation, rad/s.
Definition: fast/src/32b/userParams.h:208
_USER_Params_::fluxFraction
float_t fluxFraction
Defines the flux fraction for Id rated current estimation.
Definition: fast/src/32b/userParams.h:216
_USER_Params_::forceAngleFreq_Hz
float_t forceAngleFreq_Hz
Defines the force angle frequency, Hz.
Definition: fast/src/32b/userParams.h:210
_USER_Params_::motor_Ls_q
float_t motor_Ls_q
Defines the quadrature stator inductance, H.
Definition: fast/src/32b/userParams.h:236
_USER_Params_::IdRated_delta
float_t IdRated_delta
Defines the Id rated delta current value, A.
Definition: fast/src/32b/userParams.h:245
_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_::iqFullScaleCurrent_A
float_t iqFullScaleCurrent_A
Defines the full scale current for the IQ variables, A.
Definition: fast/src/32b/userParams.h:195
_USER_Params_::IdRated
float_t IdRated
Defines the Id rated current value, A.
Definition: fast/src/32b/userParams.h:242
_USER_Params_::maxCurrentSlope_epl
float_t maxCurrentSlope_epl
Defines the maximum current slope for Id current trajectory during EPL mode.
Definition: user/src/32b/userParams.h:115
_USER_Params_::motor_Rr
float_t motor_Rr
Defines the rotor resistance, ohm.
Definition: fast/src/32b/userParams.h:233
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_::maxNegativeIdCurrent_a
float_t maxNegativeIdCurrent_a
Defines the maximum negative current that the Id PID is allowed to go to, A.
Definition: fast/src/32b/userParams.h:260
CTRL_numStates
the number of controller states
Definition: ctrl_states.h:39
_USER_Params_::ctrlPeriod_sec
float_t ctrlPeriod_sec
Defines the controller execution period, sec.
Definition: fast/src/32b/userParams.h:258
_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_::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_
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_::IdRatedFraction_ratedFlux
float_t IdRatedFraction_ratedFlux
Defines the fraction of Id rated current to use during rated flux estimation.
Definition: fast/src/32b/userParams.h:244
_USER_Params_::RoverL_estFreq_Hz
uint_least32_t RoverL_estFreq_Hz
Defines the R/L estimation frequency, Hz.
Definition: fast/src/32b/userParams.h:255
_USER_Params_::maxCurrent
float_t maxCurrent
Defines the maximum current value, A.
Definition: fast/src/32b/userParams.h:237
_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_::voltageFilterPole_rps
float_t voltageFilterPole_rps
Defines the analog voltage filter pole location, rad/s.
Definition: fast/src/32b/userParams.h:225
_USER_Params_::directionPole_rps
float_t directionPole_rps
Defines the pole location for the direction filter, rad/s.
Definition: fast/src/32b/userParams.h:213
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_::voltage_sf
float_t voltage_sf
Defines the voltage scale factor for the system.
Definition: fast/src/32b/userParams.h:223
_USER_Params_::trajFreq_Hz
uint_least32_t trajFreq_Hz
Defines the trajectory frequency, Hz.
Definition: fast/src/32b/userParams.h:256
_USER_Params_::numVoltageSensors
uint_least8_t numVoltageSensors
Defines the number of voltage sensors.
Definition: fast/src/32b/userParams.h:205
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_::pwmPeriod_usec
float_t pwmPeriod_usec
Defines the Pulse Width Modulation (PWM) period, usec.
Definition: fast/src/32b/userParams.h:222
_USER_Params_::zeroSpeedLimit
float_t zeroSpeedLimit
Defines the low speed limit for the flux integrator, pu.
Definition: fast/src/32b/userParams.h:209
_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_::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_::fluxEstFreq_Hz
float_t fluxEstFreq_Hz
Defines the flux estimation frequency, Hz.
Definition: fast/src/32b/userParams.h:246
_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_::numCtrlTicksPerTrajTick
uint_least16_t numCtrlTicksPerTrajTick
Defines the number of controller clock ticks per trajectory clock tick.
Definition: fast/src/32b/userParams.h:203
_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_::maxCurrent_indEst
float_t maxCurrent_indEst
Defines the maximum current value for inductance estimation, A.
Definition: fast/src/32b/userParams.h:239
_USER_Params_::maxCurrentSlope
float_t maxCurrentSlope
Defines the maximum current slope for Id current trajectory.
Definition: fast/src/32b/userParams.h:240
_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_Rs
float_t motor_Rs
Defines the stator resistance, ohm.
Definition: fast/src/32b/userParams.h:234
_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_::ctrlFreq_Hz
uint_least32_t ctrlFreq_Hz
Defines the controller frequency, Hz.
Definition: fast/src/32b/userParams.h:253
_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_::numCtrlTicksPerEstTick
uint_least16_t numCtrlTicksPerEstTick
Defines the number of controller clock ticks per estimator clock tick.
Definition: fast/src/32b/userParams.h:201
_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
_USER_Params_::maxAccel_est_Hzps
float_t maxAccel_est_Hzps
Defines the maximum acceleration for the estimation speed profiles, Hz/s.
Definition: fast/src/32b/userParams.h:212
_USER_Params_::estFreq_Hz
uint_least32_t estFreq_Hz
Defines the estimator frequency, Hz.
Definition: fast/src/32b/userParams.h:254
EST_Rs_numStates
the number of stator resistance estimator states
Definition: est_Rs_states.h:43
_USER_Params_::estKappa
float_t estKappa
Defines the convergence factor for the estimator.
Definition: fast/src/32b/userParams.h:227
EST_Flux_numStates
the number of flux estimator states
Definition: est_Flux_states.h:54
_USER_Params_::iqFullScaleFreq_Hz
float_t iqFullScaleFreq_Hz
Defines the full scale frequency for IQ variable, Hz.
Definition: fast/src/32b/userParams.h:197
float_t
float float_t
Defines the portable data type for 32 bit, signed floating-point data.
Definition: types.h:121
_USER_Params_::motor_Ls_d
float_t motor_Ls_d
Defines the direct stator inductance, H.
Definition: fast/src/32b/userParams.h:235
_USER_Params_::eplGain
float_t eplGain
Defines the EPL (Efficient Partial Load) gain for computing Id reference.
Definition: user/src/32b/userParams.h:92
_USER_Params_::maxCurrent_resEst
float_t maxCurrent_resEst
Defines the maximum current value for resistance estimation, A.
Definition: fast/src/32b/userParams.h:238
_USER_Params_::motor_ratedFlux
float_t motor_ratedFlux
Defines the rated flux of the motor, V/Hz.
Definition: fast/src/32b/userParams.h:232
_USER_Params_::maxVsMag_pu
float_t maxVsMag_pu
Defines the maximum voltage magnitude, pu.
Definition: fast/src/32b/userParams.h:226