TIDUF60 December   2023

 

  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 Design Considerations
    3. 2.3 Highlighted Products
      1. 2.3.1 TMS320F2800137
      2. 2.3.2 MSPM0G1507
      3. 2.3.3 TMP6131
      4. 2.3.4 UCC28881
      5. 2.3.5 TPS54202
      6. 2.3.6 TLV9062
      7. 2.3.7 TLV74033
    4. 2.4 System Design Theory
      1. 2.4.1 Hardware Design
        1. 2.4.1.1 Modular Design
        2. 2.4.1.2 High-Voltage Buck Auxiliary Power Supply
        3. 2.4.1.3 DC Link Voltage Sensing
        4. 2.4.1.4 Motor Phase Voltage Sensing
        5. 2.4.1.5 Motor Phase Current Sensing
        6. 2.4.1.6 External Overcurrent Protection
        7. 2.4.1.7 Internal Overcurrent Protection for TMS320F2800F137
      2. 2.4.2 Three-Phase PMSM Drive
        1. 2.4.2.1 Field-Oriented Control of PM Synchronous Motor
          1. 2.4.2.1.1 Space Vector Definition and Projection
            1. 2.4.2.1.1.1 ( a ,   b ) ⇒ ( α , β ) Clarke Transformation
            2. 2.4.2.1.1.2 α , β ⇒ ( d ,   q ) Park Transformation
          2. 2.4.2.1.2 Basic Scheme of FOC for AC Motor
          3. 2.4.2.1.3 Rotor Flux Position
        2. 2.4.2.2 Sensorless Control of PM Synchronous Motor
          1. 2.4.2.2.1 Enhanced Sliding Mode Observer With Phase-Locked Loop
            1. 2.4.2.2.1.1 Mathematical Model and FOC Structure of an IPMSM
            2. 2.4.2.2.1.2 Design of ESMO for the IPMSM
            3. 2.4.2.2.1.3 Rotor Position and Speed Estimation With PLL
        3. 2.4.2.3 Field Weakening (FW) and Maximum Torque Per Ampere (MTPA) Control
        4. 2.4.2.4 Hardware Prerequisites for Motor Drive
          1. 2.4.2.4.1 Motor Current Feedback
            1. 2.4.2.4.1.1 Three-Shunt Current Sensing
            2. 2.4.2.4.1.2 Single-Shunt Current Sensing
          2. 2.4.2.4.2 Motor Voltage Feedback
  9. 3Hardware, Software, Testing Requirements, and Test Results
    1. 3.1 Getting Started Hardware
      1. 3.1.1 Hardware Board Overview
      2. 3.1.2 Test Conditions
      3. 3.1.3 Test Equipment Required for Board Validation
    2. 3.2 Getting Started GUI
      1. 3.2.1 Test Setup
      2. 3.2.2 Overview of GUI Software
      3. 3.2.3 Setup Serial Port
      4. 3.2.4 Motor Identification
      5. 3.2.5 Spin Motor
      6. 3.2.6 Motor Fault Status
      7. 3.2.7 Tune Control Parameters
      8. 3.2.8 Virtual Oscilloscope
    3. 3.3 Getting Started C2000 Firmware
      1. 3.3.1 Download and Install Software Required for Board Test
      2. 3.3.2 Opening Project Inside CCS
      3. 3.3.3 Project Structure
      4. 3.3.4 Test Procedure
        1. 3.3.4.1 Build Level 1: CPU and Board Setup
          1. 3.3.4.1.1 Start CCS and Open Project
          2. 3.3.4.1.2 Build and Load Project
          3. 3.3.4.1.3 Setup Debug Environment Windows
          4. 3.3.4.1.4 Run the Code
        2. 3.3.4.2 Build Level 2: Open-Loop Check With ADC Feedback
          1. 3.3.4.2.1 Start CCS and Open Project
          2. 3.3.4.2.2 Build and Load Project
          3. 3.3.4.2.3 Setup Debug Environment Windows
          4. 3.3.4.2.4 Run the Code
        3. 3.3.4.3 Build Level 3: Closed Current Loop Check
          1. 3.3.4.3.1 Start CCS and Open Project
          2. 3.3.4.3.2 Build and Load Project
          3. 3.3.4.3.3 Setup Debug Environment Windows
          4. 3.3.4.3.4 Run the Code
        4. 3.3.4.4 Build Level 4: Full Motor Drive Control
          1. 3.3.4.4.1 Start CCS and Open Project
          2. 3.3.4.4.2 Build and Load Project
          3. 3.3.4.4.3 Setup Debug Environment Windows
          4. 3.3.4.4.4 Run the Code
          5. 3.3.4.4.5 Tuning Motor Drive FOC Parameters
          6. 3.3.4.4.6 Tuning Field Weakening and MTPA Control Parameters
          7. 3.3.4.4.7 Tuning Current Sensing Parameters
    4. 3.4 Test Results
      1. 3.4.1 Load and Thermal Test
      2. 3.4.2 Overcurrent Protection by External Comparator
      3. 3.4.3 Overcurrent Protection by Internal CMPSS
    5. 3.5 Migrate Firmware to a New Hardware Board
      1. 3.5.1 Configure the PWM, CMPSS, and ADC Modules
      2. 3.5.2 Setup Hardware Board Parameters
      3. 3.5.3 Configure Faults Protection Parameters
      4. 3.5.4 Setup Motor Electrical Parameters
    6. 3.6 Getting Started MSPM0 Firmware
  10. 4Design and Documentation Support
    1. 4.1 Design Files
      1. 4.1.1 Schematics
      2. 4.1.2 Bill of Materials
      3. 4.1.3 PCB Layout Recommendations
      4. 4.1.4 Altium Project
      5. 4.1.5 Gerber Files
    2. 4.2 Software Files
    3. 4.3 Documentation Support
    4. 4.4 Support Resources
    5. 4.5 Trademarks
  11. 5About the Author
Run the Code

To run the code, complete the following steps:

  1. Set the AC source output to 0 V at 50/60 Hz, turn on the AC power supply, slowly increase the input voltage from 0-V to 220-V AC.
  2. The required motor parameters must be recorded in the header files (user_mtr1.h) as shown in the following example codes. If the motor parameters are not well known, the motor identification can be used to achieve the motor parameters if the FAST estimator is implemented in the reference design.
    #define USER_MOTOR1_Rs_Ohm                  (2.68207002f)
    #define USER_MOTOR1_Ls_d_H                  (0.00926135667f)
    #define USER_MOTOR1_Ls_q_H                  (0.00926135667f)
    #define USER_MOTOR1_RATED_FLUX_VpHz         (0.381890297f)
  3. Change the userParams_M1.flag_bypassMotorId value to "false" to enable the motor identification as the following example code for motor.
    // true->enable identification, false->disable identification
        userParams[MTR_1].flag_bypassMotorId = false;
  4. Set the right identification variables value in the user_mtr1.h according to the specification of the motor.
     #define USER_MOTOR1_RES_EST_CURRENT_A       (1.0f)      // A - 10~30% of rated current of the motor
    #define USER_MOTOR1_IND_EST_CURRENT_A       (-1.0f)     // A - 10~30% of rated current of the motor, just enough to enable rotation
    #define USER_MOTOR1_MAX_CURRENT_A           (6.5f)      // A - 30~150% of rated current of the motor
    #define USER_MOTOR1_FLUX_EXC_FREQ_Hz        (40.0f)     // Hz - 10~30% of rated frequency of the motor
  5. Rebuild the project and load the code into the controller, run the project by clicking on the GUID-20210205-CA0I-MBHJ-Q1VP-G5KSK6MTBX5D-low.svg button, or click RunResume in the Debug tab. The systemVars.flagEnableSystem needs to be 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 motor fault flags motorVars_M1.faultMtrUse.all need to be equal to "0", if not, check the current and voltage sensing circuit as described in Section 3.3.4.1.
  6. Set the variable motorVars_M1.flagEnableRunAndIdentify to "1" in the Expressions window as shown in Figure 3-36, the motor identification can be executed, the whole process takes about 150 s. Once motorVars_M1.flagEnableRunAndIdentify is equal to "0", the motor parameters have been identified. Record the watch window values with the newly-defined motor parameters in user_mtr1.h as follows:
    • USER_MOTOR1_Rs = motorVars_M1.Rs_Ohm’s value
    • USER_MOTOR1_Ls_d = motorVars_M1.Ls_d_H’s value
    • USER_MOTOR1_Ls_q = motorVars_M1.Ls_q_H’s value
    • USER_MOTOR_RATED_FLUX = motorVars_M1.flux_VpHz’s value
  7. Set both userParams_M1.flag_bypassMotorId to "true" after successfully identify the motors parameters, rebuild the project and load the code into the controller.
    • Set the variables motorVars_M1.flagEnableRunAndIdentify equal to "1" again for starting to run the motor.
    • Set the variables motorVars_M1.speedRef_Hz to a different value and watch how the motor shaft speed follows.
    • To change the acceleration, enter a different acceleration value for the variables motorVars_M1.accelerationMax_Hzps and motorVars_M1.accelerationMax_Hzps.
  8. The controller can now be halted before setting the motorVars_M1.flagEnableRunAndIdentify to "0", and the debug connection terminated. Fully halting the controller by first clicking the Halt button GUID-20210410-CA0I-9RHS-JH6R-HGGSQQK0HGJ6-low.svg on the toolbar or by clicking TargetHalt. Finally, reset the controller by clicking on GUID-20210205-CA0I-NRZW-VPNN-F3WWKQZJLPHF-low.svg or clicking RunReset.
  9. Close the CCS debug session by clicking on Terminate Debug SessionGUID-20210205-CA0I-W5NW-T57Q-LSMG9XLRGNTV-low.svg or clicking RunTerminate.
GUID-20231110-SS0I-CLDJ-QBB0-XF3HWBRHLCRW-low.pngFigure 3-36 Build Level 4: Expressions Window at Run Time
GUID-20231110-SS0I-2QZS-G8L4-SWKN36TFPVHR-low.pngFigure 3-37 Build Level 4: Rotor Angle, Phase Current of Motor