Introduction: Flip-Flop CyliBot
Runner Up in the
Robotics Contest 2016
This is an Android controlled, Bluetooth signaled, 3-wheeled, 3D printed cylinder shaped Arduino bot that flip-flops when quickly reversing directions. The genesis for this bot came after I had polished off a can of Pepperidge Farm Creme Filled Pirouette Rolled Wafers. I naively thought, stick motors and wheels on each end, an Arduino in the middle, and away it goes. After destroying the can, due to too much cutting and bending, I 3D printed a body. After a few iterations I had a cylinder bot. It turned out that the body would spin more than the wheels (I did not take mechanical engineering 101). Because I didn't want to spend the time implementing the software to control the acceleration rate, I instead added a 3rd wheel in the center which prevents the body from spinning. It also has the desired effect of flip-flopping, something I remembered that one of my kids' RC cars had done. It no longer looks like a sleek cylinder, but because I liked the name, it stuck.
CyliBot's body, wheels, and tires are fully 3D printed. The most difficult aspect of the printing was printing the tires with soft PLA. More on this later.
The electronics are the standard Arduino bot components. An UNO, a motor controller, a switch, bluetooth board, and motors. That's it.
To control CyliBot, I use an Android device connected to Arduino using Bluetooth. Normally I would just code Android natively, but I took this opportunity to re-learn MIT App Inventor. I have the goal of learning it in order to teach my kids to create something that they can put on their own devices.
Step 1: Parts, 3D Materials, & Tools
- Arduino UNO (I used a SparkFun RedBoard)
- AdaFruit Motor Shield
- 120 RPM DC 6V geared motor
- SparkFun BlueSMiRF Silver
- SPDT slide switch
- 2200 mAH 7.4v LiPo
- battery adapter
- 2" 3mm smooth rod
- 2x M3x6 countersunk screw
- small set screws
3D Printer and Materials
- High quality 3D printer. I used a Ultimaker 2 (known as UM2 from here on in)
- Standard filament in desired colors. I used black and yellow 3mm ABS
- Soft or flexible PLA. I used 3mm soft PLA from Ultimaker
Side note about UM2. I got mine from the Maker Shed. It appears that Ultimaker no longer makes UM2 but instead they make a UM2+.
- wire cutters
- soldering station
- screwdrivers of various types
- rasps and filers of various sizes
Step 2: Body
The body is made up of 3 3D printed parts: the main body and two end caps. The main body is cylindrical shaped with an attached center bracket for the stabilizing wheel. It has a swiss cheese appearance to save on print time and material and to be able to see the onboard LEDs of the BlueSMiRF when the bot is on. The end caps are cone shaped with a recess inside to fit the motor and with holes on the end for the mounting screws. The dimensions of the end caps are such that they will press fit over the ends of the body and will not need any glue or screws to keep it there.
Because the body has lots of big holes and has one big overhang, which is for the center wheel, it is very important to utilize print supports everywhere. If you can visualize your print job and verify that supports will be printed in all the important places, I'd suggest you do it. I learned this tip the hard way. After getting halfway of a very long print job, I saw that it was failing. I didn't realize that Cura, the slicing software provided by Ultimaker, distinguishes between external supports and internal supports. Unfortunately, because I was tweaking the body design, I made the mistake of not adding internal supports twice.
Ultimaker has a heated glass bed. For small prints the glass alone seems to work well. But for medium to big prints, additional adhesion is needed. I used a glue stick. It seems to work pretty well. I've only had a few prints pop off when using a glue stick and that might have been because I didn't use enough.
These are the Cura settings I used for my bot body:
- Initially in quickprint
- Fast print
- Print support structure
- Platform adhesion: brim
- Shell thickness: 1.2
- Support type: Everywhere
- Everything else are the defaults
Using "fast print" takes 9 hours. Adding "everywhere" print support adds 3 more hours. And, as you can see from the photos, 3D printing is not yet a perfected science.
Finally, I should add that although Cura is the slicing software, I used Tinkercad to make the 3D models. You can download the models directly from Tinkercad.
Step 3: Tires and Wheels
Both the tires and the wheels are 3D printed. The wheels are printed with 3mm ABS. The tires are printed with 3mm soft PLA. The biggest time sink of this entire project was probably printing the tires. UM2 does not do well with soft PLA, at least not out of the box. A lot of tweaking was performed. There is not a lot of specific instructions on how to print with soft PLA for the UM2. Here are some tips that finally resulted in half-way decent tires:
- Print very, very slow. I set the print speed in Cura (UM2's slicer) to be 20mm/s. Subsequently, while it was printing, I slowed it down even more to 75% of the speed.
- Print hotter than you think. The label on the spool says 190C. I printed at 230C. That seems to produce a good flow.
- Lubricate the Bowden tube. UM2 has a tube inside which the filament travels. Put a few drops of sewing machine oil in the tube. This helps reduce friction inside the tube.
- Make sure the filament can roll off the spool smoothly. One print job which was in its 28th hour failed because there was a filament knot. Needless to say, I had to start over.
- Simplify the print design if possible. The more complicated the design, the more likelihood it will fail. In the beginning I had quite elaborate tire designs. But after many failures of very long print jobs, I got frustrated and just printed the most simplest design that met my needs.
These are the 3D models:
Step 4: Electronics
This is probably the easiest part of the build. Bluetooth controlled Arduino bots are pretty much commonplace. In essence, there are only 6 simply connected parts. There is an Adafruit motor shield which sits atop an Arduino UNO. Attached to the shield are two DC geared motors, a BlueSMiRF Bluetooth board, and a LiPo. The shield is configured (via a jumper) to power both boards and the motors from the single LiPo. A small switch is put in between the LiPo and the board so that the bot can be easily turned on and off. And that's it. Personally, I think this is exactly why Arduino platform is so popular. It makes the complex simple.
The BlueSMiRF TX and RX are connected Arduino not on the board's RX and TX but to pins 2 and 3. SoftwareSerial is used to read the values. This makes it possible to change and upload the Arduino code without having to pull the wires from the RX and TX pins.
Step 5: App Controller
Like I mentioned in the Introduction, I opted to write the bot app controller using MIT App Inventor. Having done this, I think I can now explain to my kids how that system works and how they can write their own apps.
Programming in App Inventor is like programming in Scratch. It is a visual programming system that makes certain programming constructs like assignments, loops, and procedures easier to understand. There's nearly immediate feedback. In general programs can be run either on device or in an emulator. CyliBot, however, can only run on device because it utilizes Bluetooth.
The controller logic is pretty simple. As the left and right circles are moved up and down, their positions in relation to the horizontal center of the device are translated to forward and backward movement. The father from the center the faster the movement. There are 3 squares. The squares on each side indicate that that motor should stop and the center square indicates both motors should stop.
Android signals to Arduino a left and right flag and a number between -255 and 255. Left and right flag, as you can guess, indicates which motor. The positive or negative nature of the number indicates forward or backwards direction. And the absolute value indicates speed with 0 being stopped.
The controller can use additional work. It can made more pretty. Different controller interaction can be used. UI is a whole other science. For now, it works pretty well.
Here's a link direct to the published AppInventor project.
Step 6: Bot Assembly
Perform this step last. Make sure that your bot responds to the app controller before fully assembling the bot. Because 3D printing does not result in exact parts, there is a considerable amount squeezing, pushing, filing, and just plain forcing to get parts together.
Follow these steps:
- Mount the motor into an end cap using a countersunk screw
- Slide the other motor and the Arduino, shield, and battery through one end of the cylinder and out the other end. Position the bot body such that the center wheel bracket points upward and and then position the electronics atop the battery and the battery at the very bottom.
- Press fit the end cap onto the body
- Mount the other motor into the other end cap and screw it down
- Press fit the final end cap onto the body
- Feed the 3mm rod into the center mount just enough so that peeks out into the center wheel well
- Place two washers on the rod
- Place the wheel on the rod
- Place two more washers on the rod
- Then push the rod through to the other side
- Press fit the motor's axle into the wheel leaving only enough room to not bump the head of the motor mount screw
- Use a set screw to hold the wheel in place
- Perform the prior two steps with the other wheel
Step 7: Miscellaneous
I tried a few other body designs before settling with the black swiss cheese. The same goes for the tires. A lot of it had to do with what worked and what failed.
We have a be nice policy.
Please be positive and constructive.