Let's Make Robots!


Remote-controlled from a computer.
exploded.stl3.23 MB


I decided to work on something smaller, using all the experience I gained with Kubik. This one is as small as I could make it, uses an Arduino Pro Micro for the brains, SG90 servos for the muscles, a 2S LiPo pack for power, and I plan on adding a Bluetooth later (for now it's tethered on a serial cable). Since I have some room in there, and the case is transparent, I'm also thinking about a Sharp distance sensor.

Because I don't like the relatively low level language that Arduino gives you, the code is basically just a servo controller -- listening on the serial for positions to set the servos to. This way I can put all the logic I need on the big computer and program it in Python. It will also let me use a wired gamepad for controlling it -- no need to muck about with the wireless ones.

So far I'm pretty happy with the mechanical design, especially with the fact, that it required no extra parts -- just the horns and screws that came with the servos, and an iPod Shuffle box.

An "exploded" view with all the parts:

I made a page with instructions and the code for it at http://sheep.art.pl/Micro-Kubik.

The Bluetooth module just came, and I see an obvious problem with it. It's slow. Extremely so. I will improve the protocol I use to send the servo positions, but I'm afraid that I will just need to put a lot more code on the arduino side, and send higher-level commands. Turns out that sending all servo positions at once and not reading the reply made it fast enough, so I don't have to learn how to use AT commands to switch the module into higher baud rate.

I hereby announce this project finished.

I want to slowly make the Arduino part of this robot smarter, gradually moving the inverse kinematics, and maybe even gait, code into it, and adding higher-level commands. But developing on the whole robot is quite annoying -- I have to open the robot, disconnect the arduino, connect it to the programmer, program, then connect everything back to try it. That's because the servo power and the arduino power are hardwired together. I might need to add a jumper in there, but in the mean time, I build this simple leg code testing facility:

Since I want to be able to recover the servos, no glue this time.

I played with OpenScad a little today:

I did some more work on the electronics. I removed the IR distance sensor, and replaced it with a 3 axis accelerometer, connected to the analog pins of the arduino -- I have more uses for that. I also designed a much smaller breakout board:

and that lets me fit an UBEC in there -- so that the servos will get a much more consitent voltage now and the battery will hopefully last longer. I still need to improve the arduino code.

I made some progress today. First, I managed to correctly use the AT commands to set the bluetooth module to 115200 baud rate, so now it can all work faster. Second, I connected a simple resistor bridge to the battery, and connected that to an analog input -- so now I can read the battery voltage. This will let me to fold up, disable all servos and just sit there when the battery gets too low.

On the bad side, I just discovered that Servo.writeMicroseconds() doesn't work the way I expected in the Arduino library, and that I was using just regular write() with angles the whole time (but throught I was using writeMicroseconds()). I need to use the latter for smoother movement.

The problem with writeMicroseconds turned out to be an off-by-one buffer overflow in some other part of the code, so all is well now. The movement got much smoother now. I also have some battery-saving mechanisms in there now. If the voltage of the lipo cells drops below 3.72V for longer than 2s, it will start beeping. When it drops for longer than 4s, it will curl up into a ball, shut down all the servos and refuse to do anything.

STL Viewer (beta)

Rotate: |

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

downloaded Openscad seeing this post and it's pretty nice! Where i can find models for the servos and other common robotic equipment?

I had the same problem. There is some stuff on thingiverse, but that's mostly screws and gears. I made the SG90 servo you can see here, and also an Arduino Pro Mini board, you can get them both here https://bitbucket.org/thesheep/scad-parts, I need to add some open license there. I will be adding more stuff in there, as I make it, but it would truly be great if people added their stuff too! Of course, with proper attribution and such.

I will have to print parts for SG90. I'm getting the basics on openscad now:) There are many 3d models of arduino boards, rasperry and others at Sparkfun, maybe they could be imported!


"The Bluetooth module just came, and I see an obvious problem with it. It's slow. Extremely so."

Hmmm... How slow? What is the max Baud rate? And is that something general or is it just this particular module?

Nah, it was something else, no idea what. Besides, you can trivially change the baud rate and other parameters using your arduino. I set it to 115200 now and it's super-fast.

I suspect the problem was actually in my code.

maybe you could glue little slice of eraser (the gum part from a pencil for example)

You will get some grip.

After some experimenting, I got the right rubbers for the feet. I used the anti-vibration rubbers that they add to larger servos. I simply half-cut them, so that they form something like figure 8, and then use wire to tie them at the ends of the feet.

I'm not going to rush it, I just plan to keep my eyes open when visiting hardware, hobby and sewing utensil stores and see if I can get something right. Maybe some kind of rubber washers or something. I have the anti-vibration rubber things from the servos, maybe that...

i like the way he walks(very smooth).  Great work sir!

Wow, that's indeed a minimal design. I like that very much and i also like how he walks. I hope you will decide for coding it in the Arduino to give him the freedom he deserves. Wired or wireless controller would mak him to just another remote controlled toy. With the Arduino and the code for walking he will have freedom to go whereever he wants :-)