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. Power on the appropriate power supply, and gradually increase the output voltage of the power supply to get an appropriate DC-bus voltage.
  2. If using the graph tool, level 2 uses the same graph configurations and parameters as lab 1 to monitor 2 of the phase currents.
  3. Disable the data cache by unchecking the Data Cache Enabled in Tools > ARM Advanced Features.
  4. Run the project by clicking on the 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 has completed. The fault flags, motorVars_M1.faultMtrUse.all is equal to 0. If this is not the case, the user must double check the current and voltage sensing circuit in level 1 as described in Section 4.4.1.3. Also, if the moduleOverCurrent in motorVars_M1.faultMtrPrev.bit is 1, then motorSetVars_M1.overCurrent_A needs to be set to higher value to avoid initial high current fault.
  5. To verify the current and voltage sensing circuits of the motor driver, set the variable motorVars_M1.flagEnableRunAndIdentify to 1 in the Expressions window as shown in Figure 4-16. The motor runs with voltage/frequency (v/f) open loop. If the motor does not spin smoothly, tune the v/f profile parameters in the user_mtr1.h file as shown in the following according to the specification of the motor. Note: modification of these parameters requires rebuilding the project. See step 15 of Section 4.4.1.3 for more information on rebuilding the project in debug mode.
    #define USER_MOTOR1_FREQ_LOW_HZ            (5.0)            // Hz
    #define USER_MOTOR1_FREQ_HIGH_HZ           (400.0)          // Hz
    #define USER_MOTOR1_VOLT_MIN_V             (1.0)            // Volt
    #define USER_MOTOR1_VOLT_MAX_V             (24.0)           // Volt
  6. The motorVars_M1.speedRef_Hz variable is used to set the speed reference for the motor. Check the value of the motorVars_M1.speed_Hz variable in the Expressions window to maintain that the motor speed (motorVars_M1.speed_Hz) is close to the reference speed (motorVars_M1.speedRef_Hz) as shown in Figure 4-16.
  7. In this build level, the current sensing, voltage sensing, rotor angle estimator, and generator need to be validated. This can be done using the PWMDAC in HV motor kit as described in Section 4.5.2. Additionally, the DATALOG module can be used to view these sensing waveforms. For more information on using the DATALOG to view the currents, voltages, and angle signals, see step 8.
  8. If using the DATALOG module with the graph tool to check the current sensing signals, voltage sensing signals, and the angle outputs, follow the steps described in the following. For more info on the datalog module, see Section 4.5.1. Note:You must rebuild the project in between each of the following steps after modifying the code.
    1. To test the phase currents using the DATALOG module, the following code must be set up in the sys_main.c file. Note: this code is already configured by default for build level 2. The phase current sampling signals waveform displayed on the graph tool as shown in Figure 4-18.
      datalogObj->iptr[0] = (float32_t*) &motorVars_M1.adcData.I_A.value[0];
      datalogObj->iptr[1] = (float32_t*) &motorVars_M1.adcData.I_A.value[1];
    2. To test the phase voltage using the DATALOG module, the following code must be set up in the sys_main.c file. The phase voltage sampling signals waveform displayed on graph tool as shown in Figure 4-19.
      datalogObj->iptr[2] = (float32_t*) &motorVars_M1.adcData.V_V.value[0];
      
    3. The angle from the force angle generator or estimator can be monitored on the graph tool as shown in Figure 4-21. Notice that the angle of the force angle generator is very similar as the estimated rotor angle of the eSMO estimator.
      datalogObj->iptr[3] = (float32_t*) &motorVars_M1.angleFOC_rad;
  9. Verify the over current fault protection by decreasing the value of the variable motorVars_M1.overCurrent_A, the over current protection is implemented by the CMPSS modules. The over current fault triggers if the motorVars_M1.overCurrent_A is set to a value less than the motor phase current actual value, the PWM output is disabled, the motorVars_M1.flagEnableRunAndIdentify is cleared to 0, as shown in Figure 4-17.
  10. Set the variables motorVars_M1.flagEnableRunAndIdentify to 0 to stop run the motor.
  11. Once complete, the controller can now be halted, and the debug connection terminated. Fully halting the controller by first clicking the Halt button on the toolbar Suspend or by clicking TargetHalt. Finally, reset the controller by clicking on CPU Reset or clicking RunReset.
  12. Close CCS debug session by clicking on Terminate Debug Session button or clicking RunTerminate.
  13. Power off the power supply to the inverter kit.
TIDM-02018 Build Level 2: Variables in
          Expressions Window Figure 4-16 Build Level 2: Variables in Expressions Window

Adjust the value of motorVars_M1.overCurrent_A in Expression window to trigger the over current fault as shown in Figure 4-17.

TIDM-02018 Build Level 2: Current Protection
          Setting Figure 4-17 Build Level 2: Current Protection Setting

Use Datalog with Graph Tool to monitor three phase sensing current of the motor as shown in Figure 4-18.

TIDM-02018 Build Level 2: Motor Phase Current
          Waveforms with Graph Tool Figure 4-18 Build Level 2: Motor Phase Current Waveforms with Graph Tool

Use Datalog with Graph Tool to monitor three phase sensing voltage of the motor as shown in Figure 4-19. The SVM mode selected here is DPWM with minimum modulation.

TIDM-02018 Build Level 2: Motor Phase Voltage
          Waveforms with Graph Tool - DPWM Minimum Figure 4-19 Build Level 2: Motor Phase Voltage Waveforms with Graph Tool - DPWM Minimum

Use Datalog with Graph Tool to monitor three phase sensing voltage of the motor with SVPWM Common modulation as shown in Figure 4-20. SVM type can be selected in motor1_drive.c file.

TIDM-02018 Build Level 2: Motor Phase Voltage Waveforms with Graph Tool - SVPWM Common Figure 4-20 Build Level 2: Motor Phase Voltage Waveforms with Graph Tool - SVPWM Common

Use Datalog with Graph Tool to monitor rotor angle of the motor from the angle generator and angle from the eSMO estimator as shown in Figure 4-21.

TIDM-02018 Build Level 2: Motor Rotor Angle
          Waveforms With Graph Tool Figure 4-21 Build Level 2: Motor Rotor Angle Waveforms With Graph Tool