This article uses LM3S615 to design a BLDCM controller with good versatility and controllability for BLDCM containing Hall position detection sensors, and conducts experiments to test its basic performance in many aspects.
1 Working principle of BLDCM
The brushless DC motor consists of three parts: the motor body, the rotor position sensor and the inverter power supply circuit. The motor body consists of two parts: the stator (armature) and the rotor. The stator is generally a multi-phase winding, and the rotor is composed of permanent magnetic materials with a certain number of pole pairs. During operation, the rotor rotates driven by the air gap magnetic field of the armature. At the same time, the position detection sensor will continuously detect the rotor position information and feed it back to the controller. The controller sends a control signal through calculation to drive the power switch devices in the inverter circuit to turn on in turn, the armature winding is energized in turn, the air gap magnetic field jumps and steps continuously, and the rotor rotates continuously. The controller uses PWM signals to drive the switching devices. Changing the duty cycle of the PWM signal can change the average terminal voltage of the armature, and then change the motor speed. When designing, attention should be paid to the correct logical relationship of the PWM signal driving the switch and avoiding direct connection of the upper and lower bridge arms.
2 The structural principle of the BLDCM controller based on LM3S615
The structural principle of the BLDCM controller based on LM3S615 is shown in Figure 1.
2.1 Main hardware components and principles
Schematic diagram 1 also shows the system hardware components and main I/O allocation. The controller corresponds to a three-phase brushless DC motor with a Y-type armature connection. It adopts a three-phase two-way six-state power supply method and H_PWM, L_on unipolar inverter bridge control (that is, when the winding is energized, the lower bridge arm tube is always turned on, and the upper bridge arm tube is PWM modulated). This can also reduce the high switching loss and noise caused by bipolar PWM control.
The controller sets the speed through the ADC0 channel (1# pin) front-end potentiometer. The corresponding 10-bit A/D converter will convert the speed setting value into a digital quantity and save it in a specific storage unit. After that, the speed setting value required when the system starts and runs is read from the unit, without frequent reading and A/D conversion. The LCD is a 1602 that can display 16×2 characters. It can be used to display the speed setting value, current speed value, system fault code and display parameters when setting P and I in real time. Figure 2 is the connection diagram between 1602 and MCU. The potentiometer in the figure can be used to adjust the backlight; the start and stop buttons are used to control the start and stop of the motor; the setting button can be pressed four times to select the four parameters of the two PI regulators (i.e., the P and I parameters of ASR and ACR). The increase and decrease buttons change the parameters in 0.1 steps and set; the increase and decrease buttons are available when the motor stops, but are invalid during operation. The 5 buttons of the controller are connected to the GPI0 pin of the MCU after passing through the monostable trigger 74121. The working mode of these 5 GPIO pins can be set to interrupt through the GPIO function; the Hall sensor embedded in the motor can convert the rotor position into a pulse signal and send it to the MCU. Table 1 shows the logic combination of the 3-way Hall signal and the conduction sequence of the power devices corresponding to the forward and reverse rotation.
[page]
The three Hall elements inside the motor are spaced 120° apart in electrical angle, and the pole arc width of the permanent magnets matched with them is 180°. When the rotor rotates, the three Hall elements will alternately output three rectangular wave signals (H1, H2, H3) with a width of 180° and a phase difference of 120°. These three signals are further shaped (Figure 3 is the shaping circuit of the three-phase Hall pulse signal) and then captured by the CAP port of the MCU. On the one hand, the captured information is used as the phase change logic to participate in the generation and output of the PWM signal. On the other hand, the speed calculation module uses the time interval between the leading and trailing edges of one of the pulses (such as H1, it should be noted that when the number of motor pole pairs is P, there are P square waves per revolution) to calculate the speed feedback value. The controller sends the speed feedback value to the LCD display and compares it with the speed setting value to obtain the speed deviation, and then obtains the current set value through ASR operation. The current feedback value is compared with the current set value to obtain the current deviation value, and then obtains the PWM duty cycle adjustment value through ACR operation. The PWM module outputs PWM according to the obtained duty cycle value and commutation logic when the bus current does not exceed the limit and sends it to the drive circuit IR2130 through the high-speed optocoupler TIL117.
Considering the reliability, the MOSFET inverter bridge drive circuit adopts the integrated device IR2130. The working power supply voltage range of IR2130 itself is relatively wide (3~20 V), and it can generate a 2μs interlocking delay for the gate drive signal of the two power devices on the same bridge arm, which can effectively avoid direct short circuit.
2.2 Control algorithm selection and detection processing method
The controller constructed by LM3S615 adopts a dual closed-loop control strategy of current inner loop and speed outer loop. Considering that BLDCM is a self-controlled motor, the MCU computing power is not as good as DSP, and the operating performance of the whole system including the motor is also affected by the performance of the motor itself, so ASR and ACR do not need to use overly complex algorithms. Here, both use incremental PI algorithm. Compared with the position PI algorithm, the incremental PI algorithm does not require accumulation. The controller only outputs the increment, which is less affected by false operation. The control increment is only related to the sampling value of the last K times, and it is easy to obtain better control effect through weighted processing. When setting the PI parameters, the integral link can be fixed to zero first, the proportional link can be adjusted until the system response is stable, and then the integral link can be adjusted to improve the dynamic response and static stability of the system.
In Figure 3, the three Hall signals are isolated by high-speed optocouplers and then sent to the microcontroller through pull-up resistors, non-gates, and capacitor shaping filters. The TIL117 input circuit has a certain input current requirement and cannot be directly driven by Hall signals. The optocoupler output is connected to the inverter to restore the logic state of the original signal. There
are sensor method and series resistance method for detecting BLDCM bus current. When using Hall sensors to detect current, the circuit is relatively complex and the cost is high. When the detected current is small, the detection accuracy will be affected. The bus series resistance method is simple, but attention should be paid to controlling the power consumption of the resistor. Here, the bus current is detected by the series resistance method. In order to reduce the power consumption of the resistor and ensure the detection accuracy, a 0.47 Ω high-precision small resistor for current detection from Vishay Company of the United States is selected, and the power consumption is expected to be no more than 0.1 W. Use wires to lead out from both ends of the current-sense resistor, and after filtering, connect to the circuit shown in Figure 4. This circuit is a high-input impedance differential amplifier circuit built using TI's broadband low-noise op amp OPA842ID, which can effectively amplify the difference between the two input signals. The output of the differential circuit is sent to the ADC1 channel of the MCU for 10-bit A/D conversion. Figure 4 is a current-sense differential amplifier circuit.
[page]
3 Open-loop soft-start control of the motorWhen starting the motor under closed-loop conditions, the instantaneous speed is zero and the PWM duty cycle will reach the maximum value. When loaded, the motor may fail to start due to overcurrent. Therefore, an open-loop start method is used, and the process is shown in Figure 5. When the start button is pressed, the motor rotor is ready to start from the current position. First, the speed setting value (n0) is read and a duty cycle constant D1 is set. The duty cycle is 5% for the first power-on, and then increases in 5% steps until the start is completed. Because the initial duty cycle is relatively small, no matter whether the speed setting is large or small, no load or load, it will start smoothly, and there will be no large overshoot at the start. During the startup process, the MCU will continuously judge the speed, and switch to the closed loop when the slip rate is less than 0.2 (n in Figure 5 is the real-time speed).
4 Strategies for solving the main problems in software compilation
In addition to the main program, the system software mainly includes subroutines such as open-loop startup, A/D conversion, speed calculation, incremental PI, PWM generation, 1602 driver, and key interrupt. TI has equipped the Stellaris series MCU with a complete peripheral driver library, which makes it extremely convenient to use and control the on-chip peripherals. With the support of the API in the peripheral driver library, the peripherals can be fully controlled and applications can be quickly developed without understanding the details of the peripherals. This feature can be called the trend of MCU applications in the future.
For the multiple GPIO ports used in the LCD1602 driver, the programming process can be summarized as follows: initialization (setting the LDO output voltage, setting the system clock); enabling the peripherals (GPIO port); setting the input/output type of each bit of the GPIO port (high-impedance input, push-pull output, open-drain output); reading/writing the status of the GPIO port.
4.1 Key control
All five keys must work in the interrupt state. To achieve good control, two points should be noted when programming: First, the corresponding GPIO pins should be set in the main program. The specific work is in the following order: enable the GPIO port where the key is located, set the pin where the key is located as input, set the interrupt trigger type (edge, level) of the key on the pin, enable the interrupt of the pin, enable the interrupt of the GPIO port, and enable the processor interrupt; second, pay attention to the interrupt status after reading the interrupt status in the interrupt service program.
4.2 Generation of PWM drive signal
The PWM module of LM3S615 is very powerful and consists of 3 PWM generator modules and 1 control module. The control module determines the polarity of the PWM signal and the transmission pin. Each PWM generator has a 16-bit timer and 2 comparators, which can generate 2-way PWM. When the PWM generator is working, the timer is constantly counting and comparing with the values of the two comparators. It can affect the output PWM when it is equal to the comparator or when the timer count value is zero or the load value. Before enabling the PWM generator, the timer counting speed, counting mode, timer reload value and the values of the two comparators must be configured. From the schematic diagram 1, it can be seen that the PWM output is affected by three events: the ACR operation result, the overcurrent judgment result, and the Hall signal logic. The corresponding relationship between the Hall logic combination and the switch conduction combination in Table 1 should be stored in the memory in advance so that it can be looked up every time the PWM output pin is determined.
4.3 Motor overcurrent detection
Overcurrent judgment is relatively simple to implement using the Timer capture/compare module, but the A/D conversion result of the current value is required for ACR operation. In order to improve system efficiency, overcurrent judgment does not use a comparator, and the A/D conversion result is used directly. In specific programming, a constant can be set in advance through analysis. Each time a PWM wave is output, the comparison result of the constant and the A/D conversion value of the current can be used as one of the output conditions. If there is an overcurrent, PWM is immediately blocked.
[page]
5 Experimental test
The brushless DC motor used for the test has Un=36 V, In=1.3 A, Pn=40 W, P=3, and a rated speed of 1 500 rad/min. The motor contains a Hall position sensor, and the sensor working voltage is 5 V. The experimental items include starting process test, phase current waveform test, Hall position pulse test, single-phase winding back electromotive force test, etc. The test results are shown in Figures 6 to 9.
In Figure 6, there is no overshoot in the speed, and the speed changes from zero to the set value (1200 rad/min) in about 1.6 s. The open-loop startup is fast, and there is no abnormal phenomenon such as sudden jump in the graph when it is turned into the closed loop; the phase current wave head in Figure 7 is basically rectangular without serious distortion, and the slight fluctuation at the top is related to PWM chopping; the motor speed can be calculated from the pulse frequency in Figure 8 to be 1455 rad/min, which is consistent with the set value; Figure 9 shows that the back electromotive force waveform of the single-phase winding of the motor is a trapezoid with alternating positive and negative, and the waveform is good.
6 Conclusion
The 32-bit LM3S615 has rich on-chip peripherals, more GPIO port pins, and powerful peripheral driver library functions, which provides good hardware and software support for the built BLDCM controller. The BLDCM controller finally obtained has a compact peripheral unit, appropriate function settings, reasonable algorithm selection, and gives full play to the superior performance of the 32-bit MCU. From the test results, its control performance is good and has certain practical value. Based on the experience of this LM3S615 application, the programming mode using API as the main hardware control method may become the trend of MCU applications in the future.
Previous article:Several issues to consider when using chips to replace 8032 in embedded systems
Next article:Technical Analysis of RTOS Based on uC/OS-II and MSP430 MCU
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- ARM register analysis and exception handling methods
- 【GD32307E-START】Development environment construction + development practice -> light up the onboard LED
- DM642 hard interrupt delay problem
- [Xingkong Board Python Programming Learning Main Control Board] Basic Use of Display Graphical Interface
- Is the semiconductor industry still worth investing in?
- Regarding the question of safety capacitors, let's see who is right
- Download and get a gift! Rohm will teach you tips on power supply design and application
- CircuitPython 6.1.0-rc.0 released
- Live broadcast: STM32's ecosystem of continuous innovation
- Do you know how to synthesize 1-20hz low-frequency electromagnetic waves through high-frequency electromagnetic waves? What is the method?