End Node Virtualization of PMSM FOC on MCSPTR2AK396 Motor Control Kit with S32K396

End Node Virtualization of PMSM FOC on MCSPTR2AK396 Motor Control Kit with S32K396

WHAT IS PMSM FOC?

In the world of electric motor control, achieving high efficiency and precision is crucial, especially in applications such as electric vehicles, robotics, and industrial automation. This is where the FOC of PMSM comes into play. FOC, also known as vector control, allows for independent and precise control of motor torque and magnetic flux.

A PMSM is a type of synchronous motor where the rotor's magnetic field is generated by permanent magnets instead of windings. This design offers higher efficiency and better performance compared to other motor types. However, controlling a PMSM effectively requires sophisticated techniques due to its non-linear behavior and the need for precise synchronization between the stator and rotor fields.

The mathematical model of PMSM in rotational reference frame dq is very popular for FOC structures because controllable quantities such as current, and voltage, are DC values (see Fig. 1) In addition, it allows employing simple controllers to force the machine currents to the required states.

Fig. 1. Transformation from stationary to rotational reference frame

PARK & CLARKE TRANSFORMATIONS

In order to decompose currents into torque and flux producing components (id, iq), the position of the magnetizing flux has to be known. This requires knowledge of the accurate rotor position as being strictly fixed with magnetic flux. A?transformation of the controllable motor quantities, such as current and voltage, from the stationary abc to the rotational reference system dq must be conducted.

Fig. 2?illustrates the fundamental structure of the vector control algorithm for PMSMs.?To perform vector control, it is necessary to take the following four steps:

  • Measure the motor quantities?(DC bus voltage and currents, rotor position/speed).
  • Transform measured currents iabc into the 2-phase orthogonal system αβ using a Clarke transformation (1).?Second, transform the currents in αβ coordinates?iαβ into the dq reference frame using a Park transformation (2).

= ia? ? ? iβ?=?ib1/3 -?ic2/3? ? ??(1)

id?= iα?cos(θe) +?iβ?sin(θe)? ? ? iq?= -iα?sin(θe) +?iβ?cos(θe)? ? ? (2)

  • The stator current torque (iq) and flux (id) producing components are separately controlled in the dq rotating frame.
  • The outputs of the controllers' are the required dq voltages?and they are transformed by an inverse Park transformation (3) back from the dq reference frame into the 2-phase orthogonal system αβ fixed with the stator. The other options are to transform?αβ voltages directly to the abc reference frame by means of (4) or using?a Space Vector Modulation (SVM)?to generate?3-phase voltages with 3rd harmonics for improved DC bus voltage utilization.

= ud?cos(θe) -?uq?sin(θe)?? ? ???= ud?sin(θe) +?uq?cos(θe)? ? ? (3)

ua?= uα?? ? ??ub?= -uα1/2?+?3/2? ? ??uc?= -uα1/2?-?uβ3/2? ? ??(4)

The Clarke/Park transformations and SVM discussed above are part of the NXP's?Automotive Math and Motor Control Library (AMMCLib) set.

The?MCSPTR2AK396 motor control kit handles a sensor based FOC control, where the position and speed are obtained by the position/velocity estimator executed by enhanced Time Processor Unit (eTPU). Position and speed are processed by the eTPU co-processor that runs independently on the system core.

WHY THE DIGITAL TWIN?

Designing a digital twin involves the abstraction of motor control algorithms and hardware into a virtual environment. Rather than relying solely on physical hardware, this approach leverages software simulations and virtual models to replicate motor behavior and control strategies. The virtual models are commonly implemented in the MCU while running in parallel with the real models. By decoupling the control algorithms from specific hardware platforms, virtualization enables seamless portability and adaptability across different environments.

There are some crucial advantages that push the digital twins ahead for future considerations:

  • Predictive Maintenance:?Digital twins enable proactive maintenance by continuously monitoring and analyzing motor performance data. Early detection of potential issues allows for timely maintenance, reducing downtime and minimizing maintenance costs.
  • Improved Efficiency:?Digital twins provide insights into motor behavior under various conditions, facilitating the optimization of control strategies for maximum efficiency. This leads to reduced energy consumption, cost savings, and environmental benefits.
  • Reduced Costs: By eliminating the need for physical prototypes, digital twins significantly reduce development costs. Additionally, predictive maintenance helps in preventing costly breakdowns, saving on maintenance expenses.
  • Time Savings: With digital twins, developers can accelerate the design iteration process, leading to faster development cycles and reduced time-to-market for motor control systems.
  • Optimized Performance: The use of digital twins enables engineers to fine-tune control algorithms and parameters with precision, leading to optimized motor performance and efficiency. Simulating different scenarios allows for performance improvements before deployment, ensuring optimal system operation.
  • Flexibility and Adaptability: Digital twins allow for easy adaptation of control algorithms to different hardware platforms and motor specifications, enhancing system flexibility and scalability. This adaptability extends to maintenance processes, where digital twins can be updated with new data and insights to improve predictive maintenance algorithms over time.

VIRTUAL MODEL OF PMSM

To design a digital twin of PMSM, equations 5 and 6 need to be employed, since they represent the voltage equations?of the motor with differential terms. The voltage equations in rotational reference frame dq can be obtained by using Clarke (abc?→?αβ) and Park transform (αβ?→ dq).

ud = Rsid?+?Lddid/dt?-?ωeLqiq? ? ??(5)

uq?= Rsiq?+?Lqdiq/dt?+?ωeLdid?+ ωeΨPM? ? ??(6)

where?Rs?is the stator resistance, id?and iq are the dq currents,?Ld and?Lq are the dq inductances, ωe is the electrical angular velocity, and?ΨPM?is the permanent magnet flux linkage. Since the PMSM represents a dynamic system with transient effects, the differential terms cannot be neglected. On the other hand, these terms should be expressed from the dq?voltage equations and integrated to obtain the dq currents equations (7) and (8):

id?= 1/Ld?∫(ud?- Rsid?+?ωeLqiq)dt? ? ??(7)

iq?= 1/Lq?∫(uq?- Rsiq?-?ωeLdid -?ωeΨPM)dt? ? ??(8)

Another crucial part of the PMSM mathematical model is the relationship for the electromagnetic torque Te, which consists of two components. The first component is the synchronous torque Tsyn, independent of the d-axis current, and represents the interaction of the permanent magnet flux linkage and the q-axis current:

Tsyn?= 3p/2(ΨPMiq)? ? ?(9)

The second component is the reluctance torque?Trel, which is independent of the permanent magnet flux linkage and is created due to the influence of different inductances in the d- and q-axis:

Trel?= 3p/2(Ld?-?Lq)idiq? ? ?(10)

The resulting equation of the PMSM electromagnetic torque Te is then defined as the sum of the synchronous and reluctance torque components:

Te?= 3p/2[ΨPMiq + (Ld?- Lq)idiq]? ? ??(11)

Both terms reflect an essential aspect of the torque production in the PMSM machine. For the digital twin, the electromagnetic torque Te represents a crucial variable. Its sublimation from the load torque TL, and viscous friction component B, the mechanical equation of PMSM is derived as:

Te?-?TL?- Bωm?= Jdωm/dt? ? ??(12)

where ωm is the mechanical angular velocity, J is the moment of inertia, and B is the viscous friction coefficient.?The mechanical angular velocity?ωm needs to be expressed from the mechanical equation as follows:

ωm?=?1/J?∫(Te?- TL?- Bωm)dt?? ? ??(13)

However, equations 7 and 8 include the electrical angular velocity ωe, which needs to be determined. There is a simple relationship between the mechanical and electrical angular velocity defined by the following equation:

ωe?=?pωm? ? ? ?(14)

The digital twin requires accurate electrical and mechanical parameters for proper operation. These parameters need to be determined precisely before the first application of digital twin. However, the parameters such as stator resistance Rs, dq axis inductances Ldq, back-EMF constant ke, and torque constant kt?may slightly differ for each motor control kit due to the ambient temperature variations, manufacturing deviations, among other variables. NXP’s AMMCLib?offers advanced motor control functions for electrical and mechanical parameters measurement. The function AMCLIB_EstimRL estimates the stator resistance Rs and dq inductances Ldq. The function AMCLIB_EstimBJ estimates the moment of inertia J, torque constant kt, and viscous friction coefficient B. The FOC current loop and FOC speed loop settings should follow the same configuration as for the real machine.

Discover more about about Virtual PMSM FOC and see example code from implementation on the NXP Community


Author | Michal Vidlák


要查看或添加评论,请登录

NXP Developer Zone的更多文章

社区洞察

其他会员也浏览了