Introduction: 3D Printed R/C Telepresence Balancing Bot
Why "Be Here Now" when you can "Be There Now"? Telepresence, allowing you to experience another place, is a fun kind of "out of body" experience that is more and more affordable these days.
This project started out building "Your Arduino Balancing Robot", a cool little balancing robot using stepper motors described at http://www.brokking.net/yabr_main.html. It is a nice design around an Arduino Uno, with a RF remote built around a WII nunchuch controller. They built it into a wooden case, but the 3D printing addict in me cried out for a printed case so I hit Sketchup and did a case with a head, and a remote case for the controller.
It worked great - nice balance, very maneuverable and steady. The remote works fine, but is limited to just a room area. I thought it would be fun to have longer range so I hacked the code to read a RC receiver, as they have a much longer range. I set the code to read 2 channels when the RC transmitter was on and now could control it in other rooms or down the street.
But now how to see where I was in the other room? There were two more RC channels to play with, so I designed a gimbal that can yaw and pitch with a small camera, so now the RC transmitter could drive him and point his eye.
I used a little TX-03 camera from Bangood (about $20) that could transmit to box video goggles VR-007 from Bangood (about $50). It is amazing how the cheap camera and wide screen box goggles can start to become your reality. It is a lot of fun to zoom around somewhere and look anywhere you want. He can go into and under many spaces and is really easy to drive.
But now how to communicate with the people you see? My cheap and easy answer was to design a phone holder, one can put a cell phone on speaker and harass people at will. One could also run something like Facetime if there were no goggles, but would not be as much fun.
At any rate, this is a fairly straightforward project that could be built up to any level. The 3D printing is relatively simple, and moderate soldering skills can build the perfboard circuit. He can run for 2+ hours on a 2200 mah battery. Plus, he is ready for even cooler upgrades from the creative maker.
Step 1: Parts Needed
Check out http://www.brokking.net/yabr_main.html for better links to these parts
1 x Arduino pro mini clone
1 x FTDI USB to TTL programmer for the Arduino pro mini
1 x Arduino Uno clone
1 x MPU-6050 gyro and accelerometer
2 x 2.4G wireless serial transceiver module
2 x 42mm Stepper motor ******* NOTE: Print files are for the 42 mm motor, not the 35mm in article
2 x Geeetech StepStick DRV8825
1 x Wired nunchuck controller for Wii
1 x Mini DC 7~28V to DC 5V step-down converter
1 x 11.1V 2200mAh 30C Li-polymer Battery
1 x B3AC 2S/3S Lipo balance charger
12v LED strip (only need 3 led in head)
Perfboard 75mm x 85mm
Hardware - (2) seltapping screws (2) small screws/nut like 6-32x3/8 () small self tap to mount pcb (like servo screws), (8) motor screws, misc.wire, battery connector, rubber bands
Tools -- usual tools, voltmeter. Variable power supply nice for testing but not needed.
For RC Upgrade -
RC Transmitter (like Spektrum, Frsky, etc)
4 channel receiver for transmitter
For Video Upgrade-
TX-03 Camera Bangood
VR-007 box goggles Bangood
Hitec HS-53 Servo
GoTeck GS-9018 Servo
Step 2: Print the Bot
Fire up the 3D printer and set for .2mm layer and 10% fill, except for the neck at 100%. I printed all in PLA except for the front and face, done in translucent PETG filament allowing for LED happy glowing faces. Skip the RemoteCase if you will use RC, and only print servo parts if you plan to use a camera. No supports except for the phone holder and the servobase.
Basic assembly can start now if you want. Mount the motors with 4 screws each. The neck tube joins the head to the body . Assemble them and drill some pilot holes, use sheet metal self tapping screw to join. The wheels press fit on the motor shafts. I then super glued rubber bands on for tires. All the covers just clip on.
Step 3: Build the Circuit
This can be done on a 85mm x 75mm perfboard with mounting holes (small, I used tiny servo screws that tap into holes) at 60mm x78mm. The site at http://www.brokking.net/yabr_main.html has a great build instructions starting at step 4. They have clear instructions and videos so I can save my lazy self some typing.
The two connectors at the bottom go to the motor. I shortened the long motor leads so they fit in the case bottom better, and that yields some good hookup wire for later. One regret in my build is not using sockets for the two motor drivers. The only build problem I had was I got 2 defective stepper drivers and if I had a socket that would have not been a problem. Also, if anything ever overheats and burns out it would be these. Luckily they are cheap.
Basic assembly can start now if you want. Mount the motors with 4 screws each. The neck tube joins the head to the body . Assemble them and drill some pilot holes, use sheet metal self tapping screw to join.
The wheels press fit on the motor shafts. I then super glued rubber bands on for tires. All the covers just clip on.
Step 4: Wire the Head
Mount the toggle switch in the head. The red lead from the battery connector goes to one pole of the switch. Run a red and black wire (can use wires from shortened motor leads) down through the neck. The black wire goes the the black battery wire and down to the ground of the circuit board. the red goes to the diode in the schematic. I used a small red connector here so I could remove the head without soldering, but probably not necessary.
Put some velcro in the bottom to mate with the battery. Stick the LED strip inside the top and wire the black to battery black and red to the red off the switch going down the neck.
Step 5: Calibrate
This is where we set the balance point and step motor current.
Plug the Uno into a usb port and start the Arduino IDE. Then download the YABR Hardware test into the Uno. Step 4.3 in http://www.brokking.net/yabr_main.html shows how to get the balance value, write it down. The next step they describe setting max motor current, but I did not have good luck setting it the way they describe. The motors are rated at 1.25 amps max, and the driver specs say that we should get about .7 volts on the pot wiper arm. To do this, I first made sure the pots were turned down as shown in their picture. I then powered it up (nice to use a current limited power supply here and first set a low current limit like .5 amp in case of shorts. If you can run it up to 12 volts it is safe for battery. With the hardware test program running, I clipped the + lead of my voltmeter to the little adjusting screwdriver. I slowly brought them up to .7 volts. Once set, should get about a total .8 - .9 amp total draw with both motors and a good battery. One strange thing I have never explained is that many times when you power up the motors are not being driven and spin freely. I just turn it off and then on (sometimes a couple of times) and they start to work - you can hear a little hum and they do not spin. This means we are good to go. Strange but it is a minor bug
Step 6: Edit Code, Download and See What Happens!
We are getting close! Now we need to load the actual balancing code into the Uno. Open the Balancing_robotRC script in the Arduino IDE. My first compile complained of missing EnableInterrupt library, so I included it - just unzip it in your Arduino library folder if yours complains.
Find the lines at the beginning-
int acc_calibration_value = -739; //Enter the accelerometer calibration value *******USER ADJUST
int batt_cutoff = 840; // value that gets 10.5v cutoff in my layout *******USER ADJUST
Replace the -729 with the number you came up with in the hardware test.
The intbatt_cutoff variable was 900 in the original code - it sets the point that the software stops due to low voltage. In my setup, maybe due to resistor / wire variances it shut down early for me (about 10.9 volts). I set this lower and my shutoff voltage is about 10.6 volts, a safe value. If you have a variable power supply, this is easy to test - lower the voltage until Uno led comes on. You can default to 900 just to be safe.
Once it downloads, we are ready for real fun. Install battery, lay it on his back, and power up. The Uno will flash for a few seconds while calibrating - leave it still then. Check that the wheels do not turn, you should hear a slight hum. If not, turn off and try again until both wheels are powered. Now slowly stand him up - it should start to balance and usually runs a few feet until it hits steady balance. If you see this, happy days! Now off to control him.
This was the point I had trouble due to the stepper drivers. One of them seemed to work but the bot would go crazy and crash. I finally debugged this by holding him up off the ground. Both wheels should spin as you get close to vertical, and some angle after that should make them reverse. I discovered that I could just touch one wheel and slow it or reverse it. After a few wasted hours, replacing the stepper driver fixed that. Once again, sockets here would have been wise, and they are very cheap so an extra one or two would be nice.
Step 7: Build a Remote
If you are just planning for RC control, go to step 8, otherwise if you just want a balancing robot with his own controller (about 30 foot range)-- lots of fun for family play - then you can build the remote as described on the web site. I designed a case for it that hold a usb battery so it is self powered, or you can skip the battery and just plug into any usb. Once again, http://www.brokking.net/yabr_main.html has good info on doing the hardware test.
The software will use this controller if no RC controller is detected. Get him to balance and this should steer him quite well.
Step 8: RC Control
To do this we need a RC transmitter that can bind to a receiver. I used a Spektrum transmitter (others like FrSky or FlySky with appropriate receiver should work). Spektrum uses DSM technology that binds to many things (Bind and Fly), you can also use Orange and Lemon DSM receivers from Bangood that are very cheap.
The Spektrum AR400 4 channel receiver is velcroed in the head with (2) 3 wire connectors plugged into ALE and ELEV. I used the usual RC connector / wires about 8 inches long. Cut off the connector at the other end. Separate the power leads (usually black / red) and leave them in the head, they will be +5v power for our camera. run the other 4 wires (signals from ALE and ELEV plus +5v / ground).
Step 9: Wire RC Receiver
Now we need to solder the 4 wires on the circuit board per the picture- The black ground wire to circuit ground, red to the vcc pin on Uno, ALE wire (white) goes to A2, ELEV wire (yellow) goes to A1. We are ready to test!
Spektrum requires a 'bind plug' to connect to the transmitter - insert it and power up the bot. Hold the bind button on your transmitter until the receiver shows a steady led. Power down and pull the bind plug.
Now you should be able to power up (with transmitter on) and see the receiver lock on. At this point you can stand him up and steer him. If he goes the wrong way (i.e. push forward and he goes backward) you can reverse that channel on the transmitter.
Step 10: Add a RC Controlled Camera
Print the servobase, servoyaw, and servopitch +TX03 parts. I used supports in the hole in the bottom of servobase, probably not critical. The little white circle shipped with the bigger servo should fit in the base and held with small servo screws. The servopitch is screwed into a long arm on the small servo, and the TX03 camera drops into it. I used a drop of hot glue near the antenna to hold it in.
The gimbal cn be mounted with two screws on top of the head and the wires run down through the hole. Plug the pitch servo into throttle on the receiver, and to yaw wire into rudd. Use the 5v power wires that came from the ALE connector to power the camera.
Now when we power up, we need to program the camera. A long press sets the power, I set it to max (200mw) 3 bar. Then select band with a shorter pres (A is fine) and pick a channel 1-7 with short presses.
Now start up the video goggles and search for the channel you set on the camera, hopefully a picture appears. If the transmitter is on and locked, moving the throttle stick should move the camera. You can reverse channels on the transmitter if it moves the wrong way.
Step 11: Time to Drive!
Put on goggles and have fun!
Step 12: Communicate!
Now we need a way to talk - print the phone holder and it will slide into the front and attached with the neck screw. I put some velcro fuzz inside to keep the phone from moving. This holder may need redesign if you have a different sized phone (mine Samsung Note) or if you wanted to try Face time, so I attached the Sketchup file.
You can drop a cell phone into it- call it and put it on speaker. Now he can interact and hilarity ensues!
The only problem with this cheap voice solution is the phone mike is too close to the mechanism making it hard to hear. He is noisy when he moves, but I have come to like the sound - kind of like R2D2 talking. I have not tried this
but I bet mounting it in a little foam would help a great deal.
Step 13: Where to Now?
My final vision of this guy would be stereo vision sent to a VR headset like Oculus, stereo ears to localize sound, and cameras synced to goggles with a head tracker all hooked up to WiFi. The true 3D vision and sound would really immerse you in the remote location, and WiFi would mean you could ship this guy to your relative's house and have a nice visit (plus you can turn them off anytime!).
A black box that can take two camera inputs, two sound inputs, one movement control output, one head tracker output, and one voice output all hooked to WiFi done cheaply seems a bit off, but who knows? I would love to hear any ideas from those who know a lot more about this than I do. Also, feel free to contact me if there are issues or ideas.