www.sjwaller.com

Robotics » Quadru-Pet 1

Quadru-Pet 1 – Part 4 – gait testMarch 23rd, 2010

After waiting for what seemed like an eternity my servos finally arrived in the post!! This has enabled me to put my Quad back together and start working on the gait programming. Here is a quick video to show what I’ve done so far.

Creep Gait

So in the video you can see the robot creeping forward. This type of gait is pretty much the same as what your cat does when it’s creeping up on something … slowly moving one leg at a time while making a stable tripod with the other three legs. I found Oricom Technologies NICO project a really useful resource whilst researching suitable walking patterns for my quad. There is a ton of really useful stuff but most of all the timing diagrams came in really handy. In order to implement the timing I wrote some code to produce trapezoidal curves over the course of a set period of ticks to produce the ‘y’ value for leg lift and ‘z’ value for travel:


        while (tick < period) {
            if (tick >= this.a && tick < this.b) {
                double AX = this.b - this.a;
                double BX = this.amplitude;
                double AB = Math.sqrt((AX * AX) + (BX * BX));
                double angle = Math.asin(BX / AB);
                y = Math.tan(angle) * (tick - a);
            } else if (tick >= this.b && tick < this.c) {
                y = this.amplitude;
            } else if (tick >= this.c && tick < this.d) {
                double CX = this.amplitude;
                double DX = this.c - this.d;
                double CD = Math.sqrt((CX * CX) + (DX * DX));
                double angle = Math.asin( CX / CD);
                y = Math.tan(angle) * (d - tick);
            } else {
                y = 0;
            }
            yield(y);
            tick++;
        }

... where 'a' is the start of the rise, 'b' is the maximum, 'c' is the fall of the rise and 'd' is the end of the rise.

I then used Inverse Kinematics to position the feet where they fall on the timing diagram. I based the IK on the algorithm described on the Learn About Robots website - but had to modify it so it would work in 3D. My next task will be to incorporate the body physics into the IK routine which will allow for tilt and twist (as per the original Phoenix hexapod code). This will be essential as I plan to invest in a gyro/accelerometer for balance compensation at some stage in the future.

Light & Sound

I'm using a small piezo speaker controlled by my arduino for the amazing sound effects! So far there is a few beeps when the robot finishes the setup routine and a repeated beep when it encounters an obstacle. I was also sent a free RGB LED from the good folk at oomlout.co.uk which is responsible for making the robots colourful expressions.

Sensors

The only sensor I have at the moment is a Sharp Infra Red detector. This generates a voltage representing the proximity to an obstacle within a range of about 10-30 cm. I'm not doing anything exciting when an obstacle is encountered at the moment aside from stopping the robot in his tracks and flashing the LED purple. I could perhaps sweep the sensor left to right and decide which way to turn to avoid the object - but I think I plan to use sonar for general obstacle avoidance instead. The IR sensor could then be used to detect any sudden drops in front of me or if the robot has somehow left the floor (ie - stairs or picking it up).

2 Responses to “Quadru-Pet 1 – Part 4 – gait test”

  1. Tony.Bournemouth. says:

    I liked it Stew.whats next ?

  2. Hila says:

    Hello My name is Hila, i have very interesting in your applications. Greats work, but I’M at the first explerience with quadrpod and i need help with source code. I have arduino 2009 and ssc-32 but i need help code if u want pass me the code i have very happy for this and i many thank for you. Thanks Hila

Leave a Reply