SLAU927A March   2024  – June 2024 MSPM0G3507

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Hardware Setup
    1. 2.1  EVM Hardware Setup
      1. 2.1.1 EVM Hardware Support
    2. 2.2  Pin Configurations for IPD Usage
    3. 2.3  Pin Configurations for PWM Outputs
    4. 2.4  Pin Configurations for ADC Currents
    5. 2.5  Pin Configurations for ADC Voltages
    6. 2.6  Pin Configurations for Faults
    7. 2.7  Pin Configurations for GPIO Output Functions
    8. 2.8  Pin Configurations for SPI Communication
    9. 2.9  Pin Configurations for UART Communication
    10. 2.10 External Connections for Evaluation Boards
  6. 3Software Setup
    1. 3.1 Software Support
  7. 4GUI Setup
  8. 5Register Map
    1. 5.1 User Control Registers (Base Address = 0x20200400h)
    2. 5.2 User Input Registers (Base Address = 0x20200000h)
    3. 5.3 User Status Registers (Base Address = 0x20200430h)
  9. 6Basic Tuning
    1. 6.1 System Configuration Parameters
      1. 6.1.1 Configuring System Parameters from GUI
      2. 6.1.2 Motor Resistance in Milliohms (mΩ)
      3. 6.1.3 Motor Inductance in Microhenries (μH)
      4. 6.1.4 Saliency of IPMSM Motor
      5. 6.1.5 Motor BEMF Constant
      6. 6.1.6 Base Voltage (V)
      7. 6.1.7 Base Current (A)
      8. 6.1.8 Maximum Motor Electrical Speed (Hz)
    2. 6.2 Control Configurations for Basic Motor Spinning
      1. 6.2.1 Basic Motor Startup
        1. 6.2.1.1 Disable ISD
        2. 6.2.1.2 Motor Start Option - Align
        3. 6.2.1.3 Motor Open Loop Ramp
        4. 6.2.1.4 Motor Open Loop Debug
      2. 6.2.2 Controller Configuration for spinning the Motor in Closed Loop
        1. 6.2.2.1 PI Controller Tuning for Closed Loop Speed Control
        2. 6.2.2.2 Testing for Successful Startup Into Closed Loop
    3. 6.3 Fault Handling
      1. 6.3.1 Abnormal BEMF Fault [ABN_BEMF]
      2. 6.3.2 Monitoring Power Supply Voltage Fluctuations for Voltage Out of Bound Faults
      3. 6.3.3 No Motor Fault [NO_MTR]
  10. 7Advanced Tuning
    1. 7.1 Control Configurations Tuning
      1. 7.1.1  Initial Speed Detection of the Motor for Reliable Motor Resynchronization
      2. 7.1.2  Unidirectional Motor Drive Detecting Backward Spin
      3. 7.1.3  Preventing Back Spin of Rotor During Startup
      4. 7.1.4  Gradual and Smooth Start up Motion
      5. 7.1.5  Faster Startup Timing
      6. 7.1.6  Stopping Motor Quickly
      7. 7.1.7  Flux Weakening : Operating Motor at Speeds Higher than Rated Speed
      8. 7.1.8  Maximum Torque Per Ampere : Improve Efficiency of IPMSM Motors
      9. 7.1.9  Preventing Supply Voltage Overshoot During Motor Stop.
      10. 7.1.10 Protecting the Power Supply
      11. 7.1.11 FOC Bandwidth Selection
  11. 8Hardware Configurations
    1. 8.1 Direction Configuration
    2. 8.2 Brake Configuration
    3. 8.3 Main.h Definitions
    4. 8.4 Real Time Variable Tracking
  12. 9Revision History

PI Controller Tuning for Closed Loop Speed Control

Current Controller Tuning

The FOC Algorithm uses two current PI controllers: one each for Id and Iq to control flux and torque separately. Kp and Ki coefficients are the same for both PI controllers and are configured through currLoopKp and currLoopKi in the Motor Tuning page.

For the basic tuning, configure currLoopKp and currLoopKi parameters as "0" so that these values are auto-computed based on the motor parameters and reflected in the User Outputs section of the Motor Tuning page in the GUI. These values can be further updated for fine tuning the performance and controlling the dynamics of the system.


 PI Loop Tuning in GUI Motor Tuning page

Figure 6-9 PI Loop Tuning in GUI Motor Tuning page

Speed Controller Tuning

The FOC Algorithm uses an integrated speed control loop that helps maintain a constant speed over varying operating conditions. The Kp and Ki coefficients are configured through speedLoopKp and speedLoopKi in the "System Configurations" section on the Motor Tuning page. The output of the speed loop is used to generate the current reference for torque control. The output of the speed loop is limited by configuring iLIMIT in the closedLoop1 configuration in the Register Map page of GUI. When output of the speed loop saturates, the integrator is disabled to prevent integral wind-up.

To tune the Kp and Ki values for speed loop:

  1. Configure the motor to spin continuously in open loop by setting closedloopDis to 1b. Disable the automatic handoff by setting autoHandOffEn to 0b.
  2. Set the closed loop hand off threshold to around 50% of maximum speed using olClHandOffThr.
  3. Set the iqRampEn bit to 1b in the userInputMotorStartUp1 register.
  4. The current reference gradually decreases and settles down to the lowest possible Iqref to run at the given threshold speed.
  5. Speed loop Kp [SPD_LOOP_KP] is calculated using this equation: SpeedLoop Kp = Current Reference at olClHandOffThr in Amps / olClHandOffThr in Hz
  6. Speed loop Ki [SPD_LOOP_KI] is calculated using this equation: Speed Loop Ki = Speed Loop Kp × 0.1
  7. Enable closed loop by clearing the closedloopDis to (0b) in the configuration in the Register Map page of the GUI.
    Note: The tuning of speed loop Kp and Ki is experimental. If the above recommendation does not work, manually tune speed loop Kp and Ki until the desired results are achieved.

    The following table shows general guidelines to change controller gains.

    Parameter Rise Time Overshoot Settling Time Stead State Error Stability
    Kp Decreases Increases Small Change Decreases Degrades
    Ki Decreases Increases Increases Eliminates Degrades