9g Tai Chi Stepper
Summary
Inspired by Wallace & Gromit – The Wrong Trousers, this project was defined as the construction of a self powered bipedal walker using cheap 9g servos and applying the principles of Tai Chi.
Actually a martial art, Tai Chi is practised here mainly as a healthy mind and body exercise. It is taught by example with the students then copying the teacher and being corrected by hands on adjustment to attain the proper postures. Movement is slow both to allow time to perform carefully and to show any instability as a wobble or stumble.
The Picaxe ‘training program’ uses a universal IR remote controller to directly address each of twelve servos. A number between 75 and 255 can be entered then a ‘nudge up’ or nudge down’ key allows precise adjustment of rotation. This is very useful when first assembling the unit and setting the servo arms and linkages. It also allows any ‘posture’ to be achieved.
The 20X2 has sufficient pins to accommodate the 12 servos, the IR input and program I/O. It also has enough scratch pad memory to store ten ‘postures’. These stored positions can be retrieved immediately or an interpolation routine can be used to move slowly from one position to the next. Dividing the difference in servo values into sixteen intermediate positions, the servos will move at different speeds to reach the new position at the same time. Once a usable routine is tested, it can be transferred to a Look Up Table in the main program then called up via the controller as one of 10 sequences.
Additional tools include ‘overlays’ which concern groups of servos, used for example to bend both knees or sway from side to side. Because the model will be constantly redesigned as its characteristics become better understood, it is important to move away from using simple servo values. Any choreography previously tested will become useless if a linkage or fulcrum changes. To this end symbols are used and a number of terms defined to help the progress towards walking.
The model was designed in 3D using Sketchup. It is constructed mainly from 2mm plywood and uses spare servo accessories for the joints. Being mushroom shaped plastic in cross section they fit through a 7mm hole in the 5-ply, which can spin freely with little lateral play. Thirteen servos were purchased for under £20.
This outcome of this project was never certain. However, 90% of the hardware and software still had to be designed and built in order to test the premise. After some major reconstruction it became even clearer that the 9g servos could not be bullied into working. With a total model weight of around 330g (without batteries) and balanced on one leg, the lower servos simply collapsed. Just as Tai Chi uses technique to defeat superior force so various techniques were employed to overcome these problems
In summary, it did take an unreasonable time to create a working sequence that allows stepping forwards and backwards. This is not the ‘controlled falling’ that we might use to catch a train but a stylised and careful movement of weight from one foot to the other. Because the geometry of the legs-only model is actually quite unlike the human form, the movements would not please a Tai Chi master but are quite fascinating to watch.
Electronics
The circuitry is minimal with the usual program I/O resistors and a LED20 with pull up and capacitor. To allow the use of on board alkaline batteries there are two 1N4001 diodes to drop the volts to the 20X2. Servo inputs are fed via 330 ohm resistors from the 20X2.
The main issue is cable management. The lower servo leads will not reach the top of the leg so there is a wiring concentrator above the knee where three inputs and common power transfer to ribbon cables. The circuit boards use bell wire on copper tripads, unfortunately no longer sold by Maplin. Ribbon cable, connectors, headers and crimp pins from Hobbytronics.
Normally running via an umbilical for programming and sertxd diagnostics, power can be similarly supplied from rechargeable AA batteries. Carrying such batteries proved too much as they are considerably heavier than alkaline. Ordinary single use AA batteries could be carried but would have to be arranged singly on each thigh and shin. Duracell Ultra single-use AAA batteries will supply the servos and can be carried on the thighs in pairs. This extra weight greatly changes the balance points so many symbols have had to be redefined.
Construction
As my introduction to Picaxe was via a project to build intelligent scale model heritage trams to run in the garden, I had the necessary tools to make the model in wood. Available from model shops the 2mm 5-ply is stable and easy to work using jewellers saw and white glue. The spare servo accessories make the bearings, clamped through one piece onto the other using No 2 6.4mm self tappers from Modelfixings.
3D design using Sketchup allows checking for clashes of parts in different positions. This is in the Warehouse - search for 9g Tai Chi. Interestingly, someone has a Sketchup design for a walker that is to be 3D printed.
Servos
Servos from hittime_3C in Asia, arrived within a week. Model shop K&S 1.19mm brass rod links are a good fit through the servo arm holes. Generally the slop in the links is proportionally less if the radius of rotation is greater. So using the longest arm is best if the mechanical advantage allows. A design difficulty was making provision to change out a servo after build; much easier to wrap the construction around and cut it out later!
What were the techniques to make success possible?
Firstly mechanical advantage. Like a pulley system if the servo can rotate further than needed then more torque can be attained at the expense of rotational angle. The footplate rolls over to move the centre of gravity onto one leg. Here maybe 15 degrees left or right is needed and therefore an improvement of 4 or 5 times can be made if a suitable linkage can be designed. The first two designs were discarded and in the current one the planes of movement of servo arm and fulcrum are different. Perfection still to be achieved but the foot is now strong enough to hold.
Second problem was the knees. Collapsing forward looks painful but is easily fixed with a mechanical stop. Collapsing backwards causes a number of servos to attempt to recover and the resultant current draw drops the battery supply and the Picaxe browns out. The knee needs a lot of rotation so only a bit of help possible via mechanical advantage. However, with the leg straight the servo arm can be arranged to be almost in line with the linkage such that the servo can move the link but the knee cannot.
Thirdly the legs move forwards and backwards at the ankle and serious help is required to support the weight above. The solution involves a peg on the footplate and a detent at the bottom of the leg. Rolling the foot engages the peg. The angle of the ankle and the position and shape of the peg have to be determined by experiment but, using the interpolation routine, the peg and detent can be in the right place at the same time. With the ankle thus locked the weight above is supported on the rolled foot.
If the model is in balance then the servos do not need constant refreshing with positional information. The irritating chittering can be turned off between moves. They are slow to move under load sometimes so the pulsout commands stop after a dozen chances to attain the correct position.
Program
Hopefully the program comments will assist but some experiences to note: Originally planning to use the send function of the terminal emulator and having missed the 330 ohm resistor to a servo, I thought I had blown the chip. A couple of days researching the problem and completely remaking the circuit board I vowed never to use serrxd again. Only a finger in exactly one place (not a pull up, pull down nor capacitor) would allow a reset to resolve the internal Picaxe conflict. Fortunately the use of the Kingavon BB-TV154 remote (from Electromart) was an improvement anyway.
The stored postures in scratchpad memory can only be transferred to main program manually. They appear on screen in CSV format but, unfortunately, the terminal emulator does not support cut & paste. Print Screen is still a useful backup in case the servos brown out the 20X2.
The real problem that was being examined was one of language. How to explain to a robot what is required and how best to understand the information available from the robot. Using symbols does help to separate changes to servo values from higher level instructions but you cannot force the robot to do something impossible just by defining a symbol. The learning process turns out to be both ways!
Video Clip
A two minute clip of the demo sequence (turns and moves forward and back) in the program can be found at https://youtu.be/imq0HPXiQmM.
Summary
Inspired by Wallace & Gromit – The Wrong Trousers, this project was defined as the construction of a self powered bipedal walker using cheap 9g servos and applying the principles of Tai Chi.
Actually a martial art, Tai Chi is practised here mainly as a healthy mind and body exercise. It is taught by example with the students then copying the teacher and being corrected by hands on adjustment to attain the proper postures. Movement is slow both to allow time to perform carefully and to show any instability as a wobble or stumble.
The Picaxe ‘training program’ uses a universal IR remote controller to directly address each of twelve servos. A number between 75 and 255 can be entered then a ‘nudge up’ or nudge down’ key allows precise adjustment of rotation. This is very useful when first assembling the unit and setting the servo arms and linkages. It also allows any ‘posture’ to be achieved.
The 20X2 has sufficient pins to accommodate the 12 servos, the IR input and program I/O. It also has enough scratch pad memory to store ten ‘postures’. These stored positions can be retrieved immediately or an interpolation routine can be used to move slowly from one position to the next. Dividing the difference in servo values into sixteen intermediate positions, the servos will move at different speeds to reach the new position at the same time. Once a usable routine is tested, it can be transferred to a Look Up Table in the main program then called up via the controller as one of 10 sequences.
Additional tools include ‘overlays’ which concern groups of servos, used for example to bend both knees or sway from side to side. Because the model will be constantly redesigned as its characteristics become better understood, it is important to move away from using simple servo values. Any choreography previously tested will become useless if a linkage or fulcrum changes. To this end symbols are used and a number of terms defined to help the progress towards walking.
The model was designed in 3D using Sketchup. It is constructed mainly from 2mm plywood and uses spare servo accessories for the joints. Being mushroom shaped plastic in cross section they fit through a 7mm hole in the 5-ply, which can spin freely with little lateral play. Thirteen servos were purchased for under £20.
This outcome of this project was never certain. However, 90% of the hardware and software still had to be designed and built in order to test the premise. After some major reconstruction it became even clearer that the 9g servos could not be bullied into working. With a total model weight of around 330g (without batteries) and balanced on one leg, the lower servos simply collapsed. Just as Tai Chi uses technique to defeat superior force so various techniques were employed to overcome these problems
In summary, it did take an unreasonable time to create a working sequence that allows stepping forwards and backwards. This is not the ‘controlled falling’ that we might use to catch a train but a stylised and careful movement of weight from one foot to the other. Because the geometry of the legs-only model is actually quite unlike the human form, the movements would not please a Tai Chi master but are quite fascinating to watch.
Electronics
The circuitry is minimal with the usual program I/O resistors and a LED20 with pull up and capacitor. To allow the use of on board alkaline batteries there are two 1N4001 diodes to drop the volts to the 20X2. Servo inputs are fed via 330 ohm resistors from the 20X2.
The main issue is cable management. The lower servo leads will not reach the top of the leg so there is a wiring concentrator above the knee where three inputs and common power transfer to ribbon cables. The circuit boards use bell wire on copper tripads, unfortunately no longer sold by Maplin. Ribbon cable, connectors, headers and crimp pins from Hobbytronics.
Normally running via an umbilical for programming and sertxd diagnostics, power can be similarly supplied from rechargeable AA batteries. Carrying such batteries proved too much as they are considerably heavier than alkaline. Ordinary single use AA batteries could be carried but would have to be arranged singly on each thigh and shin. Duracell Ultra single-use AAA batteries will supply the servos and can be carried on the thighs in pairs. This extra weight greatly changes the balance points so many symbols have had to be redefined.
Construction
As my introduction to Picaxe was via a project to build intelligent scale model heritage trams to run in the garden, I had the necessary tools to make the model in wood. Available from model shops the 2mm 5-ply is stable and easy to work using jewellers saw and white glue. The spare servo accessories make the bearings, clamped through one piece onto the other using No 2 6.4mm self tappers from Modelfixings.
3D design using Sketchup allows checking for clashes of parts in different positions. This is in the Warehouse - search for 9g Tai Chi. Interestingly, someone has a Sketchup design for a walker that is to be 3D printed.
Servos
Servos from hittime_3C in Asia, arrived within a week. Model shop K&S 1.19mm brass rod links are a good fit through the servo arm holes. Generally the slop in the links is proportionally less if the radius of rotation is greater. So using the longest arm is best if the mechanical advantage allows. A design difficulty was making provision to change out a servo after build; much easier to wrap the construction around and cut it out later!
What were the techniques to make success possible?
Firstly mechanical advantage. Like a pulley system if the servo can rotate further than needed then more torque can be attained at the expense of rotational angle. The footplate rolls over to move the centre of gravity onto one leg. Here maybe 15 degrees left or right is needed and therefore an improvement of 4 or 5 times can be made if a suitable linkage can be designed. The first two designs were discarded and in the current one the planes of movement of servo arm and fulcrum are different. Perfection still to be achieved but the foot is now strong enough to hold.
Second problem was the knees. Collapsing forward looks painful but is easily fixed with a mechanical stop. Collapsing backwards causes a number of servos to attempt to recover and the resultant current draw drops the battery supply and the Picaxe browns out. The knee needs a lot of rotation so only a bit of help possible via mechanical advantage. However, with the leg straight the servo arm can be arranged to be almost in line with the linkage such that the servo can move the link but the knee cannot.
Thirdly the legs move forwards and backwards at the ankle and serious help is required to support the weight above. The solution involves a peg on the footplate and a detent at the bottom of the leg. Rolling the foot engages the peg. The angle of the ankle and the position and shape of the peg have to be determined by experiment but, using the interpolation routine, the peg and detent can be in the right place at the same time. With the ankle thus locked the weight above is supported on the rolled foot.
If the model is in balance then the servos do not need constant refreshing with positional information. The irritating chittering can be turned off between moves. They are slow to move under load sometimes so the pulsout commands stop after a dozen chances to attain the correct position.
Program
Hopefully the program comments will assist but some experiences to note: Originally planning to use the send function of the terminal emulator and having missed the 330 ohm resistor to a servo, I thought I had blown the chip. A couple of days researching the problem and completely remaking the circuit board I vowed never to use serrxd again. Only a finger in exactly one place (not a pull up, pull down nor capacitor) would allow a reset to resolve the internal Picaxe conflict. Fortunately the use of the Kingavon BB-TV154 remote (from Electromart) was an improvement anyway.
The stored postures in scratchpad memory can only be transferred to main program manually. They appear on screen in CSV format but, unfortunately, the terminal emulator does not support cut & paste. Print Screen is still a useful backup in case the servos brown out the 20X2.
The real problem that was being examined was one of language. How to explain to a robot what is required and how best to understand the information available from the robot. Using symbols does help to separate changes to servo values from higher level instructions but you cannot force the robot to do something impossible just by defining a symbol. The learning process turns out to be both ways!
Video Clip
A two minute clip of the demo sequence (turns and moves forward and back) in the program can be found at https://youtu.be/imq0HPXiQmM.