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

Lab Software Overview

Figure 4-5 shows the project software flow diagram of the firmware that includes one ISR for real time motor control and the main loop for motor control parameters that updates in a background loop. The ISR is triggered by ADC End of Conversion (EOC).

TIDM-02018 Project Software Flowchart
          Diagram Figure 4-5 Project Software Flowchart Diagram

To simplify the system bring up and design, the software is organized in four incremental builds, which makes learning and getting familiar with the board and software easier. This approach is also good for debugging and testing boards.

Table 4-4 lists the framework modules to be used in this project.

Table 4-4 Using Motor Control Modules in Project
Module Names Explanation Algorithm
ANGLE_GEN_run Ramp angle generator for open-loop running eSMO, ENC, HALL
CLARKE_run Clarke transformation for current or voltage eSMO, ENC, HALL
collectRMSData, calculateRMSData Collect sampling values to calculate the RMS value of phase current and voltage eSMO, ENC, HALL
DATALOG_update Stores the real-time values into for displaying with graph tool All Algorithms
ENC_run Calculate rotor angle based on encoder ENC
ESMO_run Enhance Sliding Mode Observer (eSMO) for sensorless-FOC eSMO
HAL_readMtr1ADCData Returns ADC conversion values with floating-point format All Algorithms
HAL_writePWMDACData Converts software variables into the PWM signals All Algorithms
HAL_writePWMData PWM drives for motor All Algorithms
HALL_run Calculate rotor angle ans speed based on Hall sensors HALL
IPARK_run Inverse Park transformation eSMO, ENC, HALL
PARK_run Park Transformation eSMO, ENC, HALL
PI_run PI Regulators for current and speed All Algorithms
PI_run_series Runs the series form of the PI controller SFRA, MPTA
SPDCALC_run Speed Measurement based on the angle from encoder signal ENC
SPDFR_run Speed measurement based on the angle from observer eSMO
SVGEN_runMin Space Vector PWM with quadrature control eSMO, ENC, HALL
TRAJ_run Trajectory for setting speed reference All Algorithms
VS_FREQ_run Generate vector voltage with v/f profile for Vd and Vq calculation in level 2.

This can be done manually based on specific motors.

eSMO, ENC, HALL

Table 4-5 summarizes the modules tested in each incremental system build.

Table 4-5 Motor Control Modules Used per Incremental Build
Software Module DMC_LEVEL_1 DMC_LEVEL_2 DMC_LEVEL_3 DMC_LEVEL_4
50% PWM duty, verify ADC offset calibration, PWM output, and phase shift Open loop control to verify the motor current and voltage sensing signals Closed current loop to validate the current sensing on the board and the current control with the PID Closed-loop run with estimators/observers
HAL_readMtr1ADCData √√
HAL_writePWMData √√
ANGLE_GEN_run √√ √(eSMO, ENC, HALL)*
VS_FREQ_run √√
CLARKE_run
TRAJ_run √√ √√
ESMO_run √(eSMO)* √(eSMO)* √√ (eSMO)*
SPDFR_run √(eSMO)* √(eSMO)* √√ (eSMO)*
ENC_run √(ENC)* √(ENC)* √√(ENC)*
SPDCALC_run √(ENC)* √(ENC)* √√(ENC)*
HALL_run √(HALL)* √(HALL)* √√(HALL)*
PARK_run
PI_run (Id) √√
PI_run (Iq) √√
PI_run (speed) √√
IPARK_run √√
SVGEN_runMin √√
HAL_writePWMDACData √** √** √**
DATALOG_update
  1. √ means this module is used. √√ means this module is being tested.
  2. √ (eSMO)* means this module is only used by eSMO. √ (ENC)* means this module is only used by ENC. √ (HALL)* means this module is only used by HALL.
  3. √** means this module is supported by some hardware kit as shown in Table 4-1.

The universal project can use one of the FOC algorithms separately for motor control, or use two of the eSMO and encoder FOC algorithms simultaneously. The estimator in use can be switched smoothly on the fly if two algorithms are implemented in the project.