gump

Final Report
 
 
 
 
 

Marc Binette
mbinette@ee.ualberta.ca

Lambert Lo
ltlo@telusplanet.net

Ralph Nevins
ralph@ee.ualberta.ca

EE552
April 6, 2000


The project and the contents of this report are entirely the original work of the authors except the VHDL code for 6805 processor taken from Roth text.[4]


Abstract

A crawling autonomous vehicle, "Gump", was created. The vehicle is comprised of a platform with two wheels and two limbs. The position of the limbs is monitored and positioned by servo Pulse Width Modulation control and the tilt of the platform is measured by an accelerometer mounted on the platform. Different gaits were created to allow movement.


Table of Contents

Achievements *

Description of operation *

Data Sheet *

FPGA Logic Cells *

Results of experiments *

References *


Achievements

The project has been compiled, simulated and implemented in hardware. We had wanted Gump to walk in several different gaits with at least one being a smooth walk with feedback from an accelerometer. The final hardware does achieve all of these goals. It was decided to make three forward and one backwards walking gaits where only one of the forward gaits uses the accelerometer. If an object is detected in front of the robot by its antenna, it stops and waits for a command (i.e. reset or change gait).

Initially, we planned to have four additional accelerometers (two per leg) but due to time constraints they were not put on the robot. Two of the four have been left in the VHDL code to accommodate future expansion. With less accelerometers the processor's knowledge of where the legs are at all times is lower but the accelerometer mounted on the platform allows any errors to be corrected.

It would be quite simple to make any number of different gaits using our design. All that would be required is a little knowledge of assembly language and the proper compiler.


Description of operation

The group has attempted to make simple crawling autonomous vehicle with a smooth crawling/walking motion. The device has a load bearing platform to haul the FPGA with room to mount a small battery. Each actuator or leg is set in motion by two [1]Hitec HS-300 Servos. One servo controls the hip/thigh and one controls the knee/calf section. The accelerometer is the ADXL202 from Analog Devices[2] and is attached to the platform. Only the x-axis component of the accelerometer is used so the chip is set at an angle on the platform to give us the maximum change in the output pulse width.

Servo controller

The servos have a digital control line which must be pulsed every 16.384ms. The minimum pulse width for the servos is ~ 1ms, which corresponds to 0 degrees, and the maximum pulse width is ~ 2ms, which corresponds to 180 degrees. The pulses are generated using the servo_controller which has inputs load(four bits), data(eight bits) and clock. The load input selects which of the servo’s four 8-bit hold registers is to be loaded with the data input. A twelve bit counter increments on every leading edge of the clock and has an overflow output. Every time the counter turns over, the overflow goes high and the data in the hold registers is loaded into a second set of registers. These registers, with "0001" added as their most significant four bits, are then compared to the counter. When a register (plus the four added bits) is larger then the counter, the output is high. The outputs from the comparators are then put through D flip-flops to take out any glitches before being sent to their respective servos. The counter also outputs it's four most significant digits which are used by the processor for timing.

Accelerometer output

The accelerometer has a digital output that varies it's pulse width with the tilt of the platform. To read values from the accelerometer there is a counter and a register. The counter starts to increment on the accelerometer pulse's leading edge and then stores the count value in a register on the lagging edge. This value is used to determine the length of the pulse.

6805 processor

A significantly modified 6805 processor [4] was constructed to implement our walking algorithm. Modification of the 6805 code was necessary as the code from the Roth text [4] used tri-state logic and include some features that Max Plus II did not support. The processor has 128 bytes of ram and 1024 bytes of ROM. A diagram of the memory map is in appendix 5. The walking algorithms used 800 bytes of ROM. External ROM could easily be added to the design to allow for more complex walking algorithms.

Walking Algorithm I

The first walking algorithm begins with the left leg extended and the right contracted. The gait is split into two sections, the first is the left leg contracting and the right leg extending and the second is the right leg contracting and the left leg extending. Each of the sections is split further into smaller steps to allow the processor to check if the platform is still level. As the calves are contracting, if the platform becomes non level then a small adjustments are made to the contracting leg’s thigh servo until the platform is again level.

Walking Algorithm II

The second gait implemented extends the left leg, then extends the right leg and finally contracts both legs at the same time. The next time through the right leg is extended first and then the left leg before they are both contracted. This gait does not use the accelerometer for error checking.

Walking Algorithm III and IV

The third algorithm is similar to the first just without the error correction from the accelerometer information. The fourth gait is similar to the first gait in reverse and does not use the accelerometer either.

Avoidance Detection

Added to the design is a very simple avoidance detection system that stops the robot when a collision is detected. To detect collisions, an antenna, which extends in front of the platform, is attached to a micro-switch, which in turn notifies the processor.

Power Supply

A 12 volt 7Ahr battery powers the Altera board and the servos through two 5 volt LM309K regulators. Two regulators were used to minimize the noise from the servomotors being fed back to the logic portions of the circuit.

All schematics and block diagrams can be seen in appendix 5. All VHDL can be seen in appendix 3 and 6805 code along with pictures and block diagrams of the gaits are in appendix 6.


Data Sheet

Gump's Altera Chip

by: Marc Binette, Lambert Lo, and Ralph Nevins

Features

Designed for servo control with input from push buttons, dip switches and accelerometers

Multi-purpose design

Expandable ROM & RAM

General Description

The "gump" chip is a field programmable gate array chip programmed to include a 6805 processor[4], a servo controller and three counter/registers. The processor takes in values from the counter/registers and uses them to calculate what should be send to the servo controller. Every 16.384ms the servo controller outputs four digital pulses of widths of 1 to 2 ms. The default code the chip is loaded with was written to control the "Gump" walking robot as describe above. This code could be easily modified to produce different gaits or even to control different devices which use servos or any other device that requires periodic digital outputs.

Input/Output
 
Inputs (# of inputs) Purpose (using default software)
Clk (1) Clock
Reset button (1) Resets the walking algorithm.
Gait change button (1) Loads dip switch value into processor.
Dip switches (7) Correspond to different gaits.
Accelerometer values (5) Pulses used to measure the position of the accelerometer.
Outputs (# of outputs)  
Servo control lines (4) Outputs digital outputs of widths 1 to 2 ms every 16.384ms
LED outputs (16) Outputs accelerometer data to LEDs

Timing

Internally processor runs at 1.57MHz with an external clock of 25.175Mhz.
 



FPGA Logic Cells

The Altera EPF10K20RC240-4 has a total of 1152 available logic cells. The whole project used 97% of the logic cells available, and 35 lines of I/O. As mentioned above this included inputs from two leg accelerometers and their associated data capture clocks / double buffers which we have not implemented in our design. This allows our design to be easily upgraded to contain the two additional accelerometers and thus have more feedback of the position of the legs. The processor took up a majority of the chip at 76%. This included 128 bytes of RAM, and 1k bytes of ROM. The servo_controller used about 11% of the logic cells and the servo counter/register, digital I/O and accelerometer inputs used the remaining 10%.



Results of experiments

Mechanical Restraints

The mechanical motion limited the gaits that could be implement. In order to find the legs’ boundaries, a simple program (joint2.asm) was written that allowed us to change the servo values using the dip switches. From the results of this program the maximum and minimum values that each servo could move to were found. The code for the joint2.asm program is in appendix 6.

Accelerometer

Only one coordinate axis of the accelerometer was necessary in the design because only the information about the forwards and backward tilt of the platform was needed. To find the maximum change in the one axis we experimented with having the accelerometer at different angles while running the tilttest.asm program. Tilttest.asm simply outputted the value of the accelerometer to the LEDs. It was found that the biggest change in the x-axis occurred with the chip at approximately a 45 degree angle. The code for the tiltest.asm program is in appendix 6.

Processor Carry Problem

When testing of the walking algorithms began it was found that the processors code was not entering all of its subroutines. In order to test that the processor was functioning correctly a program (branch2.asm) was written. It was found that the error was caused by a problem in the VHDL code for the processor. The code for branch2.asm is in appendix 6.

Compiler Problem

In the course of testing the initial 6805 compiler was found to be faulty and produced bad absolute addresses in jump and jump-to-subroutine opcodes. This was initially thought to be a processor bug until a fine-grained simulation was done, analyzed and proved to be correct function. Using a different compiler cleared this roadblock.

Floating Input Problem

An interesting effect of leaving input lines floating was observed. The two interrupt service input lines were left open and floating, which caused a undetermined lead time of the processor "hanging" prior to acknowledging the reset button. Once the input lines settled (up to 15 second) low the processor would function. The interrupt lines were tied to ground which solved the problem.

Servo_controller glitches

When the servo_controller outputted a pulse longer than the minimum (~1ms) there were glitches in it due to the comparator. To solve this we put in D flip-flops, which load on the 4 us clock. This easily solved the problem because the glitches were just a few nanoseconds wide.
 
 

Notes:

[1]

Hitec HS-300 *Torque:49 oz/in @ 6.0v *Speed:0.17 seconds/ 60deg @ 6.0v *Weight:1.6 oz *Size:1.6 x 0.8 x 1.4

References

[1] http://www.hitecrcd.com/servos/hs300.html

[2] http://products.analog.com/products/info.asp?product=ADXL202

[3] Todd, D.J., "The Origins of Energy Losses," Walking machines : an introduction to legged robots, Korgan Page Ltd., London, 1985, pp. 45.

[4]Roth, Charles H. , Digital Systems Design using VHDL, PWS Publishing,1998
http://www.brookscole.com/engineering/ee/roth.html

Motorola, M6805 HMOS M146805 CMOS family Microcomputer/Microprosseor User's Manual, Prentice-Hall,1983

D.J. Todd, Walking machines : an introduction to legged robots, London : Kogan Page, 1985.

Marc H. Raibert, Legged robots that balance,Cambridge, Mass. : MIT Press, 1986.

Shin-Min Song, Kenneth J. Waldron., Machines that walk : the adaptive suspension vehicle ,Cambridge, Mass. : MIT Press, c1989.

A. Morecki Biomechanics of engineering : modelling, simulation, control, Wien : Springer, c1987

M. Vukobratovic, M. Kircanski.,Kinematics and trajectory synthesis of manipulation robots, Berlin ; New York : Springer-Verlag, c1986

A.J.Critchlow, Introduction to Robotics NewYork Macmillan,1985

 


To see a Static example of the gaits click  walk1.htm



 
CODE
VHDL Tar
ASM Tar