SPRUJ26A September   2021  – April 2024

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Motor Control Theory
    1. 2.1 Mathematical Model and FOC Structure of PMSM
    2. 2.2 Field Oriented Control of PM Synchronous Motor
    3. 2.3 Sensorless Control of PM Synchronous Motor
      1. 2.3.1 Enhanced Sliding Mode Observer with Phase Locked Loop
        1. 2.3.1.1 Design of ESMO for PMSM
        2. 2.3.1.2 Rotor Position and Speed Estimation With PLL
    4. 2.4 Hardware Prerequisites for Motor Drive
      1. 2.4.1 Motor Phase Voltage Feedback
    5. 2.5 Additional Control Features
      1. 2.5.1 Field Weakening (FW) and Maximum Torque Per Ampere (MTPA) Control
      2. 2.5.2 Flying Start
  6. 3Running the Universal Lab on TI Hardware Kits
    1. 3.1 Supported TI Motor Evaluation Kits
    2. 3.2 Hardware Board Setup
      1. 3.2.1  LAUNCHXL-F280025C Setup
      2. 3.2.2  LAUNCHXL-F280039C Setup
      3. 3.2.3  LAUNCHXL-F2800137 Setup
      4. 3.2.4  TMDSCNCD280025C Setup
      5. 3.2.5  TMDSCNCD280039C Setup
      6. 3.2.6  TMDSCNCD2800137 Setup
      7. 3.2.7  TMDSADAP180TO100 Setup
      8. 3.2.8  DRV8329AEVM Setup
      9. 3.2.9  BOOSTXL-DRV8323RH Setup
      10. 3.2.10 BOOSTXL-DRV8323RS Setup
      11. 3.2.11 DRV8353RS-EVM Setup
      12. 3.2.12 BOOSTXL-3PHGANINV Setup
      13. 3.2.13 DRV8316REVM Setup
      14. 3.2.14 TMDSHVMTRINSPIN Setup
      15.      34
      16.      35
    3. 3.3 Lab Software Implementation
      1. 3.3.1 Importing and Configuring Project
      2.      38
      3.      39
      4. 3.3.2 Lab Project Structure
      5. 3.3.3 Lab Software Overview
    4. 3.4 Monitoring Feedback or Control Variables
      1. 3.4.1 Using DATALOG Function
      2. 3.4.2 Using PWMDAC Function
      3. 3.4.3 Using External DAC Board
    5. 3.5 Running the Project Incrementally Using Different Build Levels
      1. 3.5.1 Level 1 Incremental Build
        1. 3.5.1.1 Build and Load Project
        2. 3.5.1.2 Setup Debug Environment Windows
        3. 3.5.1.3 Run the Code
      2. 3.5.2 Level 2 Incremental Build
        1. 3.5.2.1 Build and Load Project
        2. 3.5.2.2 Setup Debug Environment Windows
        3. 3.5.2.3 Run the Code
      3. 3.5.3 Level 3 Incremental Build
        1. 3.5.3.1 Build and Load Project
        2. 3.5.3.2 Setup Debug Environment Windows
        3. 3.5.3.3 Run the Code
      4. 3.5.4 Level 4 Incremental Build
        1. 3.5.4.1 Build and Load Project
        2. 3.5.4.2 Setup Debug Environment Windows
        3. 3.5.4.3 Run the Code
  7. 4Building a Custom Board
    1. 4.1 Building a New Custom Board
      1. 4.1.1 Hardware Setup
      2. 4.1.2 Migrating Reference Code to a Custom Board
        1. 4.1.2.1 Setting Hardware Board Parameters
        2. 4.1.2.2 Modifying Motor Control Parameters
        3. 4.1.2.3 Changing Pin Assignment
        4. 4.1.2.4 Configuring the PWM Module
        5. 4.1.2.5 Configuring the ADC Module
        6. 4.1.2.6 Configuring the CMPSS Module
        7. 4.1.2.7 Configuring Fault Protection Function
      3. 4.1.3 Adding Additional Functionality to Motor Control Project
        1. 4.1.3.1 Adding Push Buttons Functionality
        2. 4.1.3.2 Adding Potentiometer Read Functionality
        3. 4.1.3.3 Adding CAN Functionality
    2. 4.2 Supporting New BLDC Motor Driver Board
    3. 4.3 Porting Reference Code to New C2000 MCU
  8.   A Appendix A. Motor Control Parameters
  9.   References
  10.   Revision History

Importing and Configuring Project

The example lab is a universal project that has support for various TI EVM motor driver kits that can be used in conjunction with the F280025C, F280039C, or F2800137 C2000 MCU devices. The user can run different TI EVM kits by setting the build configurations and properties of the lab project. In the following sections, the LAUNCHXL-F280025C, LAUNCHXL-F280039C, or LAUNCHXL-F2800137 is used in combination with the BOOSTXL-DRV8323RS lab to show how to import and run the example lab on this kit.

  1. Import the project within CCS by clicking "Project" ➔"Import CCS Projects...", and then click "Browse..." button to select search directory at:
    1. F28002x based lab:<install_location>\solutions\universal_motorcontrol_lab\f28002x\ccs\motor_control\ to select the "universal_motorcontrol_lab_f28002x" project.
    2. F28003x based lab:<install_location>\solutions\universal_motorcontrol_lab\f28003x\ccs\motor_control\ to select the "universal_motorcontrol_lab_f28003x" project.
    3. F280013x based lab:<install_location>\solutions\universal_motorcontrol_lab\f280013x\ccs\motor_control\ to select the "universal_motorcontrol_lab_f280013x" project.
  2. The lab project can be configured to run on a variety of motor driver kits. You can select one of these kits by right-clicking on the imported project name and selecting the right build configuration (such as Flash_lib_DRV8323RS_3SC) as shown in Figure 3-18.
  3. Configure the project to select the supporting functions in the project by right-clicking on the imported project name, and then click the "Properties" command to set the pre-define symbols for the project as shown in Figure 3-19.
    1. A pre-define symbol is active or disabled by removing or adding the "_N" in the name. For example, field weakening control is enabled by removing the "_N" in "MOTOR1_FWC_N" to change it to "MOTOR1_FWC", and field weakening control functions are disabled for motor 1 (Compressor) by changing the "MOTOR1_FWC" symbol name to "MOTOR1_FWC_N".
    2. Select the right supporting motor control algorithm based on the motor and hardware board by enabling the related pre-define symbol as described above. The supporting algorithms and related motors matrix are shown in Table 3-4.
    3. Select the right supporting functions by enabling the pre-define symbol/s as shown in Figure 3-19.
  4. Select the right target configuration file (.ccxml) as shown in Figure 3-21 by right clicking on the file name to select "Set as Active Target Configuration" and "Set as Default Target Configuration" on the pop-up menu.
    1. TMS320F280025C_LaunchPad.ccxml is for the LAUNCHXL-F280025C based hardware kits.
    2. TMS320F280025C.ccxml is for the TMDSCNCD280025C based hardware kits.
  5. Select or define the right motor model in the user_mtr1.h and user_common.h files. These files are located under the src_board folder located in the project explorer window. The motor defines section in the user_mtr1.h file begins on line 921. Uncomment the #define that corresponds with the motor being tested, and ensure that the rest of the #define motors remain commented out. Make sure that the motor parameters in the code match with the specifications of the connecting motor.
  6. Set up the hardware kit, connect the motor, encoder, and/or hall sensor to the kit as described in Section 3.2.