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

Field Weakening (FW) and Maximum Torque Per Ampere (MTPA) Control

Permanent magnet synchronous motor (PMSM) is widely used in home appliance applications due to its high power density, high efficiency, and wide speed range. The PMSM includes two major types: the surface-mounted PMSM (SPM), and the interior PMSM (IPM). SPM motors are easier to control due to their linear relationship between the torque and q-axis current. However, the IPMSM has electromagnetic and reluctance torques due to a large saliency ratio. The total torque is non-linear with respect to the rotor angle. As a result, the MTPA technique can be used for IPM motors to optimize torque generation in the constant torque region. The aim of the field weakening control is to optimize to reach the highest power and efficiency of a PMSM drive. Field weakening control can enable a motor operation over its base speed, expanding its operating limits to reach speeds higher than rated speed and allow optimal control across the entire speed and voltage range.

The voltage equations of the mathematical model of an IPMSM can be described in d-q coordinates as shown in Equation 26 and Equation 27.

Equation 26. v d = L d d i d d t + R s i d - p ω m L q i q  
Equation 27. v q = L q d i q d t + R s i q + p ω m L d i d + p ω m ψ m

The dynamic equivalent circuit of an IPM synchronous motor is shown in Figure 2-18.

 Equivalent Circuit of an IPM
          Synchronous Motor Figure 2-18 Equivalent Circuit of an IPM Synchronous Motor

The total electromagnetic torque generated by the IPMSM can be expressed as Equation 28 that the produced torque is composed of two distinct terms. The first term corresponds to the mutual reaction torque occurring between torque current i q and the permanent magnet ψ m , while the second term corresponds to the reluctance torque due to the differences in d-axis and q-axis inductance.

Equation 28. T e = 3 2 p   ψ m i q + ( L d - L q ) i d i q

In most applications, IPMSM drives have speed and torque constraints, mainly due to inverter or motor rating currents and available DC link voltage limitations respectively. These constraints can be expressed with the mathematical equations Equation 29 and Equation 30.

Equation 29. I a = i d 2 + i q 2 I m a x
Equation 30. V a = v d 2 + v q 2 V m a x

Where V m a x and I m a x are the maximum allowable voltage and current of the inverter or motor. In a two-level three-phase Voltage Source Inverter (VSI) fed machine, the maximum achievable phase voltage is limited by the DC link voltage and the PWM strategy. The maximum voltage is limited to the value as shown in Equation 31 if Space Vector Modulation (SVPWM) is adopted.

Equation 31. v d 2 + v q 2 v m a x = v d c 3

Usually the stator resistance R s is negligible at high speed operation and the derivate of the currents is zero in steady state, thus Equation 32 is obtained as shown.

Equation 32. L d 2 ( i d + ψ p m L d ) 2 + L q 2 i q 2   V m a x ω m

The current limitation of Equation 29 produces a circle of radius I m a x in the d-q plane, and the voltage limitation of Equation 31 produces an ellipse whose radius V m a x decreases as speed increases. The resultant d-q plane current vector must be controlled to obey the current and voltage constraints simultaneously. According to these constraints, three operation regions for the IPMSM can be distinguished as shown in Figure 2-19.

 IPMSM Control Operation
          Regions Figure 2-19 IPMSM Control Operation Regions
  1. Constant Torque Region: MTPA can be implemented in this operation region to ensure maximum torque generation.
  2. Constant Power Region: Field weakening control must be employed and the torque capacity is reduced as the current constraint is reached.
  3. Constant Voltage Region: In this operation region, deep field weakening control keeps a constant stator voltage to maximize the torque generation.

In the constant torque region, according to Equation 28, the total torque of an IPMSM includes the electromagnetic torque from the magnet flux linkage and the reluctance torque from the saliency between L d and L q . The electromagnetic torque is proportional to the q-axis current i q , and the reluctance torque is proportional to the multiplication of the d-axis current i d , the q-axis current i q , and the difference between L d and L q .

Conventional vector control systems of a SPM motors only utilizes electromagnetic torque by setting the commanded i d to zero for non-field weakening modes. But an IPMSM will utilize the reluctance torque of the motor, d-axis current should be controlled as well. The aim of the MTPA control is to calculate the reference currents i d and i q to maximize the ratio between produced electromagnetic torque and reluctance torque. The relationship between i d and i q , and the vectorial sum of the stator current I s is shown in the following equations.

Equation 33. I s = i d 2 + i q 2
Equation 34. I d = I s cos β
Equation 35. I q = I s sin β

Where β is the stator current angle in the synchronous (d-q) reference frame. Equation 28 can be expressed as Equation 36 where I s substituted for i d and i q .

Equation 36 shows that motor torque depends on the angle of the stator current vector; as such:

Equation 36. T e = 3 2 p I s sin β   ψ m + ( L d - L q ) I s cos β

The maximum efficiency point can be calculated when the motor torque differential is equal to zero. The MTPA point can be found when this differential, d T e d β is zero as given in Equation 37.

Equation 37. d T e d β = 3 2 p   ψ m I s cos β + ( L d - L q ) I s 2 cos 2 β = 0  

Following, the current angle of the MTPA control can be derived as in Equation 38.

Equation 38. β m t p a = cos - 1 - ψ m + ψ m 2 + 8 * L d - L q 2 * I s 2 4 * L d - L q * I s

Thus, the effective d-axis and q-axis reference currents can be expressed by Equation 39 and Equation 40 using the current angle of the MTPA control.

Equation 39. I d = I s * cos β m t p a
Equation 40. I q = I s * sin β m t p a

However, as shown in Equation 38, the angle of the MTPA control, β m t p a is related to d-axis and q-axis inductance. This means that the variation of inductance will impede the ability to find the optimal MTPA point. To improve the efficiency of a motor drive, the d-axis and q-axis inductance should be estimated online, but the parameters L d and L q are not easily measured online and are influenced by saturation effects. A robust Look-Up Table (LUT) method ensures controllability under electrical parameter variations. Usually, to simplify the mathematical model, the coupling effect between d-axis and q-axis inductance can be neglected. Thus, assumes that L d changes with i d only, and L q changes with i q only. Consequently, d- and q-axis inductance can be modeled as a function of their d-q currents respectively, as shown in Equation 41 and Equation 42.

Equation 41. L d = f 1 i d ,   i q = f 1 i d
Equation 42. L q = f 2 i q ,   i d = f 2 i q

To reduce the ISR calculation burden by simplifying Equation 38. The motor-parameter-based constant, K m t p a is expressed instead as Equation 44, where K m t p a is computed in the background loop using the updated L d and L q .

Equation 43. K m t p a = ψ m 4 * L q - L d = 0.25 * ψ m L q - L d
Equation 44. β m t p a = c o s - 1 K m t p a / I s - K m t p a / I s 2 + 0.5

A second intermediate variable, G m t p a described in Equation 45, is defined to further simplify the calculation. Using G m t p a , the angle of the MTPA control, β m t p a can be calculated as Equation 46. These two calculations are performed in the ISR to achieve a real current angle β m t p a .

Equation 45. G m t p a = K m t p a / I s
Equation 46. β m t p a = c o s - 1 G m t p a - G m t p a 2 + 0.5

In all cases, the magnetic flux can be weakened to extend the achievable speed range by acting on the direct axis current i d . As a consequence of entering this constant power operating region, field weakening control is chosen instead of the MTPA control used in constant power and voltage regions. Since the maximum inverter voltage is limited, PMSM motors cannot operate in such speed regions where the back-electromotive force, almost proportional to the permanent magnet field and motor speed, is higher than the maximum output voltage of the inverter. The direct control of magnet flux is not an option in PM motors. However, the air gap flux can be weakened by the demagnetizing effect due to the d-axis armature reaction by adding a negative i d .

Considering the voltage and current constraints, the armature current and the terminal voltage are limited as Equation 29 and Equation 30. The inverter input voltage (DC-Link voltage) variation limits the maximum output of the motor. Furthermore, the maximum fundamental motor voltage also depends on the PWM method used. In Equation 32, the IPMSM has two factors: one is a permanent magnet value and the other is made by inductance and current of flux.

Figure 2-20 shows the typical control structure is used to implement field weakening. β f w is the output of the field weakening (FW) PI controller and generates the reference i d and i q . Before the voltage magnitude reaches its limit, the input of the PI controller of FW is always positive and therefore the output is always saturated at 0.

 Block Diagram of Field-Weakening and
          Maximum Torque per Ampere Control Figure 2-20 Block Diagram of Field-Weakening and Maximum Torque per Ampere Control

Figure 2-11 and Figure 2-13 show the implementation of FAST or eSMO-based FOC block diagram. The block diagrams provide an overview of the FOC system's functions and variables. There are two control modules in the motor drive FOC system: one is MTPA control and the other one is field weakening control. These two modules generate current angle β m t p a and β f w , respectively, based on input parameters as show in Figure 2-21.

 Current Phasor Diagram of an IPMSM
          During FW and MTPA Figure 2-21 Current Phasor Diagram of an IPMSM During FW and MTPA

The switching control module is used to decide which angle should be applied, and then calculate the reference i d and i q as shown in Equation 34 and Equation 35. The current angle is chosen as following Equation 47 and Equation 48.

Equation 47. β = β f w   i f   β f w > β m t p a
Equation 48. β = β m p t a   i f   β f w < β m t p a

Figure 2-22 is the flowchart that shows the steps required to run InstaSPIN-FOC with FW and MPTA in the main loop and interrupt.

 Flowchart for an InstaSPIN-FOC Project
          With FW and MTPA Figure 2-22 Flowchart for an InstaSPIN-FOC Project With FW and MTPA