JFET

Brushless DC motor control system based on CW32F030C8T6

 
Overview

Brushless DC motor based on CW32F030C8T6

This project is designed with three boards. (Why I designed it this way: First of all, I didn’t want to integrate the chip! I hope to control one board and be able to play with some peripherals in the future without welding it to the motor board; Secondly, I originally planned to make FOC control for CW32F030C8T6. My driver board has also been made into FOC. It is still being tested. It will take some time before I share it. The school has been busy recently, so I have been delaying it. I will work hard later. After finishing it, this time I will finish the basic BLDC six-step commutation driver first; finally, you can refer to my design ideas, or you can inherit them all on a board, it’s all fine, no problem at all!)
1. Main control board: First, it is mainly powered by USB, which is stepped down to 3.3V by LDO to power the chip. It is worth noting that this chip is a chip with a wide voltage range and can directly supply 5V! Secondly, the SWD interface and UART interface are led out through the chip pins, which facilitates downloading programs and printing data from the host computer; finally, an onboard button reset circuit is added, and hardware debouncing is added to ensure the stability of the buttons.
2. Undertake board: This circuit mainly includes: buzzer circuit, LED light circuit, OLED display circuit, button circuit, knob potentiometer circuit and 2×17P bullhead female socket; it plays the role of taking over the main control board and driver board .
3. Driver board: This circuit mainly includes: power circuit, driver circuit, current sampling circuit, Hall signal circuit, back electromotive force circuit, motor interface layer circuit and temperature measurement layer circuit; it mainly plays the role of high-power driver.
Next, I will introduce my hardware part , and some key information will be pasted in the software part. For others, please refer to the routine shared by UET teacher Li Fang ! Here, thank you Sister Li Fang ! ! !

Hardware parts

Selection

Power supply section

24VBuck part
Question 1: What is the minimum voltage of the main power supply? How big is the load current required?
Answer: This project uses a 57 DC brushless motor, its rated voltage is: 24V (DC); rated current: 5.9A; no-load current: 0.8A; rated speed is 2500RPM; therefore, the main power supply part needs to be greater than or equal to 24V , the load current should be greater than 0.8×3=2.4A , leaving a threshold, choose a load output current of 3A , a step-down circuit.
1. Enter Lichuang Mall.png
After the above screening, we can see that there are 19 models that meet the conditions. We select the spot products in ascending order of price . Take a closer look at the relevant description of the IC. In addition to considering the price, you should also consider whether it meets our requirements.
2. View chip introduction.png
I saw a Core Dragon Buck chip here, the price is acceptable, and the inventory is very rich. The most important thing is: Core Dragon is a domestic chip! ! ! No need to think about it, this is it.
OK, after selecting the chip, enter the data sheet to read the relevant parameters.
3. XL1507 chip features.png
What we can know is:
The input voltage range is: 4.5V-40V. Our input is 24V, which fully meets the margin and requirements.
The output voltage range is: 1.23V-37V. Our output is 10V-20V, which fully meets the margin and requirements.
The output current is: 3A. We also need a circuit above 2.4A, and 3A fully meets the requirements.
Switching frequency: 150KHz. Okay, this speed.
4. XL1507 pin definition.png
We can know from the description:
1. An appropriate large-capacity capacitor needs to be placed on the input pin to eliminate input noise.
2. The GND pin needs to be considered when laying out: The GND pin needs to be placed outside the path from the Schottky diode to the output capacitor ground to prevent voltage noise caused by switching current spike induction.
3. The feedback voltage is: 1.23V.
4. If the ON/OFF pin is left floating, it defaults to low level. If this pin is at a low level, the chip will work; if it is at a high level, the chip will not work.
5. XL1507 typical applications.png
We can know from the description:
1. R1 uses a resistor close to 1K ohm and uses an accuracy of 1%.
2. C1 and CFF are optional to improve stability and reduce power supply noise. CIN and C1 must be placed close to pin 1 and pin 3.
3. For output voltages higher than 10V, a CFF capacitor is needed. At this time, CFF is used as a compensation capacitor and is used in parallel with R2. Its value is between 100pf and 33nf. The capacitance value of CFF is equal to (1/(31×1000×R2)).
6. XL1507 parameter selection.png
To sum up, our selection parameters are:
CIN: The capacitance is 180uf, and the withstand voltage is greater than (24×2=48)V;
C1: The capacitance is 10×10^5pf=1uf, and the withstand voltage is 50V;
CFF: capacitance is 1nf, voltage resistance is 50V;
R1: resistance value is 1K ohm, accuracy is 1%;
R2: The resistance value is: (1+R2/R1)*1.23=Vout--->R2 is equal to 8.76K ohms.
COUT: The capacitance is 180uf, and the withstand voltage is greater than (12×2)=24V;
L1: Inductance value is 68uH;
D1: Schottky diode uses DSK34.
Therefore, the overall solution for converting 24V into 12V is:
7. XL1507 overall solution.png

12VBuck part
Considering that the working voltage of the Hall sensor is 5V, it is necessary to Buck convert 12V to 5V. This project uses Shouding's SD8942 . As for why I chose it, it's because I bought a lot of this material and have a lot of inventory, so I can't waste money. . . Moreover, I have verified this scheme of converting 12V into 5V, and there is no problem. The most important thing is: Schottky diodes are not needed, and the peripheral circuit is very simple.
8. SD8942 chip features.png
We can know from the description:
1. The input voltage range is: 4.5V-16V. Our input voltage is 12V, which meets the requirements.
2. The switching frequency is 600KHz and the switching frequency is fast.
3. Output current: 2A motor no-load current 0.8A, 2 times margin, meeting the requirements.
4. No Schottky diode is required, and internal integration saves costs.
5. Chip efficiency: 96% high efficiency.
6. Reference voltage: 0.6V to facilitate calculation of feedback resistor resistance.
A basic circuit with an output of 5V/2A is given in the typical application, which we can use directly. There is nothing special, the main thing is that the capacitor withstands a higher voltage, and there is nothing else to consider. So the final circuit diagram looks like this:
9. SD8942 overall solution.png

Therefore, the power supply part has been solved as a whole.

Driver hardware part

If we want to drive a brushless DC motor in an open loop , what functions do we need to use?
1. Power supply part: 24V power supply; 12V for MOS drive circuit; 5V for Hall drive circuit; and power supply for main control chip
2. Main control chip: sends 6 PWM signals and 3 Hall sensor detection signals;
3. MOS drive circuit + three-phase full-bridge circuit;
4. Potentiometer circuit, controlling speed through knob;
5. OLED display function circuit
6. Current sampling part
Therefore, we might as well start with the analysis of these circuits. It is worth noting that we will not analyze the main control chip and power supply part. The power supply has been analyzed above. The main control chip is CW32F030C8T6 developed by Wuhan Xinyuan Semiconductor. ;

MOS drive circuit
10. MOS drive circuit.png
The MOS driver chip we use is EG3013 . Why did we choose it? See for yourself: (The last time I did an experiment in the lab, I needed a gate driver IC, so I bought a lot of them. Only after the board was made and welded was I discovered that the gate driver IC used by Sister Li Fang was also made of this material!)
11. Gate drive IC selection.png
One thing worth noting about this chip is that its truth table looks like this:
HIN LIN HO LO
0 0 0 1 (top tube open)
0 1 0 0 (both upper and lower tubes are closed)
1 0 0 0 (Both the upper and lower tubes are open. In this case, the chip has a latch function and will not output! Prevent short circuit)
1 1 1 0 (downtube open)
The LIN of this chip is an active low pin! In the program, there is a GPIO configuration for turning on or off AL, BL, and CL. Here is the opposite logic! ! ! So when you use it, just modify it according to your own IC!
FR107 is to speed up the turn-on efficiency, Schottky diodes can also be used! But the official FR107 is a material I bought when I was making Momentum Lun, so I just follow the official instructions. 10uF is a boost capacitor. I asked a technician from Yijing Microelectronics Co., Ltd. about this resistance value . He told me that generally 10uf is enough! It is recommended to use the 1206 package to ensure power! I use 0805 in my circuit, and the only material I have is 0805.... There is no problem in using it, I have verified it! Finally, there are the driving signals for the upper and lower MOS. Resistors and diodes are added to prevent parasitic capacitance and loop inductance ! ! ! Reduce ringing . Adding an R to form an RLC circuit can absorb parasitic parameters; the diode mainly provides a freewheeling channel. For details, please refer to the video: https://b23.tv/9a7pe1Q

Three-phase full bridge circuit
12. Three-phase full-bridge circuit.png
The NMOS used here is:
13. NMOS selection.png

I mainly consider that the voltage and current should be larger and the RDS smaller to prevent serious heating. The last thing is to consider the price issue.

Current sampling circuit
14. Current sampling circuit.png
The model number is:
15. Low resistance sampling resistor selection.png
cheap price! ! ! Secondly, the maximum current it can pass is: 2/0.01=20A! We don't usually have such high voltages. There are 5A and 6A ones. For a novice like me, they are about to shut down! ! ! Ha ha

Hall interface circuit
16. Hall interface circuit.png
Among them: C14, C15, and C16 are used for filtering; R3, R4, and R5 are used to pull up the three Hall signal pins. Because the 120° Hall sensor does not have a 111 situation, it is also a protective function! I didn't choose the 5Pin interface terminal here because I only have 3P and 2P materials and don't want to buy any more....

The above circuit is enough to run an open loop. Here are some protection functions of the closed loop, such as current detection, voltage protection, temperature protection, etc. I won’t explain its working principle one by one. This circuit diagram is from Teacher Li Fang ’s book. The book describes it in more detail. If you need it, you can download it in the attachment! I won’t show off my shame here anymore! I will simply show the schematic diagram here, and the specific how it works is described in the book.

Op amp circuit
17. Op amp circuit.png
This op amp is exactly the same in the book. For specific amplification factors and working principles, please refer to the book: Brushless DC motor control application based on STM8S series microcontroller
It is worth noting: This involves the sampling problem of the program, so you must understand it! I have written in the program how to calculate those values!

protect the circuit
18. Protection circuit.png
These are some protection circuits added during closed loop. They are very simple. I believe you can analyze them yourself.

Back electromotive force detection circuit
19. Back electromotive force detection circuit.png
This circuit is related to the use when driving motors without induction . This value is also particular. Please compare this circuit with the bus voltage detection circuit. You will find the relationship between the coefficients. This relationship needs to be applied to the non-inductive circuit!

For original details, please refer to: Lichuang Open Source Hardware Platform: Beauty_Light . Thank you for the hardware circuit reference design! ! !


参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-15 03:18:07

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号