background image

Figure 20. MID FreeMASTER control

NXP Semiconductors

Remote control using FreeMASTER

MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC motors, Rev. 0, 01/2022

User Guide

27 / 50

Содержание MCUXpresso

Страница 1: ...MCUXpresso SDK Field Oriented Control FOC of 3 Phase PMSM and BLDC motors NXP Semiconductors Document identifier PMSMRT1170 User Guide Rev 0 01 2022...

Страница 2: ...17 Chapter 6 Motor control peripheral initialization 18 Chapter 7 User interface 20 Chapter 8 Remote control using FreeMASTER 21 Chapter 9 Conclusion 45 Chapter 10 Acronyms and abbreviations 46 Chapt...

Страница 3: ...These tools provide a simple and user friendly way for the motor parameter identification algorithm tuning software control debugging and diagnostics This document describes how to run and control th...

Страница 4: ...in layout The FRDM MC LVPMSM low voltage 3 phase Permanent Magnet Synchronous Motor PMSM Freedom development platform board has the power supply input voltage of 24 48 VDC with a reverse polarity prot...

Страница 5: ...sensors hall and encoder For information on the wiring of feedback sensors see the datasheet on the manufacturer web page The motor parameters are listed in Table 2 Table 2 Teknic M 2310P motor param...

Страница 6: ...y 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 NXP Semiconductors Hardware setup M...

Страница 7: ...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 3 MIMXRT1160 EVK and MIMXRT1170 EVK jumper settings Jumper Setting Jumper Set...

Страница 8: ...and solder some resistors Please solder resistor R1841 and 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...

Страница 9: ...TE 2 Connect the 3 phase motor wires to the screw terminals J7 on the Freedom PMSM power stage 3 On the top of FRDM MC PMSM shield connect by wires following pins Table 4 MIMXRT1170 EVK pin assignment...

Страница 10: ...Figure 8 Assembled Freedome system NXP Semiconductors Hardware setup MCUXpresso SDK Field Oriented Control FOC of 3 Phase PMSM and BLDC motors Rev 0 01 2022 User Guide 10 50...

Страница 11: ...ipherals take care of the timing and synchronization on the hardware layer In addition you can set the PWM frequency as a multiple of the ADC interrupt ADC ISR frequency where the FOC algorithm is cal...

Страница 12: ...trigger control ADC_ETC The ADC_ETC module enables multiple users to share the ADC modules in the Time Division Multiplexing TDM way The external triggers can be brought from the Cross BAR XBAR or oth...

Страница 13: ...map linker file including the 4 KB FreeMASTER recorder buffer allocated in RAM The CPU load is measured using the SysTick timer The CPU load is dependent on the fast loop FOC calculation and slow loo...

Страница 14: ...mum CPU load is depending on executing functions from RAM or FLASH memory Executing functions can be speeding up in RTCESL_cfg h header file by using macros RAM_OPTIM_HIGH RAM_OPTIM_MEDIUM or RAM_OPTI...

Страница 15: ...ue to the possibility to add or remove files and directories The pack_motor_board project includes all the available functions and routines MID functions scalar and vector control of the motor FOC con...

Страница 16: ...ntaining the FreeMASTER communication and features setup pin_mux and h port configuration files It is recommended to generate these files in the pin tool peripherals c and h MCUXpresso Config Tool con...

Страница 17: ...tial runtime logic and performance errors In some cases warnings can be suspended and these warnings do not show during the compiling process One of such special cases is the unused function warning w...

Страница 18: ...easurable on both ADC converters and the two remaining phase currents must be measurable on different ADC converters The reason for this is that the selection of the phase current pair to measure depe...

Страница 19: ...atically clears the flags if set This function returns true when an over current event occurs Otherwise it returns false The available APIs for the quadrature encoder are mcdrv_qd_enc_t MCDRV QD struc...

Страница 20: ...n and the set of software drivers running in the embedded application Data is transferred between the PC and the embedded application via the serial interface This interface is provided by the CMSIS D...

Страница 21: ...g steps to control a PMSM motor using FreeMASTER 1 Download the project from your chosen IDE to the MCU and run it 2 Open the FreeMASTER file pmsm_x pmp The PMSM project uses the TSA by default so it...

Страница 22: ...ents one sub module which enables you to tune or control different aspects of the application Besides the MCAT page for PMSM several scopes recorders and variables in the project tree are predefined i...

Страница 23: ...le to generate the m1_pmsm_appconfig h file which is then used to preset all application parameters permanently at the project rebuild Online update this tab shows actual values of variables on target...

Страница 24: ...endent on the motor speed Both the d axis and q axis stator voltages can be specified in the M1 MCAT Ud Required and M1 MCAT Uq Required fields This control method is useful for the BEMF observer func...

Страница 25: ...l devices The position control using the P controller can be tuned in the Speed loop menu tab An encoder sensor is required for the feedback Without the sensor the position control does not work A bra...

Страница 26: ...is not STOP 8 4 Identifying parameters of user motor Because the model based control methods of the PMSM drives provide high performance e g dynamic response efficiency obtaining an accurate model of...

Страница 27: ...Figure 20 MID FreeMASTER control NXP Semiconductors Remote control using FreeMASTER MCUXpresso SDK Field Oriented Control FOC of 3 Phase PMSM and BLDC motors Rev 0 01 2022 User Guide 27 50...

Страница 28: ...utomatically starting a new measurement If a MID fault appears the measurement process immeadiatelly stops and brings the MID state machine safely to the STOP state If a MID warning appears the measur...

Страница 29: ...de is automatic Rotor is not fixed In this mode will be performed automatic measurement of the inductances for a definied number NUM_MEAS of different DC current levels using positive values of the DC...

Страница 30: ...of pp is correct The required speed for the Ke measurement is also calculated from pp Therefore inaccuracy in pp causes inaccuracy in the resulting Ke Increase Id meas to produce higher torque when sp...

Страница 31: ...s freely with no generated torque only by friction This enables you to simply measure the mechanical time constant m J B as the time in which the rotor decelerates from its original value by 63 The fi...

Страница 32: ...verall system inertia and can be obtained using a mechanical measurement The J parameter is used to calculate the speed controller constant However the manual controller tuning can also be used to cal...

Страница 33: ...tion scales Parameter Units Description Typical range N max rpm Speed scale 1 1 N nom E block V BEMF scale ke Nmax kt Nm A Motor torque constant 7 Check the alignment parameters these fields are calcu...

Страница 34: ...ition difference depends on the motor load The higher the load the bigger the difference between the positions due to the load angle Figure 23 Generated and estimated positions 7 If an opposite speed...

Страница 35: ...determined as follows 1 Navigate to the Scalar Voltage Control tab in the project tree and select SCALAR_CONTROL in the M1 MCAT Control variable 2 Turn the application switch on The application state...

Страница 36: ...loop parameters do not correspond to the required response the bandwidth and attenuation parameters can be tuned 1 Lock the motor shaft 2 Set the required loop bandwidth and attenuation and click the...

Страница 37: ...e 27 Figure 27 Optimal step response of the Id current controller 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 2...

Страница 38: ...shape equals the Speed Ramp profile 2 The increments are common for the scalar and speed control The increment fields are in the Speed loop tab and accessible in both tuning modes Clicking the Update...

Страница 39: ...electrical revolution The higher the value the faster the merge Values close to 1 are set for the drives where a high start up torque and smooth transitions between the open loop and the closed loop a...

Страница 40: ...e proportional gain Set the SL_Ki integral gain to 0 Set the speed ramp to 1000 rpm sec or higher Run the motor at a convenient speed about 30 of the nominal speed Set a step in the required speed to...

Страница 41: ...ure 32 Speed controller response SL_Kp value is low Speed Actual Filtered greatly overshoots The speed loop response has a small overshoot and the Speed Actual Filtered settling time is sufficient Suc...

Страница 42: ...de an example of how to set the position P controller for a PM synchronous motor 1 Select the Position Controller scope in Position Control tab in the FreeMASTER project tree 2 Tune the proportional g...

Страница 43: ...n overshoots the required position Figure 35 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 NXP Se...

Страница 44: ...on controller response the actual position response is good NXP Semiconductors Remote control using FreeMASTER MCUXpresso SDK Field Oriented Control FOC of 3 Phase PMSM and BLDC motors Rev 0 01 2022 U...

Страница 45: ...r control application timing is described in RT crossover processors features and peripheral settings and the peripheral initialization is described in Motor control peripheral initialization The moto...

Страница 46: ...e Input Output LPIT Low power Periodic Interrupt Timer LPUART Low power Universal Asynchronous Receiver Transmitter MCAT Motor Control Application Tuning tool MCDRV Motor Control Peripheral Drivers MC...

Страница 47: ...l Application Tuning MCAT Tool for 3 Phase PMSM document AN4642 3 PMSM Field Oriented Control on MIMXRT10xx EVK User s Guide document PMSMFOCRT10xxUG 4 PMSM Field Oriented Control on MIMXRT10xx EVK do...

Страница 48: ...d 6 i MX RT1170 EVK board 7 i MX RT Crossover MCUs 8 FRDM MC PMSM Freedome Development Platform 9 MCUXpresso IDE Importing MCUXpresso SDK 10 MCUXpresso Config Tool 11 MCUXpresso SDK Builder SDK exampl...

Страница 49: ...ne to the document since the initial release Table 13 Revision history Revision number Date Substantive changes 0 01 2022 Initial release NXP Semiconductors MCUXpresso SDK Field Oriented Control FOC o...

Страница 50: ...ate design and operating safeguards to minimize the risks associated with their applications and products NXP the NXP logo NXP SECURE CONNECTIONS FOR A SMARTER WORLD COOLFLUX EMBRACE GREENCHIP HITAG I...

Отзывы: