Let's Make Robots!

Low Cost DIY Bipedal

DIY bipedal robot, walking, upstairs, one leg balance, with remote control

This is my second robot.

This bipedal is made with 12 low cost servos (MG995), 4 atmega168, aluminium material for window frames, and with small hand drills, hand saws and files. 

It is still in progress. I would like to remote control it first, and later to have it self-navigate in the house. Will post to show how to make it. But you can check out also in my blog :

 

Servo

In the planning stage, I actually possessed very limited knowledge in controlling servos. I knew that I need powerful servos. Thus I got some TowerPro MG995 to play around. I started by writing a simple servo controller, which supports group movement. I mean that a group of servos to move together to various positions within a fix period.

After that I realized MG995 is too shaky for bipedal robot. I go immediately to try out openservo software. This fix the problem and bring me quite a number of skills, like TWI communication, TWI bootloader, etc.

Servo Mount

It is a big question mark to me on how to mount a servo. I don't want to drill holes on the servo and have no budget to buy the nice looking mounts on the net. Finally I figure out the way to make the mounts and the cross joint from aluminium window frame material. It is low cost, easily crafted, strong enough for robotic usage:

Sample 1

Sample 2

Servo mount and arm example

Some more samples

 

Simulator

It would be nice to have autocad or similar tools to simulate the design before actual development. Of course, I don't have the money and I don't want to use illegal software, usually. Python is my primary development tools on PC side robotic development. Thus I try the vPython 3D package and it is surprisingly easy to use. However, vPython is just a simple 3D presentation tool. I added the pyODE (a physical engine) so that I can model a robot in a physical world:

simulator 1

simulator 2

Later, I found out that it is just a nice-to-have tool in robot development. I will tell you later why. But the simulator does help me to visualize the robot before I build it. Also, it helps me to develop the first version of the sequencer, which is very important in later development. More info

 

How to walk

The first step to walk is to shift the CG (center of gravity) to one leg, and lift the other leg up. This is very simple task to human being but a bit tricky to a robot. It is because of the control logic on your servo can deal with itself only. Usually a servo uses control logic like PID You specific a position, the servo will move to the position precisely at the maximum speed but not overshoot. When a bipedal robot is built, the overall weight will be a big burden to your servos. Thus the servo is always at certain offset from the target position that you specified. The situation is more serious when the robot is standing on one leg, when walk upstairs and etc. 

This is why I said a simulator is not very useful at this stage. It is because it is hard to simulate this situation for a real robot that may have different minor defects in physical structure and servos performance. It is also why you would like to use powerful servos instead of the small one.

On top, you will need to control your servos to move at a predefined speed/timeslot and synchronized them. It will rely on your servo controllers (or openservo already support it). I also recommend to have curve motion function if you want a more natural and fast motion. Curve motion means your servo can move non-linearly. e.g. move more initially and gradually move to the target slowly. Openservo supports beizer curve motion, which I think a bit complicated to use.  I've made a semi-circle-like curve motion (check the blog for more information if you want to).

To walk naturally, here is a good reference link.  I would say minimize the shifting of the CG (center of gravity) of your robot will be a key. It also minimizes the energy lost when the robot walks if the CG is kept at constant level.

 

How to work fast

From the first walking sequence @ 6 second per step, to the latest working sequence at 0.55 second per step. The improvement is not only from the optimizing each movement of the servo, but also overcome the bottlenecks between the communication paths to the servo. 

On average it takes 4 sets of 12 servo movement to complete one walking step. If you are using a 9600 bps link, and a send and acknowledge protocol, the max data rate is no more than 600 bytes per second. Thus your servo controller must support a batch mode in specifying servo movement (allow setting of 12 servo together in one command.).

If one servo command is 3 byte, here is a simple comparison of 4 set of 12 servo commands to send:

Your controller support batch commands: 4 x 12 x 3 / 600 = 0.24 seconds

Your controller does not support batch commands, so each commands has to be acknowledged: 0.24 x 12 = 2.88 seconds

On the other hand, if your controller supports a one way protocol (no acknowledgement required), the situation will be much better. It takes 0.12 seconds to complete in both case.

Still, if your controller does not support batch mode, the different between first servo command and the final servo command may be more than 0.06 second. This is significant to demage the walking sequence. A high speed link is recommended in this case.

Thus pay attention to the controller design and speed of communication. High speed, batch commands, curve motion, linear motion, and high speed servos are the keys to archieve fast walking.

 

Robot Simulator Source Code

I have packed the source code for your download at http://code.google.com/p/clrobotsim/

To be continued....

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
(SHREAKS OF JOY) Amazing!!!!!!!!!! I always wanted to build a biped maybe not quite as big tho... I saw your second video which is awesome you should make an instructable!!! A biped under 150 WOW!!!
That is really cool, walks great, and looks well controlled. Your blog shows you put a lot of work into this, with a sim as well. That's really good construction too. I don't always do well hand making items, servo mounts etcetra, what you've done is pretty amazing.

Your work is really inspiring!

/ vzz-clck-"Maneuver"

That's a great project, and you've documented it really well on your blog. That was really interesting reading, thanks. I hadn't heard of this 'openservo' idea where you remove the servo's control PCB and run the wires from the motor AND the pot out to an external control board. Interesting idea.

You've managed to get the motion looking quite natural too. I'm interested to read what else you'll post about the robot.

Dan

Thanks for that summup, Dan, yes, that is one smart combo - idea - and what a cool robot!! Very impressive!!

Thank you very much Dan. openservo.com is a great open source project. The software is of very good quality and those guys know very much about servos and motors.

Glad to know that you guys find the robot interesting. Before I post more about this robot, I would like to post my first robot project, a robot arm playing Chinese chess game. It is because quite a lot of work is based on the robot arm project (like to servo mount and servo controller).

I am planning on the fourth robot, which is a simple tank doing home exploring / map building. Looking forward to your feedback also.

Having been so proud of my biped (which never actually got finished), to see somone elese overtake me to the sub £100 biped makes me feel awful that I didn't stick at it. I am extremely envious!

This appears easily as good as some of the $800+ robots we see elsewhere.

Can you tell me how you sourced the parts for under $150? I have a couple of MG995 servos and they NEVER worked properly. I read on the net that the control board and position pots in thm are rubbish. I actually looked at openservo and wrote it off as too expensive. The cheapest assembled version I can buy is £107.94 for six. (That's over $200 already and doesn't include the servos!)

As well as being too flimsy (PVC is too bendy for this project), my R/C servos were under powered, so I'd be really keen to get my MG995's working, but not at $36 each! Irritatingly, it says on the openservo website that the board can be bought for $10. THAT is a reasonable price. I can only assume that the the RobotFuzz people are taking the piss.

Do I understand that you didn't buy the openservo board, but you made your own board wich sits outside the servo case? This would be a viable option for me: making PCBs is no problem, but I can't do serface-mount.

Yours is a brilliant project and I'd love to see it blogged here in LMR. It would be a great credit to us, and builders of your genius would also be a credit.

Yeah, in this post on his blog you can see that apparently he built a board using several ATmega168's to control all of the servos. Not sure if it's running software from openservo.com but the hardware seems to be all scratch-built. Definitely something I'll be looking into for future projects.

Dan

Hi.

I think the raw cost comparison is not a fair measurement for a success of a project. I live in Hong Kong and very near to mainland China. The China electronics retail market is quite strange. It only has limited variety of supply, but the common items can be at very low cost. Also, TowerPro servos are made in China. So the cost structure of my project is like this:

12 x MG995 (or MG945) = 12 x 8 = 96

4 x atmega168 8 Mhz = 4 x 2 =8

1 x atmega88 = 1

6 x L298N  = 6 x 1.25 =8

2 x AM wireless module = 2

buttons, PCB, switches, some 74LS0x, = 10

Alum Material  = 15

Total 140

Unless it is in mass production, raw cost is not very meaningful. However, if someone interested to invest on it, the manufacturing cost shall be low.

MG995's controller is well known problematic. If you use several of them together they will shake a lot. However, the rumor about the pot is not right. It is relatively stable but....the pot is not very linear...(it makes my life very difficult in the arm project). The motor power and metal gear are very good. Therefore I pick it and make it digital......if you get a digital servo with similar power in the market, I believe it is over $30-$40 ?.

You are right. The openservo board is a bit expensive. They are too powerful to me for a little robot....power measurement, temperature measure, backemf, current measurement..and etc. cost me too much to build a budgeted robot. But the software of openservo is very good. Apart from cost, I am not sure if the openservo board can fit to a MG995 or not.

I develop the servo control software base on their software. It uses one atmega168 8MHz to control 4 servo.

http://hk.myblog.yahoo.com/jw!afd6dGGRHBRkp2laqwk198fg/article?mid=393

http://hk.myblog.yahoo.com/jw!afd6dGGRHBRkp2laqwk198fg/article?mid=567

So 12 DOF robot use 3 atmega168. I choose L298N, because in my experience, MOSFET is the best, L298N better than L293D....MOSFET is too big and expensive in general unless SMD version is used. L293D only deliver 0.5A which is a bit too low for a bipedal (and in my first robot arm project, I use L293D...seems marginally enough).

Actually I tried SMT also:

http://hk.myblog.yahoo.com/jw!afd6dGGRHBRkp2laqwk198fg/article?mid=233

It is quite a lot of fun to fit a full MOSFET H-bridge to 17x19mm two layer DIY PCB.

http://hk.myblog.yahoo.com/jw!afd6dGGRHBRkp2laqwk198fg/article?mid=178

However, there is brownout reset issue still outstanding (the MCU got reset when MG995 motor drawn too much current.) So I go for a DIP version.

I would recommend to use power and stable servo for bipedal development. PVC is too soft....I think aluminium window frame material is a good pick is you really want to make the hand dirty. Otherwise buy a kit is a better choice.

 

I wanted to use aluminium for my biped, and considered window frame material but the only extrusions I could find had very complicated cross-sections designed to hold rubber seals and link together in strange ways. I just couldn't find a 1mm box section or U-section.

It's great to see this opinion from someone who's REALLY used the MG995. Most of the other information I'd gathered had come from model aircraft enthusiasts who were too frightened to entrust the safety of their models to this servo.

I haven't looked very deeply into your project, but I solved my brownout issues byrunning the micro-controller and teh servos off seperate power supplies. The regulators I was using only had a sink of about 1A and I found that the servos would easily take 300mA at stall. My guess would be that if I could get the MG995 to work, it would easily soak up at least 500mA. So, it seems logical that your MCUs would reset running two servos. Based on this, I would guess that if you found a more powerful H-bridge, your servo controller would definitely give you better performance.

Yes, logarithmic pots are less expensive to manufacture than linear ones. Now that you know the relationship between the rotational position and the resistance is logarithmic, that should make coding your controller easier!

I share your worry that the openservo board won't fit. The board would occupy the full length of the servo chassis, but the MG995 only has space for a half-length board.

You could solve the brownout by putting two regulators on the board: one for the MCU and one for the servo, but there's no way you can fit that all into the servo footprint!!