S32K396 Motor Control Kit with 3-Phase PMSM

S32K396 Motor Control Kit with 3-Phase PMSM

The S32K396 motor control kit with 3-phase PMSM is the newest version of NXP's motor control kits. It creates compatibility between the 3-phase low voltage source inverter and NXP's S32K396 MCU, which is part of the S32K39/37/36 family for electrification applications. The power stage incorporates the MC33937 3-Phase Field Effect Transistor Pre-Driver, offering a comprehensive set of functions and condition monitoring capabilities. The following are the main features of the motor control kit:

?Fig. 1.?S32K396 motor control kit with 3-phase PMSM

SYSTEM CONCEPT

The system is designed to drive a 3-phase PMSM, using the following NXP components:

  • Designed for compatibility with the S32K396 (see Fig. 2)

Fig. 2.?S32K396 microcontroller for electrification applications

Fig. 3. MC33937 3-phase field effect transistor pre-driver

Control methodology includes:

  • FOC for 3-phase PMSM with phase currents measurement and resolver position sensor

  • Closed-loop speed and current control with a sampling period of 1 ms and?100 μs respectively

  • Bi-directional rotation support

  • Independent control of magnetic flux and electromagnetic torque
  • Field weakening (FW) control extending the speed range of the PMSM beyond the base speed
  • Position and speed computations performed by the?enhanced Time Processing Unit (eTPU)
  • Sampling of FOC state variables at a 100 μs period
  • Utilization of the?Automotive Math and Motor Control Library (AMMCLib), featuring FOC algorithms built on precompiled SW library blocks
  • Integration of the eTPU motor control function set to offload CPU
  • Incorporates the FreeMASTER software for control interface (motor parameters, current loop, speed loop)
  • Features a graphical control page: MCAT, FreeMASTER software displaying required speed, actual motor speed, start/stop status, DC bus voltage level, motor current, and system status
  • Provides functionality within FreeMASTER software for observing various motor control variables
  • Offers a high-speed recorder with FreeMASTER software for capturing reconstructed motor currents and vector control algorithm quantities
  • Implements protection mechanisms for DC bus overvoltage and undervoltage, overcurrent, overload, and start-up failure

PMSM CONTROL STRATEGIES

The NXP's 3-phase PMSM motor control kit offers four control strategies which can be enabled in FreeMASTER using the MCAT tool:

  • Scalar Control
  • Voltage FOC
  • Current FOC
  • Speed FOC

Each of them has its own purpose.

SCALAR CONTROL

The Scalar Control (see Fig. 4) is primarily used to debug the position sensor signals and verify the phase currents measurement since these variables do not provide any feedback to the control structure. The input to the scalar control scheme is the required speed in rpm (Speed_req) which is further recalculated to the required electrical angular velocity ωe in rad/s. This variable is?multiplied by Kfactor?to provide the required q-axis voltage uq_req?for the PMSM and also integrated to receive the required electrical position θe needed for the Inverse Park Transformation. The required d-axis voltage ud_req?is set to zero which means that the stator voltage lies in the motor q-axis. The dq voltages are then further transformed with the Inverse Park Transformation to the stationary reference frame αβ. These voltages are inputs into the Space Vector Modulation (SVM) to create duty cycles for the Voltage Source Inverter (VSI) which provides PWMs for PMSM.

Fig. 4. Scalar Control structure

VOLTAGE FOC

The Voltage FOC can be turned on when the position sensor signals are debugged properly in Scalar Control. As evident from Fig. 5, the feedback from the position sensor is now set back to the Inverse Park Transformation to transform required dq voltages to the stationary reference frame?αβ. Requesting the?d-axis voltage ud_req, the PMSM will align to the nearest d-axis position. Requesting the q-axis voltage uq_req, the PMSM will start to spin in a forward or backward direction based on the amplitude of the required voltage.

Fig. 5. Voltage FOC structure

CURRENT FOC

In the Current FOC, dq currents are used as feedback to the control loop. Firstly, phase currents in the 3-phase stationary reference frame abc need to be transformed to the 2-phase stationary reference frame?αβ using the Clarke Transformation. Afterward, the Park Transformation needs to be employed to transform the?αβ currents to the rotational reference frame dq. In this reference frame, the currents are DC values and can be easily controlled by simple PI controllers. In the Current FOC scheme, the application user can choose to control d- or q-axis current. Requesting the d-axis current, the PMSM will align to the nearest d-axis position similarly as in the Voltage FOC scheme. Attention needs to be paid when choosing the required q-axis current. Firstly, it is recommended to hold the shaft of the PMSM before demanding any current in the q-axis. Afterward, the required q-axis current can be demanded, which will provide torque to the PMSM. Thus, the machine will try to rotate in a forward or backward direction based on the amplitude of the required current. The measured q-axis current Iq_real?can be compared with the required q-axis current Iq_req?in the FreeMASTER project panel as well as the d-axis currents.

Fig. 6. Current FOC structure

In the Current FOC, the feedback currents can be calibrated with the real currents measured on the shunt resistors of VSI. Requiring the d-axis current will align the rotor to the d-axis position. Since the d-axis position is aligned with phase a, the measured d-axis current as watched in the FreeMASTER should be the same as the current measured directly on phase a of VSI. If not, the current scales should be calibrated properly for accurate FOC operation.

SPEED FOC

The Speed FOC, as the name implies, allows for control of the PMSM speed in a forward or backward direction. It is the outer loop of the FOC structure. The only addition according to the Current FOC is another PI controller in the q-axis. This connection represents a cascade control structure. The speed can be controlled by the required electrical angular velocity ωe_req. The error between the required and measured electrical angular velocity is then suppressed to zero with a speed PI controller to set a reference current in the q-axis.

Fig. 7. Speed FOC structure

The required d-axis current is set to zero in the NXP's application. However, by providing a negative required d-axis current to the PMSM, the speed region of the machine can be further enhanced. The part of the?AMMCLib library is also NXP's algorithm FW, which allows to increase PMSM speed range by controlling the required d-axis current to the negative values.

OUTPUT VOLTAGE ACTUATION AND PHASE CURRENT MEASUREMENT

The 3-phase VSI shown in Fig. 8?uses three shunt resistors (R38, R39, R40) placed in three legs of the inverter as phase current sensors. Stator phase current which flows through the shunt resistor produces a voltage drop which is interfaced to the ADC of the microcontroller through conditional circuitry.

?

Fig. 9 shows a gain setup and input signal filtering circuit for the operational amplifier which provides the conditional circuitry and adjusts voltages to fit into the ADC input voltage range.

Fig. 9. Phase current measurement conditional circuitry

The phase current sampling technique is a challenging task for the detection of phase current differences and for acquiring full 3-phase information of stator current by its reconstruction. Phase currents flowing through shunt resistors produce a voltage drop which needs to be appropriately sampled by the ADC when low-side transistors are switched on. The current cannot be measured by the shunt resistors at an arbitrary moment. This is because the current only flows through the shunt resistor when the bottom transistor of the respective inverter leg is switched on. Therefore, considering Fig. 8, phase a current is measured using the R38 shunt resistor and can only be sampled when the low-side transistor Q2 is switched on. Correspondingly, the current in phase b can only be measured if the low-side transistor Q3 is switched on, and the current in phase c can only be measured if the low-side transistor Q4 is switched on. To get an actual instant of current sensing, voltage waveform analysis has to be performed.

In standard motor operation, where the supplied voltage is generated using the SVM, the sampling instant of phase current takes place in the middle of the PWM period in which all bottom transistors are switched on. If the duty cycle goes to 100%, there is an instant when one of the bottom transistors is switched on for a very short time period. Therefore, only two currents are measured and the third one is calculated.

S32K396 is using the eTPU timer for switching pattern generation. The duty cycle of PWMs is limited to 98% by default. This is due to the minimum PWM that is needed for all the phase current measurements. Default settings and also type of modulation can be changed by using of eTPU function selector.

ROTOR POSITION/SPEED ESTIMATION

Different sensor types might require different approaches to evaluate the speed and position of the motor. The NXP approach for resolver systems utilizes an Angle Tracking Observer (ATO), see Fig. 10, which is based on the Phase-Locked Loop (PLL) technique. The ATO input is a position error between the position given by the sensor and the estimated ATO position. The PI controller in the ATO loop minimizes the input error by adjusting a control variable, in this case, the control variable is equivalent to a motor speed. Integration of the speed leads to the estimated position.

Fig. 10. ATO for resolver systems

The ATO for the resolver system is characterized by the position error calculation.?The coefficients of the ATO PI controller, integrator, and filter can be tuned by the MCAT tool. The ATO function is a member of the motor control SW library?and is available as AMCLIB_TrackObsrv.

S32K396 is using eTPU for resolver feedback signal demodulation.?The resolver digital interface eTPU function (RESOLVER) uses an eTPU-based trigger to initiate the sine wave generator SGEN. SGEN generates a single harmonic sinusoidal frequency needed to recover coil excitation. In the resolver position sensor, this excitation signal is modulated by the sine and cosine of the actual motor angle. Motor angular position, angular speed, a revolution counter, and diagnostics are the results of the sine and cosine feedback signal processing.

SUMMARY

The S32K396 motor control kit with a 3-phase PMSM offers a comprehensive and advanced solution for motor control applications. It features the S32K396 MCU from S32K39/37/36 family and the MC33937 3-Phase Field Effect Transistor Pre-Driver, providing robust control and monitoring capabilities. The S32K396 motor control kit key highlights are:

  • Field Oriented Control: Enhanced control of speed and current with precise current sensing
  • User Interface: FreeMASTER software and MCAT?tool for seamless application tuning and debugging
  • Various Control Strategies: Including Scalar Control, Voltage FOC, Current FOC, and Speed FOC, each designed for specific control needs
  • Accurate Measurement: Effective phase current measurement and rotor position/speed estimation using resolver

Overall, the kit is an ideal solution for developing efficient and reliable motor control systems in various electrification applications.


Author | Michal Vidlák


Dacil Cruz

Automotive Processing Digital Marketing at NXP Semiconductors

1 个月

Motor control has always been a complicated mistery for me since I was in engineering school. I am always happy to see my co-workers at NXP find ways to make motor control simpler and faster.

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

NXP Developer Zone的更多文章

社区洞察

其他会员也浏览了