SPRUJ26A September   2021  – April 2024

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Motor Control Theory
    1. 2.1 Mathematical Model and FOC Structure of PMSM
    2. 2.2 Field Oriented Control of PM Synchronous Motor
    3. 2.3 Sensorless Control of PM Synchronous Motor
      1. 2.3.1 Enhanced Sliding Mode Observer with Phase Locked Loop
        1. 2.3.1.1 Design of ESMO for PMSM
        2. 2.3.1.2 Rotor Position and Speed Estimation With PLL
    4. 2.4 Hardware Prerequisites for Motor Drive
      1. 2.4.1 Motor Phase Voltage Feedback
    5. 2.5 Additional Control Features
      1. 2.5.1 Field Weakening (FW) and Maximum Torque Per Ampere (MTPA) Control
      2. 2.5.2 Flying Start
  6. 3Running the Universal Lab on TI Hardware Kits
    1. 3.1 Supported TI Motor Evaluation Kits
    2. 3.2 Hardware Board Setup
      1. 3.2.1  LAUNCHXL-F280025C Setup
      2. 3.2.2  LAUNCHXL-F280039C Setup
      3. 3.2.3  LAUNCHXL-F2800137 Setup
      4. 3.2.4  TMDSCNCD280025C Setup
      5. 3.2.5  TMDSCNCD280039C Setup
      6. 3.2.6  TMDSCNCD2800137 Setup
      7. 3.2.7  TMDSADAP180TO100 Setup
      8. 3.2.8  DRV8329AEVM Setup
      9. 3.2.9  BOOSTXL-DRV8323RH Setup
      10. 3.2.10 BOOSTXL-DRV8323RS Setup
      11. 3.2.11 DRV8353RS-EVM Setup
      12. 3.2.12 BOOSTXL-3PHGANINV Setup
      13. 3.2.13 DRV8316REVM Setup
      14. 3.2.14 TMDSHVMTRINSPIN Setup
      15.      34
      16.      35
    3. 3.3 Lab Software Implementation
      1. 3.3.1 Importing and Configuring Project
      2.      38
      3.      39
      4. 3.3.2 Lab Project Structure
      5. 3.3.3 Lab Software Overview
    4. 3.4 Monitoring Feedback or Control Variables
      1. 3.4.1 Using DATALOG Function
      2. 3.4.2 Using PWMDAC Function
      3. 3.4.3 Using External DAC Board
    5. 3.5 Running the Project Incrementally Using Different Build Levels
      1. 3.5.1 Level 1 Incremental Build
        1. 3.5.1.1 Build and Load Project
        2. 3.5.1.2 Setup Debug Environment Windows
        3. 3.5.1.3 Run the Code
      2. 3.5.2 Level 2 Incremental Build
        1. 3.5.2.1 Build and Load Project
        2. 3.5.2.2 Setup Debug Environment Windows
        3. 3.5.2.3 Run the Code
      3. 3.5.3 Level 3 Incremental Build
        1. 3.5.3.1 Build and Load Project
        2. 3.5.3.2 Setup Debug Environment Windows
        3. 3.5.3.3 Run the Code
      4. 3.5.4 Level 4 Incremental Build
        1. 3.5.4.1 Build and Load Project
        2. 3.5.4.2 Setup Debug Environment Windows
        3. 3.5.4.3 Run the Code
  7. 4Building a Custom Board
    1. 4.1 Building a New Custom Board
      1. 4.1.1 Hardware Setup
      2. 4.1.2 Migrating Reference Code to a Custom Board
        1. 4.1.2.1 Setting Hardware Board Parameters
        2. 4.1.2.2 Modifying Motor Control Parameters
        3. 4.1.2.3 Changing Pin Assignment
        4. 4.1.2.4 Configuring the PWM Module
        5. 4.1.2.5 Configuring the ADC Module
        6. 4.1.2.6 Configuring the CMPSS Module
        7. 4.1.2.7 Configuring Fault Protection Function
      3. 4.1.3 Adding Additional Functionality to Motor Control Project
        1. 4.1.3.1 Adding Push Buttons Functionality
        2. 4.1.3.2 Adding Potentiometer Read Functionality
        3. 4.1.3.3 Adding CAN Functionality
    2. 4.2 Supporting New BLDC Motor Driver Board
    3. 4.3 Porting Reference Code to New C2000 MCU
  8.   A Appendix A. Motor Control Parameters
  9.   References
  10.   Revision History

Appendix A. Motor Control Parameters

The Universal Motor Control Lab has numerous defined parameters that impact system performance. The parameters available for user manipulation in the user_mtr1.h file are listed below. Some of these parameters are described as derived and generally should not be manipulated- the values for these parameters are dependent on one or more other parameters.

  • Hardware Parameters:
    • USER_M1_NOMINAL_DC_BUS_VOLTAGE_V

      This parameter defines the nominal DC bus voltage in Volts (V).

      The value of this parameter must be greater than the rated motor voltage and less than the maximum sensing DC bus voltage of the hardware.

    • USER_M1_ADC_FULL_SCALE_VOLTAGE_V

      This parameter defines the maximum voltage at the input to the ADC in Volts (V). This value is represented by the maximum ADC reading.

      This parameter is used to scale the ADC readings, and should be set to the maximum expected voltage at the input to the ADC.

    • USER_M1_ADC_FULL_SCALE_CURRENT_A

      This parameter defines the maximum current at the input to the ADC in Amps (A). This value is represented by the maximum ADC reading.

      This parameter is used to scale the ADC readings, and should be set to the maximum expected current at the input to the ADC.

    • USER_M1_VOLTAGE_FILTER_POLE_Hz

      This parameter defines the analog filter pole location, in Hz.

      This parameter must be set to match the filter pole location of the hardware voltage feedback filter.

    • USER_M1_VOLTAGE_FILTER_POLE_rps

      This derived parameter is a radians per second conversion of USER_M1_VOLTAGE_FILTER_POLE_Hz.

    • USER_M1_SIGN_CURRENT_SF

      This parameter defines the sign (positive or negative) of the current scale factor derived from USER_M1_ADC_FULL_SCALE_CURRENT_A.

      If the noninverting (+) pin of the op-amp is grounded in the current feedback circuit, the value of this parameter is -1.0f. If the inverting pin (-) is grounded, the value is +1.0f.

    • USER_M1_NUM_CURRENT_SENSORS

      This parameter defines the number of current sensors present in the hardware.

      The calculations in this lab assume that there are either 2 or 3 current sensors. A higher or lower value will therefore cause a compilation error.

    • USER_M1_NUM_VOLTAGE_SENSORS

      This parameter defines the number of voltage phase sensors present in the hardware.

      The calculations in this lab assume that there are 3 voltage sensors. A higher or lower value will therefore cause a compilation error.

    • USER_M1_Ix_OFFSET_AD

      The USER_M1_Ix_OFFSET_AD parameter, where 'x' is A, B, or C, represents the ADC current offset for each respective phase, as defined by the hardware.

      This value should be close to 2048.

      The lab is capable of automatic offset calibration via the 'flagEnableOffsetCalc' flag. If set, the new value for this parameter is loaded into motorVars_M1.adcData.offset_I_ad.value[2:0] after the calibration process completes. The value in user_mtr1.h must be manually updated.

      USER_M1_IA_OFFSET_AD; USER_M1_IB_OFFSET_AD; USER_M1_IC_OFFSET_AD

    • USER_M1_Vx_OFFSET_SF

      The USER_M1_Vx_OFFSET_SF parameter, where 'x' is A, B, or C, represents the ADC voltage offset for each respective phase, as defined by the hardware. These parameters are used only for InstaSPIN-FOC FAST and InstaSPIN-BLDC.

      This value should be close to 0.5.

      The lab is capable of automatic offset calibration via the 'flagEnableOffsetCalc' flag. If set, the new value for this parameter is loaded into motorVars_M1.adcData.offset_V_sf.value[2:0] after the calibration process completes. The value in user_mtr1.h must be manually updated.

      USER_M1_VA_OFFSET_SF; USER_M1_VB_OFFSET_SF; USER_M1_VC_OFFSET_SF

    • USER_M1_IDC_OFFSET_AD

      This parameter defines the ADC current offsets for single-shunt hardware.

      As with USER_M1_Ix_OFFSET_AD, this value can be calibrated via the 'flagEnableOffsetCalc' flag. The new value is loaded into motorVars_M1.adcData.offset_Idc_ad.

  • Timing Parameters:
    • USER_SYSTEM_FREQ_Hz

      This derived parameter (found in user_common.h) is a floating point conversion of the device SysClk frequency DEVICE_SYSCLK_FREQ in Hz. DEVICE_SYSCLK_FREQ is found in the device.h file.

    • USER_M1_PWM_FREQ_kHz

      This parameter defines the frequency of the ePWM in kHz. Changing this value alters the control interrupt frequency.

    • USER_M1_PWM_PERIOD_usec

      This derived parameter is the period of the ePWM frequency USER_M1_PWM_FREQ_kHz in microseconds.

    • USER_M1_ISR_FREQ_Hz

      This derived parameter defines the control interrupt frequency in Hz.

      This parameter is derived from the PWM frequency USER_M1_PWM_FREQ_kHz.

    • USER_M1_ISR_PERIOD_usec

      This derived parameter is the period of the control interrupt frequency USER_M1_ISR_FREQ_Hz in microseconds.

    • USER_M1_NUM_PWM_TICKS_PER_ISR_TICK

      This parameter defines the number of PWM periods per interrupt. This value divides the control interrupt frequency.

      This lab assumes this value is between 1 and 3, inclusive.

    • USER_M1_NUM_ISR_TICKS_PER_SPEED_TICK

      This parameter defines the number of interrupt ticks per speed controller ticks. This value divides the speed controller trigger rate. This contributes to system response time.

  • Sampling Parameters:
    • USER_M1_CURRENT_SF

      This derived parameter calculates the scale of the ADC result bits for current readings, relative to the actual current value in Amps (A). This calculation assumes a 12-bit ADC.

      This parameter is derived from the ADC full scale current USER_M1_ADC_FULL_SCALE_CURRENT_A.

    • USER_M1_VOLTAGE_SF

      This derived parameter calculates the scale of the ADC result bits for voltage readings, relative to the actual voltage value in Volts (V). This calculation assumes a 12-bit ADC. This parameter is used only by the InstaSPIN-FOC FAST and eSMO estimators.

      This parameter is derived from the ADC full scale voltage USER_M1_ADC_FULL_SCALE_VOLTAGE_V.

    • USER_M1_CURRENT_INV_SF

      This derived parameter is equivalent to 1 / USER_M1_CURRENT_SF for a 12-bit ADC.

      This parameter is derived from the ADC full scale current USER_M1_ADC_FULL_SCALE_CURRENT_A.

    • USER_M1_DCLINKSS_MIN_DURATION

      This parameter defines the minimum duration in clock cycles for the single-shunt ADC readings.

      Calculations for the value of this parameter are described in the motor1_drive.c file.

    • USER_M1_DCLINKSS_SAMPLE_DELAY

      This parameter defines the delay in clock cycles before the single-shunt ADC readings to account for signal propagation.

      Calculations for the value of this parameter are described in the motor1_drive.c file.

  • Motor Properties:
    • USER_MOTOR1_TYPE

      This parameter defines the motor type.

      The two valid values for this parameter are MOTOR_TYPE_PM (for BLDC, PMSM, SMPM, or IPM motors) and MOTOR_TYPE_INDUCTION (for Asynchronous ACI motors)

    • USER_MOTOR1_NUM_POLE_PAIRS

      This parameter defines the number of pole pairs in the motor. This value is utilized to calculate motor output power when utilizing the InstaSPIN-FOC FAST estimator.

    • USER_MOTOR1_Rr_Ohm

      This parameter defines the rotor resistance of the motor in Ohms for induction motors. For non-induction motors, set to NULL. This parameter is used only by InstaSPIN-FOC FAST.

    • USER_MOTOR1_Rs_Ohm

      This parameter defines the stator resistance of the motor in Ohms.

    • USER_MOTOR1_Ls_d_H

      This parameter defines the stator inductance of the motor in the direct direction in henries (H). For PM, this is average stator inductance.

    • USER_MOTOR1_Ls_q_H

      This parameter defines the stator inductance of the motor in the quadrature direction in henries (H). For PM, this is average stator inductance.

    • USER_MOTOR1_RATED_FLUX_VpHz

      This parameter defines the rated flux of the motor in V/Hz (or V*s, Webers).

    • USER_MOTOR1_MAGNETIZING_CURRENT_A

      This parameter defines the rated current value of the motor in the direct direction in Amps for induction motors only. For other motors, set to NULL. This parameter is used only by InstaSPIN-FOC FAST.

    • USER_MOTOR1_MAX_CURRENT_A

      This parameter defines the maximum current of the motor in A. This contributes to overcurrent handling.

    • USER_MOTOR1_INERTIA_Kgm2

      This parameter defines the moment of inertia of the mass rigidly coupled with the motor in kg · m2. This contributes to the speed controller gain constant calculation.

    • USER_M1_VD_SF

      This parameter defines the initial maximum value for Vd for the Id current controller. See USER_M1_MAX_VS_MAG_PU for more detail.

      This value must be between 0.1 and 0.95.

    • USER_M1_MAX_VS_MAG_PU

      This parameter defines the maximum magnitude for the Voltage vector Vs in V per-unit.

      By the definition of a vector, the relationship between the magnitude of the Voltage vector Vs and the Vd and Vq axis components is as follows;

      Vs = √(Vd2 + Vq2)

      Vd is determined by the end application- for some motors, a value of 0 is a valid option. For this example, this is defined differently depending on whether closed or open-loop control is being used. In either case, the calculations for Vs and Vd are provided below.

      In open-loop control, Vd is set to 0.3 in the voltage-frequency characterization profile.

      In closed-loop control, Vd is dynamically determined by a PI controller. The maximum magnitude of |Vd| is initially set to USER_M1_VD_SF * USER_MOTOR1_RATED_VOLTAGE_V. During motor operation, it is instead set to USER_MOTOR1_RATED_VOLTAGE_V.

      In open-loop control, Vs is set to USER_M1_MAX_VS_MAG_PU. All operations are in per-unit.

      In closed-loop control, Vs is set to USER_M1_MAX_VS_MAG_PU * obj->adcData.VdcBus_V (the DC Bus Voltage). All operations are in Volts.

    • USER_M1_MAX_ACCEL_Hzps

      This parameter defines the maximum acceleration magnitude for the estimation speed profiles in Hz per second. Used only during InstaSPIN Motor ID.

      This value should typically be left at the default.

    • InstaSPIN-FOC FAST Parameters:
    • USER_MOTOR1_RES_EST_CURRENT_A

      This parameter defines the maximum current value to be used for stator resistance estimation, in Amps.

      This value should be set to 10% to 40% of the rated phase current of the motor. If the motor does not spin during the ramp-up process, increase in 5% increments until the motor is in motion during the entire ramp-up process.

    • USER_MOTOR1_IND_EST_CURRENT_A

      This parameter defines the maximum current value to use for stator inductance estimation, in Amps.

      This value should be set to 10%-20% of the rated phase current of the motor, just enough to enable rotation.

    • USER_MOTOR1_FLUX_EXC_FREQ_Hz

      This parameter defines the flux excitation frequency used to estimate the stator inductance and flux during motor identification, in Hz.

      Typically, 5%-20% of the motor rated frequency is high enough for estimation for PMSM motors with ~10-20 microHenries stator inductance or higher. If the inductance is in the single digits of microHenries, then a higher frequency is recommended, up to 60Hz for very low inductances.

    • USER_M1_R_OVER_L_EXC_FREQ_Hz

      This parameter defines the R/L excitation frequency in Hz, used during motor identification to estimate initial values for the stator resistance and inductance. This is used to calculate current controller gains.

      By default, this parameter is set to 300 Hz.

    • USER_M1_IDRATED_FRACTION_FOR_L_IDENT

      This parameter defines the fraction of the rated Id to use during inductance estimation.

      This parameter should not be changed from the default value of 0.5.

    • USER_M1_SPEEDMAX_FRACTION_FOR_L_IDENT

      This parameter defines the fraction of the max speed to use during inductance estimation.

      This parameter should not be changed from the default value of 1.0.

    • USER_M1_R_OVER_L_KP_SF

      This parameter defines the scale factor for Kp in the FOC current controllers.

      This parameter should not be changed from the default value of 0.02.

    • USER_M1_IDRATED_DELTA_A

      This parameter defines the Id delta current to use during estimation, in A.

      This parameter should not be changed from the default value of 0.0001.

    • USER_M1_FORCE_ANGLE_FREQ_Hz

      If the force angle startup option is enabled, this parameter defines the force angle startup frequency in Hz. This value is used during motor startup.

      Typical force angle startup speed is +-1 Hz.

    • USER_MOTOR1_FREQ_NEARZEROLIMIT_Hz

      If the force angle startup option is enabled, this parameter defines the speed range within which the force-angle startup process is used.

      For most applications, the default value of 5Hz is sufficient.

    • USER_M1_PW_GAIN

      This parameter defines the PowerWarp gain for computing the Id reference value for induction motors.

      This parameter should not be changed from the default value of 1.0.

    • USER_M1_DCBUS_POLE_rps

      This parameter defines the pole location for the software DC bus filter in radians/second.

      This parameter should not be changed from the default value of 100.

    • USER_M1_SPEED_POLE_rps

      This parameter defines the pole location for the software frequency estimator filter in radians/second.

      For most applications, the default value of 100rps is sufficient. For high-speed motors, performance may be improved by increasing this value up to 500rps.

    • USER_M1_EST_FLUX_HF_SF

      This parameter defines the scale factor for flux estimation.

      This parameter can range from 0.1 to 1.25. For most PMSM motors, a value of 1.0 is sufficient. For higher frequency lower inductance motors, a lower value may be used.

    • USER_M1_EST_BEMF_HF_SF

      This parameter defines the scale factor for Back-EMF (BEMF) estimation.

      If using the InstaSPIN-FOC FAST estimator, this parameter should not be chagned from the default value of 1.

      Otherwise, this parameter can range from from 0.5 to 1.25. For most PMSM motors, a value of 1.0 is sufficient. For higher frequency lower inductance motors, a lower value may be used.

    • USER_MOTOR1_Ls_d_COMP_COEF

      This parameter defines the Ls d-axis compensation coefficient. Motor inductance decreases with respect to the amplitude of the applied stator current. To simplify calculations, a linear relationship is assumed.

      Where Ls is the motor stator inductance Ld and Ls1 is the motor stator inductance after compensation,

      Ls1 = Ls * (1 -(Ls Compensation Coefficient))

      This parameter should be set according to the inductance vs current model provided by the motor manufacturer.

    • USER_MOTOR1_Ls_q_COMP_COEF

      This parameter is identical to USER_MOTOR1_Ls_d_COMP_COEF, except it refers to Lq instead of Ld.

    • USER_MOTOR1_Ls_MIN_NUM_COEF

      This parameter defines the minimum inductance of the motor.

      This parameter should be set according to the inductance vs current model provided by the motor manufacturer.

    • USER_MOTOR1_RSONLINE_WAIT_TIME

      Rs online calibration is used to recalibrate the stator resistance Rs while the motor is running in closed-loop. However, given that Rs changes slowly over time, and the Rs online calibration process injects d-axis current that does not generate torque, the process is only enabled intermittently.

      This parameter defines the wait time between Rs Online calibration cycles in 5ms periods.

      This parameter's default value is typically sufficient.

    • USER_MOTOR1_RSONLINE_WORK_TIME

      This parameter defines the duration of the Rs Online calibration cycle in 5ms periods.

      This parameter's default value is typically sufficient.

  • Open Loop Voltage/Frequency Profile Parameters:
    • USER_MOTOR1_FREQ_LOW_Hz

      This parameter defines the low frequency boundary of the open-loop Voltage/Frequency profile in Hz.

      This value defines the lower limits of the linear region of the Voltage/Frequency profile of the motor. Within the linear region, to calculate the applied voltage necessary to achieve a chosen motor speed is incredibly simple. Beyond the lower limit, this relationship is no longer linear.

      This parameter should be set to approximately 10% of the rated motor frequency.

    • USER_MOTOR1_FREQ_HIGH_Hz

      This parameter defines the high frequency boundary of the open-loop Voltage/Frequency profile in Hz.

      This value defines the upper limits of the linear region of the Voltage/Frequency profile of the motor. Within the linear region, to calculate the applied voltage necessary to achieve a chosen motor speed is incredibly simple. Voltage should not increase beyond the rated motor voltage.

      This parameter should be set to the rated motor frequency.

    • USER_MOTOR1_VOLT_MIN_V

      This parameter defines the voltage value that generates a speed of USER_MOTOR1_FREQ_LOW_Hz in the motor, in V.

      This parameter should be set to approximately 15% of the rated motor voltage.

    • USER_MOTOR1_VOLT_MAX_V

      This parameter defines the voltage value that generates a speed of USER_MOTOR1_FREQ_HIGH_Hz in the motor, in V.

      This parameter should be set to the rated motor voltage.

  • Motor Encoder Parameters:
    • USER_MOTOR1_NUM_ENC_SLOTS

      This parameter defines the number of encoder slots in the motor quadrature encoder.

      This parameter should be set according to the encoder used.

    • USER_MOTOR1_ENC_POS_MAX

      This derived parameter defines the maximum value of the position counter for the eQEP module.

      This parameter is derived from the number of encoder slots (USER_MOTOR1_NUM_ENC_SLOTS).

    • USER_MOTOR1_ENC_POS_OFFSET

      This parameter defines the offset number of the encoder at position zero.

  • eSMO Estimator Parameters:
    • USER_MOTOR1_KSLIDE_MAX

      This parameter defines the maximum value of the time-dependent eSMO Kslide gain variable.

      This parameter must be set greater than the maximum back-EMF at the maximum motor frequency, in per-unit. The default value is sufficient for most applications. This parameter may vary between 0.1 and 10.

    • USER_MOTOR1_KSLIDE_MIN

      This parameter defines the initial value of the time-dependent eSMO Kslide gain variable.

      This parameter must be set greater than the maximum back-EMF at the maximum motor frequency, in per-unit. The default value is sufficient for most applications. This parameter may vary between 0.1 and 10.

    • USER_MOTOR1_PLL_KP_MAX

      This parameter defines the maximum gain for the eSMO PLL.

      This parameter must be set greater than the maximum back-EMF at the maximum motor frequency, in per-unit. The default value is sufficient for most applications. This parameter may vary between 0.1 and 10.

    • USER_MOTOR1_PLL_KP_MIN

      This parameter defines the minimum gain for the eSMO PLL.

      This parameter must be set greater than the maximum back-EMF at the maximum motor frequency, in per-unit. The default value is sufficient for most applications. This parameter may vary between 0.1 and 5.

    • USER_MOTOR1_PLL_KP_SF

      This parameter defines the scale factor applied to the per-unit motor speed. This controls the gain of the eSMO PLL.

      This parameter should be set to (USER_MOTOR1_PLL_KP_MAX - USER_MOTOR1_PLL_KP_MIN) / (fscale * fmax). In most cases, the default value is sufficient.

    • USER_MOTOR1_BEMF_THRESHOLD

      This parameter defines the threshold of estimated current error for the eSMO sliding mode controller.

      This parameter should be equal to the maximum motor Back-EMF (BEMF) divided by the motor's rated voltage, and should range between 0.3 and 0.5. In most cases, the default value of 0.5 is sufficient.

    • USER_MOTOR1_BEMF_KSLF_FC_Hz

      This parameter defines the cutoff frequency of the low pass filter for the eSMO estimated back-EMF.

      This parameter is equal to the cutoff frequency * 2 * PI() * Ts (timescale). In most cases, the default value is sufficient.

    • USER_MOTOR1_THETA_OFFSET_SF

      This parameter defines the coefficient applied to the back-EMF filter compensation factor.

      This parameter should be set between 0.5 to 1.5, inclusive. The default value of 1 is sufficient in most cases.

    • USER_MOTOR1_SPEED_LPF_FC_Hz

      This parameter sets the cutoff frequency of the low-pass filter used to calculate speed. Given that this filter is applied to per-unit values, this parameter only influences the eSMO output in very high noise scenarios.

      The default value of 200Hz is sufficient in most cases. Otherwise, this parameter should be set between 100 and 400.

  • InstaSPIN-BLDC Parameters:
    • USER_MOTOR1_RAMP_START_Hz

      This parameter defines the minimum speed when the motor runs in open-loop, in Hz.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be 0.5%-1% of the rated motor speed.

    • USER_MOTOR1_RAMP_END_Hz

      This parameter defines when the BEMF zero-cross point for commutation begins to be considered, in Hz.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be 10%-20% of the rated motor speed.

    • USER_MOTOR1_RAMP_DELAY

      This parameter defines how long the system runs the motor in open-loop, in seconds.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 5-20s.

    • USER_MOTOR1_ISBLDC_INT_MAX

      This parameter defines the maximum threshold of integration voltage for commutation point detection, percent of the nominal.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 0.01-0.15.

    • USER_MOTOR1_ISBLDC_INT_MIN

      This parameter defines the minimum threshold of integration voltage for commutation point detection, percent of the nominal.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 0.005-0.1.

    • USER_MOTOR1_ISBLDC_I_START_A

      This parameter defines the current to start the motor in open-loop, in A.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 5%-20% of the rated current.

    • USER_MOTOR1_ISBLDC_DUTY_START

      This parameter defines the PWM duty to start the motor in open-loop, in percent.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 5%-20% duty.

  • Field Weakening Control (FWC) Parameters:
    • USER_M1_FWC_KP

      This parameter defines the Kp gain of the PI regulator for FWC.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 0.01-0.1.

    • USER_M1_FWC_KI

      This parameter defines the Ki gain of the PI regulator for FWC.

      The specific value for this parameter should be based on motor or system test on performance requirements. This value could be between 0.01-0.1.

    • USER_M1_FWC_MAX_ANGLE

      This parameter defines the maximum vector angle for FWC, in degrees.

      This parameter should be defined between 0 and -45 degrees. A large negative value will set a higher negative current on the d-axis for FWC.

    • USER_M1_FWC_MIN_ANGLE

      This parameter defines the minimum vector angle for FWC, in degrees.

      This parameter should not be changed from its default value of 0.

  • Startup and Running State Parameters:
    • USER_MOTOR1_RATED_VOLTAGE_V

      This parameter defines the rated voltage of the motor, in V.

      This parameter could be set to USER_M1_NOMINAL_DC_BUS_VOLTAGE_V / sqrt(2).

    • USER_MOTOR1_FREQ_MAX_Hz

      This parameter defines the maximum rotational speed of the motor in Hz.

      This parameter is system-dependent, and may be higher than the rated speed of the motor. A value of 100% to 150% of the rated speed of the motor is typical. Specific values should be decided according to system performance requirements.

    • USER_MOTOR1_ALIGN_CURRENT_A

      This parameter defines the current used to run motor rotor alignment, in A.

      This parameter should be set to 5%-50% of the rated current of the motor. Specific values should be decided according to system performance requirements.

    • USER_MOTOR1_FLUX_CURRENT_A

      This parameter defines the current used to run the motor in forced open-loop, in A.

      This parameter should be set to 5%-50% of the rated current of the motor. Specific values should be decided according to system performance requirements.

    • USER_MOTOR1_STARTUP_CURRENT_A

      This parameter defines the current, in A, used to run the motor in closed-loop when the speed is below the defined startup speed (USER_MOTOR1_SPEED_START_Hz).

      This parameter should be set to 10%-100% of the rated motor current.

    • USER_MOTOR1_TORQUE_CURRENT_A

      This parameter defines the initially assigned value for motor startup current, in A.

    • USER_MOTOR1_SPEED_START_Hz

      This parameter defines the startup speed threshold of the motor, in Hz.

      This parameter should be set higher than the minimum rotation speed of the motor, and typically falls between 10%-50% of the rated motor speed.

    • USER_MOTOR1_SPEED_FORCE_Hz

      This parameter defines the force open-loop speed threshold of the motor, in Hz.

      This parameter should be set higher than the minimum rotation speed of the motor, and typically falls between 5%-30% of the rated motor speed.

    • USER_MOTOR1_ACCEL_START_Hzps

      This parameter defines the motor acceleration during startup.

      This parameter should be set less than the maximum acceleration of the motor (USER_MOTOR1_ACCEL_MAX_Hzps), and otherwise should be set according to system performance requirements.

    • USER_MOTOR1_ACCEL_MAX_Hzps

      This parameter defines the maximum acceleration of the motor.

      This parameter should be set according to system performance requirements and motor hardware limitations.

    • USER_MOTOR1_SPEED_FS_Hz

      This parameter defines the flying-start speed threshold of the motor, in Hz.

      This parameter should be set higher than the minimum rotation speed of the motor, and typically falls between 0.1%-5% of the rated motor speed.

    • USER_MOTOR1_BRAKE_CURRENT_A

      When braking is enabled, this parameter defines the motor current during the braking state.

      This parameter should be set between 10%-50% of the rated motor current, according to system performance requirements.

    • USER_MOTOR1_BRAKE_TIME_DELAY

      This parameter defines the delay of the motor braking state in 5ms periods.

      This parameter should be set according to system performance requirements, and typically falls between 1-300s, converted to 5ms periods.

    • USER_M1_STOP_WAIT_TIME_SET

      This parameter defines the minimum waiting time to start the motor from a stopped state, in 5ms periods.

      This parameter should be set higher than 0.1s, converted to 5ms periods.

    • USER_M1_RESTART_WAIT_TIME_SET

      This parameter defines the minimum waiting time to start the motor from a fault state, in 5ms periods.

      This parameter should be set higher than 0.1s, converted to 5ms periods.

    • USER_M1_START_TIMES_SET

      This parameter defines the duration of the motor rotor alignment state, in 5ms periods.

      This parameter should be set between 1s-30s, converted to 5ms periods.

  • Motor Protection Parameters:
    • USER_M1_IS_OFFSET_AD_DELTA

      This parameter defines the error threshold for the ADC offset for the phase currents. If offset calibration is enabled, the system checks to ensure that all ADC offset values for current measurement circuits are within this delta from the initially defined parameters (USER_M1_Ix_OFFSET_AD). If the calculated ADC offset is beyond this delta from the initially defined parameter, this indicates a software error or hardware fault, and the system enters a fault handling state. This parameter is not used when utilizing single-shunt measurement.

      This parameter should be set between 0 to 200, inclusive, to allow sufficient range while still catching errors. To achieve a lower error delta, a higher accuracy sensing circuit may be required.

    • USER_M1_VA_OFFSET_SF_DELTA

      This parameter defines the error threshold for the ADC offset for the phase voltages. If offset calibration is enabled, the system checks to ensure that all ADC offset values for voltage measurement circuits are within this delta from the initially defined parameters (USER_M1_Vx_OFFSET_SF). If the calculated ADC offset is beyond this delta from the initially defined parameter, this indicates a software error or hardware fault, and the system enters a fault handling state. This parameter is only used for InstaSPIN-FOC FAST and InstaSPIN-BLDC.

      This parameter should be set between 0 to 200, inclusive, to allow sufficient range while still catching errors. To achieve a lower error delta, a higher accuracy sensing circuit may be required.

    • USER_M1_OVER_VOLTAGE_FAULT_V

      This parameter defines the over-voltage threshold for the motor and inverter hardware, in Volts. A DC bus voltage greater than this value indicates a software error or hardware fault has resulted in the calculated DC bus voltage going above the user-defined safe or expected range, and the system enters a fault handling state.

      This parameter should be set to a hardware-dependent value less than the full scale ADC voltage (USER_M1_ADC_FULL_SCALE_VOLTAGE_V).

    • USER_M1_OVER_VOLTAGE_NORM_V

      This parameter defines the lower threshold that indicates that a DC bus over-voltage fault (see USER_M1_OVER_VOLTAGE_FAULT_V) is no longer present, in V.

      This parameter should be set to a hardware-dependent value less than the over-voltage fault threshold (USER_M1_OVER_VOLTAGE_FAULT_V). Typically, this is several Volts below the over-voltage fault threshold, to ensure that the system has reliably returned to a safe or expected state.

    • USER_M1_UNDER_VOLTAGE_FAULT_V

      This parameter defines the under-voltage threshold for the motor and inverter hardware, in Volts. A DC bus voltage greater than this value indicates a software error or hardware fault has resulted in the calculated DC bus voltage going below the user-defined safe or expected range, and the system enters a fault handling state.

      This parameter should be set to a hardware-dependent value, typically, a few Volts above the minimum required to spin the motor.

    • USER_M1_UNDER_VOLTAGE_NORM_V

      This parameter defines the upper threshold that indicates that a DC bus under-voltage fault (see USER_M1_UNDER_VOLTAGE_FAULT_V) is no longer present, in V.

      This parameter should be set to a hardware-dependent value greater than the under-voltage fault threshold (USER_M1_UNDER_VOLTAGE_FAULT_V). Typically, this is a few Volts above the under-voltage fault threshold, to ensure that the system has reliably returned to a safe or expected state.

    • USER_M1_LOST_PHASE_CURRENT_A

      This parameter defines the current threshold for the lost phase fault, in A. Beyond the minimum speed threshold for this error (USER_M1_FAIL_SPEED_MIN_HZ), the absolute value of any phase currents being beneath this value indicates a software error or hardware fault, and the system enters a fault handling state.

      This parameter should be set to a motor-dependent value according to system performance requirement. Typically, this value is between 0.1% to 10% of the rated current of the motor.

    • USER_M1_UNBALANCE_RATIO

      This parameter defines the ratio threshold indicating a phase unbalance fault. If the ratio between the largest to smallest RMS phase current value is beyond this ratio, this indicates a software error or hardware fault, and the system enters a fault handling state.

      This parameter should be set to a motor-dependent value according to system performance requirement. Typically, this value is a percent value between 5% and 25%. The default value of 20% should typically be sufficient for this application.

    • USER_MOTOR1_OVER_CURRENT_A

      This parameter defines the over-current threshold of the motor, in A. This value is used to calculate the CMPSS peripheral's DAC values, which in turn trigger the PWM's trip zone fault handling.

      This parameter should be set to a motor and system-dependent value that is typically 50% to 300% of the rated motor current.

      NOTE: If this value of this parameter is set greater than the maximum peak current value of the motor, defined as 47.5% of the ADC full scale current in this example, this parameter is ignored and the maximum peak current is used instead.

    • USER_M1_OVER_LOAD_POWER_W

      This parameter defines the over-power threshold for the motor and inverter hardware, in W. In the motor running state, if the calculated power of the motor is above this value, this indicates a software error or hardware fault, and the system enters a fault-handling state.

      This parameter should be set to a motor-dependent value, typically 50% to 200% of the rated motor power. This value must be less than the maximum output power that the motor can produce without exceeding its thermal rating.

    • USER_M1_STALL_CURRENT_A

      This parameter defines the current threshold for the RMS motor stator current, in A, when the calculated motor speed is beneath the speed threshold (USER_M1_FAIL_SPEED_MIN_HZ). When the motor current is above the fault checking threshold (see USER_M1_FAULT_CHECK_CURRENT_A), this indicates the minimum value for the motor stator current, and values beneath this parameter indicates a failed motor startup fault condition. A value above this parameter always indicates a motor stall fault condition.

      This parameter should be set to a motor-dependent value, typically 50% to 300% of the motor rated current. This value should be lower than the maximum peak current of the motor, defined as 47.5% of the ADC full scale current in this example.

      Note: The failed motor startup and motor stall conditions should not both be active.
    • USER_M1_FAULT_CHECK_CURRENT_A

      This parameter defines the current threshold for several motor faults, in A. When the RMS motor stator current is below this value, the unbalanced phase current fault, over-speed fault, and failed startup faults are not checked.

      This parameter should be set to a motor-dependent value according to system performance requirements. This value is typically 0.1% to 20% of the rated motor current.

    • USER_M1_FAIL_SPEED_MAX_HZ

      This parameter defines the maximum speed of the motor in Hz. If the calculated speed is above this value, this indicates a software error or hardware fault, and the system enters a fault-handling state.

      This parameter should be set to a motor-dependent value according to system performance requirements. This value is typically 200% to 500% of the rated speed of the motor.

    • USER_M1_FAIL_SPEED_MIN_HZ

      This parameter defines the minimum speed threshold of the motor, in Hz. Certain faults are only checked when the motor is above or below this value. The stall current and failed motor startup faults are only checked when the motor speed is below this value. The lost phase fault is only checked when the motor speed is above this value.

      This parameter should be set to a motor-dependent value according to system performance requirements. This value is typically 1% to 10% of the rated motor speed, and must be higher than the minimum rotation speed of the motor.

    • USER_M1_VOLTAGE_FAULT_TIME_SET

      This parameter defines the duration time to set or clear the over and under-voltage faults, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set. When the fault condition is not present for longer than this period, the error flag is reset.

      This parameter should be set according to system performance requirements. This value is typically between 0.02 to 3.0s. The default value should be sufficient for most applications.

    • USER_M1_OVER_LOAD_TIME_SET

      This parameter defines the duration time to set the over load power fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.01 to 1.0s. The default value should be sufficient for most applications.

    • USER_M1_STALL_TIME_SET

      This parameter defines the duration time to set the motor stall current fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.01 to 2.0s. The default value should be sufficient for most applications.

    • USER_M1_UNBALANCE_TIME_SET

      This parameter defines the duration time to set the motor unbalanced phase current fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.05 to 5.0s. The default value should be sufficient for most applications.

    • USER_M1_LOST_PHASE_TIME_SET

      This parameter defines the duration time to set the motor lost phase current fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.05 to 5.0s. The default value should be sufficient for most applications.

    • USER_M1_OVER_SPEED_TIME_SET

      This parameter defines the duration time to set the motor over-speed fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.05 to 5.0s. The default value should be sufficient for most applications.

    • USER_M1_STARTUP_FAIL_TIME_SET

      This parameter defines the duration time to set the failed motor startup fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 1.0s to 20.0s. The default value should be sufficient for most applications.

    • USER_M1_OVER_CURRENT_TIMES_SET

      This parameter defines the duration time to set the motor over-current fault, in 5ms periods. When the fault condition is detected for longer than this period, the error flag is set.

      This parameter should be set according to system performance requirements. This value is typically between 0.01s to 0.5s. The default value should be sufficient for most applications.

  • PI Regulator Gain Tuning Parameters:
    • General PI Tuning Notes

      Typical initial Kp and Ki of the speed and current regulators are calculated based on motor parameters. These runtime values for the gain will be changed according to the motor running speed or vector current after startup.

      The gain of the PI regulator is set according to the following rules:

      Kp Gain Ki Gain Condition
      Kp* = Kp * G(p_start) Ki* = Ki * G(i_start) Motor startup
      Kp* = Kp * G(p_low) Ki* = Ki * G(i_low) After startup and condition low
      Kp* = Kp * G(p_high) Ki* = Ki * G(i_high) After startup and condition high

      Kp* = Kp * (G(p_low) + H(p_low) * (condition state))

      Ki* = Ki * (G(i_low) + H(i_low) * (condition state)) No other conditions matched

      Where:

      • H(p_slope) = (G(p_high) - G(p_low)) / (condition range)
      • H(i_slope) = (G(i_high) - G(i_low)) / (condition range)
      • Condition low =
        • Speed regulator: ω(e) < ω(e_low)
        • Current regulator: i(s) < i(s_low)
      • Condition high =
        • Speed regulator: ω(e) > ω(e_high)
        • Current regulator: i(s) > i(s_high)
      • Condition state =
        • Speed regulator: ω(e) - ω(e_low)
        • Current regulator: i(s) -i(s_low)
      • Condition range =
        • Speed regulator: ω(e_high) - ω(e_low)
        • Current regulator: i(s_high) -i(s_low)
    • USER_MOTOR1_GAIN_SPEED_LOW_Hz

      This parameter defines the low speed threshold for adjusting Kp* and Ki* of the speed PI regulator.

      This parameter should be set between 10% to 30% of the rated speed of the motor, according to motor and application requirements.

    • USER_MOTOR1_GAIN_SPEED_HIGH_Hz

      This parameter defines the high speed threshold for adjusting Kp* and Ki* of the speed PI regulator.

      This parameter should be set between 60% to 100% of the rated speed of the motor, according to motor and application requirements.

    • USER_MOTOR1_Kx_SPD_START_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_start to adjust the Kx* of the speed PI regulator for startup.

      This parameter should be set between 0.1 to 2.0 according to motor and application requirements, and should be lower than Gx_low in most application.

      USER_MOTOR1_Kp_SPD_START_SF; USER_MOTOR1_Ki_SPD_START_SF

    • USER_MOTOR1_Kx_SPD_LOW_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_low to adjust the Kx* of the speed PI regulator.

      This parameter should be set between 0.1 to 10.0 according to motor and application requirements, and should generally be higher than Gx_high.

      USER_MOTOR1_Kp_SPD_LOW_SF; USER_MOTOR1_Ki_SPD_LOW_SF

    • USER_MOTOR1_Kx_SPD_HIGH_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_high to adjust the Kx* of the speed PI regulator.

      This parameter should be set between 0.1 to 5.0 according to motor and application requirements, and should generally be lower than Gx_low.

      USER_MOTOR1_Kp_SPD_HIGH_SF; USER_MOTOR1_Ki_SPD_HIGH_SF

    • USER_MOTOR1_GAIN_IQ_LOW_A

      This parameter defines the low current threshold is_low to adjust the gains of the q-axis current PI controller.

      This parameter should be set to 10% to 50% of the rated current of the motor, according to system performance, motor, and application requirements.

    • USER_MOTOR1_GAIN_IQ_HIGH_A

      This parameter defines the high current threshold is_high to adjust the gains of the q-axis current PI controller.

      This parameter should be set to 50% to 100% of the rated current of the motor, according to system performance, motor, and application requirements.

    • USER_MOTOR1_Kx_IQ_START_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_start to adjust the gains of the q-axis current PI controller during startup.

      This parameter should be set to 0.1 to 5.0 according to system performance, motor, and application requirements.

      USER_MOTOR1_Kp_IQ_START_SF; USER_MOTOR1_Ki_IQ_START_SF

    • USER_MOTOR1_Kx_IQ_LOW_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_low to adjust the gains of the q-axis current PI controller during startup.

      This parameter should be set to 0.1 to 10.0 according to system performance, motor, and application requirements, and should be higher than Gx_high.

      USER_MOTOR1_Kp_IQ_LOW_SF; USER_MOTOR1_Ki_IQ_LOW_SF

    • USER_MOTOR1_Kx_IQ_HIGH_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx_high to adjust the gains of the q-axis current PI controller during startup.

      This parameter should be set to 0.1 to 5.0 according to system performance, motor, and application requirements, and should be lower than Gx_low.

      USER_MOTOR1_Kp_IQ_HIGH_SF; USER_MOTOR1_Ki_IQ_HIGH_SF

    • USER_MOTOR1_Kx_ID_SF

      Where Kx is either Kp or Ki, this parameter defines the gain coefficient Gx to adjust the gains of the d-axis current PI controller.

      This parameter should be set between 0.1 to 5.0 according to system performance, motor, and application requirements.

      USER_MOTOR1_Kp_ID_SF; USER_MOTOR1_Ki_ID_SF

  • Potentiometer Control Parameters:
    • USER_M1_POT_ADC_MIN

      When potentiometer speed control is enabled, this parameter defines the minimum allowable ADC value for the potentiometer. If the ADC reading is below this value, the motor speed is set to 0.

      This parameter should be set such that ADC noise cannot result in a value above this when the motor is intended to be disabled.

    • USER_M1_POT_ADC_MAX

      When potentiometer speed control is enabled, this parameter defines the maximum allowable ADC value for the potentiometer. If the ADC reading is above this value, the motor speed is set to the maximum.

      This parameter should be set to the maximum possible ADC value ( 4096 in this example) offset by USER_M1_POT_ADC_MIN. In this example, that's 4096U-200U.

    • USER_M1_POT_SPEED_SF

      When potentiometer speed control is enabled, this derived parameter defines the exact relationship between ADC reading and motor speed.

      This parameter is derived from the minimum and maximum potentiometer ADC values (USER_M1_POT_ADC_MIN and USER_M1_POT_ADC_MAX), as well as the motor maximum speed (USER_MOTOR1_FREQ_MAX_Hz).

    • USER_M1_POT_SPEED_MIN_Hz

      When potentiometer speed control is enabled, this derived parameter defines the minimum frequency of the motor in Hz. When the potentiometer ADC reading results in a nonzero value that is below this speed, the motor speed is set to this value instead.

      This parameter is set to 10% of the motor maximum speed (USER_MOTOR1_FREQ_MAX_Hz).

    • USER_M1_POT_SPEED_MAX_Hz

      When potentiometer speed control is enabled, this derived parameter defines the maximum frequency of the motor in Hz. When the potentiometer ADC reading results in a value that is above this speed, the motor speed is set to this value instead.

      This parameter is set to 50% of the motor maximum speed (USER_MOTOR1_FREQ_MAX_Hz).

    • USER_M1_WAIT_TIME_SET

      When potentiometer speed control is enabled, this parameter defines the wait period between speed updates in 1ms periods.

      This parameter should be set to a value which allows for rapid adjustments, while not allowing noise to excessively influence calculations. The default value of 500ms is sufficient for most applications.

  • Speed Pulse Control Parameters:
    • USER_M1_SPEED_CAP_MIN_Hz

      When cmd pulse speed control is enabled, allowing the motor speed to be calculated from a speed pulse on an input GPIO, this parameter defines the minimum frequency of the motor in Hz. When the calculated motor speed is below this value, the motor speed is instead set to 0.

      This parameter should be set according to the minimum motor rotation speed, and by default is not derived automatically.

    • USER_M1_SPEED_CAP_MAX_Hz

      When cmd pulse speed control is enabled, allowing the motor speed to be calculated from a speed pulse on an input GPIO, this parameter defines the maximum frequency of the motor in Hz. When the calculated motor speed is above this value, the motor speed is instead set to 0.

      This parameter should be set according to the maximum rated motor speed, and by default is not derived automatically.

      Note: A calculated speed above the maximum does NOT set the speed to the maximum as it does in the potentiometer control mode, instead it disables the motor.
    • USER_M1_CAP_WAIT_TIME_SET

      When cmd pulse speed control is enabled, allowing the motor speed to be calculated from a speed pulse on an input GPIO, this parameter defines the wait period between speed updates in 1ms periods.

      This parameter should be set to a value which allows for rapid adjustments, while not allowing noise to excessively influence calculations. The default value of 200ms is sufficient for most applications.

  • Switch Control Parameter:
    • USER_M1_SWITCH_WAIT_TIME_SET

      When cmd switch control is enabled, allowing the motor to be enabled or disabled with a switch, this parameter defines the minimum wait period between switch state updates in 1ms periods.

      This parameter should be set to a value which allows for rapid adjustments, while not allowing noise to excessively influence calculations. The default value of 50ms is sufficient for most applications.