Autonomous 1:10 car
My aim for these holidays (ending at the start of March) is to automate a remote control car.
It's got an electric motor, battery, servo, reciever, and ESC (electronic speed control). I'm hoping to be able to replace the reciever with my mbed (and some electronics & sensors)
Parts so far:
- mbed NXP LPC1768 ($74)
- AVR Butterfly (left over from a uni project - $20 at student rate)
- Elexol USB I/O 24 DIP R ($126)
- Winstar WH1602A LCD module ($20)
- Accelerometer - Crodnet KXPS5 - 3 axis over i2c ($~50? I bought it a while ago)
- Distance - 3x Devantech SRF-2 Ultrasonic Range Finder ($20.95 each)
- Soon to come: Direction - Devantech CMPS03 Magnetic Compass ($49.50)
- 12 button Keypad ($9)
- 4wd HSP racing R/C car ($349)
- Breadboards + jumpers ($60)
- 1x KBee Module 1mW Wire Antenna ($28.50) (Need to buy another)
Total so far: $~850
- 3x distance sensors to avoid objects & map environment
- accelerometer to detect rolls/collisions
- compass to assist with tracking position
- display to show debugging information
- keypad for changing settings/modes on the fly
- wireless module and usb i/o card for
- recieving/sending data
- and controlling via laptop
Keep heading in a straight line (using compass) until distance sensors show objects ahead. Slow down as objects get closer. Turn towards the furthest object (prefer turning towards last found object, if car is past it). Map out a rough 2d array of the terrain. Display on laptop.
Stop if out of range of wireless signal.
Slow right down if accelerometer registers sudden acceleration in any direction (either hit something or fallen), or sudden direction change in compass direction (collision/sliding - rough terrain). Try turning one direction, see if compass shows change. Continue if it does, stop and display warning if it doesn't.
- Auditory feedback - siren or speaker with prerecorded sounds ("I have fallen over!", "You're in my way, move!", etc)
- GPS - for position tracking in large areas (park across the road, etc).
- Camera - for avoiding objects, remote navigation
- Control steering servo (Demo)
- Read keypad (See above demo)
- Read accelerometer (Demo)
- Print to display (See above demo)
- Read from a distance sensor (Demo)
- Read from multiple distance sensors at once (See above demo)
- Control motor - forwards & reverse (smoothly and steadily) & braking (Demo with camera outside in a week)
- Gear down car - start slow & carefully (no slower gears or boxes available - use PWM instead)
- Mount sensors & electronics on car (see photos below)
Currently working on:
- Write basic program to control motion
Soon to come:
- Buy IR sensors, distance & proximity
- Buy compass
- Read from compass
- Add compass navigation into program (as per logic section above)
- Investigate storage of data onto SD card or similar - build up map of environment & store
- Keypad button input to alter program in runtime
Fancy wireless stuff: (for later)
- Buy 2nd wireless module
- Connect laptop via USB to i/o board & wireless module
- Write program (VB / C / C++ ?) to control i/o board & wireless module
With the shell:
Front - ultrasonic sensors:
Basic forwards/backwards & steering
- Movement is jerky and inconsistent at low speeds.
- Full speed is too fast for inside. Try park? Waterproof electronics
- Neutral at 0.5. Forwards threshold is at around 0.53. Backwards is at around 0.43. Scale neutral down so forwards is more accurate?
- Smooth acceleration?
- Steering servo whines when held still - issue?
- Steering limits not at 0 and 1, but around 0.75 and 0.25. Test exactly.
- Ultrasonic sensors jumpy and unreliable at close range. Additional distance sensors required.
- Won't detect objects < ~20cms. Proximity switch/beam required
- Range sensors individually or use same beam?
- Mounting centre sensor off centre a problem?
- Sensor behind for reversing?
- Buy 3 IR distance sensors - no interference with existing sensors, 2 for front, 1 for behind.
- Try mounting sensors on servos & pan for more accurate object avoidance
- Store data of environment so won't repeat mistakes
You need to log in to post a comment