Other Parts Discussed in Thread: MOTORWARE, LAUNCHXL-F28069M, BOOSTXL-DRV8301, DRV8301
hi i`m working with launchxl-f28069m + boostxl-drv8301 to drive a motor up to 80000 rpm, but instaSpin-motion only reach up to 60000 rpm in lab project_lab6a. Below there is the motorware_selecting_user_variables.xlsx for configuration and the user_j1.h file.
any suggestion or idea?
Thanks
1. FILL IN THESE VALUES FOR YOUR USER.H, MOTOR, and INVERTER HW | 3. THESE VALUES ARE RECOMMENDED FOR USE once TRUE checks are satisfied | ||||||||
USER_SYSTEM_FREQ_MHz | 90 | MHz | sub-calculations | ||||||
Maximum Bus Voltage | 24 | V | Ideal USER_IQ_FULL_SCALE_FREQ_Hz for Motor | 1466,7 | Target Hz with 10% buffer | ||||
Maximum Target RPM | 80000 | RPM | 1333,333333 | Hz | Maximum allowed USER_IQ_FULL_SCALE_FREQ_HZ for HW | 1386,0 | 4 * USER_VOLTAGE_FILTER_POLE_Hz [with 5% buffer] | ||
USER_MOTOR_NUM_POLE_PAIRS | 1 | PAIRS | 2 | POLES | USER_IQ_FULL_SCALE_FREQ_Hz | 1386,0 | Lower of Ideal and Maximum | ||
USER_PWM_FREQ_kHz | 75 | kHz | Maximum RPM Supported | 164657 | Rotor Hz can be 1.98 * USER_IQ_FULL_SCALE_FREQ_HZ; EST speed will roll-over outside boundary!!!! | ||||
USER_NUM_PWM_TICKS_PER_ISR_TICK | 3 | ticks | 25 | kHz | USER_MOTOR_FLUX_EST_FREQ_Hz | 133,0 | 5-150 Hz; ~10% of Maximum Target Hz but use low as possible where Ls and Flux can be ID'd consistently | ||
USER_NUM_ISR_TICKS_PER_CTRL_TICK | 1 | ticks | 25 | kHz | USER_MAX_ACCEL_EST_Hzps | 18,0 | If USER_MOTOR_FLUX_EST_FREQ_Hz > 50 Hz must increase the acceleration during ID to avoid a timeout | ||
USER_NUM_CTRL_TICKS_PER_CURRENT_TICK | 1 | ticks | 25 | kHz | CURRENT Hz > MAX_Hz * 7 | VERDADERO | If FALSE increase CURRENT kHz or reduce MAX_HZ; Standard good practice for control systems | ||
USER_NUM_CTRL_TICKS_PER_EST_TICK | 1 | ticks | 25 | kHz | EST <= CTRL | VERDADERO | If FALSE correct; No need to run the estimator if results are not being updated in control loop | ||
USER_ZEROSPEEDLIMIT | 0,002 | EST > 10 * USER_VOLTAGE_FILTER_POLE_Hz (+10% margin) | VERDADERO | If FALSE increase EST Rate | |||||
2. The following are set by HW design, use defaults for TI EVM or your own HW | EST > 8 * TARGET_Hz | VERDADERO | If FALSE, increase effective EST Frequency using TICKs | ||||||
USER_VOLTAGE_FILTER_POLE_Hz | 365 | Hz | Tune to HW Pole | FLUX_EST_FREQ > ZEROSPEEDLIMIT * FULL_SCALE_FREQ | VERDADERO | If FALSE, lower ZEROSPEEDLIMIT | |||
USER_ADC_FULL_SCALE_CURRENT_A | 33,00 | A | USER_IQ_FULL_SCALE_CURRENT_A | 18,0 | Slightly >= 0.5 * ADC_FULL_SCALE_CURRENT_A | ||||
USER_ADC_FULL_SCALE_VOLTAGE_V | 26,3147 | V | starting USER_IQ_FULL_SCALE_VOLTAGE_V | 24,0 | Initially set to bus voltage until flux is identified | ||||
4. Once Motor ID is attempted, update these as best you can and check IQ_V Scaling | 4. Check after valid USER_MOTOR_RATED_FLUX Identification | ||||||||
USER_MOTOR_RATED_FLUX | 4,3 | V/Hz | 0,3604 | V/Hz | = Minimum Flux that can be measured with new USER_IQ_FULL_SCALE_VOLTAGE_V (cell I20) | ||||
USER_MOTOR_Ls_d | 7,5081605 | H | Minimum Flux Measurement < 0.9 * RATED_FLUX | VERDADERO | If FALSE, reduce new USER_IQ_FULL_SCALE_VOLTAGE as low as Bus Voltage / 2 + 10% buffer | ||||
5. * Ideal Pole Design when you build wwn HW | IQ_VOLTAGE < RATED_FLUX * EST Hz | VERDADERO | If FALSE, reduce new USER_IQ_FULL_SCALE_VOLTAGE or increase EST_Hz | ||||||
Minimum Pole | 200 | Hz MIN | new USER_IQ_FULL_SCALE_VOLTAGE_V | 6307,0 | Use larger of a) or b). Minimum of Bus Voltage / 2 + 10% buffer if required to make I18 & I19 TRUE | ||||
Ideal* Pole >= | 366,6666667 | Hz | a) Bus Voltage | 24,0 | Typical Minimum, but can reduce as low as Bus Voltage / 2 + 10% buffer | ||||
Half** Pole >= | 183,3333333 | Hz | b) Bemf Generated @ Target Hz + 10% buffer | 6306,7 | |||||
* Use Ideal pole to keep Target Hz < USER_IQ_FULL_SCALE_FREQ_Hz but note that as pole Hz increases you are more susceptible to drift/error and should use higher precision Vph filter Capacitors | |||||||||
** You may use a lower pole (down to half the value of the ideal) that is less sensitive to capacitor error/offset/drift. Set USER_IQ_FULL_SCALE_FREQ_HZ <= 4 * Lowered Pole * 0.95 buffer. Target Hz can reach +/- 1.98 * USER_IQ_FULL_SCALE_FREQ_Hz | |||||||||
Performance difference between the two is typically very marginal though. Do NOT use a filter pole < Minimum Pole!!! |
//! \brief CURRENTS AND VOLTAGES
// **************************************************************************
//! \brief Defines the full scale frequency for IQ variable, Hz
//! \brief All frequencies are converted into (pu) based on the ratio to this value
//! \brief this value MUST be larger than the maximum speed that you are expecting from the motor
#ifndef QEP
#define USER_IQ_FULL_SCALE_FREQ_Hz (1450.0) // 800 Example with buffer for 8-pole 6 KRPM motor to be run to 10 KRPM with field weakening; Hz =(RPM * Poles) / 120
#else
#define USER_IQ_FULL_SCALE_FREQ_Hz (USER_MOTOR_NUM_POLE_PAIRS/0.008) // (4/0.008) = 500 Example with buffer for 8-pole 6 KRPM motor to be run to 6 KRPM; Hz = (RPM * Poles) / 120
#endif
//! \brief Defines full scale value for the IQ30 variable of Voltage inside the system
//! \brief All voltages are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST meet the following condition: USER_IQ_FULL_SCALE_VOLTAGE_V > 0.5 * USER_MOTOR_MAX_CURRENT * USER_MOTOR_Ls_d * USER_VOLTAGE_FILTER_POLE_rps,
//! \brief WARNING: otherwise the value can saturate and roll-over, causing an inaccurate value
//! \brief WARNING: this value is OFTEN greater than the maximum measured ADC value, especially with high Bemf motors operating at higher than rated speeds
//! \brief WARNING: if you know the value of your Bemf constant, and you know you are operating at a multiple speed due to field weakening, be sure to set this value higher than the expected Bemf voltage
//! \brief It is recommended to start with a value ~3x greater than the USER_ADC_FULL_SCALE_VOLTAGE_V and increase to 4-5x if scenarios where a Bemf calculation may exceed these limits
//! \brief This value is also used to calculate the minimum flux value: USER_IQ_FULL_SCALE_VOLTAGE_V/USER_EST_FREQ_Hz/0.7
#define USER_IQ_FULL_SCALE_VOLTAGE_V (30.0) // 24.0 Example for boostxldrv8301_revB typical usage and the Anaheim motor
//! \brief Defines the maximum voltage at the input to the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the voltage sensing and scaling to the ADC input
#define USER_ADC_FULL_SCALE_VOLTAGE_V (26.314) // 26.314 boostxldrv8301_revB voltage scaling
//! \brief Defines the full scale current for the IQ variables, A
//! \brief All currents are converted into (pu) based on the ratio to this value
//! \brief WARNING: this value MUST be larger than the maximum current readings that you are expecting from the motor or the reading will roll over to 0, creating a control issue
#define USER_IQ_FULL_SCALE_CURRENT_A (20.0) // 20.0 Example for boostxldrv8301_revB typical usage
//! \brief Defines the maximum current at the AD converter
//! \brief The value that will be represented by the maximum ADC input (3.3V) and conversion (0FFFh)
//! \brief Hardware dependent, this should be based on the current sensing and scaling to the ADC input
#define USER_ADC_FULL_SCALE_CURRENT_A (33.0) // 33.0 boostxldrv8301_revB current scaling
//! \brief Defines the number of current sensors used
//! \brief Defined by the hardware capability present
//! \brief May be (2) or (3)
#define USER_NUM_CURRENT_SENSORS (3) // 3 Preferred setting for best performance across full speed range, allows for 100% duty cycle
//! \brief Defines the number of voltage (phase) sensors
//! \brief Must be (3)
#define USER_NUM_VOLTAGE_SENSORS (3) // 3 Required
//! \brief ADC current offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
#define I_A_offset (0.827802360)
#define I_B_offset (0.828094780)
#define I_C_offset (0.803567231)
//! \brief ADC voltage offsets for A, B, and C phases
//! \brief One-time hardware dependent, though the calibration can be done at run-time as well
//! \brief After initial board calibration these values should be updated for your specific hardware so they are available after compile in the binary to be loaded to the controller
#define V_A_offset (0.397775924)
#define V_B_offset (0.399682021)
#define V_C_offset (0.397315598)
//! \brief CLOCKS & TIMERS
// **************************************************************************
//! \brief Defines the Pulse Width Modulation (PWM) frequency, kHz
//! \brief PWM frequency can be set directly here up to 30 KHz safely (60 KHz MAX in some cases)
//! \brief For higher PWM frequencies (60 KHz+ typical for low inductance, high current ripple motors) it is recommended to use the ePWM hardware
//! \brief and adjustable ADC SOC to decimate the ADC conversion done interrupt to the control system, or to use the software Que example.
//! \brief Otherwise you risk missing interrupts and disrupting the timing of the control state machine
#define USER_PWM_FREQ_kHz (75.0) //30.0 Example, 8.0 - 30.0 KHz typical; 45-80 KHz may be required for very low inductance, high speed motors
//! \brief Defines the maximum Voltage vector (Vs) magnitude allowed. This value sets the maximum magnitude for the output of the
//! \brief Id and Iq PI current controllers. The Id and Iq current controller outputs are Vd and Vq.
//! \brief The relationship between Vs, Vd, and Vq is: Vs = sqrt(Vd^2 + Vq^2). In this FOC controller, the
//! \brief Vd value is set equal to USER_MAX_VS_MAG*USER_VD_MAG_FACTOR. Vq = sqrt(USER_MAX_VS_MAG^2 - Vd^2).
//! \brief Set USER_MAX_VS_MAG = 0.5 for a pure sinewave with a peak at SQRT(3)/2 = 86.6% duty cycle. No current reconstruction is needed for this scenario.
//! \brief Set USER_MAX_VS_MAG = 1/SQRT(3) = 0.5774 for a pure sinewave with a peak at 100% duty cycle. Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief Set USER_MAX_VS_MAG = 2/3 = 0.6666 to create a trapezoidal voltage waveform. Current reconstruction will be needed for this scenario (Lab10a-x).
//! \brief For space vector over-modulation, see lab 10 for details on system requirements that will allow the SVM generator to go all the way to trapezoidal.
#define USER_MAX_VS_MAG_PU (0.5) // Set to 0.5 if a current reconstruction technique is not used. Look at the module svgen_current in lab10a-x for more info.
//! \brief DECIMATION
// **************************************************************************
//! \brief Defines the number of pwm clock ticks per isr clock tick
//! Note: Valid values are 1, 2 or 3 only
#define USER_NUM_PWM_TICKS_PER_ISR_TICK (3)
//! \brief Defines the number of isr ticks (hardware) per controller clock tick (software)
//! \brief Controller clock tick (CTRL) is the main clock used for all timing in the software
//! \brief Typically the PWM Frequency triggers (can be decimated by the ePWM hardware for less overhead) an ADC SOC
//! \brief ADC SOC triggers an ADC Conversion Done
//! \brief ADC Conversion Done triggers ISR
//! \brief This relates the hardware ISR rate to the software controller rate
//! \brief Typcially want to consider some form of decimation (ePWM hardware, CURRENT or EST) over 16KHz ISR to insure interrupt completes and leaves time for background tasks
#define USER_NUM_ISR_TICKS_PER_CTRL_TICK (1) // 2 Example, controller clock rate (CTRL) runs at PWM / 2; ex 30 KHz PWM, 15 KHz control
//! \brief Defines the number of controller clock ticks per current controller clock tick
//! \brief Relationship of controller clock rate to current controller (FOC) rate
#define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK (1) // 1 Typical, Forward FOC current controller (Iq/Id/IPARK/SVPWM) runs at same rate as CTRL.
//! \brief Defines the number of controller clock ticks per estimator clock tick
//! \brief Relationship of controller clock rate to estimator (FAST) rate
//! \brief Depends on needed dynamic performance, FAST provides very good results as low as 1 KHz while more dynamic or high speed applications may require up to 15 KHz
#define USER_NUM_CTRL_TICKS_PER_EST_TICK (1) // 1 Typical, FAST estimator runs at same rate as CTRL;
//! \brief Defines the number of controller clock ticks per speed controller clock tick
//! \brief Relationship of controller clock rate to speed loop rate
#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK (15) // 15 Typical to match PWM, ex: 15KHz PWM, controller, and current loop, 1KHz speed loop
//! \brief Defines the number of controller clock ticks per trajectory clock tick
//! \brief Relationship of controller clock rate to trajectory loop rate
//! \brief Typically the same as the speed rate
#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (15) // 15 Typical to match PWM, ex: 10KHz controller & current loop, 1KHz speed loop, 1 KHz Trajectory
//! \brief LIMITS
// **************************************************************************
//! \brief Defines the maximum negative current to be applied in Id reference
//! \brief Used in field weakening only, this is a safety setting (e.g. to protect against demagnetization)
//! \brief User must also be aware that overall current magnitude [sqrt(Id^2 + Iq^2)] should be kept below any machine design specifications
#define USER_MAX_NEGATIVE_ID_REF_CURRENT_A (-0.5 * USER_MOTOR_MAX_CURRENT) // -0.5 * USER_MOTOR_MAX_CURRENT Example, adjust to meet safety needs of your motor
//! \brief Defines the R/L estimation frequency, Hz
//! \brief User higher values for low inductance motors and lower values for higher inductance
//! \brief motors. The values can range from 100 to 300 Hz.
#define USER_R_OVER_L_EST_FREQ_Hz (300) // 300 Default
//! \brief Defines the low speed limit for the flux integrator, pu
//! \brief This is the speed range (CW/CCW) at which the ForceAngle object is active, but only if Enabled
//! \brief Outside of this speed - or if Disabled - the ForcAngle will NEVER be active and the angle is provided by FAST only
#define USER_ZEROSPEEDLIMIT (0.5 / USER_IQ_FULL_SCALE_FREQ_Hz) // 0.002 pu, 1-5 Hz typical; Hz = USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz
//! \brief Defines the force angle frequency, Hz
//! \brief Frequency of stator vector rotation used by the ForceAngle object
//! \brief Can be positive or negative
#define USER_FORCE_ANGLE_FREQ_Hz (2.0 * USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz) // 1.0 Typical force angle start-up speed
//! \brief POLES
// **************************************************************************
//! \brief Defines the analog voltage filter pole location, Hz
//! \brief Must match the hardware filter for Vph
#define USER_VOLTAGE_FILTER_POLE_Hz (364.682) // 364.682, value for boostxldrv8301_revB hardware
//! \brief USER MOTOR & ID SETTINGS
// **************************************************************************
//! \brief Defines the default bandwidth for SpinTAC Control
//! \brief This value should be determined by putting SpinTAC Control through a tuning process
//! \brief If a Bandwidth Scale value has been previously identified
//! \brief multiply it by 20 to convert into Bandwidth
#define USER_SYSTEM_BANDWIDTH (20.0)
//! \brief Define each motor with a unique name and ID number
// BLDC & SMPM motors
#define AIRFAN_MFA0500 401
//! \brief Uncomment the motor which should be included at compile
//! \brief These motor ID settings and motor parameters are then available to be used by the control system
//! \brief Once your ideal settings and parameters are identified update the motor section here so it is available in the binary code
#define USER_MOTOR AIRFAN_MFA0500
#if (USER_MOTOR == AIRFAN_MFA0500) // Name must match the motor #define
#define USER_MOTOR_TYPE MOTOR_Type_Pm // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)
#define USER_MOTOR_NUM_POLE_PAIRS (1)// PAIRS, not total poles. Used to calculate user RPM from rotor Hz only
#define USER_MOTOR_Rr (NULL)// Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Rs (0.134118915)// Identified phase to neutral in a Y equivalent circuit (Ohms, float)
#define USER_MOTOR_Ls_d (0.0000173241478) // For Induction, Identified average stator inductance (Henry, float)
#define USER_MOTOR_Ls_q (0.0000173241478)// For Induction, Identified average stator inductance (Henry, float)
#define USER_MOTOR_RATED_FLUX (0.0118218949)// sqrt(2/3)* Rated V (line-line) / Rated Freq (Hz)
#define USER_MOTOR_MAGNETIZING_CURRENT (NULL)// Identified magnetizing current for induction motors, else NULL
#define USER_MOTOR_RES_EST_CURRENT (0.5)// During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current
#define USER_MOTOR_IND_EST_CURRENT (-0.5)// not used for induction
#define USER_MOTOR_MAX_CURRENT (8.0) // CRITICAL: Used during ID and run-time, sets a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller
#define USER_MOTOR_FLUX_EST_FREQ_Hz (133.0) // During Motor ID, maximum commanded speed (Hz, float). Should always use 5 Hz for Induction.
#define USER_MOTOR_ENCODER_LINES (1.0)// Number of lines on the motor's quadrature encoder
#define USER_MOTOR_MAX_SPEED_KRPM (80.0) // Maximum speed that the motor
#define USER_SYSTEM_INERTIA (0.02218168974) // Inertia of the motor & system, should be estimated by SpinTAC Velocity Identify
#define USER_SYSTEM_FRICTION (0.003876209259) // Friction of the motor & system, should be estimated by SpinTAC Velocity Identify
#define USER_SYSTEM_BANDWIDTH_SCALE (1.0)