Purpose:
The main purpose of this project was to get more experience designing and programming a custom PCB. I had some brief experience in college creating a PCB in my senior project but the end product was not something I was super happy with. The main reason for creating an Arduino-capable device was my desire to share this device with more people. I help a high school robotics club and after the season is over we create 3D printed battle bots for fun. I found that some of the students were confused when all the “programming” of the RC system was really already done. The greatest amount of “programming” or customization was reversing motors on an RC controller I wanted to give students the freedom of being able to input custom control schemes or other programming algorithms without the hassle of a separate programming device like an FTDI board.
Design Goals:
- Run Arduino
- Direct connection to computer (no inbetween boards)
- Can program with power from computer
- Two full bridge mosfet with around 3A output current
- Small form factor
- Battery powered with 5V regulation for potential servos and powering the microcontroller
- Budget friendly
Motor Driver Version 1:
My first version of the motor driver was designed in easyEDA browser-based system. This allowed me to work on the design in multiple locations pretty easily. For the circuit design, I based most of the microcontroller circuity on the Arduino nano. With the chip shortage, I had to find and use many alternative components. I decided to add one additional feature to the circuit board. I added an IMU (ICM-20689) as the board’s purpose was for small robotics platforms and would benefit greatly from being able to detect orientation and outside forces.
I had a few issues with this board. First, the three-wire connection pins were a larger hole size than needed making the connections weak and prone to breaking. I used some electrical tape to strain relieve the wires which left some residue on the board. I also used electrical tape to strain relieve the motor connections and stabilize a bulk capacitor across the battery connections. Once all the connections were made the board did perform as wanted. It was able to power four motors at 12V at around 1A continuously. The purpose of the board is to survive 3 minutes in a battle setting so most measurements will be taken with this in mind. As the first proof of concept, this board performed well. It was able to power motors at variable speeds in both directions, read IMU data, connect to a computer via USB, and be programmed using the USB’s power. For the next iteration improvements to the connections and various oversights needs to be addressed like voltage protection and powering the MCU properly.
Improvements:
- Voltage levels to microcontroller when using USB low (around 4.6V)
- Pins used to send PWM to H-bridges run at different frequencies
- No overvoltage protection for 5V side
- Needs low battery voltage detection
- Needs smaller form factor
- Proper pin hole sizes
Motor Driver Version 2:
I focused on a few different things when creating version 2 of the motor controller. I wanted better circuit protection so I added a zener voltage clamp for the low voltage side powering the MCU. I also added a voltage detector IC. The IC will output a flag to the MCU when the battery voltage to below a certain threshold. This will let me disable the motors in software to prevent over-discharging the battery. I also focused on slimming down the whole device while still keeping components big enough to hand solder on.
Another big design challenge was tackling the dual-source option for the device. I wanted to be able to program to the device using USB power. The device also needs to run solely on battery power after it has been programmed and placed into a robot. I researched various options for this. I saw different MOSFET circuits, diode solutions, and tried to design my own circuits, but the result always had more components than I really wanted to add to this board which needs to be slim. The solution I ended up using was a simple switch that can handle the current while being really slim. This solution worked great and isolates the USB power in case I want to program while the battery voltage is present. There is more work for the user to change the voltage source but I think the tradeoff for keeping the design simple and slim is worth it.
Future Plans:
- Run dyno tests with motor to test efficiency and limits of device
- Create easy to use version with larger connections and mounting points for more ages
- Create robot that will use IMU data in design