If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.
Special Thanks To:
Aaron Holmes
Aaron Wheeler
Adam Horden
Alan Scrimgeour
Andre
Andrew Haynes
Anonymous000
asabase
Austin Weil
barney
Barry
Bert Hickman
Bill Kukowski
Blitzorn
Brandon Paradelas
Bruce Bowling
BubeeMike
Byong Park
Cesiumsponge
Chris F.
Chris Hooper
Corey Worthington
Derek Woodroffe
Dalus
Dan Strother
Daniel Davis
Daniel Uhrenholt
datasheetarchive
Dave Billington
Dave Marshall
David F.
Dennis Rogers
drelectrix
Dr. John Gudenas
Dr. Spark
E.TexasTesla
eastvoltresearch
Eirik Taylor
Erik Dyakov
Erlend^SE
Finn Hammer
Firebug24k
GalliumMan
Gary Peterson
George Slade
GhostNull
Gordon Mcknight
Graham Armitage
Grant
GreySoul
Henry H
IamSmooth
In memory of Leo Powning
Jacob Cash
James Howells
James Pawson
Jeff Greenfield
Jeff Thomas
Jesse Frost
Jim Mitchell
jlr134
Joe Mastroianni
John Forcina
John Oberg
John Willcutt
Jon Newcomb
klugesmith
Leslie Wright
Lutz Hoffman
Mads Barnkob
Martin King
Mats Karlsson
Matt Gibson
Matthew Guidry
mbd
Michael D'Angelo
Mikkel
mileswaldron
mister_rf
Neil Foster
Nick de Smith
Nick Soroka
nicklenorp
Nik
Norman Stanley
Patrick Coleman
Paul Brodie
Paul Jordan
Paul Montgomery
Ped
Peter Krogen
Peter Terren
PhilGood
Richard Feldman
Robert Bush
Royce Bailey
Scott Fusare
Scott Newman
smiffy
Stella
Steven Busic
Steve Conner
Steve Jones
Steve Ward
Sulaiman
Thomas Coyle
Thomas A. Wallace
Thomas W
Timo
Torch
Ulf Jonsson
vasil
Vaxian
vladi mazzilli
wastehl
Weston
William Kim
William N.
William Stehl
Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Registered Member #952
Joined: Mon Aug 13 2007, 11:07AM
Location: Finland
Posts: 388
I decided to post my little non-HV side project, a walking robot.
I still don't have a website of my own, so this post is written in quite good detail. However, there's also a shorter description for those who don't want to read all the technical stuff.
Short explanation The robot is controlled by a ATtiny2313 microcontroller, which can be programmed from a computer. ATtiny2313 seemed quite a good choice for the purpose because of its low price and a 16-bit timer with two outputs capable of doing a PWM signal -> just enough to control two servo motors. The robot moves forward by moving its legs as pairs (front legs, rear legs). The legs are moved by regular RC model servo motors. The controller sets the positions of the servos with a PWM signal.
Youtube video:
In detail
Electronics The circuit board in the picture above is the brain of the bot. Notice that there are quite few components on the board. I like Atmel AVR microcontrollers quite a lot, because they don't need too many surrounding components. In fact, even the resistors could be left out. They're there to protect the parallel port from getting damaged in case something shorted out on the circuit board. Notice the black connector. It is the programming connector. I didn't want to include a big parallel port connector on the board, so I made this kind of a programming cable: It connects the 5 pins needed for programming to the right pins of the parallel port. They can be seen in the schematic below. There's nothing special about the schematic. The usual colour coding of servo motor cables is: red: + black: - yellow or any other colour: PWM
Mechanics The chassis of the robot is made out of plexiglass. I chose it mainly because it looks cool, but it also provides a solid base for mounting the servos. It was quite easy to machine. Bending was done by heating it with a hot air gun.
The legs are made out of coat hangers. My leg design is far from optimal, but works well enough for me. The legs are attached to the servo shafts like this: Notice the blue heatshrink tubing in the tips of the legs in the first picture. It is needed to prevent the legs from slipping. They still slip a bit so perhaps I'll have to invent something better.
Programming interface One advantage of the AVR chips is that they can be programmed while they're in their actual circuit. So no more need to take the chip out of its socket for programming. In this project I am using 'dapa', direct parallel port programming, which is quite outdated but still works well. I tried serial programming, but it ended up with some verification errors, maybe caused by my USB-to-serial programmer. There are a plenty of different interfaces for programming AVRs. Ladyada has some excellent articles about programmers and programming: The whole AVR tutorial is also recommended reading.
Actual programming and firmware So how do you actually program a microcontroller? First, you need to choose a programming language. If we are going to use open-source software, we are limited to C and asm. C suits well for this purpose because of its easily understandable syntax and effectiveness. We need a special compiler, called avr-gcc. Linux users can just install packages avrdude, binutils-avr, avr-libc and gcc-avr from the package repository. Windows users will have to download and install WinAVR which should contain everything you need.
What does real AVR code look like? Here's an example:
This is what it's all about. Registers and bit manipulation. Don't be scared by the cryptic letter combinations, they will be all explained in the ATtiny2313 datasheet. It really isn't that complex at all.
]Download the source files[/file]
So how do you control a servo motor? A servo motor needs a 50Hz PWM signal with pulsewidth varying from 1 to 2 milliseconds. 1.5ms is where the shaft is at its center position, 1 and 2 ms are the extreme positions. So all that the program has to do is to rotate the servos from side to side.
The sourcecode has to be first compiled with avr-gcc. Then it is converted to Intel HEX (ihex) format with avr-objcopy. Then the hex file, containing the firmware, is uploaded to the chip with avrdude. I've wrapped this procedure in a makefile, so anyone building this robot won't need to worry about that part.
Did you read this far? Congratulations! Now go to build your own robot, it's pretty easy and a great fun.
TODO
better grip for the feet
improve walking routine
I am currently developing light sensors for the robot, so it can be programmed to be afraid of light or seek light, you decide
Banned on 3/17/2009. Registered Member #487
Joined: Sun Jul 09 2006, 01:22AM
Location:
Posts: 617
Hey that's cool, I used to be all about this kind of stuff. Pretty much were I started in electronics. Mine were mostly BEAM though.
I see you already got heat shrink on the feet. What I used to do is bend the ends of the legs backward so they are kind of like barbs and will dig in more when the bot pushes back but wont get stuck when moving the other direction. If you know what im trying to say. I can post a pic later.
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.