Robot Projects > Rolling



Barclays Bank ran a series of TV ads warning against online scams. Supercon - Defender of the Galaxy - was a £1.99 web special that would never be delivered. Looking good in CGI, it was always going to be hard to model in the real world.

P1060733a.JPG (34.1 kB . 431x768 - viewed 214 times)

With massive forearms and a narrow waist it reminded me of Popeye - so what could be hidden under those bell-bottoms?

A robot weighing 742g would require much more powerful components to genuinely walk. Four inexpensive yellow motors with wheels and an optical sensor familiar in line-followers find a new role here. Five 9g servos complete the kit list.

Now Supercon is off duty and has discarded some armoured covers. Time to practice some smoother moves for ice planets and moons.


Notice there are no active components at the hips. The left leg carries the torso and the right leg is free to swing. All movement is created at ground level, literally. The action relies on a suitable surface and just the right amount of tyre grip. Doubling up on the wheels improves tracking so the bot moves forward and back with little meander. This comes at the expense of turning ability.

To ‘walk’ ahead, one motor drives forward for a time. Swinging about the pivot at the hips, this will lift the toes. Then the other motor drives forward until the sensor detects the legs are in line again with both feet on the floor. The same motor continues to drive forward for a time and the toes lift. The cycle continues. The arms swing for balance so the bot doesn’t tip at the wrong time.

To walk backwards the routine is similar but with the motors driving in reverse. This way round the geometry is different because the hinge point is now ahead of the feet. For a heel lift not to tip the bot to one side, the leg length must change. The knee servos can shorten the leg length but for smoothness this change must mesh with the motor movement.

I did originally graph the trig in Excel to quantify the knee angles and pivot position. But it is a whole lot easier to use a cardboard ‘puppet’ with studs at the knee and hips, a ruler and protractor! Either way, balance is key.


The pivot causes problems when making a turn. Firstly if the leg motors are driven in opposition to turn like a tank - the bot will simply do the splits!

The pivot rotation must therefore be limited to allow one foot to move ahead or behind the other by just enough to simulate walking. Changing the grub screw in the retaining collet to a longer bolt and fitting stops solved this problem.

Because the left leg carries the torso the bot is not symmetrical. When turning to the right the torso may lean back too far and not balance properly.


Realistic movement relies on repeatable motor times as there is only one feedback sensor in the bot. The motors are driven for a fixed time as the legs are separating, and the sensor is only used to stop the drive on the return.

The Picaxe 20X2 has free running timer tmr3 which is not used by other functions. With setfreq m64 and a pre-scalar of 8 this will increment the word value timer3 every 33.768mS. Unfortunately, irin - that most useful Picaxe feature for robot control - changes the clock to 4MHz when executing. So with the irin timeout set to 15ms the loop time becomes around 44mS. This is ok for servo refreshing which itself can take up to 12.5 mS out of the cycle time.

Motor timing can now use a count of time. To drive for a quarter second the count would be 6. It is advisable to cover a possible missed sensor detection with an overrun count value.

Servos and motors can move too swiftly to be lifelike. Byte values for three positions for each of the five servos were noted. A smoothing process compares the current value to the target value and changes by a small amount each cycle time. These values count out 10µS of pulse time, so with a fast clock they must be multiplied by 16 for the pulsout command to work correctly.

Similarly for the motors, the current PWM word value is altered each cycle according to a mode setting: minimum, maximum, slower, faster.


Construction is mainly plywood and card. Segments of 3mm ply were laminated to form the thighs and head followed by much sanding to shape. Cavities and cable routes can be included in the slices.

The bell-bottom covers were made from layers of thin card wrapped onto plywood frames and held in place with 10mm disc magnets.

A 3D printer and easy software would improve the finish of these complex curves. I did develop a technique of butt-jointing segments of cereal box cardboard to form the torso covers. This used lots of bits of masking tape to hold whilst the white wood glue set and then filling in the gaps with more glue. Three or four coats of acrylic paint hardened the shell nicely.

The disc cannons make the arms heavy but fortunately 9g servos are just up to the job.

Barclay’s Ad

like it, where you hiding the picaxe and driver... in the  rear torso?. you gonna post the code, like to see how you wrote it " hoping for inspiration to get out a picaxe"  if you think it bloats your post  you could add it too the code section. we dont have a lot picaxe in there yet  :'(.


Thanks jinx

parted.jpg (168.48 kB . 811x562 - viewed 269 times)

There is only room for the 3 servos in the torso so most of the electronics is under the bell-bottoms. You can see the line follower reflector on the other leg.

layout.jpg (204.77 kB . 1000x682 - viewed 265 times)

Spreading the legs apart by moving the knee joints you can see the tripad layout just fits the available space. The motor controller is the 754410. The Picaxe USB cable uses the 3 pins to the right.


The cycle time is 44mS so that there is time to refresh the servos, change motor speed (PWM duty), wait for IR from the remote controller, and do the actual processing. Using a 'present state, next state' approach, we could be doing nothing in state 0 or stepping back in states 13 through 20.

It gets a bit more complicated because above this level are the two demo sequences. Once started they cannot be interrupted and they concatenate the individual movements using lookup tables.

A lot of code I used for testing and commissioning has been REM'd out at the end.


[0] Message Index

Go to full version