Motor Driver Board

Motor Driver Board

To drive the motors my RC Tank, I needed to build two H-bridges, one for the left tread motor and one for the right tread motor. Rather than putting together an H-bridge with discrete components, I used two BA6886N modules. They're smaller, more powerful, cheaper, and much easier to use than building my own.

The BA6886N can use a supply voltage of up to 28V. It drive drive a motor up to 1A. It takes two inputs from the microcontroller: Fin and Rin. An analog input, Vref (pin 3), can be used to set the voltage output to the motor.

BA6886N Pinout

I decided that, although I plan on using a regulated 5V to all of the digital logic in the RC Tank, I will connect the power the motor drivers directly from the batteries. I can connect the regulated 5V to Vref. The driver will lower the voltage, which would reduce the burden on my voltage regulator. This means that I would be able to use a regulator more on the order of 150mA rather than >1A and a heat sink. It would also help isolate the line noise that is generated from the motors from the rest of the circuitry. I'm going to connect Vref directly to VM.

As I mentioned, I planned to tie Vref to 5V. If I had tied Vref to ground, the motor would move freely. If toggled between the two, I can use pulse-width modulation (PWM) to control the speed of the motor. I had two PWM modules in the microcontroller that I didn't plan on using yet. I added this to my design. Even if I didn't use PWM, I can still just set the pins active without any other change. It's a lot easier to change firmware than hardware.

Here is the truth table for the BA6886N from its data sheet:

BA6886N Truth Table

I designed this schematic for my driver board:

Motor Driver Board Schematic

%mytable%|Symbol|Part/Value|Notes ||------|---------:|------||C1 |0.10 µF | ||C2 |0.10 µF | ||C3 |0.10 µF | ||R1 |1 kΩ | ||R2 |1 kΩ | ||Q1 |BS170 |NMOS ||Q2 |BS170 |NMOS ||U1 |BA6886N |driver||U2 |BA6886N |driver|

Part Selection Notes

Here is a "map" of where everything is placed on the protoboard:

Motor Driver Board Labelled

Finally, here is the total truth table for the entire board. I've lumped "brake" and "standby" into one item. They are considered the same thing pertaining to my project. I will only be using standby as the drivers use less power in this mode, but the motors themselves do not behave differently in either mode.

Speed Fin Rin Tread Direction
H X X Stopped
L H L Forward
L L H Reverse