Let's Make Robots!

Bajdupod 996R

Walk smoothly :)

Update 09-06-2013 I'm considering this project finished.Well maybe I reprogram it one day :p

Made a new video showing Bajdupod 996R doing some fitness outside in the sun :) It show some of the "moves" that I have preprogrammed. In the last bit of the video you can see me moving one leg. I can move each leg individually with my remote control. Took me a lot time to code everything and test it out. My code is over 1000 lines long and one big mess. Maybe I'll clean it up one day and try to improve it.

I've written some more code to let the hexapod walk autonomously. But it's a bit difficult to make a video of it. I still haven't received a new Lipo. The current Lipo lasts less then 7 minutes :p It can now track an IR light source using the WiiCamera or do some obstacle avoidance using the ultrasonic sensors.

This project was a very good programming lesson to learn how to multiple things with one mico controller. Controlling 21 servos, doing some wireless communication, controlling 18 leds and reading some sensors needs a lot of code :) One year ago I did not think I would be able to program a beast like this. But you can accomplish lots with dedication and hard work!

Update 17-05-2013

New video showing of the blue leds that I've added :)

My hexapod is now fitted with 21 servos, 18 leds (16 are controlled by 2 shift registers), 2 ultrasonic sensors and a Wiicam :p Now I need to code this beast. It can already walk pretty smooth. All the sensors are connected and work. At the moment I just take the readings and sent them to my remote control. Need to learn it some tricks now :)

During the many test sessions my big Lipo has gone poof :( Now waiting for a new one plus a decent charger. Thankfully I have some spare lipos. But they don't last very long, this is one power hungry beast :p

Some photos:

 

Update 29-04-2013

New video uploaded, let my hexapod loose outside :)

Finally designed a new chassis and had it laser cut by a local company. I had 3 plates made. Between the bottom and the middle plate the battery, UBECs and power servo PCB are fitted. Between the middle and bottom plate the Seeeduino Mega and my Bajduino Mega 3A sit. I chose to use 2 micro controllers just for fun. I have dozens of ATmega's so I might as well use them :) My Bajduino Mega 3A has an ATmega1284P micro controller. It has 2 serial ports which is very handy. One for the serial monitor and one to communicate with the Seeeduino Mega. The Bajduino only does the wireless communication at the moment, the PCB has a header for the nRF24L01 module. I have not fitted the top plate of the chassis yet.

To replace the chassis I had to take the hexapod apart. I put it back together and replaced all the plastic servo horns with metal ones. I then had to check all the servos again to see if they all line up. In the video you can see that it's not walking very straight. So I need to do some adjusting... I also mounted the legs on small bearings that sit inside the bottom acryl plate.

My code seems to run ok. It still has a bug that I can't seem to fix. When I switch between the walking mode and the "move the body" mode strange things happen :p Think I'll rewrite that function so it uses the same timer as my walking function. Still I'm happy with the progress so far :)

Update 23-03-2013

Added another video showing my last state of code. I've changed the way I move the servos. All my code is now based on timers. I have added speed control and "bodyshifting". I can select a mode on my remote with a button. So I can choose between walking or moving the body.

Now I have to tackle some mechanical problems. The legs need a lot more grip and I need to design a new bigger chassis. I have received my metal servo horns. Once I have the new chassis plates I'll replace all the horns. It's quite a big job, 72 screws :p

Update 12-03-2013

Uploaded third video. Snowed in today so had to stay at home and play with my hexapod. I have changed my massive moveServos function so it moves the servos in little steps. I can now control the speed of the servos. I do use a for loop and the delay function. I've added a second micro controller (ATmega328) with a wireless nRF24L01 module. All my bots have been controlled by these modules so it didn't take me long to program the communication. The ATmega328 receives a struct from my remote control via the wireless modules. The ATmega328 then sends these values via software serial to the Arduino Mega which receives these values over hardware serial. Sounds complex but it's actually very straight forward. In the video you can now see that you can make a hexapod with cheap Chinese servos that can walk smoothly :) Not as smooth as a lynxmotion of course but that has more to do with my code. And it cost me a lot less.

Update 10-03-2013

Added the second video, this time of Bajdupod 996R taking its first steps :) After blowing up a couple of expensive 8A UBECs I think I have found a solution to powering the 18 servos. I am now using 3 8A UBECs, each UBEC powers 2 legs / 6 servos. To give you an idea about how current this black monster needs, I had a 10A fuse between the Lipo and the 3 UBECs. It blew up when I tried out the real walking test. So I've replaced it with a 20A fuse.

I have written a basic walking gait to move the hexapod forward, backward, left and right. I'm using inverse kinematics to calculate the servo angles. The code still needs a lot of improvement, I want it to move a lot smoother. For this I'll need to move the servos in little steps. Writing that code for 18 servos is not so easy, certainly as I refuse to use the delay function. That's to easy :) I had a bit of trouble finding out how much I could move the legs and keep the hexapod stable. In the beginning I was moving the legs to far for/backward and that caused the hexapod to fall on it's ass :p Takes quite a bit of time figuring everything out...

Future plans:

  • Replace all the servo horns with metal horns (are on the way from China)
  • Replace the original base plates with self designed laser cut acryl plates, the chassis I use now is to small, I'll make it a little bigger so I can fit my Lipo and UBECs inside the chassis
  • Replace current servo PCB with new version (is on the way from China)
  • Replace Arduino Mega2560 with a Seeeduino Mega2560 (Seeeduino version is smaller)
  • Write some fancier code so the hexapod moves a lot smoother and I can control the speed of the servos (this will be very hard)
  • Fit a second micro controller with a nRF24L01 module so I can remote control it.
  • Add a shit load of LEDs and let it dance, Gangnam style :D

Update 22-02-2013

Added first video :) I've done some more testing. I've written a sketch were I move all 6 legs (18 servos) at the same time. Lifting 3 legs up and 3 legs down using inverse kinematics. I powered 3 legs from my lab power supply and the other 3 from an 8A UBEC. I'm afraid the servos will draw close to 20A when walking. So I've now ordered 3 more 8A UBECs. I will use 1 8A UBEC to power 2 legs, so 3 8A UBECs in total. I hope that will do it.

Update 18-02-2013:

I have spent the last weeks trying to figure out how inverse kinematics work. After a big struggle and a lot of head scratching I can now move every leg using inverse kinematics. That means that in my code I can do this: moveLeg1(X,Y,Z). The X,Y,Z is the position of the tip of the leg :) The code will then calculate the angle of each servo and move the leg to the X,Y,Z position. I borrowed a lot of code from this website: http://www.engineer-this.com/IK.shtml Converting the IK angles to servo angles was actually easier then I thought. Using a protractor I compared the calculated IK angles with my servo angles. I still have to do some fine tuning. But the biggest hurdle has been taken :) 

Of course I wanted to show of my successful coding and quickly wrote a simple sketch to move all 6 legs at the same time. So I could make a video. Bad luck struck of course and one of my UBEC's has given up. I was powering the 18 servos with 2 8A UBEC's. Each UBEC powers 3 legs. Now I'll be honest when I first tested the UBEC's I short circuited them. They have been working fine till today... Grrr. I then decided to use my lab power supply. I set it at 6V and moved all the legs, the servos were drawing almost 10A. And the servos are under no / a very small load. So I will redesign my power supply circuit. Suggestions are welcome. Current solutions are a 5A UBEC for each leg? I have also seen some 10A 12 to 5V automotive regulators on Ebay, maybe 2 of those will be strong enough? I'm going to put the hexapod away for a bit now till I have found a decent solution. I'm definately not giving up, it will walk :p But I have bought a lot of other toys the last months, I'll play with them for a while :)

Original post:

I've started building my second hexapod. This time I'm using a Chinese hexapod kit. I bought the kit on Ebay for 90$. It included the parts in the photo below:

I bought 30 Towardpro MG996R servos some time ago on Ebay. They are pretty cheap and have +10kg/cm of torque. I hope they are strong enough :)

 

I used a lot of M3 nuts and bolts to put everything together. I did some thinking about how I was going to power 18 servos. I decided a big strong lipo and some UBECs were a good solution. I bought 2 8A UBECs. I soldered a fuse and switch to some connectors so I could hook up the lipo to the UBECs. I designed a small PCB (and had it made by Seeedstudio) to distribute the power from the UBECs to the 18 servos. Each UBEC powers 3 legs / 9 servos of the robot. The Mega 2560 is powered by a separate 2S Lipo.

 

I've now mounted an Arduino Mega 2560 on the robot and hooked it up to my servo power board. I might change the Mega for one of my self designed boards and use a Torobot 32 channel servo controller that I have lying around.

At the moment I have only set up the 18 servos, checking if they work and adjusting the centre position. Takes some time with 18 servos. I hope to write a sketch using inverse kinematics for it. But that will probably take some time.

Another issue I have is that the chassis is a bit on the small side. I might design a bigger base plate for it and have it made from Acryl. So I can attach some more electronics.

Comment viewing options

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

Congratulations on a job well done!  Those blue leds are very cool looking.  A lot of engineering into just how to power everything without melting something I imagine. 

I don't think I have ever done a software project I didn't wish I had done better. 

Amazing robot !

Nicely done Bajdi. The blue LEDs are really an eyecatcher.

I'm really impressed.  That's a lot of good work, right there now!

You are really progressing nicely with your control of your bot.

Now PLZZ GIVZ ME DE code PLZ :D

That was my first plan :) I bought 10 of those boards on ebay, then I did some testing. I powered 3 MG996R servos from 1 LM2596 board and let the servos sweep. Half hour later the board started to melt. The LM2596 is a 3A regulator but it needs to be able to dissipate some heat. That little PCB is not up to the job.

For the last week I've been using 3 Turnigy 8A UBECs and it seems to be fine, fingers crossed. Those UBECs are sold as 8A continuous and 15A peak. But continuous for the Chinese means 5 sec, peak 5 microseconds :p

I searched ebay for your 8A UBECs, $12 a piece. Compare that with the cheap LM2596 Buck Converters, 3A for $1.5. Why not stuff your walker with an array of those?

To be honest it's far from pretty at the moment. There is a tower of pcb's on the top with an Arduino Mega next to it. And a massive amount of cables connecting it all. I have not spent any time on making it look better. I just received the metal servo horns. Now I should design a bigger base and have it cut from acryl. I'm waiting for a new power servo pcb and a Seeeduino Mega. When I have all the parts I will take it apart and try to make it look a bit sleeker. I'm open to ideas to add some bling. I have already done RGB leds and EL wire on my previous hexa so I need to come up with something new. Mount a couple of lasers on a tilt pan bracket? I would like to put some small leds in the tips of the leds, think that would be cool :p

well... here I was watching the 3rd video and mrs was walking near... and then she's like:

"What's that?..." (she approaches and takes a look)

"Aw how cute, it's like a spider?... and it's pretty than [any of ] yours..." (me astonished/frowning... if I could react to such candure :P)

Anyhow here you go, let me tell you just been greatly complimented (partly at my expense :P) and don't even use my poor excuses of robots for comparison... but a robot to catch the eye of the mrs takes a lot :|

 

As for my own comments: the gait has improved greatly, looking pretty good :D (goes off mumbling about buying a bunch of servos) [ :P ] 

 

I have 10 of those cheap LM2596 boards http://www.bajdi.com/?attachment_id=944 Long ago I tested them with some MG996R servos. The LM2596 could not reliably power more then 2 MG996R's. With 3 servos it would melt the board. I have powered my hexapod from my lab power supply, the meter on my power supply was showing +15A when walking.

BTW Some time ago I made a small hexapod with 2 DOF legs using small SG90 servos, I powered it from an LM2576 (predecessor of the LM2596) voltage regulator. http://letsmakerobots.com/node/34540