Introduction: How to Create a Remotely Controlled 3D Printed Self-Balancing Robot
This is an evolution of the previous version of B-robot. 100% OPEN SOURCE / Arduino robot. The CODE, 3D parts and electronics are open so feel free to modify it or create a huge version of the robot. If you have doubts, ideas or need assistance make the most of the B-robot community
The new version comes with tons of new features:
- Control and tune it up using your smartphone/tablet via the free jjRobots APP
- Google Blockly controllable!
- Perfect to have fun as you learn robotics (Take a look to the Robotics Challenges!)
- Now can use regular AA batteries (or a 3 cells LIPO battery) Anything capable of delivering 9V
- Two SERVO outputs (one used for the ARM). Control the two servo output just tapping on your smartphone screen.
- Easier to print and using less plastic
- PRO MODE can be activated from your smartphone/Tablet (increased agility and velocity)
- Increased WIFI range (up to 40 meters)
- Battery status and “Tilt angle” displayed in real time on your smartphone screen
- Modify its PID robotic control in real time and see how that affects to its behavior and performance.
But first, lets start from the beginning. As this is Instructables you might have some of the elements needed to create the B-robot EVO.
- jjRobots Brain Shield (this Shield makes the set-up easier. If you want to manufacture your own, take a look at this schematic)
- Arduino Leonardo + USB cable
- 2x NEMA17 stepper motors +14 cms cables (pair)
- 2x Stepper motor driver (A4988)
- IMU (gyro+accelerometers) + custom cable
- Metal gears servo (you will need an arm to fight and raise your B-robot…)
- 6x AA Battery case with ON/OFF Switch
- Bolts+nuts needed to set everything up
- Pair of nylon bumpers (14×5 cms)
- Double side tape, googly eyes…
2 rubber bands for the wheels: grip
Step 1: BOM List and What the Elements Are
- jjRobots Brain Shield:this Shield makes the set-up easier. If you want to manufacture your own, take a look at this schematic. It have, voltage regulatos, two servo outputs, header for the A4988, WIFI module and ports to connect all the elements
- Arduino Leonardo + USB cable. Why a Leonardo and not the regular Arduino UNO? its processor, we needed more power than the provided by the UNO´s processor so we opted for the Leonardo instead. They are easy to get
- 2x NEMA17 stepper motors +14 cms cables (pair). Well, a NEMA17 stepper motors with the same specs should work.
- 2x Stepper motor driver (A4988). The most widely used stepper motor driver.
- IMU (gyro+accelerometers) + custom cable: MPU6050 model
- Metal gears SERVO : You will need an arm to fight and raise your B-robot…The nylon gears servo will not work as good as intended
- 6x AA Battery case with ON/OFF Switch: This case has been fitted into the frame but you can use a LiPO battery too (3S)
- Bolts+nuts needed to set everything up: M3 bolts and nuts (12x6mm, 12x15mm)
- Pair of nylon bumpers (14×5 cms): alternatively you can create your own custom bumper here and print it
- Double side tape, googly eyes… to fix the IMU to the Brain shield. This double sided tape will work as a shock absover on the IMU
- Frame: 3D printed parts
- 2 rubber bands for the wheels: grip
- Your smartphone/tablet to control it + free control APP
If you want to skip all of this and jump to the Assembly guide video. Click here
Step 2: B-robot Features and Robotic Challenges
We have created challenges to beat with the B-robot, they are an easy way to introduce the electronics and robotics control while you have fun. We have tried to make everything as affordable as possible using very common "MAKER World" elements and providing free APPs to control the robots.
The B-robot can be controlled via Google Blockly. More info here
Its behavior parameters adjusted in real time: info
You can even be a robot technician: Adjust your B.robot to win the race!
Many makers have been modifying and adding parts to the B-robot. Take a look at them here
Some theory behind a self balancing robot: here
Step 3: Elements Used in This Robot
If you already have the parts needed to create this robot you already have 90% of the items needed to create:
- the Sphere-o-bot: friendly art robot that can draw on spherical or egg-shaped objects from the size of a ping pong ball to a large duck egg (4-9 cm).
- The Iboardbot: The iBoardbot is a robot connected to the internet capable of writing texts and drawing with great precision
- or the Air hockey robot!: A challenging air hockey robot, perfect to have fun!
All of them use the same electronics and ancillary elements
Step 4: Assembly Guide Video
This is the first time we have recorded a video instead of doing a "photo" assembly guide. For this robot, it is easier if you see how to connect everything and get some explanations/tip about how to do everything.
There is an "always updated" assembly guide here with some tips just in case you want to take a loot at it.
Step 5: UPLOAD the ARDUINO CODE to the ARDUINO LEONARDO
a) Install the Arduino IDE on your PC from (skip this step if you have the Arduino IDE already installed)
This B-robot code has been tested and developed on IDE version 1.6.5 and later versions. If you have a problem compiling the code stick to the 1.6.5 v
b) Download all the arduino files from GITHUB (https://github.com/jjrobots/B-ROBOT_EVO2/tree/master/Arduino/BROBOT_EVO2) or from here (or download the attached file)
Copy the files inside the BROBOT_EVO2 folder in your hard drive
c) Compile and send the code to the Arduino Leonardo
- Open your Arduino IDE
- Open the main code in /BROBOT_EVO2/BROBOT_EVO2-XX.ino
- Connect your Leonardo board with the USB to the PC
- Note: If this is the first time you connect a Leonardo board to your PC maybe you might need to install the driver.
- Select the board Leonardo (tools->board)
- Select the serial port that appears on the tools->Serial port
- Send the code to the board (UPLOAD button: Arrow pointing to the RIGHT)
Step 6: CONTROL YOUR B-ROBOT EVO 2:
We have developed a FREE APP to control the Brobot (and future JJrobots) for your Android based Smartphone/Tablet: install it from here
It works sending UDP packets to the B-robot. It uses a simple layout with Throttle and Steering slicers and several buttons.
Steps to follow:
- Install the JJRobots control APP
- After turning the Brobot EVO ON, connect your smartphone/tablet to the B-robot EVO´s wifi network (the default WIFI´s password is 87654321)
- Launch the JJrobots control APP and play with your B-robot EVO!
iOS B-robot control APP (thanks to Xuyen for this great contribution!)
iOS TouchOSC APP: Alternative way to control the B-robot EVO: Setup guide and files here
Step 7: 3D Interactive B-robot Model
The interactive 3D model will help you to get a good idea about how the B-robot EVO looks once assembled
Step 8: Troubleshooting
My B-robot is not responding to the command sent from my smartphone/tablet
Check you are connected to the JJROBOTS_XX netwrok using the correct password (by default: 87654321) and your device has not blocked the data traffic to the B-robot (stay always connected to the robot)
The IMU gets loose/ the i2C cable is too short
The gyroscope (IMU) is one of the most important element in this robot. It provides the current angle of the robot updating its value hundred times per second. The protocol used to send the data is quite sensitive to any electromagnetic interference so a very short cable is needed to connect the IMU and the Brain Shield. At the same time, vibrations create false angle measurements so we have to isolate the Brobot´s main frame vibrations from the IMU: that is the reason to use a double sided sticky pad to fix the IMU to the Brain Shield. Place the IMU as indicated above: Close to the Brain Shield´s i2C connector. Bend the cable if needed. If you place the IMU as above, there should not be any lateral force pushing the IMU out of place
My B-robot lacks of power or fall without reason
Adjust the current delivered by the stepper motors drivers. Use a screwdriver and gently rotate the screws indicated on the photo below. Rotating 10º-30º is more than enough. Clockwise rotation: increase the power delivered to the motors
My B-robot can not stand up by itself.
If everything is ok, the B-robot only needs a little bit of help from the servo to stand up by itself. Take a look to this video. If your robot does not behave like in the video, adjust the stepper motor drivers output power (instructions above). Keep in mind that the bumpers have two functions here: protect the electronics+robot and help it to stand up easily.
There is a DEBUG MODE inside the B-robot CODE. This MODE will allow you the debug the behaviour of the robot if you are having issues. Please, refer to the B-robot community if you have problems or questions.
Look at the sketch line “#define DEBUG 0″ and change the 0 to 1…8 depending on what info you want to get.
More info at the very end of this page
Step 9: FAQ
frequently asked questions:
Why are you using Stepper motors?
There are several options for motors: DC, Brushless, Steppers… We choose stepper motors because they have enough torque, you could connect the wheels directly without gears that generate some backslash (this is a common problem in balancing robots), they have good bearings and you will be able to control the speed of the motors with accuracy. In standard sizes these motors are cheap (we use the same motors used on a regular 3D printers) and the drivers are cheap and easy to interface with Arduino too.
Why you use a Wifi connection?
Using a Wifi connection allow us to work with a lot of devices (Smartphones, Tablets, PCs…) Bluetooth devices are cheaper but their range is usually shorter. Old devices are not supported and you could not connect it to Internet easily. The Wifi module that we recommend, allow us to create an Access Point, so you don’t need to use an existing Wifi infrastructure (cheap Wifi modules don´t let you do this). You can connect your device directly to the Robot anywhere but if you prefer you can hack it and use your own infrastructure therefore controlling your robot (or whatever you have created) over the Internet from any remote place in the world! (Cool, isn´t it?)
Self balancing robots are fun to see and play. A self balancing robot requires sensors and control algorithms. You will find all the HOWTO and technical documents which explains the “behind the scenes” in JJROBOTS. Learn electronics and robotics creating your own BROBOT from scratch!.
There are some commercial solutions to the balancing robot, but here we want to share knowledge and thoughts. You can use the BROBOT parts to create more robots or gadgets, keep in mind all the devices used in a BROBOT are standard devices/electronics with a lot of potential. In the JJROBOTS community we want to show you how! You are now buying a self balancing robot, your are buying your own electronic and ancillary devices!
Thinking about creating a GPS self guidance robot? a modified version of BROBOT is your robot!
How much payload could carry BROBOT?
BROBOT could easily carry your soft-drink cans. We have tested with 500g of payload with success. More weight makes the robot more unstable but this could be fun also, isn’t it?
Why use stepper motors for a balancing robot?
There are several options for motors, DC, Brushless, Steppers… We choose stepper motors because they have enough torque, you could connect the wheels directly without gears that generate some backslash, they have good bearings and you could control the speed of the motors very precisely. Also they are cheap and the drivers too…
Could I use rechargeable batteries of Lipo batteries?
Yes, you could use standard AA batteries (alkaline recommended), AA rechargeable batteries (e.g. NiMh) or you could optionally use a 3S Lipo battery. Run Lipo batteries at your own responsibility.
What is the runtime of BROBOT?
With rechargeable AA batteries (e.g. Ni-Mh 2100mAh) you could expect around half to an hour of runtime
Could BROBOT work without the wifi module?
Yes, BROBOT could work and keep its stability. But, of course you could not control it without the module.
Could I change the name of the Wifi network that BROBOT generate?
Yes, on the configuration sketch you could change the name and also some other internet configurations. You could also connect BROBOT with your existing Wifi network
Is this a project for an Arduino beginner?
Well, BROBOT is not an easy "beginner project", but it has a lot of documentation so you have a platform to grow your skills. You could first mount your BROBOT following the instructions and it should work OK, then you could start understanding some parts of the code and finally writing your own pieces of code…
For example it could be easily (there are tutorials for this) to write your code so the robot automatically move the arm and spin itself if you don’t send a command in 10 seconds…
More advanced hacks: Convert to a totally autonomous robot with obstacle avoiding adding a SONAR, convert to a follow line robot, and so on…
Why BROBOT electronics are not so cheap?
We are a really small startup (2 persons in our free time) and now we could only run small batch of electronics. As yo know the price of electronics drops quickly in high volume productions but we are starting… If we sell many boards and we could run more volume productions we will drop the prices!!. JJROBOTS didn´t born to get money, our spirit is to sell “good products” to found our next projects and spread the robotics knowledge