Control Design of Brushless Motor
Published:
2023-03-29 14:41
Using the LPC2101 ARM7 kernel to develop a brushless DC motor control system, the code is simplified and the control system is reliable. After a long period of practical measurement, it has been proved that the selection and design of the system related devices are stable. In addition, compared to the LPC21 series, the price and performance of the current enhanced 51 series microprocessors are lower in power consumption, and the price is similar to that of ordinary 8-bit computers, but the performance is better than that of the enhanced 51 series. For example, dual serial ports with Modem, dual I2C interfaces, large capacity Flash and RAM storage areas, multi-channel PWM, multiple 32-bit timers, high-precision 10-bit A/D converters, and so on. Therefore, in terms of chip design and system design, the brushless motor product has certain promotion value.
Basic principle of brushless DC motor
Design Scheme of Brushless DC Motor Control
Figure 1 Composition of brushless motor
Brushless DC motors are generally composed of stator, rotor, and metal housing. As shown in Figure 1, torque is generated by the attraction of reverse polarity to make the motor run. Once the rotor starts to operate, the fixed brush and rotor portion will be repeatedly connected and disconnected, and electromotive force and back electromotive force will be generated during the rotor rotation process. New electrodes will always have opposite polarity to the stator. Because this transformation is fixed, the rotor moves in a fixed form. By applying a reverse voltage and reverse rotor coil current to the motor, the north-south polarity is reversed, and the motor changes its direction of motion and rotation.
The speed and torque of the motor are controlled based on the strength of the magnetic field generated by the rotation of the motor, while the rotational energy of the motor is controlled based on the magnitude of the current. Therefore, adjusting the voltage and current of the motor rotor can change the speed of the motor. The control of the speed of this motor is generated based on changes in the PWM signal of the LPC2101 microcontroller.
Control of brushless DC motor
2.1 Two-way rotation
Design Scheme of Brushless DC Motor Control
Figure 2 Using a full bridge circuit for bidirectional rotation
The bidirectional rotation of a brushless DC motor can be achieved by changing the current through a full bridge drive circuit, as shown in Figure 2. This full bridge drive circuit consists of N-channel MOSFETs. When Q2 and Q3 are turned off, Q1 and Q4 conduct the motor to rotate in positive phase; When Q1 and Q4 are closed, Q2 and Q3 conduction motors rotate in reverse phase.
2.2 Speed control part
The speed of a no-load motor is proportional to the voltage applied to the motor, so the speed of the motor can be controlled by sampling the voltage applied to the motor. Pulse width modulation and demodulation are used to generate this voltage variation, as shown in Figure 3. Pulse width modulation is a fixed frequency pulse width waveform based on a duty cycle. The average voltage applied to the motor is proportional to the PWM duty cycle.
Design Scheme of Brushless DC Motor Control
Figure 3 PWM Speed Control
The PWM signals (Q1 and Q2) determine the time base frequency of the signal based on the three matching registers of the LPC2101 microcontroller timer 2. The motor speed (duty cycle) and direction are controlled by adjusting the potentiometer input and changing the input value of the LPC2101 ADC, as shown in Figure 4.
Design Scheme of Brushless DC Motor Control
Figure 4 System Configuration
2.3 Motor feedback part
Low power motor current measurement uses a current sensor between the MOSFET and ground (see Figure 4). Detecting small voltages through the sampling resistance of the current sensor; By filtering and amplifying at the front end of the microcontroller, current collection is always at the highest level, before PWM is generated. This operation is interrupted by an external timer matching, after which the A/D conversion starts first. The conversion value represents the current of the motor.
Low power sensorless motor rotational speed feedback is measured through the feedback EMF voltage (see Figure 4). The back electromotive force is generated by the rotating magnetic field of the motor rotor and the external electromagnetic field. In other words, the motor behaves like a generator. The RPM is directly proportional to the back electromotive force voltage, and the back electromotive force measurement is accomplished through MOSFET switching (braking mode). In this article, the BEMF measurement is used to detect whether the motor has completely stopped. The voltage divider is used to meet the back electromotive force voltage (up to 12 V) between 0 and 3.3 V.
Application of brushless DC motor
3.1 Selection of LPC2102
LPC2102 (packaged with LQFP48) is currently the smallest and cheapest 32-bit CPU processor in the LPC2000 series ARM7 family with a bus frequency of up to 70 MHz; There is 2 KB of static RAM and 8 KB of on-chip Flash storage. For using USB, CAN bus, and Ethernet bus, the LPC2000 series of higher level processors can be selected. In this article, LPC2101 has a CPU usage code space of 3 KB and a CPU load of less than 5%. The following internal peripheral resources are not used: UART, I2C, SPI/SSP, RTC, 2 timers, and 4 A/D inputs. Twenty unused I/O ports are available for user expansion.
3.2 Motor selection
The design selects a 150 W MAXON RE40 motor. At 12 V input, the unloaded speed is 6920 r/s. The maximum continuous current is 6 A. PWM time based signals have a significant impact on motor noise (because the frequency range of sound waves that can be heard by the human ear is generally 20 Hz to 20 kHz), and also affect the performance of the motor. To prevent the current from crossing zero during the entire cycle (usually referred to as a discontinuous current state, when the motor is lightly loaded), as shown in Figure 5 (b). This discontinuous current can lead to a very steep torque speed curve, which will generate some kind of pulse in the motor, causing greater noise in the motor rotor. This circuit uses MAXON motors to obtain a continuous current mode, and the PWM pulse frequency selected is 8 kHz.
Design Scheme of Brushless DC Motor Control
Figure 5 Effect of PWM time base frequency
3.3 MOSFET selection
The NXP semiconductor PH1875L N-channel MOSFET is used in the system. The associated motor voltage is 12 V, and the maximum motor starting current is 103 A. As a 12 V motor, the voltage Vds of the MOSFET is at least 40 V. Sufficient current is required to start the motor, and software control can be used to reduce the current during system operation. The maximum pouring current required for PH1875L is 45.8 A, and the leakage current is 183 A. The SMD chip package for the PH1875L is shown in Figure 6.
Design Scheme of Brushless DC Motor Control
Figure 6 SO669 (LFPAK) Packaging
3.4 MOSFET Drive Selection
MOSFET driving improves the ability of the controller to output signals to drive the motor. In this design, NXP chips PMD2001D and PMGD280UN are selected, as shown in Figure 7.
Design Scheme of Brushless DC Motor Control
Figure 7 Simplified MOSFET MOSFET full bridge and half bridge drive circuits
3.5 Speed control and direction control
To control the direction and motor speed, connect a 10 k Ω potentiometer to the LPC2101 ADC input terminal (see Figure 4). Since it is a 10 bit A/D, only 8 bits are actually required to use 256 step values, as shown in Figure 8. Using 10 bit A/D can achieve 1024 step values.
Design Scheme of Brushless DC Motor Control
Figure 8 Potentiometer Analog Speed Input and Direction
4 Hardware and Software Design
4.1 Hardware design
The circuit principle of the control part is shown in Figure 9. The circuit principle of the power supply and motor parts is shown in Figure 10.
Design Scheme of Brushless DC Motor Control
Figure 9 Circuit principle of control part
4.2 Software design
The software is written in C language using Keil μ Vision (ARM7 RealView V3.0) development environment. The main function performs the following functions: reading the potentiometer value to adjust the speed and motor direction; Read the back electromotive force current of the motor; Set PWM duty ratio and control Q1 to Q4 MOSFET output; Perform RS232 communication. Figure 11 shows the control system flow. Use the RS232 interface to send motor speed, current, and voltage information to the PC terminal computer every 200 ms. The state machine of the motor control software is shown in Figure 12. The state processing is processed in the main program loop, and the timer 2 of LPC2101 is used to generate a PWM signal. After each PWM signal interrupt subroutine enters, the predetermined motor speed can be adjusted by changing the duty cycle and MOSFET output controls Q1 to Q4 can be set. Timer 0 is used for system timing of 10 ms.
Design Scheme of Brushless DC Motor Control
Figure 10 Circuit principle of power supply and motor
Design Scheme of Brushless DC Motor Control
Figure 11 Main program flow
The LPC2101 configuration uses the standard startup code in the Keil ARM development environment, setting the CCLK clock to 60 MHz and the PCLK clock to 15 MHz. The relevant test code includes main. c, adc. c, timer0. c, motor. c, uart. c, bcd. h.
Hot News
2023/03/29