TIDUF67 April 2024
The user_mtr1.h file is where all the user parameters are stored for motor control. The maximum phase current and phase voltage at the input to the AD converter are hardware dependent and must be based on the current and voltage sensing circuitry and scaling at the ADC input. The number of phase current sensors and phase voltage sensors are also defined in the user_mtr1.h file. These values are hardware-dependent.
All of the configurable parameters defined in the user_mtr1.h file can be calculated using the Motor Control Parameters Calculation.xlsx Excel® spreadsheet. This file is included in the project folder: \examples\universal_motorcontrol_lab\doc. Copy parameters marked in bold to the user_mtr1.h file as shown in the following code.
//! \brief Defines the maximum voltage at the AD converter
#define USER_M1_ADC_FULL_SCALE_VOLTAGE_V (57.52845691f)
//! \brief Defines the analog voltage filter pole location, Hz
#define USER_M1_VOLTAGE_FILTER_POLE_Hz (680.4839141f) // 47nF
//! \brief Defines the maximum current at the AD converter
#define USER_M1_ADC_FULL_SCALE_CURRENT_A (47.14285714f) // gain=10