Let's Make Robots!

Bibi the quadruped

Walk with 4 legs (2 DOF) and scan the environment. If an obstacle comes close (treshold programmed) the robot searches for a new direction to go.
Bibi.zip24.12 KB
CAD_SCH.zip54.27 KB

This is my 3rd robot and I thought now it was time to make one that walks!

For this robot I used the Keil uVision4 compiler evaluation version. I also used the STM firmware library from ST.com which is called STM32F10x_StdPeriph_Lib_V3.5.0

This lib has a ready to go project structure which can be opened with the Keil compiler. A number of fixed files are required to make it work. Their names and where to put them can be seen in the image here:


These files you must put in the directory STM32F10x_StdPeriph_Template

In the KEIL compiler you must open the project located one dir higher in the folder MDK-ARM.

My files / sourcecode I'd like to this project but does anyone know how??

I would like to thank the maker of robot Cane, I used his algoritm/design to make my robot walk. Before that it looked awfull haha!

Some background info on the code. In main after setting all timers for their pwm modes (servo's for legs and knees as well as the pan servo) and interrupts I go in an infinite while(1) loop. Here the robot takes one step, checks a FLAG which indicates wether there is an obstacle detected or not and if so it executes a piece of code to avoid it.

The glowing of the body I do with bright green leds connected in parallel to a channel of TIM2. In an irq routine I increment /decrement a variable which I use for dutycyle and so the leds dim on and of in a peaceful manner.

The ultrasonic distance sensor works as follows: in the main function infinite while(1) loop I trigger a measurement simply by bitbanging a pulse of 10uS high. The sensor issues 8 ultrasonic 40khz pulses. TIM15 is configured in input capture mode on both edges. The echo (response) pin of the sensor I connect to one of the TIM15 input channels. On rising edge I reset the CNT register of TIM15. I also configure the other channel to monitor if the TIM15 overflows. I have it running on 1Mhz so 1 count is 1 uS. Since the sensor goes no further then 500cm of distance aka 29000 uS (so 29000 counts), an overflow means we have a bogus value. Als a value between 29000 and 65535 is invalid so I check for that as well. On the falling edge of the echo pulse I readout the capture value. This number is the pulse HIGH time in uS. Divide this by 58 and you have the distance in CM! Last, I compare the distance just measured to a treshold valua and set a FLAG variable if it is over the limit. In the main program while(1) loop I check for this flag to see if we need to do an evasive manouvre or not!

The making of the mechanics and make it work took me a lot of time.

The acrylic body I designed myself using a CAD program. I used the so called FAB-LAB initiative from MIT, known in my city Utrecht as protospace.nl to make the body. They have a laser cutter which on certain days anybody who wants to design stuff can use. GREAT that something like that exists!

Enjoy my robot. I will go develop it further, I'm thinking of mounting a camera but since I know nothing about this I still did not start... I want to experiment with line flollowing or object tracking.



update 26-3-2012: added the sourcecode. You require Keil uVision4 and the STM firmware lib mentioned in my description above



Comment viewing options

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

Awesome work!
Since I am a nerd I have to point out that a hexapod has six legs, and a quadrapod has four legs.
But that doesn't diminish the fact that you have made a nice robot there...

haha maneuver you are totally right, hex is 6 quad is 4, I mixed it up! I try if I can still change it.

Does anyone know if and where I can share my sourcecode? I had lots of learing moments on the code from Cane but this was linked via this site to the builder's own site. I have no site, maybe I can put the code somewhere here?


I love the look of this robot.  The blue glow coming out from the bottom of it is very sexy.  Its pretty fast to.  Great job!  -Hal (kingart3)

Tnx Kingart3! I got some space left in the glass body for 4 more leds. I'm thinking of bright red ones so I can make the robot turn red when it encounters an object or error!

Hi robodve. Nice bot, i like it. You can share your code when you go to EDIT your project and then choose the last line "File Attachments"...just upload it and it will appear under your introduction.

Tnx Lumi that was it, I've looked over this link I guess...

You are welcome. Frankly I also had to search again, even I did use it already for my projects. It should be more dominant ... but maybe it will in LMR v4 ;-)

its very hidden but its also very important!

Good thingI still have a STM32Fxxx in the box, because I'm going to experiment with your code somewhat.

Thanks for the provision of the code.

Best regards from Germany