TIDUF67 April   2024

 

  1.   1
  2.   Description
  3.   Resources
  4.   Features
  5.   Applications
  6.   6
  7. 1System Description
    1. 1.1 Terminology
    2. 1.2 Key System Specifications
  8. 2System Overview
    1. 2.1 Block Diagram
    2. 2.2 Highlighted Products
      1. 2.2.1 AM263x Microcontrollers
        1. 2.2.1.1 TMDSCNCD263
        2. 2.2.1.2 LP-AM263
  9. 3System Design Theory
    1. 3.1 Three-Phase PMSM Drive
      1. 3.1.1 Mathematical Model and FOC Structure of PMSM
      2. 3.1.2 Field Oriented Control of PM Synchronous Motor
        1. 3.1.2.1 The ( a ,   b ) ⇒ ( α , β ) Clarke Transformation
        2. 3.1.2.2 The α , β ⇒ ( d ,   q ) Park Transformation
        3. 3.1.2.3 The Basic Scheme of FOC for AC Motor
        4. 3.1.2.4 Rotor Flux Position
      3. 3.1.3 Sensorless Control of PM Synchronous Motor
        1. 3.1.3.1 Enhanced Sliding Mode Observer With Phase Locked Loop
          1. 3.1.3.1.1 Design of ESMO for PMSM
          2. 3.1.3.1.2 Rotor Position and Speed Estimation with PLL
      4. 3.1.4 Hardware Prerequisites for Motor Drive
      5. 3.1.5 Additional Control Features
        1. 3.1.5.1 Field Weakening (FW) and Maximum Torque Per Ampere (MTPA) Control
        2. 3.1.5.2 Flying Start
  10. 4Hardware, Software, Testing Requirements, and Test Results
    1. 4.1 Hardware Requirements
    2. 4.2 Software Requirements
      1. 4.2.1 Importing and Configuring Project
      2. 4.2.2 Project Structure
      3. 4.2.3 Lab Software Overview
    3. 4.3 Test Setup
      1. 4.3.1 LP-AM263 Setup
      2. 4.3.2 BOOSTXL-3PHGANINV Setup
      3. 4.3.3 TMDSCNCD263 Setup
      4. 4.3.4 TMDSADAP180TO100 Setup
      5. 4.3.5 TMDSHVMTRINSPIN Setup
    4. 4.4 Test Results
      1. 4.4.1 Level 1 Incremental Build
        1. 4.4.1.1 Build and Load Project
        2. 4.4.1.2 Setup Debug Environment Windows
        3. 4.4.1.3 Run the Code
      2. 4.4.2 Level 2 Incremental Build
        1. 4.4.2.1 Build and Load Project
        2. 4.4.2.2 Setup Debug Environment Windows
        3. 4.4.2.3 Run the Code
      3. 4.4.3 Level 3 Incremental Build
        1. 4.4.3.1 Build and Load Project
        2. 4.4.3.2 Setup Debug Environment Windows
        3. 4.4.3.3 Run the Code
      4. 4.4.4 Level 4 Incremental Build
        1. 4.4.4.1 Build and Load Project
        2. 4.4.4.2 Setup Debug Environment Windows
        3. 4.4.4.3 Run the Code
    5. 4.5 Adding Additional Functionality to Motor Control Project
      1. 4.5.1 Using DATALOG Function
      2. 4.5.2 Using PWMDAC Function
      3. 4.5.3 Adding CAN Functionality
      4. 4.5.4 Adding SFRA Functionality
        1. 4.5.4.1 Principle of Operation
        2. 4.5.4.2 Object Definition
        3. 4.5.4.3 Module Interface Definition
        4. 4.5.4.4 Using SFRA
    6. 4.6 Building a Custom Board
      1. 4.6.1 Building a New Custom Board
        1. 4.6.1.1 Hardware Setup
        2. 4.6.1.2 Migrating Reference Code to a Custom Board
          1. 4.6.1.2.1 Setting Hardware Board Parameters
          2. 4.6.1.2.2 Modifying Motor Control Parameters
          3. 4.6.1.2.3 Changing Pin Assignment
          4. 4.6.1.2.4 Configuring the PWM Module
          5. 4.6.1.2.5 Configuring the ADC Module
          6. 4.6.1.2.6 Configuring the CMPSS Module
  11. 5General Texas Instruments High Voltage Evaluation (TI HV EVM) User Safety Guidelines
  12. 6Design and Documentation Support
    1. 6.1 Design Files
      1. 6.1.1 Schematics
      2. 6.1.2 BOM
      3. 6.1.3 PCB Layout Recommendations
        1. 6.1.3.1 Layout Prints
    2. 6.2 Tools and Software
    3. 6.3 Documentation Support
    4. 6.4 Support Resources
    5. 6.5 Trademarks
  13. 7About the Author

Run the Code

  1. Power on the AC or DC power supply, gradually increase output voltage at power supply to get an appropriate DC-bus voltage.
  2. The required motor parameters must be defined in the user_mtr1.h header file as shown in the following example code.
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (4)
    #define USER_MOTOR1_Rr_Ohm (NULL)
    #define USER_MOTOR1_Rs_Ohm (0.38157931f)
    #define USER_MOTOR1_Ls_d_H (0.000188295482f)
    #define USER_MOTOR1_Ls_q_H (0.000188295482f)
    #define USER_MOTOR1_RATED_FLUX_VpHz (0.0396642499f)
  3. Build the project and load the code into the controller, disable the data cache by unchecking the "Data Cache Enabled" in Tools > ARM Advanced Features, run the project by clicking on Resume button, or click RunResume in the Debug tab. The systemVars.flagEnableSystem is set to 1 after a fixed time, that means the offsets calibration have been done and the power relay for inrush is turned on. The fault flags motorVars_M1.faultMtrUse.all is equal to 0 , if not, the user must check the current and voltage sensing circuit as described in Section 4.4.1.
  4. Set the variable motorVars_M1.flagEnableRunAndIdentify to 1 in the Expressions window as shown in Figure 4-26.
  5. After you start running the motor:
    1. Set the target speed value to the variable motorVars_M1.speedRef_Hz and watch how the motor shaft speed follow the setting speed.
    2. To change the acceleration, enter a different acceleration value for the variable motorVars_M1.accelerationMax_Hzps.
    3. Use PWMDAC module to display the monitoring variables as described in Section 4.5.2. The motor angle and current waveforms are shown in Figure 4-27.
  6. The default proportional gain (Kp) and integral gain (Ki) for the current controllers of the FOC system are calculated in the function setupControllers(). After setupControllers() is called, the global variables motorSetVars_M1.Kp_Id, motorSetVars_M1.Ki_Id, motorSetVars_M1.Kp_Iq, and motorSetVars_M1.Ki_Iq are initialized with the newly calculated Kp and Ki gains. Tune the Kp and Ki value of these four variables in Expressions Watch Window as shown in Figure 4-26 for the current controllers to achieve the expected current control bandwidth and response. The Kp gain creates a zero that cancels the pole of the motor’s stator and can easily be calculated. The Ki gain adjusts the bandwidth of the current controller-motor system. When a speed controlled system is needed for a certain damping, the Kp gain of the current controller relates to the time constant of the speed controlled system.
  7. Set the variables motorVars_M1.flagEnableRunAndIdentify to 0 to stop run the motor.
  8. Once complete, the controller can now be halted and the debug connection terminated. Fully halting the controller by first clicking the Suspend button on the toolbar or by clicking TargetHalt. Finally, reset the controller by clicking on CPU Reset button or clicking RunReset.
  9. Close CCS debug session by clicking on Terminate Debug Session button or clicking RunTerminate.
GUID-20240320-SS0I-BFXG-SMFC-M7TZV5SHLFH3-low.svg Figure 4-26 Build Level 4: Variables in Expressions Window
GUID-20240327-SS0I-6SKF-TWZR-RRL2SZTJFTMQ-low.svg Figure 4-27 Build Level 4: Phase Current and Rotor Angle with eSMO Waveforms at Forward Move

As illustrated in Section 4.2.2, multiple FOC algorithms can be supported in the project. The user can use one (eSMO or Hall or Encoder) algorithm or two algorithms (eSMO + Encoder) for motor control in the project.

The user can implement eSMO and Encoder estimators in the project simultaneously by adding the pre-define name MOTOR1_ESMO and MOTOR1_ENC in project properties as described in Section 4.2.1. Rebuild, load and run the project as the operation steps above.

  • The systemVars.estType value equals to EST_TYPE_ESMO_ENC that means eSMO and Encoder estimators are enabled in this project.
  • The motorVars_M1.estimatorMode equals to ESTIMATOR_MODE_ESMO that means the eSMO estimator is using for sensorless-FOC, equals to ESTIMATOR_MODE_ENC that means the encoder estimator is using for sensored-FOC.
  • The estimated rotor angles from eSMO and Encoder are shown in Figure 4-28. The motor is running with eSMO at forward rotation by setting motorVars_M1.speedRef_Hz to a positive value.
  • The user can change the value to ESTIMATOR_MODE_ENC to select the Encoder estimator for sensored-FOC. And also the user can change the value to switch the using estimator on the fly.
GUID-20240320-SS0I-WJMC-QJRH-WZSPTRBPMD0C-low.svg Figure 4-28 Build Level 4: Rotor Angle with eSMO and Encoder, Phase Current Waveforms at Forward Rotation