Switching application for msata and pci express mini-card (17 pages)
Summary of Contents for NXP Semiconductors PMSMLPC55S36EVK
Page 1
User guide Document information Information Content Keywords PMSMLPC55S36EVK , PMSM, FOC, MCAT, MID, Motor control, Sensorless control, Speed control, Servo control, Position control Abstract This user guide describes the implementation of the motor-control software for 3-phase Permanent Magnet Synchronous Motors.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 1 Introduction SDK motor control example user guide describes the implementation of the motor-control software for 3-phase Permanent Magnet Synchronous Motors (PMSM) using following NXP platforms: •...
Page 3
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • pmsm_periph_framework - this example contains pins setting (e.g. PWM outputs, ADC inputs) and peripherals setting (e.g. ADC, timers, comparator). Example does not contain algorithms or state machine for motor control application, so spinning with the motor is not possible in the default example.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 2 Hardware setup 2.1 Linix 45ZWN24-40 motor The Linix 45ZWN24-40 motor is a low-voltage 3-phase permanent-magnet motor with hall sensor used in PMSM applications. The motor parameters are listed in Table Table 2. Linix 45ZWN24-40 motor parameters...
Page 5
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 3. Teknic M-2310P motor parameters ...continued Characteristic Symbol Value Units Rated power Continuous current Number of pole-pairs Figure 2. Teknic M-2310P permanent magnet synchronous motor For the sensorless control mode, you only need the power input wires. If used with the hall or encoder sensors, connect the sensor wires to the NXP Freedom power stage.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Motor phases (Mating face shown) Encoder wires Color Signal Color Signal DRAIN x3 P DRAIN GRY/WHT COMM T-R 16AWG RED PHASE S ENC I 16AWG WHT...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 7. FRDM-MC-LVPMSM modification for IOPAMP application 2.4 LPC55S36-EVK The LPCXpresso55S36 development board is an ideal platform for evaluation and development with the LPC55S36 MCU based on the Arm Cortex-M33 architecture. The Arm Cortex-M33 core operates at up to 150 MHz.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 9. LPC55S36-EVK board (bottom-side view) 2.4.1 Hardware assembling 1. Connect the FRDM-MC-LVPMSM shield to the Motor 1 or Motor 2 connector of the LPC55S36-EVK board. 2. Connect the 3-phase motor wires to the screw terminals (J7) on the Freedom PMSM power stage.
Page 11
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • pmsm_enc_iopamp example is available only on motor connector 1. • In the pmsm_enc_dual example, MCAT interface is not available. Motor identification is implemented only on motor connector 1.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 3 Processors features and peripheral settings This chapter describes the peripheral settings and application timing. 3.1 LPC-55S36 The LPC55S36 MCU family is built upon Cortex-M33-based MCU introduced with the LPC5500 series. This high-efficiency family leverages the new Armv8-M architecture to introduce new levels of performance and advanced security capabilities, including TrustZone-M and co-processor extensions.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 11. Hardware timing and synchronization on LPC55S36 • The top signal shows the eFlexPWM counter (SM0 counter). The dead time is emphasized at the PWM top and PWM bottom signals.
Page 14
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors = CPU frequency = the CPU load taken by the slow loop slow cycles = the number of cycles consumed by the slow loop slow = the frequency of the slow-loop calculation...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 4 Project file and IDE workspace structure All the necessary files are included in one package, which simplifies the distribution and decreases the size of the final package. The directory structure of this package is simple, easy to use, and organized logically. The folder structure used in the IDE differs from the structure of the PMSM package installation, but it uses the same files.
Page 16
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • board.h—contains the definitions of the board LEDs, buttons, UART instance used for FreeMASTER, and so on. • clock_config.c and .h—contains the CPU clock setup functions. These files are going to be generated by the clock tool in the future.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 5 Motor-control peripheral initialization The motor-control peripherals are initialized by calling the MCDRV_Init_M1() function during MCU startup and before the peripherals are used. All initialization functions are in the mc_periph_init.c source file and the mc_periph_init.h header file.
Page 18
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors – void M1_MCDRV_ADC_GET(mcdrv_adc_t*): this function reads and calculates the actual values of the 3-phase currents, DC-bus voltage, and auxiliary quantity. • The available APIs for the PWM are: –...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 6 User interface The application contains the demo mode to demonstrate motor rotation. You can operate it either using the user button, or using FreeMASTER. The NXP development boards include a user button associated with a port interrupt (generated whenever one of the buttons is pressed).
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7 Remote control using FreeMASTER This section provides information about the tools and recommended procedures to control the sensor/ sensorless PMSM Field-Oriented Control (FOC) application using FreeMASTER. The application contains the embedded-side driver of the FreeMASTER real-time debug monitor and data visualization tool for communication with the PC.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 15. FreeMASTER communication setup window 2. Ensure, that your computer is communicating with the plugged board. Unplug and then plug in the USB cable and reopen the FreeMASTER project.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 16. Default symbol file 5. Click OK and restart the FreeMASTER communication. For more information, check FreeMASTER User Guide. 7.3 Motor Control Aplication Tuning interface (MCAT) The PMSM sensor/sensorless FOC application can be easily controlled and tuned using the Motor Control Application Tuning (MCAT) plug-in for PMSM.
Page 23
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors tuning parameters to MCU's flash memory, m1_pmsm_appcofig.h must be saved, code recompiled, and downloaded to MCU. Note: Path to mX_pmsm_appcofig.h file also composed from Board ID value. Therefore, FreeMASTER must be connected to the target, and Board ID value read prior using Save/Load buttons.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • Sensors: this page contains the encoder parameters and position observer parameters. • Sensorless: this page enables you to tune the parameters of the BEMF observer, tracking observer, and open-loop startup.
Page 25
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 6. Parameters tab inputs ...continued MCAT group MCAT name Equation name Description Unit use the electrical parameters identification and then fill manually. Stator quadrature inductance. Obtain from motor manufacturer...
Page 26
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 6. Parameters tab inputs ...continued MCAT group MCAT name Equation name Description Unit E block Eblock Blocked rotor detection. When BEMF voltage drops under E E block per...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • M1_UDCB_IIR_A1 = -(2 * pi * UdcbIIRf0 * currentLoopSampleTime - 2) / (2 + (2 * pi * UdcbIIRf0 * currentLoopSampleTime)) • M1_SCALAR_VHZ_FACTOR_GAIN = UphNom*k_factor/100/(Nnom*Pp/60) •...
Page 28
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 8. Speed loop tab input MCAT group MCAT name Equation name Description Unit Loop parameters Sample time speedLoopSampleTime Slow control loop period. This [sec] disabled value is read from...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.3.1.5 Sensors Available at sensored (encoder) applications only. This tab enables setting the encoder properties and tuning encoder's tracking observer. MCAT group and MCAT name help to locate the parameter in MCAT layout.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 3. No pending fault. Check variable "M1 Fault Pending" in "Motor M1" project tree subblock. If there is some value, first remove the cause of the fault, or disable fault checking. (for example in variable "M1 Fault Enable Blocked Rotor")
Page 32
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors α_req d_req PMSM β_req αβ q_req θ Sensor θ init ω Frequency 2π Integrator Figure 19. Voltage - Open loop control For run motor in Voltage - Open loop control, follow these steps: 1.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 4. In variable "M1 Openloop Required Id" and "M1 Openloop Required Iq" set required values. 5. In variable "M1 Openloop Theta Electrical" set required initial position.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 2. Switch variable "M1 MCAT Control" on "SPEED_FOC". 3. Choose between sensored and sensorless control in variable "M1 MCAT POSPE Sensor". 4. In variable "M1 Speed Required" set the required speed. (i.e. 1000rpm). The motor automatically starts spinning.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 25. Faults in variable watch located in "Motor M1" subblock 7.5.1 Variable "M1 Fault Pending" It shows actually persisting faults, which means that the fault indicated during fault conditions is accomplished.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.5.2 Variable "M1 Fault Captured" If any fault condition appears, the fault captured is indicated. Similar to fault pending, fault captured is shown in the BIN format, but every fault type has its own variable ("M1 Fault Captured Over Curent" and others). For example, if the undervoltage fault condition is accomplished, fault captured is indicated.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.6 Initial motor parameters and harware configuration Motor control examples contain two or more configuration files: m1_pmsm_appconfig.h, m2_pmsm_appconfig.h, and so on. Each contains constants tuned for the selected motor (Linix 45ZWN24-40 or Teknic M-2310P for the Freedom development platform and Mige 60CST-MO1330 for the High-voltage platform).
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 12. Fault limits ...continued Parameter Units Description Typical range U DCB under Trigger value at which 0 ~ U DCB Over the undervoltage fault is detected...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 28. MID FreeMASTER control 7.7.1 Switch between Spin and MID Users can switch between two modes of application: Spin and MID (Motor Identification). Spin mode is used...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.7.2 Motor parameter identification using MID The whole MID is controlled via the FreeMASTER "Variable Watch". The Motor Identification (MID) subblock is shown in Figure 28. Following is the motor parameter identification workflow: 1.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Table 16. MID Start Result variable MID Start Result mask Description Troubleshooting b#00 0001 Error during initialization electrical Check whether inputs to the MCAA_ parameters measurement EstimRLInit_FLT are valid...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.8.4 Number of pole-pair assistant The number of pole-pairs can only be measured with a position sensor. However, there is a simple assistant to determine the number of pole-pairs (PP_ASSIST). The number of the pp assistant performs one electrical revolution, stops for a few seconds, and then repeats.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 29. PMSM identification tab 7.9 Electrical parameters measurement control This section describes how to control electrical parameters measurement, which contains measuring stator resistance R , direct inductance L , and quadrature inductance L .
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors • MID: Config El I DC positive max - Maximum positive DC current for the L dependency map measurement. Injected AC and DC currents are automatically derived from the MID: Config El I DC (estim Lq) and MID: Config El I DC positive max currents.
Page 46
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors (11) Where, = nominal voltage phnom = ratio within range 0-100% factor pp = number of pole-pairs = nominal revolutions Note: Changes V/Hz factor is not propagated to the m1_pmsm_appconfig.h.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 9. Enable the voltage FOC mode in the "M1 MCAT Control" variable while the main application switch "M1 Application Switch" is turned off. 10. Switch on the main application switch on and set a non-zero value in the “M1 MCAT Uq Required” variable.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 33. Encoder direction—wrong direction 7.10.2 Alignment tuning For the alignment parameters, navigate to the "Parameters" MCAT tab. The alignment procedure sets the rotor to an accurate initial position and enables you to apply full startup torque to the motor. A correct initial position is needed mainly for high startup loads (compressors, washers, and so on).
Page 49
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 34. Slow step response of the Id current controller • The loop bandwidth (300 Hz) is optimal and the response time of the Id current is sufficient (see Figure Figure 35. Optimal step response of the Id current controller...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 36. Fast step response of the Id current controller 7.10.4 Speed ramp tuning To tune speed ramp parameters, follow the steps below: 1. The speed command is applied to the speed controller through a speed ramp. The ramp function contains two increments (up and down) which express the motor acceleration and deceleration per second.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 7.10.5 Open loop startup To tune open loop startup parameters, follow the steps below: 1. The startup process can be tuned by a set of parameters located in the "Sensorless" tab. Two of them (ramp increment and current) are accessible in both tuning modes.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 1. Navigate to the "Sensorless" MCAT tab. 2. Set the required bandwidth and attenuation of the BEMF observer. The bandwidth is typically set to a value close to the current loop bandwidth.
Page 53
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 39. Speed controller response—SL_Ki value is low, Speed Ramp is not achieved • The "SL_Kp" value is low, the "Speed Actual Filtered" greatly overshoots, and the long settling time is unwanted.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 41. Speed controller response—speed loop response with a small overshoot 7.10.8 Position P controller tuning The position control loop can be tuned using the proportional gain "M1 Position Loop Kp Gain" variable. A proportional controller can be used to unpretend the position-control systems.
Page 55
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figure 42. Position controller response—PL_Kp value is low, the actual position response is very slow The "PL_Kp" value is too high and the actual position overshoots the required position.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 8 Conclusion This application note describes the implementation of the sensor and sensorless field-oriented control of a 3-phase PMSM. The motor control software is implemented on NXP LPC55S36EVK board with the FRDM- MC-LVPMSM NXP Freedom development platform.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 9 Acronyms and abbreviations Table 17 lists the acronyms and abbreviations used in this document. Table 17. Acronyms and abbreviations Acronym Meaning Analog-to-Digital Converter ACIM Asynchronous Induction Motor...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 10 References These references are available on www.nxp.com: • Sensorless PMSM Field-Oriented Control (document DRM148) • Motor Control Application Tuning (MCAT) Tool for 3-Phase PMSM (document AN4642) PMSMLPC55S36EVK All information provided in this document is subject to legal disclaimers.
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 11 Useful links • MCUXpresso SDK for Motor Control www.nxp.com/sdkmotorcontrol ® ® • LPC553x/S3x: Advanced Analog Arm Cortex -M33-Based MCU Family • MCUXpresso IDE - Importing MCUXpresso SDK •...
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors 12 Revision history Section 12 summarizes the changes done to the document since the initial release. Table 18. Revision history Revision number Date Substantive changes 11/2021 Initial release...
NXP Semiconductors. In the event that customer uses the product for design-in and use in In no event shall NXP Semiconductors be liable for any indirect, incidental, automotive applications to automotive specifications and standards, punitive, special or consequential damages (including - without limitation - customer (a) shall use the product without NXP Semiconductors’...
Page 63
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Tables Tab. 1. Available example type, supported motors Tab. 10. Sensorless tab input ........29 and control methods ......... 2 Tab. 11. MCAT motor parameters ......... 38 Tab.
Page 64
PMSMLPC55S36EVK NXP Semiconductors MCUXpresso SDK Field-Oriented Control (FOC) of 3-Phase PMSM and BLDC Motors Figures Fig. 1. Linix 45ZWN24-40 permanent magnet Fig. 25. Faults in variable watch located in "Motor synchronous motor ..........4 M1" subblock ...........36 Fig. 2. Teknic M-2310P permanent magnet Fig.
Need help?
Do you have a question about the PMSMLPC55S36EVK and is the answer not in the manual?
Questions and answers