TIDUF67 April   2024  – December 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. Disable the data cache by unchecking the Data Cache Enabled in the Tools > ARM Advanced Features.
  2. Run the code by pressing on the Resume button, or click RunResume in the Debug tab.
  3. The project now runs, and the values in the graph and watch window keep updating.
  4. In the Expressions window, set the variables motorVars_M1.flagEnableRunAndIdentify to 1 after systemVars.flagEnableSystem was automatically set to 1 in the watch window.
  5. The project now runs, and the values in the graphs and expressions window continuously update as shown in Figure 4-13 while using this project. You can re-size the windows according to your preference.
  6. In the watch view, the variables motorVars_M1.flagRunIdentAndOnLine is set to 1 automatically if there are no faults. The ISRCount increases continuously.
  7. Check the calibration offsets of the motor driver board. The offset values of the motor phase current sensing values are equal to approximately half of the ADC scale current as shown in Figure 4-13.
  8. If using the graph tool, the variables shown in the graphs are the FOC angle and phase currents for phase u, v and w.
  9. Expand and check the MotorVars_M1.faultMtrPrev.bit structure to maintain that there are no fault flags set.
  10. Using an oscilloscope, probe the PWM outputs that are used for motor drive control. The duty cycles of the three PWMs are set to 50% in this build level. The expected PWM output waveforms are as shown in Figure 4-14. The PWM switching frequency are the same as the value that was set for the USER_M1_PWM_FREQ_kHz define in the user_mtr1.h file.
  11. Set the motorVars_M1.flagEnableRunAndIdentify variable to 0 to disable the PWMs.
  12. If any of the previous steps provide unexpected results, additional debug is necessary. A few things to check are:
    1. Make sure that the motor driver board being used is the same as the board selected in the build configurations.
    2. Make sure that the proper predefines are set.
    3. Make sure that the switches are configured properly on the Lunchpad/ControlCARD as described in Section 4.3.
  13. Once the previous steps are complete, the controller can now be halted, and the debug connection terminated. Halt the controller by first clicking the Halt button on the toolbar or by clicking TargetHalt. Finally, reset the controller by clicking on the button or clicking RunReset→CPU Reset.
  14. Close the CCS debug session by clicking the Terminate Debug Session button or clicking RunTerminate. This halts the program and disconnect Code Composer from the MCU.
  15. Terminating the debug session each time the user changes or runs the code again is not necessary. Instead, the following procedure can be followed. After rebuilding the project, press the button or click RunReset→CPU Reset, and then press the Restart button or click RunRestart. The project must be terminated if the target device or the configuration is changed, and before shutting down CCS.
TIDM-02018 Build Level 1: Variables in
          Expressions Window Figure 4-13 Build Level 1: Variables in Expressions Window

The PWM with deadband outputs to the input of the gate drive are shown in Figure 4-14.

TIDM-02018 Build Level 1: PWM Output
          Waveforms Figure 4-14 Build Level 1: PWM Output Waveforms