Question requirements
Create a non-inductive brushless motor drive that can theoretically carry 30A current
Question analysis
The brushless motor BLDC is similar to a three-phase drive. When the rotor reaches the appropriate position, it needs to switch to the corresponding phase sequence to ensure that the motor can run smoothly.
In the absence of a Hall sensor or encoder that can transmit the motor rotor position, a solution for the drive board to sense the motor rotor position is to detect the zero-crossing time of the back electromotive force to determine whether to commutate.
In the driving scheme of two-two conduction (that is, only two of the three phases are turned on at a time), the third phase is neither powered nor pulled to ground and is in a floating state. At this time, the voltage difference between its level and the neutral point of the motor is the back electromotive force. When this voltage difference crosses the zero point upward or downward, that is, when the back electromotive force induced by the third phase switches, it is exactly the midpoint of two adjacent commutation positions of the motor rotor. Taking the electrical angle of 60° as an example, waiting for the motor to rotate another 30° electrical angle is the commutation time. Therefore, correctly identifying the zero-crossing point of the back electromotive force is the key to driving the inductive brushless motor.
Tip: Overall design block diagram
List:
Schematic design instructions
The schematic diagram is as follows:
Figure 1 Schematic diagram
The power supply in the schematic diagram uses a scheme of converting 7 to 18V to 5V, and then converting 5V to 3.3V. Among them, the conversion of 7 to 18V to 5V uses a DC-DC converter to convert the wide range of external input voltage into 5V3A. In fact, according to the chip manual, the input voltage can reach 24V, but due to driver reasons, it is conservatively marked as 18V. For details, please see the introduction of the driver section. This DC-DC can be used as a 5V2A BEC (located at the CN1 port. Since it needs to provide internal power supply to the driver board, including the loss of the terminal, conservative testing shows that it can stabilize the 5V2A output under the condition of ensuring a small voltage drop loss) . 5V to 3.3V uses a 3.3V1A LDO. This power supply can be used in the terminal (H2) of the debugging download port. It is also recommended to use an external power supply after taking into account the internal power consumption, terminal loss, and small external voltage drop loss. The load should not exceed 300mA. The four components on the left side of the power module are voltage dividing resistors, which can measure the voltage of the external power supply.
The back electromotive force sampling uses an op amp analog comparator solution. Of course, the ADC solution can also be used. The driver board also leads the three-phase voltage measurement and virtual neutral point voltage measurement circuits to the ADC pin of the MCU. The comparator is not used directly here because I have a lot of LM358, so I am too lazy to buy a comparator. . . If you have to use a comparator here, you can choose LM339. Remember that the output of the comparator is generally an open-drain output, so you need to use a pull-up resistor at the output end from 3.3V (or 5V. The comparator output of the driver board is connected to Pins that can withstand 5V high levels) obtain strong high levels. Of course, if you forget, I also made pull-up input configuration for the IO port in the program. It is recommended to connect a capacitor with a capacitance of at least 3.3nF across the op amp or comparator input, because the motor speed regulation uses PWM wave speed regulation. During the process of driving the motor to rotate, the wave is easily coupled to the comparator input terminal, causing the output The 15kHz interference signal greatly affects the judgment of the zero-crossing point, as shown in the figure below:

Figure 2 Back electromotive force waveform without filtering
Figure 3 Back electromotive force waveform when the capacitance value is appropriate
Figure 4 Waveform when the capacitance value is too large
As can be seen from the three figures above, it is important to choose a capacitor with a suitable value as the filter capacitor of the input stage. If it is too small, burrs cannot be filtered, and if it is too large, the phase delay will be serious. It can also be seen from the normal filtered back electromotive force waveform that when the back electromotive force jumps, there will be a peak interference. The time of this peak is about 50us, so the subsequent program design can be based on this point to perform targeted digital filtering. As for the voltage regulator tube at the voltage dividing resistor, I didn't know how big the neutral point voltage was before, and I was worried that it would still exceed 3.3V after dividing the voltage and fry the ADC peripheral of the chip. However, I later found that my calculations were relatively accurate, so I was too lazy to solder the voltage regulator tube for the next few versions of the circuit I debugged, as my family was poor. . .
The three-phase bridge circuit and its drive circuit are the core of the brushless motor drive. This drive board uses the PWM speed modulation of the upper tube and the speed regulation of the lower tube. In terms of internal power supply, this board should be able to support 24V input due to the DC-DC chip. However, the voltage used to drive the MOS here is the power supply voltage. If it exceeds 20V, there is a possibility of MOS breakdown, so the power supply label The input is 18V. One thing worth noting in this circuit is that when the motor is rotating, the down tube must be in a conductive state, but the motor can rotate, which means that there must be a voltage at the upper end of the motor that is slightly lower than the power supply voltage. Since the upper transistor is also an NMOS, the PWM is constantly chopping and the upper MOS transistor is constantly switching on and off. If you want the MOS upper transistor to be fully open, Vgs is required to be at least 10V. Then the gate potential Vg must exceed the power supply voltage at this time. , obviously this kind of thing is impossible with input power. Therefore, a bootstrap circuit is needed to use the characteristic that the voltage across the capacitor cannot jump to force the voltage between the MOS tubes GS to a very high value, enough to drive the MOS tube to turn on. Here I fell into a misunderstanding and debugged the driver board for a long time. The bootstrap circuit of this driver needs to use the motor driving voltage for charging when the down tube is turned on. Under normal circumstances, if a certain two phases are forcibly connected, since there is no commutation, the source of the phase where the upper tube is connected cannot be pulled to the ground and is in a floating state, so it cannot be charged. At this time, you can I found that the lower tube was open, but the upper tube was blocked. . . . . I was cautious and worried about frying the board, so I tried to conduct the upper and lower tubes of the two phases separately, which led me to think that the charging capacitor was wrongly selected or the driver chip was not powerful. So I fell into this dead end. I hope everyone can take this as a warning and be sure to understand the principles of the components. In fact, this domestic MOS driver chip has an internal logic circuit that will not allow the upper and lower tubes to be turned on at the same time. Therefore, choosing this here also reduces the risk of a lot of board damage.
The peripheral circuit of the MCU is configured for the small system of the MCU. The 8M crystal oscillator, reset circuit, etc. are relatively conventional, and the online information is relatively complete, so I will not describe them in detail. It is worth mentioning that I like serial ports very much, so I used serial port 2 as a debugging port. After all, there is no light bulb, and if there is no serial port, you don’t even know what the chip program is doing. As a social worker in the workplace, although I do all kinds of fishing, I still don’t want to see my teammates or chips doing it. This is a typical double standard. . . . There is also the PWM input port, which was inspired by the ESC of model aircraft. They also put the PWM speed control input and BEC together, so I put them together. The driver board can use external PWM signals to adjust the speed of the motor. The protocol imitates the Yinyan digital servo, with a frequency of 300Hz, a high level of 3.3V, and an effective high level time of 1500us to 1900us. Of course, since there is a serial port, it is natural to use the serial port to send and receive data. Some voltage, current, or motor speed can be used as feedback. In order to facilitate debugging, a set of Hall sensor interfaces are also added here, so there is no problem in using this driver board to drive motors with Hall sensors.
So the real thing is as follows:
Figure 5 Front view of the actual object
Figure 6 The reverse side of the op amp filter capacitor before modification
Figure 7 The reverse side of the modified op amp filter capacitor and bootstrap capacitor packages.
I put two negative sides here because I don’t want to dismantle the MOS anymore. The current circuit is a little imperfect, so I added a MOS and soldered it. I come from a poor family, and the dozens of MOS I bought have almost been blown up. I hope that the reviewer will not worry about this because I am bleeding so much. Thank you. However, I still have to say that the conditions at home are limited and I can only get a few amps of output current, so I have not tested whether this board can really withstand a large current of 30A. Each of the upper and lower tubes here uses two 80A MOS, which is also very convenient for laying heat sinks, so there is no need to worry too much about MOS. I am mainly worried about the copper coating below. Although it has a large area and a large number of vias, it has not been tested after all, so it is still a bit weak. However, there is also a solution, which is to open a window in the copper cladding and then solder the copper strips to increase the overcurrent capability of the internal circuit.
PCB design instructions
First, take a look at the overall appearance of the PCB.
Figure 8 PCB overview
It can be found that it is not very beautiful. . . I actually don't have much experience in PCB design, so I can't provide much experience. But there are some things worth talking about, especially the power supply. At that time, debugging this power supply also made me vomit blood.
First of all, the incoming and outgoing wires of the power supply should be as short and thick as possible, otherwise there will be a large voltage drop and heat. If possible, a layer of ground can be covered under the chip and a few heat dissipation holes can be drilled. The actual measured results are good. The input capacitor should be as close as possible to the chip, and the output capacitor should be as close as possible to the inductor output.
Friends who have the conditions can choose fully shielded inductors, so that the EMC of the board will be much better. If you use a half-pack, put ground under the inductor, and do not run signal lines under the inductor. The interference of this thing is not ordinary.
The feedback line should avoid interference sources as much as possible, such as the BOOST pin or SW pin of the chip. It is best to be able to go from the back and have paved ground around it. There is a particularly pitfall here, that is, the feedback line must be led from the output capacitor to the output port of the board! Although, in principle, there is a piece of copper on the left and right sides of the capacitor, and the current should be the same in theory, in fact, the current will not be stable until it passes through the capacitor, otherwise the feedback signal will have huge ripples (about 300mV, picture missing) ). This 300mV fluctuation will directly affect the output of the power chip, and even if it only outputs half the current, the chip will trip.
The next step is to keep the gate driver chip as close as possible to the gate of the MOS tube. This can reduce the stray inductance caused by long wires and avoid ringing. If there is ringing, Baidu has more information. I don’t have a picture, but I also said not sure. As for this driver board, I really can't shorten it here, so I can only add a current-limiting resistor to suppress the ringing. Of course, the price is that the charging time of the MOS tube junction capacitor is too long, the Miller platform spans a long time, and the Miller platform does not I have to say more, Baidu has it, but there is no picture here, so it is difficult to explain. Then when crossing the Miller platform, the MOS tube is in the amplification zone for a long time, so the heat will definitely be more serious. There is no way to do this. .
Finally, in terms of chip wiring, the pins of the chip still need to pay attention to the spread of the lines. Don't drill multiple vias to pass the signal lines like my first work, which can easily introduce interference.
Software description
Tip: The software can be nested using code blocks. There is no need to explain all parts of the software, just the important parts.
Code block:
#include<stdio.h>
void main()
{
printf(""/n);
}
Physical display instructions
The physical display is already in the schematic diagram section, so I won’t repeat the diagram here.
Precautions
The precautions have been explained in the schematic diagram and PCB description, and the effect is better combined with the pictures. No more copy-pasting here either.
Demo video
Please see attachment for demonstration video
Upload other attachments
See attachment for code details