Transparent Themed BB-8 Robot From Star Wars.
by Piyush_ROBOTICS in Circuits > Robots
454 Views, 8 Favorites, 0 Comments
Transparent Themed BB-8 Robot From Star Wars.
This is my Homemade BB-8 Robot from Star Wars. It's a Fun project I made to explore new concepts like the Reaction Wheel, PID Controller and real-time pitch axis stabilisation. Thanks to DFRobot for reaching out to me and sending me the components needed for this Project!
BB-8 Robot CAD:
Click here to download Project
Downloads
Supplies
BB-8's Body Materials:
1*Switch
1*Round Motor -> Reaction Wheel Motor
1*Micro Gear Motor -> Head Motor
2*L Shaped Yellow DC Motors-> Drive Motors
1*AMS1117 5V Voltage Regulator
4* Magnets
1x A4 Piece of Paper
BB-8's Charging Station Materials:
1*AMS1117 3.3 Voltage Regulator
Other Items Needed:
- 3D Printed Parts - All files will be linked in Step 1 itself
- Black PLA Filamentkk
- Orange PLA Filamentkk
- White Paint and Brush
- Type USB Micro Cables for Programming
- Wires
- Desoldering Wick (optional but useful)
- Super Glue
3D Printing
I used Black and Orange PLA Filament. I had 3D printed all models in my new Ender 3 printer. In 0.17mm layer height and 30% infill
Also please note that you had to print a few STL files multiple Times
Black PLA:
- Antenna X1
- Eye (1) X1
- Eye Ring X1
- Eye X1
- Head Lip X1
- Magnet Case X1
- Magnet Case 2 X1
- Main Base X1
- Motor Mount X1
- Reaction Wheel X1
- Motor Attachment X2
- Motor Attachment X2
Orange PLA:
- Charging Station X1
Sanding and Cutting
In this step, you will use sandpaper to make the motor shaft a bit shorter and also cut the hook off of the Christmas Ornament
2.1
Take your DC and shave about 2 mm from the Longer Shaft (Closest to the Motor) with the Sand Paper on both Motors
2.2
Place the Drive Motors on the 3D-printed while making sure it aligns and glue it using your Hot Glue Gun
2.3
Use something like pliers or Soldering Iron (recommended) to cut off the hook on the Christmas Ornament.
If you are using something like pliers, stay careful because the ornament could crack so it is recommended to either use a Soldering Iron or divide the hook into small parts and then cut it with pliers
Fitting in Magnets and Steel Balls
Now we will start Building the Main Body of the Sphere. We will begin by Arranging the Components and Soldering Wires which will be impossible to do after we Assemble the Parts onto the chassis. Then by Completing the Circuit and Uploading the Code!
Adding Magnets:
- Take the Magnet Case which looks like an arc and attach the 2 4.7 mm x 3mm x 1. 2 mm magnets in the desired spots.
- Glue the Head Motor into the motor shaft whole in the Magnet Case.
- Grab your Head Lip and insert 2 of the same magnets again into the desired spots. Make sure that you place the Magnets Oriented Correctly so the poles facing each other are North and South and attract each other, as you can see above.
- Solder wires to the motor
- Cut 2 small species of paper the size of the Magnet and Stick it on top of it to avoid Scratching the Surface of the Sphere!
- Finally, Take the Steel Balls and Glue the Needed Amount on the Reaction Wheel using the Hot Glue Gun - A Little Tedious :|
Making the Head
The Head will will be made up of 3D-Printed Lip and Antennas attached to the 6 Cm Transparent Ball. The Head can be placed on top of the robot and will be held up by magnets
4.1
Paint the 2 Antennas and the Headlip White (It is highly recommended that spray paint be used over normal acrylic paint because it gives a better finish and look).
4.2
Add 2 of the Mini Magnets to the Head lip and cut out 2 small pieces of paper the size of the magnet and stick it on top to prevent scratching.
4.3
Take the 3D Printed Eye Parts and assemble the eye as shown
4.4
Glue the Eye, Headlip and the Antennas to the Head Hemi Sphere to make it look fantastic
Making and Attaching the Motor Mount
This step is very important and you have to make sure you follow the steps correctly because you will be adding the Drive Motor Mounts onto the Christmas Ornament and if not placed correctly, the parts might not fit and the head will not be able to be mounted.
5.1
First, take one pair of the drive motor mounts that you printed and fit them together
5.2
Sandpaper the front of the parts to make it fit flush and to make it smoother. Then repeat these 2 steps again
5.3
Then use your super glue and stick the Motor Mount onto the inside of the Sphere as shown in the Picture. Make Sure the space where the motor shaft mount mounts on is facing Upwards. Line up the top edge of the curve perfectly aligned with the edge of the Dome
5.4
Take a piece of paper and use your ruler and scissors to make a long strip which is 16.5 cm
5.5
Place and align the 2.5cm gap of the paper strip on the inside rim of the hemisphere and follow it till the end of the strip
5.6
Use tape if you want to temporarily stick it in place to make it easier for yourself because we will need to align the second motor mount to the 2.5 cm gap and superglue it
The reason we used the long paper strip is that we want the mounts to be approximately directly opposite to each other. And now we have a way to mount the whole machine to the ball
Building Main Body of the Droid
6.01
Take the Motor Mount in the shape of a rectangle and glue it onto the Drive Motors while aligning them and then connect the 2 Drive Motors in a way so they both turn in the same direction after being powered. Don't mind the Switch that is glued on - it was temporarily put there :)
6.02
Put the Head motor onto the Motor mount and make sure it almost sits flush. Then take the "Hardware System" and mount it upside down onto the drive motor mounts on the Christmas ornament.
6.03
To finally Calibrate how close the motor should actually be, take your Headlip and align it to the magnets on the Magnet case to fix it in place. Then move the dome back and forth as shown below and check if it moves smoothly without the Magnet case touching the dome. If not, adjust the head motor height and finally glue it after you find your sweet spot!
6.04
Stick the wireless charger on the rim of the Round Motor and then solder 2 wires to the motor as shown
6.05
Cut and stick a 2 cm Wooden Stick under the Main Base. Then glue the back of the Round Motor onto the sick while making sure it's aligned
6.06
Stick the wires of the Wireless charger to the Main Base to make it look slick and more importantly make space for the Reaction Wheel. After sticking the wires, put some superglue on the tip of the Round Motor and fix the Reaction Wheel to the Reaction Wheel's rotor mount (the spinning part of the motor)
6.07
Glue the HC-05 Module and the BNO055 Module onto the Motor Mount6.08
Now to fit a Motor Driver into the Robot, we will have to make our own simple Breakout Board for the L293D's IC Chip (The brain of the Motor Driver). First, use the Desoldering Wick to remove the solder underneath the IC Chip Mount and take out the IC chip mount 6.08
Place the IC Socket onto a perf/protoboard and connect all the "EN" pins to both the "VCC" pins. Also, connect all the GND pins together using some wires
6.09
Glue the IRLZ34N MOSFET on the Drive Motor from the inside as shown. Then, Glue the L293D Motor Driver Chip we made onto the Head Motor and connect the components to each other using the Schematic
6.10
Place and glue the Voltage Booster and the 2S BMS Board Followed by connecting them.
6.11
Then repeat the same process for the Arduino Pro Micro by using the Schematic Provided
Now we have to connect all the power lines but first, we have to make a Series Battery Connector using the Male Header Pins. First line up the two pairs of Header Pins in front of each other and shift one pair a bit so there is one common connection. Then solder the common joint and connect 3 wires to each section
Next, glue a Switch on the BNO055 Sensor and Connect everything using the Schematic. Then take the AMS117 5V Voltage Regulator and finally hook up all the components to complete the wiring
- Refer back to Schematic 11.11 to See what is each powerline connected to
Connect the Batteries in the Correct way specified in Schematic 11.13. Then Place and Glue the Batteries snugly for it to rotate smoothly in the Sphere. Then you should be done with the Hardware!
My Changes to the Robot
Firstly, I had to use other batteries because I had to use them somewhere else, so I had one similar rechargeable battery, which was a 3.7V 800mah. Since the batteries were bigger, I had to make a few design changes including increasing the size of the ball.
Main Design Changes:
- Ball Size
- Motor Mount
- Batteries
- Circuit
Ball Size And Motor Mount
Due to the Change in the battery size and count, I had to Change the Ball Size from a 9 cm Ball to a 10 cm Ball, which means that I had to change the size of the Motor mount as well (I wanted to try using more magnets hoping for more attraction between the head and the robot so I had to use different magnets). Click Here for CAD
New Battery And Circuit
Since I am working with one battery instead of two, I removed the BMS Board (Battery Management Board). Then, I considered inputting the battery voltage and stepping it up (Voltage Booster). So I connected the wireless charger to the battery to charge it, which goes into a switch to turn the robot on and off. Finally, it goes through a Voltage Booster to provide the whole system, including the Motor Driver, Gyro Sensor, and Microcontroller, like before!
BB-8 Robot Charging Station
For the Robot to charge, I 3D-printed the Stand in Orange. I also added Bright Orange LEDs to make it look Fantastic while Charging.
Step 1
I first Added the Flexible Orange Light by DFRobot, which has a beautiful neon effect around the ring space, keeping the power connection exposed.
Step 2
Then, I made holes using my Soldering Iron to fit in the 2 wires for the wireless charger (Make sure you are using the output wireless charger). I did this by first desoldering the wireless charger's coil from its PCB, making the correct sized holes in the stand and finally putting the wires through the holes and soldering the coil back.
Step 3
I Glued the Voltage booster and the Wireless charger pcb on the inside of the stand and connected the wireless charger's input to the output of the voltage booster (Make sure you increase or decrease the output voltage of the voltage booster for minimum 2 volts if your using the original schematic and minimum 3.7V if you're using the Second schematic to reach to the wireless charger in the BB-8 Robot). After connecting the components, make a small hole and add the side for the USB A cable's wires to pass through to connect to the input of the Voltage Booster.
Step 4
Connect the USB A cable to the Voltage Booster as the Input, then connect the input of the AMS1117 3.3V voltage regulator to the USB A cable and the 3.3V Output goes to the Orange LED.
MIT App Inventor
I Have Made 2 Apps for this project, one is for Testing and PID Calibration. And one is the main Control app.
Control App:
Project Download: You can open the Control App Project in MIT App Inventor using the Import Function
App Download: Directly Download the app
Testing App:
Project Download: You can open the Control App Project in MIT App Inventor using the Import Function
App Download: Directly Download the app
Arduino Libraries
For the Robot to contain its features and work properly, we need to install a Few Libraries. Firstly, download the files, then open Arduino IDE. Go to Sketch -> Include Library -> Add .ZIP Library and select the downloaded file. Repeat the Process until all the libraries are Downloaded.
Download Files:
Software and Code
Unique Problem That I Encountered
During my time coding, I was presented with a unique problem to which I had to find a solution:
For the input of the PID controller, I wanted to input the angle values from the orientation sensor (in this case the BNO055). However, I wanted to convert circular data to continuous data. Circular data is data that resets after a certain boundary and angles go from 360° to 0°. Continuous data is the opposite of circular data, which has no boundaries and can take any value. I searched for possible solutions online but couldn’t find any so I had to make my own equation:
Logic: If ΔAngle < 100° then increment new_angle by ΔAngle
Arduino code:
Explanation:
Every time that the loop runs, it checks the angle data from the robot’s orientation and checks the angle the robot is facing for example the robot has turned 90°. So the if condition checks if the change in angle is less than 100° meaning that in every mili or nanosecond the loop repeats itself, it checks the difference between what it was before and what it is now. so if the robot turns from 0° to 360°, the change will be 360 and the if condition checks if the change in angle is less than 100 meaning that it did not turn from 0 to anything above 100. If the if condition is true, then add the change in angle from the sensor to a new variable and you get continuous data of that sensor.
Unfortunately, I didn’t have enough time to implement The PID Controller due to school work so I will be looking forward to implementing and completing the PID controller after this Instructable is Published. But I do have Codes for:
- Testing the PID Values Using Testing App
- Testing Motor Control
- Main Code without PID Controller
Testing
I do believe that there is room for improvement, especially because the robot was top-heavy with the head, therefore, couldn't keep it on and incoperating PID Controller to stablise it.
Improvements
Every project has an ending and every project has a learning curve. In the end, Difficult Projects like this are never perfect, therefore it's always good to reflect on the project.
Here are the things that I believe could enhance the project:
- Adding BB-8 Sounds
- Building a Physical Controller
- Complete the PID Controller
- More Stable
This was a very long Journey and the Most Difficult Project I have ever done. The Aim of this project was not just to successfully build and complete the robot; it was about learning something. As John Kennedy said, "We choose to go to the moon and do the other things, not because they are easy, but because they are Hard." I hope this Documentary motivates you to build your own robot and make it a challenge for yourself!