This project describes the implementation of sensorless Field Oriented Control(FOC) application for 3-phase Permanent Magnet Synchronous Motors (PMSM) on the FRDM-MCXA153 board based on the NXP MCXA153 MCU. Please refer to AN14099 for complete instructions on how to use this software.The MCXA series MCUs expands the MCX Arm® Cortex®-M33 product offerings with multiple high-speed connectivity, operating up to 96 MHz, serial peripherals, timers, analog and low power consumption. The Enhanced Flex Pulse Width Modulator(eFlexPWM) contains three sub-modules, each has a 16-bit counter which can work with 192MHz clock source and supports a pair of complementary output and 3 fault inputs. Analog component includes one 16-bit, up to 16channels and max 4Msps SAR ADC and 2 analog comparator. This application note mainly introduces the principle of PMSM FOC, hardware and software implementation with NXP development kit, including a detailed peripheral setup, driver description and FreeMASTER operation guide.
Boards: FRDM-MCXA153Categories: Motor ControlPeripherals: ADC, PWMToolchains: MCUXpresso IDE1. Software- Download and install MCUXpresso IDE V11.9.0 or later.
- Download and install the latest version of FreeMASTER(3.2.2.2).
- Download the code from Git repository an-pmsm-foc-mcxa153.
- MCUXpresso for Visual Studio Code: This example supports MCUXpresso for Visual Studio Code, for more information about how to use Visual Studio Code please refer here.
- FRDM-MCXA153 Development Board.
- FRDM-MC-LVPMSM.
- LINIX 45ZWN24 motor.
- Personal Computer
- USB type-C cable and 24V adaptor.
Open MCUXpresso IDE, in the Quick Start Panel, choose Import from Application Code Hub
- Open MCUXpresso IDE, in the Quick Start Panel, choose Import from Application Code Hub
Enter the demo name in the search bar.
- Enter the demo name in the search bar.
Click Copy GitHub link, MCUXpresso IDE will automatically retrieve project attributes, then click Next>.
- Click Copy GitHub link, MCUXpresso IDE will automatically retrieve project attributes, then click Next>.
Select main branch and then click Next>, Select the MCUXpresso project, click Finish button to complete import.
- Select main branch and then click Next>, Select the MCUXpresso project, click Finish button to complete import.
Click Build to start compiling the project.
- Click Build to start compiling the project.
Connect the FRDM-MC-LVPMSM shield to the J1~J4 arduino connector of FRDM-MCXA153 board. Connect the 3-phase wire of the motor to the J7 connector on FRDM-MC-LVPMSM according to phase sequence(White wide--phaseA; Bule wide--phaseB; Green wide--phaseC). Power the FRDM-MC-LVPMSM board with a 24V adaptor.
Compile the project and use a USB cable to connect to the EVK board via J15 connector. Use MCU-LINK to download program into MCU.
3.3 Step 3Compile the project and download program into MCU. Press SW3 on FRDM board to control the motor to run or stop. Or use FreeMASTER project "pmsm_frac.pmpx" in the code package to control the motor, change rotor speed and obverse the speed or other value.
4. FreeMASTER operationThe FreeMASTER can be used to completely control and easily tune the sensorless FOC application. The operation of different control mode of the demo in FreeMASTER are described more closely here.
4.1 Scalar ControlThe scalar control diagram is the simplest type of motor control techniques. The ratio between the magnitude of the stator voltage and the frequency must be kept at the nominal ratio. Hence, the control method is sometimes called Volt per Hertz or V/Hz. The position estimation BEMF observer and tracking observer algorithms run on the background, even if the estimated position information is not directly used.Select “Scalar Control” sub block of the FreeMASTER project and choose “SCALAR_CONTROL[0]” mode of MACT Control in Variable Watch window.
The current FOC control requires the rotor position feedback and the currents transformed into a d-q reference frame. There are two reference variables Id_req and Iq_req available for the motor control. The d-axis current component id_req is responsible for the rotor flux control. The q-axis current component of the current iq_req generates a torque and by its application, the motor starts running. By changing the polarity of the current iq_req, the motor changes the direction of rotation. Supposing that the BEMF observer is tuned correctly, the current PI controllers can be tuned using the current FOC control structure.
The speed PMSM sensor/sensorless FOC is activated by enabling the speed FOC control structure. Enter the required speed into the “Speed_req” field. The d-axis current reference is held at 0 during the entire FOC operation.
Zhihao Pan

Comments
Please log in or sign up to comment.