include/userParams.h
Go to the documentation of this file.
1 //#############################################################################
2 //
3 // FILE: userParams.h
4 //
5 // TITLE: C28x InstaSPIN public interface for user initialization data for the
6 // CTRL, DRV, and EST modules (floating point)
7 //
8 //#############################################################################
9 // $TI Release: MotorControl SDK v1.00.00.00 $
10 // $Release Date: Mon Mar 11 18:37:40 CDT 2019 $
11 // $Copyright:
12 // Copyright (C) 2017-2018 Texas Instruments Incorporated - http://www.ti.com/
13 //
14 // Redistribution and use in source and binary forms, with or without
15 // modification, are permitted provided that the following conditions
16 // are met:
17 //
18 // Redistributions of source code must retain the above copyright
19 // notice, this list of conditions and the following disclaimer.
20 //
21 // Redistributions in binary form must reproduce the above copyright
22 // notice, this list of conditions and the following disclaimer in the
23 // documentation and/or other materials provided with the
24 // distribution.
25 //
26 // Neither the name of Texas Instruments Incorporated nor the names of
27 // its contributors may be used to endorse or promote products derived
28 // from this software without specific prior written permission.
29 //
30 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
33 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
36 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
37 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
38 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
39 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 // $
42 //#############################################################################
43 
44 #ifndef USERPARAMS_H
45 #define USERPARAMS_H
46 
47 //
48 //*****************************************************************************
49 //
50 // If building with a C++ compiler, make all of the definitions in this header
51 // have a C binding.
52 //
53 //*****************************************************************************
54 #ifdef __cplusplus
55 extern "C"
56 {
57 #endif
58 
59 //*****************************************************************************
60 //
63 //
64 //*****************************************************************************
65 
67 
68 #include "motor.h"
69 
70 #include "ctrl_states.h"
71 
72 #include "est_Flux_states.h"
73 #include "est_Ls_states.h"
74 #include "est_Rr_states.h"
75 #include "est_Rs_states.h"
76 #include "est_Traj_states.h"
77 #include "est_states.h"
78 
79 
80 // **************************************************************************
81 // the defines
82 
83 
86 typedef enum
87 {
88  MTR_1 = 0,
89  MTR_2 = 1,
90  MTR_3 = 2,
91 } MotorNum_e;
92 
93 //*****************************************************************************
94 //
96 //
97 //*****************************************************************************
98 typedef struct _USER_Params_
99 {
101  int_least16_t numIsrTicksPerCtrlTick;
106  int_least16_t numIsrTicksPerEstTick;
110  int_least16_t numIsrTicksPerTrajTick;
122  uint_least8_t numCurrentSensors;
123  uint_least8_t numVoltageSensors;
147  uint16_t motor_numEncSlots;
172  float32_t Vd_sf;
188  int_least32_t calReserved[4];
190  int_least32_t ctrlWaitTime[CTRL_NUMSTATES];
193  int_least32_t estWaitTime[EST_NUMSTATES];
199  int_least32_t LsWaitTime[EST_LS_NUMSTATES];
202  int_least32_t RrWaitTime[EST_RR_NUMSTATES];
205  int_least32_t RsWaitTime[EST_RS_NUMSTATES];
240  float32_t pwGain;
257  float32_t Ls_d_H;
259  float32_t Ls_q_H;
273  float32_t Rr_Ohm;
285  float32_t Rs_Ohm;
312  bool flag_bypassMotorId;
315  // *******************************************************************************************************
318  // BELOW IS RESERVED
325 
329 
336 
337  // BELOW can be added user own varaibles
339 } USER_Params;
341 
342 
346 
347 // **************************************************************************
348 // the functions
351 extern void USER_setParams_priv(USER_Params *pUserParams);
352 
353 //*****************************************************************************
354 //
355 // Close the Doxygen group.
357 //
358 //*****************************************************************************
359 
360 //*****************************************************************************
361 //
362 // Mark the end of the C bindings section for C++ compilers.
363 //
364 //*****************************************************************************
365 #ifdef __cplusplus
366 }
367 #endif
368 
369 #endif // end of USERPARAMS_H definition
_USER_Params_::motor_Rs_a_Ohm
float32_t motor_Rs_a_Ohm
resistance, Ohm
Definition: include/userParams.h:157
_USER_Params_::IdRated_A
float32_t IdRated_A
value, A
Definition: include/userParams.h:171
est_Flux_states.h
Contains the states for the flux estimator (EST_Flux) module routines.
_USER_Params_::Ls_coarseDelta_H
float32_t Ls_coarseDelta_H
Definition: include/userParams.h:264
_USER_Params_::estKappa
float32_t estKappa
Definition: include/userParams.h:324
_USER_Params_::forceAngleFreq_Hz
float32_t forceAngleFreq_Hz
frequency, Hz
Definition: include/userParams.h:234
_USER_Params_::RoverL_min_rps
float32_t RoverL_min_rps
value allowed, rad/sec
Definition: include/userParams.h:250
_USER_Params_::Rr_Ohm
float32_t Rr_Ohm
resistance value, Ohm
Definition: include/userParams.h:274
_USER_Params_::motor_ratedFlux_Wb
float32_t motor_ratedFlux_Wb
motor, Wb
Definition: include/userParams.h:151
_USER_Params_::Ls_d_H
float32_t Ls_d_H
Definition: include/userParams.h:258
MOTOR_Type_e
MOTOR_Type_e
Enumeration for the motor types.
Definition: include/motor.h:78
_USER_Params_::Dir_fe_max_Hz
float32_t Dir_fe_max_Hz
Definition: include/userParams.h:333
_USER_Params_::numIsrTicksPerTrajTick
int_least16_t numIsrTicksPerTrajTick
Definition: include/userParams.h:110
float32_t
float float32_t
Definition: sfra_f32.h:42
_USER_Params_::pwmPeriod_usec
float32_t pwmPeriod_usec
(PWM) period, usec
Definition: include/userParams.h:128
_USER_Params_::LsWaitTime
int_least32_t LsWaitTime[EST_LS_NUMSTATES]
Definition: include/userParams.h:199
_USER_Params_::Kctrl_Wb_p_kgm2
float32_t Kctrl_Wb_p_kgm2
constant, Wb/(kg*m^2)
Definition: include/userParams.h:182
_USER_Params_::oneOverFlux_min_sf
float32_t oneOverFlux_min_sf
Definition: include/userParams.h:330
_USER_Params_::FluxWaitTime
int_least32_t FluxWaitTime[EST_FLUX_NUMSTATES]
Definition: include/userParams.h:196
_USER_Params_::Rs_coarseDelta_Ohm
float32_t Rs_coarseDelta_Ohm
Definition: include/userParams.h:288
_USER_Params_::dcBusPole_rps
float32_t dcBusPole_rps
DC bus filter, rad/sec.
Definition: include/userParams.h:134
_USER_Params_::Ls_fineDelta_H
float32_t Ls_fineDelta_H
Definition: include/userParams.h:267
_USER_Params_::voltageFilterPole_rps
float32_t voltageFilterPole_rps
pole location, rad/sec
Definition: include/userParams.h:141
_USER_Params_::trajFreq_Hz
float32_t trajFreq_Hz
Hz.
Definition: include/userParams.h:217
_USER_Params_::directionPole_rps
float32_t directionPole_rps
Definition: include/userParams.h:320
_USER_Params_::RsOnLine_DeltaInc_Ohm
float32_t RsOnLine_DeltaInc_Ohm
Definition: include/userParams.h:298
_USER_Params_::motor_Rs_q_Ohm
float32_t motor_Rs_q_Ohm
resistance, Ohm
Definition: include/userParams.h:163
_USER_Params_::Rs_max_Ohm
float32_t Rs_max_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:296
_USER_Params_::RsOnLine_angleDelta_rad
float32_t RsOnLine_angleDelta_rad
Definition: include/userParams.h:308
_USER_Params_::estWaitTime
int_least32_t estWaitTime[EST_NUMSTATES]
Definition: include/userParams.h:193
_USER_Params_::freqNearZeroSpeedLimit_Hz
float32_t freqNearZeroSpeedLimit_Hz
Definition: include/userParams.h:319
_USER_Params_::trajWaitTime
int_least32_t trajWaitTime[EST_TRAJ_NUMSTATES]
Definition: include/userParams.h:208
_USER_Params_::directionPole_2_rps
float32_t directionPole_2_rps
Definition: include/userParams.h:321
USER_setParams_priv
void USER_setParams_priv(USER_Params *pUserParams)
Sets the private user parameter values.
_USER_Params_::RoverL_excFreq_Hz
float32_t RoverL_excFreq_Hz
frequency, Hz
Definition: include/userParams.h:215
_USER_Params_::pwGain
float32_t pwGain
computing Id reference
Definition: include/userParams.h:242
_USER_Params_::Rr_max_Ohm
float32_t Rr_max_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:284
_USER_Params_::maxCurrent_A
float32_t maxCurrent_A
A.
Definition: include/userParams.h:169
_USER_Params_::ctrlPeriod_sec
float32_t ctrlPeriod_sec
period, sec
Definition: include/userParams.h:219
EST_RR_NUMSTATES
number of stator resistance estimator states
Definition: include/est_Rr_states.h:77
_USER_Params_::motor_Rr_d_Ohm
float32_t motor_Rr_d_Ohm
resistance, Ohm
Definition: include/userParams.h:153
_USER_Params_::Ls_min_H
float32_t Ls_min_H
inductance value allowed, H
Definition: include/userParams.h:270
motor.h
_USER_Params_::maxCurrentDelta_A
float32_t maxCurrentDelta_A
for Id current trajectory
Definition: include/userParams.h:227
_USER_Params_::maxAccel_Hzps
float32_t maxAccel_Hzps
for the speed profiles, Hz/sec
Definition: include/userParams.h:221
_USER_Params_::oneOverFlux_max_sf
float32_t oneOverFlux_max_sf
Definition: include/userParams.h:331
math.h
_USER_Params_::Vd_sf
float32_t Vd_sf
Definition: include/userParams.h:173
_USER_Params_::Kp_max_VpA
float32_t Kp_max_VpA
the current controller, V/A
Definition: include/userParams.h:246
_USER_Params_::angleDelayed_sf_sec
float32_t angleDelayed_sf_sec
Definition: include/userParams.h:184
_USER_Params_::motor_Ls_d_H
float32_t motor_Ls_d_H
inductance, H
Definition: include/userParams.h:165
EST_RS_NUMSTATES
number of stator resistance estimator states
Definition: include/est_Rs_states.h:78
_USER_Params_::voltage_sf
float32_t voltage_sf
for the system
Definition: include/userParams.h:130
_USER_Params_::numCtrlTicksPerSpeedTick
int_least16_t numCtrlTicksPerSpeedTick
Definition: include/userParams.h:118
est_Rs_states.h
Contains the public interface to the stator resistance estimator (EST_Rs) module routines.
_USER_Params_::oneOverDcBus_min_invV
float32_t oneOverDcBus_min_invV
1/dcBus value allowed, 1/V
Definition: include/userParams.h:254
EST_LS_NUMSTATES
number of stator inductance estimator states
Definition: include/est_Ls_states.h:89
_USER_Params_::maxFrequency_Hz
float32_t maxFrequency_Hz
Definition: include/userParams.h:338
_USER_Params_::maxCurrent_resEst_A
float32_t maxCurrent_resEst_A
for resistance estimation, A
Definition: include/userParams.h:223
_USER_Params_::RsWaitTime
int_least32_t RsWaitTime[EST_RS_NUMSTATES]
Definition: include/userParams.h:205
_USER_Params_::maxCurrent_indEst_A
float32_t maxCurrent_indEst_A
for inductance estimation, A
Definition: include/userParams.h:225
EST_FLUX_NUMSTATES
the number of flux estimator states
Definition: include/est_Flux_states.h:89
_USER_Params_::flux_Wb
float32_t flux_Wb
Definition: include/userParams.h:326
_USER_Params_::Rr_fineDelta_Ohm
float32_t Rr_fineDelta_Ohm
Definition: include/userParams.h:279
_USER_Params_::fluxExcFreq_Hz
float32_t fluxExcFreq_Hz
frequency, Hz
Definition: include/userParams.h:187
_USER_Params_::Dir_fe_min_Hz
float32_t Dir_fe_min_Hz
Definition: include/userParams.h:332
_USER_Params_::RsOnLine_DeltaDec_Ohm
float32_t RsOnLine_DeltaDec_Ohm
Definition: include/userParams.h:301
_USER_Params_::Rs_fineDelta_Ohm
float32_t Rs_fineDelta_Ohm
Definition: include/userParams.h:291
_USER_Params_::numIsrTicksPerCtrlTick
int_least16_t numIsrTicksPerCtrlTick
Definition: include/userParams.h:102
_USER_Params_::Rr_min_Ohm
float32_t Rr_min_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:282
_USER_Params_::motor_Rr_q_Ohm
float32_t motor_Rr_q_Ohm
resistance, Ohm
Definition: include/userParams.h:155
_USER_Params_::motor_Rs_b_Ohm
float32_t motor_Rs_b_Ohm
resistance, Ohm
Definition: include/userParams.h:159
_USER_Params_::current_sf
float32_t current_sf
for the system
Definition: include/userParams.h:132
ctrl_states.h
_USER_Params_::numCurrentSensors
uint_least8_t numCurrentSensors
Definition: include/userParams.h:122
_USER_Params_::ctrlFreq_Hz
float32_t ctrlFreq_Hz
Hz.
Definition: include/userParams.h:211
_USER_Params_::Ls_q_H
float32_t Ls_q_H
Definition: include/userParams.h:261
_USER_Params_::motor_numPolePairs
uint16_t motor_numPolePairs
Definition: include/userParams.h:146
est_Traj_states.h
Contains the states for the flux estimator (EST_Flux) module routines.
_USER_Params_::Rs_Ohm
float32_t Rs_Ohm
resistance value, Ohm
Definition: include/userParams.h:286
_USER_Params_::numVoltageSensors
uint_least8_t numVoltageSensors
Definition: include/userParams.h:124
_USER_Params_::RoverL_max_rps
float32_t RoverL_max_rps
value allowed, rad/sec
Definition: include/userParams.h:252
_USER_Params_::RsOnLine_min_Ohm
float32_t RsOnLine_min_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:304
MTR_1
Definition: include/userParams.h:88
CTRL_NUMSTATES
the number of controller states
Definition: ctrl_states.h:86
_USER_Params_::numIsrTicksPerEstTick
int_least16_t numIsrTicksPerEstTick
Definition: include/userParams.h:106
_USER_Params_::Ls_max_H
float32_t Ls_max_H
inductance value allowed, H
Definition: include/userParams.h:272
_USER_Params_::oneOverDcBus_max_invV
float32_t oneOverDcBus_max_invV
1/dcBus value allowed, 1/V
Definition: include/userParams.h:256
_USER_Params_::Reserved01
float32_t Reserved01
14.
Definition: include/userParams.h:334
est_Rr_states.h
Contains the public interface to the rotor resistance estimator (EST_Rr) module routines.
_USER_Params_::offsetPole_rps
float32_t offsetPole_rps
Definition: include/userParams.h:136
_USER_Params_::motor_Rs_d_Ohm
float32_t motor_Rs_d_Ohm
resistance, Ohm
Definition: include/userParams.h:161
_USER_Params_::maxVsMag_V
float32_t maxVsMag_V
magnitude, V
Definition: include/userParams.h:176
est_Ls_states.h
Contains the states for the stator inductance estimator (EST_Ls) module routines.
_USER_Params_::IdRatedFraction_indEst
float32_t IdRatedFraction_indEst
Definition: include/userParams.h:239
_USER_Params_::RoverL_Kp_sf
float32_t RoverL_Kp_sf
during R/L, pu
Definition: include/userParams.h:248
MotorNum_e
MotorNum_e
Enumeration for the Motor numbers.
Definition: include/userParams.h:86
userParams_Handle
struct _USER_Params_ * userParams_Handle
Defines the USER_Params handle.
Definition: include/userParams.h:345
_USER_Params_::motor_numEncSlots
uint16_t motor_numEncSlots
Definition: include/userParams.h:148
_USER_Params_::maxVsMag_pu
float32_t maxVsMag_pu
Definition: include/userParams.h:143
_USER_Params_::calReserved
int_least32_t calReserved[4]
Reserved space.
Definition: include/userParams.h:189
MTR_2
Definition: include/userParams.h:89
EST_NUMSTATES
the number of estimator states
Definition: include/est_states.h:141
_USER_Params_::numCtrlTicksPerCurrentTick
int_least16_t numCtrlTicksPerCurrentTick
Definition: include/userParams.h:114
MTR_3
Definition: include/userParams.h:90
_USER_Params_::RoverLPole_rps
float32_t RoverLPole_rps
Definition: include/userParams.h:323
_USER_Params_::speedPole_rps
float32_t speedPole_rps
speed control filter, rad/sec
Definition: include/userParams.h:139
est_states.h
_USER_Params_::BWdelta
float32_t BWdelta
maximize phase margin
Definition: include/userParams.h:180
_USER_Params_::indEst_speedMaxFraction
float32_t indEst_speedMaxFraction
Definition: include/userParams.h:236
_USER_Params_::ctrlWaitTime
int_least32_t ctrlWaitTime[CTRL_NUMSTATES]
Definition: include/userParams.h:190
USER_Params
struct _USER_Params_ USER_Params
Defines a structure for the user parameters.
_USER_Params_::Rs_min_Ohm
float32_t Rs_min_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:294
_USER_Params_::flag_bypassMotorId
bool flag_bypassMotorId
Definition: include/userParams.h:314
_USER_Params_
Defines a structure for the user parameters.
Definition: include/userParams.h:98
_USER_Params_::maxCurrentDelta_pw_A
float32_t maxCurrentDelta_pw_A
Definition: include/userParams.h:229
EST_TRAJ_NUMSTATES
the number of trajectory generator states
Definition: include/est_Traj_states.h:97
_USER_Params_::fluxPole_rps
float32_t fluxPole_rps
Definition: include/userParams.h:322
_USER_Params_::flux_max_Wb
float32_t flux_max_Wb
Definition: include/userParams.h:328
_USER_Params_::dcBus_nominal_V
float32_t dcBus_nominal_V
voltage, V
Definition: include/userParams.h:100
_USER_Params_::motor_Ls_q_H
float32_t motor_Ls_q_H
inductance, H
Definition: include/userParams.h:167
_USER_Params_::Rr_coarseDelta_Ohm
float32_t Rr_coarseDelta_Ohm
Definition: include/userParams.h:276
_USER_Params_::Reserved02
float32_t Reserved02
15.
Definition: include/userParams.h:335
_USER_Params_::RsOnLine_max_Ohm
float32_t RsOnLine_max_Ohm
resistance value allowed, Ohm
Definition: include/userParams.h:306
_USER_Params_::estFreq_Hz
float32_t estFreq_Hz
Hz.
Definition: include/userParams.h:213
_USER_Params_::motor_type
MOTOR_Type_e motor_type
Defines the motor type.
Definition: include/userParams.h:145
_USER_Params_::RrWaitTime
int_least32_t RrWaitTime[EST_RR_NUMSTATES]
Definition: include/userParams.h:202
_USER_Params_::systemFreq_MHz
float32_t systemFreq_MHz
frequency, MHz
Definition: include/userParams.h:126
_USER_Params_::Kp_min_VpA
float32_t Kp_min_VpA
the current controller, V/A
Definition: include/userParams.h:244
_USER_Params_::flux_min_Wb
float32_t flux_min_Wb
Definition: include/userParams.h:327
_USER_Params_::RsOnLine_pole_rps
float32_t RsOnLine_pole_rps
Definition: include/userParams.h:311
_USER_Params_::IdRated_delta_A
float32_t IdRated_delta_A
value, A
Definition: include/userParams.h:232
_USER_Params_::BWc_rps
float32_t BWc_rps
current controllers, rad/sec
Definition: include/userParams.h:178

Copyright 2023, Texas Instruments Incorporated