SLUUDM5 March   2026 MSPM0G1507 , MSPM0G1519 , MSPM0G3507 , MSPM0G3519

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Motor Control Theory
    1. 2.1 BLDC Motor Fundamentals
    2. 2.2 Mathematical Model and FOC Structure
    3. 2.3 Sensorless Field Oriented Control
      1. 2.3.1 FOC Fundamentals
      2. 2.3.2 Enhanced Sliding Mode Observer
      3. 2.3.3 Finite Difference BEMF Estimator
      4. 2.3.4 Rotor Position and Speed Estimation
  6. MSP FOC System
    1. 3.1 Design Source
    2. 3.2 FOC Feature Overview
    3. 3.3 FOC Benchmark
  7. MSP FOC Hardware
    1. 4.1 PWM Pin Configurations
    2. 4.2 ADC Pin Configurations
      1. 4.2.1 DC Bus Voltage
      2. 4.2.2 Motor Phase Voltage
      3. 4.2.3 Motor Phase Current
        1. 4.2.3.1 Single Shunt Current Sensing
        2. 4.2.3.2 Dual or Three Shunt Current Sensing
        3. 4.2.3.3 Three Shunt Current Sensing with Simultaneous Sampling
    3. 4.3 Fault Pin Configurations
    4. 4.4 Hall GPIO Pin Configurations
    5. 4.5 GPIO Pin Configurations
    6. 4.6 SPI Pin Configurations
    7. 4.7 UART Pin Configurations
    8. 4.8 External Connections for Evaluation Boards
  8. MSP FOC Software
    1. 5.1 Project Structure
    2. 5.2 Software Overview
      1. 5.2.1 Application Layer
        1. 5.2.1.1 FOC Library
        2. 5.2.1.2 Motor Control Application
        3. 5.2.1.3 Main Application
      2. 5.2.2 HAL Layer
        1. 5.2.2.1 Gate Driver Interface
        2. 5.2.2.2 Current Sensing Circuit
        3. 5.2.2.3 Hardware Interface
        4. 5.2.2.4 Communication Interface
      3. 5.2.3 MSPM0 Driverlib Layer
    3. 5.3 Register Map (Sensorless FOC)
      1. 5.3.1 User Control Registers (Base Address = 0x20200400h)
        1. 5.3.1.1 Speed Control Register (Offset = 0h) [Reset = 00000000h]
        2. 5.3.1.2 Algo Debug Control 1 Register (Offset = 4h) [Reset = 00000000h]
        3. 5.3.1.3 Algo Debug Control 2 Register (Offset = 8h) [Reset = 00000000h]
        4. 5.3.1.4 Algo Debug Control 3 Register (Offset = Ch) [Reset = 00000000h]
        5. 5.3.1.5 DAC Configuration Register (Offset = 10h) [Reset = 00000000h]
      2. 5.3.2 User Input Registers (Base Address = 0x20200000h)
        1. 5.3.2.1  SYSTEM_PARAMETERS (Offset = 0h)
        2. 5.3.2.2  MOTOR_STARTUP1 Register (Offset = 3Ch) [Reset = 00000000h]
        3. 5.3.2.3  MOTOR_STARTUP2 Register (Offset = 40h) [Reset = 00000000h]
        4. 5.3.2.4  CLOSED_LOOP1 Register (Offset = 44h) [Reset = 00000000h]
        5. 5.3.2.5  CLOSED_LOOP2 Register (Offset = 48h) [Reset = 00000000h]
        6. 5.3.2.6  FIELD_CTRL Register (Offset = 4Ch) [Reset = 00000000h]
        7. 5.3.2.7  FAULT_CONFIG1 Register (Offset = 50h) [Reset = 00000000h]
        8. 5.3.2.8  FAULT_CONFIG2 Register (Offset = 54h) [Reset = 00000000h]
        9. 5.3.2.9  MISC_ALGO Register (Offset = 58h) [Reset = 00000000h]
        10. 5.3.2.10 PIN_CONFIG Register (Offset = 5Ch) [Reset = 00000000h]
        11. 5.3.2.11 PERI_CONFIG Register (Offset = 60h) [Reset = 00000000h]
      3. 5.3.3 User Status Registers (Base Address = 0x20200430h)
  9. Quick Start Guide
    1. 6.1 CCS IDE
      1. 6.1.1 Project Setup
      2. 6.1.2 Project Debug
    2. 6.2 GUI
  10. Motor Tuning Guide
    1. 7.1 Hardware Board Parameter
      1. 7.1.1 Base Voltage (V)
      2. 7.1.2 Base Current (A)
    2. 7.2 Motor Parameter
      1. 7.2.1 Motor Phase Resistance (mΩ)
      2. 7.2.2 Motor Phase Inductance (μH)
      3. 7.2.3 Saliency of IPMSM Motor
      4. 7.2.4 Motor Pole Pairs
      5. 7.2.5 Motor BEMF Constant (mV/Hz)
      6. 7.2.6 Maximum Motor Electrical Speed (Hz)
      7. 7.2.7 Maximum Motor Power (W)
    3. 7.3 Control Loop Parameter
      1. 7.3.1 Speed / Power Loop
      2. 7.3.2 Current Loop
    4. 7.4 Hall Angle Table
      1. 7.4.1 Hall Calibration
      2. 7.4.2 Register Table
    5. 7.5 Spin the Motor (LVBLDC)
    6. 7.6 Spin the Motor with Hall Sensor
    7. 7.7 Tune the Motor (LVBLDC)
      1. 7.7.1 Basic Tuning
        1. 7.7.1.1  Startup Mode
          1. 7.7.1.1.1 Align Mode
            1. 7.7.1.1.1.1 Force Align Mode in Current Loop
            2. 7.7.1.1.1.2 Force Align Mode in PWM Loop
          2. 7.7.1.1.2 Double Align Mode
          3. 7.7.1.1.3 Initial Position Detection (IPD) Mode
            1. 7.7.1.1.3.1 High Resolution IPD
          4. 7.7.1.1.4 Slow First Cyle (SFC) Mode
        2. 7.7.1.2  Open Loop Mode
          1. 7.7.1.2.1 Auto Handoff
          2. 7.7.1.2.2 Force Open Loop Mode
        3. 7.7.1.3  Transition From Open Loop to Closed Loop
        4. 7.7.1.4  Closed Loop Mode
          1. 7.7.1.4.1 Tune Control Parameter
          2. 7.7.1.4.2 Tune PI Parameter
        5. 7.7.1.5  Stop Mode
          1. 7.7.1.5.1 Coast (Hi-Z) Mode
          2. 7.7.1.5.2 Active Spin Down Mode
          3. 7.7.1.5.3 Braking Mode
            1. 7.7.1.5.3.1 Low-Side Braking
            2. 7.7.1.5.3.2 Align Braking
        6. 7.7.1.6  Fault Handling
          1. 7.7.1.6.1 MOTOR_STALL
            1. 7.7.1.6.1.1 ABN_SPEED_FAULT
            2. 7.7.1.6.1.2 ABN_BEMF_FAULT
            3. 7.7.1.6.1.3 NO_MOTOR_FAULT
          2. 7.7.1.6.2 VOLTAGE_OUT_OF_BOUNDS
          3. 7.7.1.6.3 LOAD_STALL
          4. 7.7.1.6.4 HARDWARE_OVER_CURRENT
          5. 7.7.1.6.5 HV_DIE
        7. 7.7.1.7  Motor Spin Direction
        8. 7.7.1.8  PWM Configuration
          1. 7.7.1.8.1 PWM Frequency
          2. 7.7.1.8.2 PWM Deadband Time
        9. 7.7.1.9  FOC Loop Frequency
        10. 7.7.1.10 Hardcode for Basic Tuning
      2. 7.7.2 Advanced Tuning
        1. 7.7.2.1 Control Mode Setting
          1. 7.7.2.1.1 Closed Loop Speed Control Mode
          2. 7.7.2.1.2 Closed Loop Power Control Mode
          3. 7.7.2.1.3 Closed Loop Torque Control Mode
          4. 7.7.2.1.4 Open Loop Voltage Control Mode
            1. 7.7.2.1.4.1 Lead Angle Control
        2. 7.7.2.2 Maximum Torque Per Ampere (MTPA) Control
        3. 7.7.2.3 Field Weakening Control (FWC)
        4. 7.7.2.4 Deadtime Compensation
        5. 7.7.2.5 PWM Generation Mode
        6. 7.7.2.6 Overmodulation Mode
        7. 7.7.2.7 Initial Speed Detection (ISD) Mode
          1. 7.7.2.7.1 Motor Resynchronization
          2. 7.7.2.7.2 Reverse Drive
          3. 7.7.2.7.3 Fast ISD
        8. 7.7.2.8 Anti-Voltage Surge
    8. 7.8 Overwrite User Input Register Table
  11. Hardware Migration Guide
    1. 8.1 Hardware Layer Overview
    2. 8.2 Gate Driver Module
      1. 8.2.1 Select Reference Projects
      2. 8.2.2 Modify Pre-defined Symbols
      3. 8.2.3 Add Custom Source Files
        1. 8.2.3.1 Gate Driver Comm Folder
        2. 8.2.3.2 HAL Layer File
      4. 8.2.4 Add Custom Comm Interface
      5. 8.2.5 Overwrite Default Macro Definitions
        1. 8.2.5.1 main.h File
          1. 8.2.5.1.1 Delay Component in Current Sensing Path
        2. 8.2.5.2 gateDriver.h File
    3. 8.3 MCU Peripheral Configuration
      1. 8.3.1 PWM Module
        1. 8.3.1.1 Different Pin Used for PWM Output
        2. 8.3.1.2 Different Pin Used for PWM Fault Input
        3. 8.3.1.3 Different Mapping to PWM Output Channel
      2. 8.3.2 ADC Module
        1. 8.3.2.1 Current Sensing Type
        2. 8.3.2.2 Current Sensing Method
          1. 8.3.2.2.1 Three Shunt Configuration
          2. 8.3.2.2.2 Three Shunt Configuration with Simultaneously Sampling
          3. 8.3.2.2.3 Dual Shunt Configuration
          4. 8.3.2.2.4 Single Shunt Configuration
        3. 8.3.2.3 CSA Offset Scaling Factor
        4. 8.3.2.4 Channel Mapping
          1. 8.3.2.4.1 Phase Current Channels
            1. 8.3.2.4.1.1 Three Shunt Configuration
            2. 8.3.2.4.1.2 Dual Shunt Configuration
            3. 8.3.2.4.1.3 Single Shunt Configuration
          2. 8.3.2.4.2 Bus Voltage Channel
          3. 8.3.2.4.3 Phase Voltage Channels
        5. 8.3.2.5 Trigger Mode
          1. 8.3.2.5.1 Three or Dual Shunt Configuration
          2. 8.3.2.5.2 Single Shunt Configuration
      3. 8.3.3 GPIO Pin
      4. 8.3.4 HALL Module
      5. 8.3.5 UART Module
      6. 8.3.6 DAC12 Module
      7. 8.3.7 IPD Module (Capture Timer)
    4. 8.4 Verification for Customized Board
  12. Frequently Asked Questions (FAQs)
    1. 9.1 MSPM0 Failed to Connect
    2. 9.2 Spin the Motor in Hardcode
    3. 9.3 Reduce 1x ADC Pin for Simultaneously Sampling
    4. 9.4 Tune Real-time Control Parameter
    5. 9.5 Track Real-time Variable
      1. 9.5.1 DAC12 Output
      2. 9.5.2 J-Scope Tool
  13. 10Summary
  14. 11References
  15. 12Revision History

CLOSED_LOOP1 Register (Offset = 44h) [Reset = 00000000h]

Table 5-31 shows the register to configure close loop settings1.

Table 5-31 CLOSED_LOOP1 Register Field Descriptions
Bit Field Type Reset Description
31-30 RESERVED R/W 0h Reserved
29-28 CONTROL_MODE R/W 0h FOC Closed loop Mode of operation
0h = Closed Loop Speed Control
1h = Closed Loop Power Control
2h = Closed Loop Torque Control
3h = Voltage Control mode
27 HIGH_FREQ_FOC_EN R/W 0b Enable /Disable High FOC Sampling rate. Higher the Sampling rate, lower the CPU bandwidth available for other tasks.
0h = High Frequency FOC Enable.(Max FOC Frequency 16Khz)
1h = High Frequency FOC Disable(Max FOC Frequency 8Khz)
26-22 ILIMIT R/W 0h Current limit in Closed loop Torque Mode and Closed loop Speed control in % of CURRENT_BASE

0h = 7.5%

1h = 8.0%

2h = 8.5%

3h = 9.0%

4h = 9.5%

5h = 10%

6h = 11%

7h = 12%

8h = 13%

9h = 14%

Ah = 15%

Bh = 16%

Ch = 17%

Dh = 18%

Eh = 20%

Fh = 22.5%

10h = 25%

11h = 27.5%

12h = 30%

13h = 35%

14h = 40%

15h = 45%

16h = 50%

17h = 55%

18h = 60%

19h = 70%

1Ah = 75%

1Bh = 80%

1Ch = 85%

1Dh = 90%

1Eh = 95%

1Fh = 100%

21-20 MTR_STOP R/W 00b Motor stop method
0h = Hi-z
1h = Active spin down
2h = Braking
3h = Reserved
19 OVERMODULATION_
ENABLE
R/W 0b Overmodulation enable
0h = Disable Over Modulation
1h = Enable Over Modulation
18-14 CL_ACC R/W 0h Closed loop acceleration

0h = 0.5Hz/s

1h = 1Hz/s

2h = 2.5Hz/s

3h = 5Hz/s

4h = 7.5Hz/s

5h = 10Hz/s

6h = 20Hz/s

7h = 40Hz/s

8h = 60Hz/s

9h = 80Hz/s

Ah = 100Hz/s

Bh = 200Hz/s

Ch = 300Hz/s

Dh = 400Hz/s

Eh = 500Hz/s

Fh = 600Hz/s

10h = 700Hz/s

11h = 800Hz/s

12h = 900Hz/s

13h = 1000Hz/s

14h = 2000Hz/s

15h = 4000Hz/s

16h = 6000Hz/s

17h = 8000Hz/s

18h = 10000Hz/s

19h = 20000Hz/s

1Ah = 30000Hz/s

1Bh = 40000Hz/s

1Ch = 50000Hz/s

1Dh = 60000Hz/s

1Eh = 70000Hz/s

1Fh = No limit

13 CL_DEC_CONFIG R/W 0h Closed loop deceleration configuration

0h = Closed loop deceleration defined by CL_DEC

1h = Closed loop deceleration defined by CL_ACC

12-8 CL_DEC R/W 0h Closed loop deceleration. This register is used only if AVS is disabled and CL_DEC_CONFIG is set to '0'

0h = 0.5Hz/s

1h = 1Hz/s

2h = 2.5Hz/s

3h = 5Hz/s

4h = 7.5Hz/s

5h = 10Hz/s

6h = 20Hz/s

7h = 40Hz/s

8h = 60Hz/s

9h = 80Hz/s

Ah = 100Hz/s

Bh = 200Hz/s

Ch = 300Hz/s

Dh = 400Hz/s

Eh = 500Hz/s

Fh = 600Hz/s

10h = 700Hz/s

11h = 800Hz/s

12h = 900Hz/s

13h = 1000Hz/s

14h = 2000Hz/s

15h = 4000Hz/s

16h = 6000Hz/s

17h = 8000Hz/s

18h = 10000Hz/s

19h = 20000Hz/s

1Ah = 30000Hz/s

1Bh = 40000Hz/s

1Ch = 50000Hz/s

1Dh = 60000Hz/s

1Eh = 70000Hz/s

1Fh = No limit

7-8 PWM_FREQ_OUT R/W 0h Output PWM switching frequency

0h = 5kHz

1h = 10kHz

2h = 16kHz

3h = 20kHz

4h = 25kHz

5h = 32kHz

6h = 40kHz

7h = 48kHz

8h = 50kHz

9h = 64kHz

Ah = 80kHz

Bh = N/A

Ch = N/A

Dh = N/A

Eh = N/A

Fh = N/A

14 PWM_MODE R/W 0b PWM modulation
0h = Continuous Space Vector Modulation
1h = Discontinuous Space Vector Modulation
3 AVS_EN R/W 0b AVS enable
0h = Disable
1h = Enable
2 DEADTIME_COMP_EN R/W 0b Dead-time compensation enable

0h = Disable

1h = Enable

1 RESERVED R/W 0b Reserved