Build a brushless motor driver based on cw microcontroller and IR2101STRPBF motor driver.

It supports Hall commutation, 3-phase acquisition, and the bus acquisition
driver chip can be replaced by EG3013 (easy to use and cheap---meet the needs of the learning board--note that the EG3013 lower bridge is effective at ground level, and this learning board has defaulted Ground level)
1. Three-phase inverter full-bridge circuit The three-phase inverter bridge circuit adopts IR2101S plus MOS driving method. IR2101S itself is a half-bridge drive, using upper bridge and lower bridge drive methods, that is, one IR2101S and two MOS tubes are required for one drive, for a total of three channels. Therefore, a large part of the cost of motor drive lies in it. Moreover, depending on the application occasions, the power of the MOS tube is different. In this case, it is necessary to consider the cost and try to choose a cost-effective MOS tube. The circuit is shown in Figure
2. Circuit sampling circuit The most basic requirement for motor control is to obtain the current information of the motor. A 0.05 ohm 2W sampling resistor is added to the lower arm of each half-bridge, as shown in the figure:

the current on the motor phase line is collected. The principle is that the current flows through the power resistor to generate a voltage, which is amplified 5 times through the differential amplifier circuit, (5 times is 10/(1+1)) and then sent to the microcontroller for processing. The capacitor plays a filtering role, and the three current sampling channels are the same. Only one channel is listed here.

At the same time, in order to provide a reference voltage of 1.65V for the sampling circuit, we use an op amp to build a reference voltage circuit, also called a follower. Use resistors to divide the voltage out of 1.65V, and output a stable voltage through the follower.

4. Hall encoder drive circuit The main function of the Hall encoder drive circuit is to collect the rotation angle and speed of the motor, so as to form a closed-loop control of the motor. The Hall encoder interface adopts the standard 5-wire Hall wiring method, which is composed of a pull-up resistor, a current-limiting resistor and a filter capacitor to ensure that the collected signal is clean and free of clutter. Pay attention to the wiring sequence when wiring. The motor parameters include the Hall line sequence, which is generally distinguished by color.

With the above circuits, you can effectively control the three-phase brushless DC motor, which is suitable for various commonly used motor control algorithms, such as V/F control (also known as variable frequency control), FOC control (field oriented control) control) etc.