DC-bus voltage, and DC-bus current) are sensed on this board. There is also an interface for speed and position sensors (encoder, hall). The block diagram of this complete NXP motor-control development kit is shown in Figure Figure 1. Motor-control development platform block diagram MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 4 / 85...
Page 5
Table 2. Teknic M-2310P motor parameters Characteristic Symbol Value Units Rated voltage Rated speed 6000 Rated torque 0.247 Rated power Continuous current Number of pole-pairs MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 5 / 85...
Page 6
For the sensorless control mode, you need only the power input wires. If used with the hall or encoder sensors, connect also the sensor wires to the NXP Freedom power stage. Figure 4. Teknic motor connector type 1 MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 6 / 85...
Page 7
Table 3. Linix 45ZWN24-40 motor parameters Characteristic Symbol Value Units Rated voltage Rated speed 4000 Rated torque 0.0924 Rated power Continuous current 2.34 Number of pole-pairs MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 7 / 85...
Page 8
500 MHz to provide high CPU performance and excellent real-time response. (Quick Start Guide) Table 4. MIMXRT1010-EVK jumper settings Jumper Setting Jumper Setting Jumper Setting open open open open open MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 8 / 85...
Page 9
R794, R793, R796, R795, R798, R797 resistors for PWMs and R1849, R1850, R1852, R1853, R1854 resistors for ADCs. These resistors are located on the both sides of the EVK board. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 10
NXP Semiconductors Hardware setup Figure 8. Resistor needed for proper operation on the top side of the EVK board MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 10 / 85...
Page 11
3. Plug the USB cable from the USB host to the Debug USB connector (J41) on the EVK board. 4. Plug the 24-V DC power supply to the DC power connector on the Freedom PMSM power stage. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 12
LQFP144 package, featuring NXP’s advanced implementation of the Arm Cortex-M7 core. This core operates at up to 500 MHz to provide high CPU performance and the best real-time response. Table 5. MIMXRT1020-EVK jumper settings Jumper Setting Jumper Setting Jumper Setting open open MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 12 / 85...
Page 13
The ADC pins are shared with the next peripherals. Therefore, remove resistors R65, R68, R69, and R74 from the board. These resistors are located on the top side of the EVK board. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 16
R1870 shared with USER LED. The resistor R1847 is located on the top side of EVK next to J19. All others resistor are located on the bottom EVK side. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 17
3. Plug the USB cable from the USB host to the Debug USB connector (J23) on the EVK board. 4. Plug the 24-V DC power supply to the DC power connector on the Freedom PMSM power stage. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 18
Jumper J1 in position 5-6 means that that the board is powered from the debug USB. You may also change J1 into position 1-2 for powering from the DC input (5 V). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 19
R278, R279, R280, and R281 resistors to the board and remove resistors R309, R59, and R60 from the board. These resistors are located on the bottom side of the EVK board. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 22
Table 10. MIMXRT1060-EVK jumper settings Jumper Setting Jumper Setting Jumper Setting open open open Table continues on the next page... MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 22 / 85...
Page 23
R278, R279, R280, and R281 resistors to the board. These resistors are located on the bottom side of the EVK board. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 26
MCU. The dual core i.MX RT1170 runs on the Cortex-M7 core at 1 GHz and Arm Cortex-M4 at 400 MHz, while providing best-in-class security. Table 12. MIMXRT1170-EVK jumper settings Jumper Setting Jumper Setting Jumper Setting All others jumpers are open. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 26 / 85...
Page 27
R1842 for encoder and remove resistors R188 and R193 for right ADC measuring. These resistors are located on the top of the EVK board. For more details, see the schematic. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 28
4. Plug the USB cable from the USB host to the Debug USB connector (J11) on the EVK board. 5. Plug the 24-V DC power supply to the DC power connector on the Freedom PMSM power stage. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
• The top signal shows the eFlexPWM counter (SM0 counter). The dead time is emphasized at the PWM top and PWM bottom signals. The SM0 submodule generates the master reload at every opportunity. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 31
• Fault mode is enabled for channels A and B at submodules 0, 1, and 2 with automatic fault clearing (the PWM outputs are re-enabled at the first PWM reload after the fault input returns to zero). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 32
, and GPS. The i.MX RT1020/24 also has rich audio features, including SPDIF and I2S audio interface. Various analog IP integration, including ADC, analog comparator, MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 32 / 85...
Page 33
The CCM generates and controls the clocks of various modules in the design and manages the low-power modes. This module uses the available clock sources to generate the clock roots. The clock sources used in the motor-control application are: MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 33 / 85...
Page 34
• Six channels from three submodules are used for the 3-phase PWM generation. Submodule 0 generates the master reload at event every n opportunity, depending on the user-defined macro M1_FOC_FREQ_VS_PWM_FREQ. • Submodules 1 and 3 get their clocks from submodule 0. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 34 / 85...
Page 35
• The direction of counting is set in the M1_POSPE_ENC_DIRECTION macro. • The modulo counting and the modulus counting roll-over/under to increment/decrement revolution counter are enabled. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 35 / 85...
Page 36
• The baud rate is set to 115200 bit/s. • The receiver and transmitter are both enabled. • The other settings are set to default. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 36 / 85...
Page 37
The CCM generates and controls the clocks of various modules in the design and manages the low-power modes. This module uses the available clock sources to generate the clock roots. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 38
• Six channels from three submodules are used for the 3-phase PWM generation. Submodule 0 generates the master reload at event every n opportunity, depending on the user-defined macro M1_FOC_FREQ_VS_PWM_FREQ. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 38 / 85...
Page 39
• The FLEXPWM1_PWM1_OUT_TRIG0_1 output trigger (generated by submodule 0) is connected to ADC_ETC_XBAR0_TRIG0. • The encoder signal Phase A - IOMUX_XBAR_INOUT14 output is assigned to ENC1_PHASE_A_INPUT (GPIO_AD_B0_00 pinmux.c file). is configured as XBAR1_INOUT14 in the MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 39 / 85...
Page 40
XBAR1_INOUT16 in the pinmux.c file). • The encoder signal Phase B - IOMUX_XBAR_INOUT17 output is assigned to ENC1_PHASE_B_INPUT (GPIO_AD_B0_03 pinmux.c file). is configured as XBAR1_INOUT17 in the MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 40 / 85...
Page 41
Correct and precise timing is crucial for motor-control applications. Therefore, the motor-control-dedicated peripherals take care of the timing and synchronization on the hardware layer. In addition, you can set the PWM frequency as a multiple of the MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 42
• Fault mode is enabled for channels A and B at submodules 0, 1, and 2 with automatic fault clearing (the PWM outputs are re-enabled at the first PWM reload after the fault input returns to zero). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 43
• The baud rate is set to 115200 bit/s. • The receiver and transmitter are both enabled. • The other settings are set to default. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 43 / 85...
Page 44
69 376 B Usage 0.83% Board SRAM SRAM_DTC 23 080 B Usage 35.22% SRAM_ITC SRAM_OC 88 752 B Usage 67.71% Table continues on the next page... MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 44 / 85...
Page 45
9 672 B Usage 7.38% SRAM_OC 83 484 B Usage 10.62% Speed Control Position Control Speed Control Position Control Maximum CPU load 7.31% 7.84% 7.25% 6.84% MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 45 / 85...
Page 46
RTCESL_cfg.h header file by using macros RAM_OPTIM_HIGH, RAM_OPTIM_MEDIUM or RAM_OPTIM_LOW. NOTE Memory usage and maximum CPU load can differ depending on the used IDEs and settings. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 46 / 85...
The main project folder pack_motor_imxrt10xx\boards\evkbimxrt10xx\demo_apps\mc_pmsm\pmsm_enc\ contains these folders and files: iar —for the IAR Embedded Workbench IDE. • armgcc —for the GNU Arm IDE. • MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 47 / 85...
Page 48
—contains the software routines that are executed when the application is in a particular state or state transition. state_machine —contains the state machine functions for the FAULT, INITIALIZATION, STOP, and RUN states. • MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 48 / 85...
The Arm-MDK Keil μVision IDE suppresses these warnings: • 6314 - No section matches pattern xxx.o (yy). By default, there are no other warnings shown during the compiling process. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 49 / 85...
The length of the window for moving the average filters is set to eight samples by default. This function always returns true. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 50 / 85...
Page 51
M1_MCDRV_QD_SET_DIRECTION(mcdrv_qd_enc_t*) —this function sets the direction of the quadrature — encoder. This function always returns true. — bool_t M1_MCDRV_QD_CLEAR(mcdrv_qd_enc_t*) —this function clears the internal variables and decoder counter. This function always returns true. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 51 / 85...
If you are using your own motor (different from the default motors), make sure to identify all motor parameters. The automated parameter identification is described in the following sections. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
1. Go to the “Project -> Options -> Comm” tab and make sure that the correct COM port is selected and the communication speed is set to 115200 bps. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 54
“pmsm_used_board” and all stored parameters for the given MCU are loaded. If the connection is established and the board ID F5 to reload the MCAT HTML page. is not shown, press MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 54 / 85...
Page 55
(or restore) them from the hard drive file using the “Reload Data” and “Store Data” buttons. The following sections provide simple instructions on how to identify the parameters of a connected PMSM motor and how to appropriately tune the application. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 55 / 85...
Page 56
DRM148) for more information) run in the background, even if the estimated position information is not directly used. This is useful for the BEMF observer tuning. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 56 / 85...
Page 57
Supposing that the BEMF observer is tuned correctly, the current PI controllers can be tuned using the current FOC control structure. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 57 / 85...
Page 58
(in the “Speed & Pos” menu tab) because the voltage on the DC-bus can rise when braking the quickly spinning shaft. It may cause the overvoltage fault. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 59
• Demo mode on/off button—turns the demonstration mode on/off. • RUN/STOP PWM button—runs/stops the whole application (sets the PWM on and off). • Notification—shows the notification about the actual application state (or faults). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 59 / 85...
Page 60
• In case of a fault, click on the fault notification to clear the fault. • Click the “Demo Mode On/Off” button to turn the demonstration mode on/off. • Click the “RUN/STOP” button to stop the motor. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 60 / 85...
Teknic or Linix motor described in the previous sections, identify the parameters of your motor first. Each tuning phase is described in more detail in the following sections. Figure 49. Running a new PMSM MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 61 / 85...
Page 62
The frequency and amplitude of the sinusoidal voltage are obtained before the actual F start frequency, which are measurement, during the tuning process. The tuning process begins with a 0-V amplitude and the MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 62 / 85...
Page 63
. When the motor reaches the required speed, the BEMF voltages obtained by the BEMF observer are filtered and is calculated: MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 63 / 85...
Page 64
=J/B as the time in which the rotor decelerates from its original value by 63 %. measure the mechanical time constant The final mechanical parameter estimation can be calculated by integrating: Te moment of inertia is: MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 64 / 85...
Page 65
• Enter the motor measurement parameters and start the measurement by pressing the “Measure electrical” or “Measure mechanical” buttons. You can observe which parameter is being measured in the “Status” bar. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 66
NXP Semiconductors Identifying parameters of user motor using MCAT Figure 53. PMSM identification tab Figure 54. Measurement process diagram MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 66 / 85...
Page 67
Typical range Motor pole pairs 1-10 [Ω] 1-phase stator resistance 0.3-50 1-phase direct inductance 0.00001-0.1 1-phase 0.00001-0.1 quadrature inductance Table continues on the next page... MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 67 / 85...
Page 68
1. Select the scalar control by clicking the “DISABLED” button in the “Scalar Control” section. The button color changes to red and the text changes to “ENABLED”. 2. Turn the application switch on. The application state changes to “RUN”. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 68 / 85...
Page 69
The position difference depends on the motor load. The higher the load, the bigger the difference between the positions due to the load angle. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 69 / 85...
Page 70
A and phase B (or the other way round). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 70 / 85...
Page 71
If the calculated loop parameters do not correspond to the required response, the bandwidth and attenuation parameters can be tuned. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 71 / 85...
Page 72
• The loop bandwidth is high (700 Hz) and the response time of the Id current is very fast, but with oscillation and overshoot (see Figure 62). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 72 / 85...
Page 73
3. The start-up ramp increment is in the “Sensorless” tab and its value is usually higher than that of the speed loop ramp. Figure 63. Speed profile MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 73 / 85...
Page 74
If the calculated loop parameters do not correspond to the optimal response, the bandwidth and attenuation parameters can be tuned. 2. Select the “Observer” recorder from the FreeMASTER project tree. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 74 / 85...
Page 75
• The “SL_Ki” value is low and the “Speed Actual Filtered” does not achieve the “Speed Ramp” (see Figure 65). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 75 / 85...
Page 76
• The speed loop response has a small overshoot and the “Speed Actual Filtered” settling time is sufficient. Such response can be considered optimal (see Figure 67). MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 76 / 85...
Page 77
4. Repeat the previous steps until you achieve the required position response. The “PL_Kp” value is low and the actual position response on the required position is very slow. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide...
Page 78
The “PL_Kp” value is too high and the actual position overshoots the required position. Figure 69. Position controller response—PL_Kp value is too high and the actual position overshoots The “PL_Kp” value and the actual position response are optimal. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 78 / 85...
Page 79
NXP Semiconductors Identifying parameters of user motor using MCAT Figure 70. Position controller response—the actual position response is good MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 79 / 85...
The motor user interface and remote control using FreeMASTER are as follows. The motor parameters identification theory and the identification algorithms are described in Identifying parameters of user motor using MCAT. MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 80 / 85...
Table 28. Revision history Revision number Date Substantive changes 02/2020 Initial release 06/2020 Added MIMXRT1010-EVK 01/2021 Added MIMXRT1024-EVK and MIMXRT1170-EVK MCUXpresso SDK 3-Phase PMSM Control (i.MX RT), Rev. 2, 01/2021 User's Guide 84 / 85...
Page 85
How To Reach Us Information in this document is provided solely to enable system and software implementers to use NXP products. There are no express or implied copyright licenses granted hereunder Home Page: to design or fabricate any integrated circuits based on the information in this document. NXP nxp.com reserves the right to make changes without further notice to any products herein.
Need help?
Do you have a question about the MCUXpresso SDK and is the answer not in the manual?
Questions and answers