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

Supported TI Motor Evaluation Kits

The TMS320F28002x (F28002x), TMS320F28003x (F28003x), or TMS320F280013x (F280013x) is a member of the C2000™ real-time Microcontroller family with IEEE 754 Floating-Point Unit (FPU) and Trigonometric Math Unit (TMU). The user can use one of these LaunchPad™ development kits or controlCARDs with the relevant motor drive evaluation board to evaluate this lab for motor control.

Table 3-1 lists the current evaluation kits that are supported for this universal motor control lab project in MotorControl SDK.

Table 3-1 Motor Drive Evaluation Kits Supported by Motor Control SDK
Motor Drive Evaluation Board C2000 MCU Evaluation Module Current Sensing Topology Rotor Position Sensing Method Tested Motors
Part Number Description
DRV8329AEVM 4.5~60V, 30A 3-ph inverter with CSD18536KTTT NexFET™ LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Single shunt dc-link current FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC Sensorless trapzoidalcontrol
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
BOOSTXL-DRV8323RH 6~54V, 15A 3-ph inverter with CSD88599Q5DC NexFET™ power blocks LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Three low-side current shunt FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
BOOSTXL-DRV8323RS 6~54V, 15A 3-ph inverter with CSD88599Q5DC NexFETTM power blocks LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Three low-side current shunt FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
DRV8316REVM 4.5~35V, 8A peak current 3-ph inverter integrated MOSFET LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Integrated CSAs for three-phase low-side current FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
DRV8353RS-EVM 9~95V, 15A 3-ph inverter with CSD19532Q5B LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Three low-side current shunt FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
BOOSTXL-3PHGANINV 12~60V, 3.5A 3-ph GaN inverter LAUNCHXL-F280025CLAUNCHXL-F280039CLAUNCHXL-F2800137 Three shunt-based inline motor phase current sensing FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
Hall sensors based sensored-FOC
LVSERVOMTR (Encoder Embedded)LVBLDCMTR (Hall Sensors Embedded)
TMDSHVMTRINSPIN 400V, 10A 3-ph inverter TMDSCNCD280025C,TMDSCNCD280039C,TMDSCNCD2800137, with TMDSADAP180TO100 Three low-side current shunt FAST estimator based sensorless-FOC
eSMO observer based sensorless-FOC
QEP encoder based sensored-FOC
HVPMSMMTR (Encoder Embedded)

HVBLDCMTR (Hall Sensors Embedded)

If the lab is set to use Encoder or Hall based sensored-FOC, it is important to ensure that the physical connections are connected in the correct order. If the motor, encoder, or hall wires are connected in the wrong order, the lab will not function properly, potentially resulting in the motor being unable to spin. For the motor phase wires, it is important to ensure that the motor phases are connected to the right phase on the inverter board. For the motors that are provided with the TI Motor Control Reference Kits, the correct phase connections are provided as shown in Table 3-2.

For the encoder, it is important to ensure that A is connected to A, B to B, and I to I. For the Hall sensor, it is important to ensure that A is connected to A, B to B, and C to C. Often +5V dc and ground connections are required as well. If you are using Hall sensors or encoders that are different than the ones specifically listed in Table 2-2, please refer to the users manual for the Hall sensor or encoder you are using to ensure that you properly connect the wires.

It is important for the setup and configuration of the ENC module that the number of slots per rotation for the encoder be provided. This allows the ENC module to correctly convert the encoder signal into an angle. The USER_MOTOR1_NUM_ENC_SLOTS constant that is defined in the user_mtr1.h file needs to be updated to the correct value for your encoder. If this value is not correct, the motor will spin faster or slower depending on the value that was set. It is important to note that this value should be set to the number of slots on the encoder, not the resulting number of counts after figuring the quadrature accuracy.

Table 3-2 Motor Phase, Encoder, or Hall Sensors Connections for Reference Kits and Motors
LVSERVOMTR LVBLDCMTR HVPMSMMTR HVBLDCMTR
Motor Phase Lines U BLACK (16AWG) YELLOW RED YELLOW
V RED (16AWG) RED BLUE/BLACK RED
W WHITE (16AWG) BLACK WHITE BLACK
Encoder GND (J12-1 of LAUNCHXL-F280025C/39C/137) BLACK (J4-1) N/A, Not support for encoder based sensored-FOC BLACK Not support for encoder based sensored-FOC
+5V RED (J4-2) RED
I (1I, J12-3 of LAUNCHXL-F280025C/39C/137) BROWN (J4-3) YELLOW
B (1B, J12-4 of LAUNCHXL-F280025C/39C/137) ORANGE (J4-4) GREEN
A (1A, J12-5 of LAUNCHXL-F280025C/39C/137) BLUE (J4-1) BLUE
Hall Sensors

(LAUCHXL_F2800137 only has J12, Hall sensors share the J12 with Encoder)

GND BLACK (J10-1) BLACK Not support for Hall sensor based sensored-FOC BLACK
+5V RED (J10-2) RED RED
A (2I, J13-3 of LAUNCHXL-F280025C/39C) GRAY-WHITE (J10-3) BLUE BLUE
B (2B, J13-4 of LAUNCHXL-F280025C/39C) GREEN-WHITE (J10-4) GREEN GREEN
C (2A, J13-5 of LAUNCHXL-F280025C/39C) GREEN (J10-5) WHITE WHITE

Get started with C2000™ Real-Time Control Microcontrollers (MCUs) to implement motor control.

  1. Step 1: Order the desired motor drive evaluation board, C2000 MCU evaluation module, and motor as shown in Table 3-1.
  2. Step 2: Download the latest version of MotorControl SDK.
  3. Step 3: Download the latest version of Code Composer Studio IDE.
  4. Step 4: Follow the instructions in Section 3.2 to setup the hardware and run the example labs described in the following sections.
  5. Step 5: For answers to any design questions that you may have, you can search existing answers or ask your own question using the TI C2000 E2E forum.