-
Notifications
You must be signed in to change notification settings - Fork 1
Parts Overview
The brains of our system is an ESP32 microcontroller development board which has a dual core processor and integrated WiFi and Bluetooth.
search for esp32 on amazon
Stepper motors are great options for a self balancing robot because they can have high torque and precision without a gearbox, and move in precisely controllable steps so no encoders are necessary for exact movements. Here's a good general reference about stepper motors. We use Nema17 motors with torques around 65 oz-in (0.46 NM). The steppers should have around 200 steps per revolution, since if the motor has a lot fewer steps, it has fewer positions it can turn to and one step makes the wheel move too much and there isn't enough precision over position.
Nema17 stepper motor, $11.82 each, or a good price of 10 for $76, if you want to buy in bulk.
M3 x 8mm screws for attaching motors, 4 needed for each motor
A microcontroller can't supply enough current to run a stepper directly from its digital pins. Some kind of driver chip is necessary. A chip with just two H-bridge motor drivers can be used to run a stepper motor if the microcontroller sends the right signals to make the motor step and the motor driver just amplifies the power. URSA uses a second kind of driver chip. It handles what signals to send to the motor and is controlled with a step pin and a direction pin. The microcontroller only needs to signal what direction the motor should go in, and send a pulse for every step. URSA uses an a4988 chip (datasheet, and a good reference).
Voltage spikes in the power can lead to motors stalling, and even damage to the driver boards. These spikes can be minimized by adding a capacitor of 100microF or larger.
100uF capacitor, $6.24 for 10, but only 1 needed.
This sensor is used to calculate what angle the robot is leaning at-essential information for staying balanced.
Although the ESP32 can operate with an input voltage greater than 5v, we have found that connecting it directly to the AA batteries causes the voltage regulator on the ESP32 to quickly overheat (even with a heat sink attached) and cause general wonkiness. Dropping the ESP32 input voltage to 5v resolved the problem. Although using a linear voltage regulator would do the trick, it would be less efficient (and a bigger battery drain) than the switching regulator in a UBEC (UBEC datasheet).
To allow the ESP32 to measure the voltage remaining in the batteries, a voltage divider is needed to drop the power of the 8 AA batteries to a maximum of 3.3v (the maximum input allowed by the ESP32). A divider using 10kohm and 26.7kohm resistors works well, but other values could work as well, as long as the ratio is appropriate for dropping the maximum 12v output of the batteries to no more than 3.3v, and the overall resistance is fairly high so that excess power is not wasted by the divider.
10kohm and 26.7kohm resistors -- with only one of each needed, that's enough for 100 robots!
Quality hubs are needed to connect the wheels to the shaft of the stepper motor. A hub with a 5mm bore works well with the 4.5mm shaft of the stepper. We used 4" diameter wheels, but other diameters would probably work as well. You'll want something with a good grip -- slipping makes self-balancing impossible.
wheels at $5.99 for a pack of 2
6-32 x 3/8" screws for attaching wheels to hub, 4 needed for each wheel
Power for the circuit comes from 8 rechargeable NiMH AA batteries. The weight of the 8 AA batteries should be distributed equally over the wheels, either in the center of the bot, or split equally in front of and behind the wheels. If two cases of 4 batteries each are used (like in our design), they should be wired in series.
battery case for 4 AAs, $5.99 for a pack of 2
8 AA NiMH batteries and charger for $24.99
It's handy to be able to unplug the battery cases to load/unload batteries. In addition, a plug makes it convenient to disconnect the UBEC from the ESP32 while using the USB to upload the code (the +5V pin on the ESP32 can back-power the circuit and draw too much power from your computer -- always disconnect the UBEC from the ESP32 before plugging in the USB).
small plugs, $5.49 for a set of 10, to disconnect the battery packs (2 needed) and to disconnect the UBEC from the ESP32 (1 needed)
F/F jumper wires make it convenient to connect the various pins on the circuit boards, and can be soldered to the resistors, capacitor, etc., after a connector is cut off on one end.
10cm F/F jumpers ($9.99 for 100) and 15cm F/F jumpers ($9.99 for 100), more than enough.
To hold everything together, a 3D printed shell is needed. Files will be posted soon.
We topped off our bot with a styrofoam head -- amusing, yet creepy!