Self-Guided RC Car

From Hive13 Wiki
Revision as of 17:29, 3 September 2009 by Traylerphi (talk | contribs) (Next Steps)
Jump to navigation Jump to search

This is the wiki page for the self-guided RC car that TP is working on.

Overview

Background

Several years ago when I had the nerve to blow money on such things, I attempted to build out a '68 Volkswagen Beetle for The DARPA Grand Challenge. During that time I thought it would be fun to convert a small RC car for self-guided operation also. I bought the car from RadioShack for maybe $30, tore it apart, and promptly forgot about it completely.

Inspired by joining Hive13, and particularly a similiar RC Vehicle project that Paul is working on, I am now trying to actually build this thing (the Volkswagen was never finished either, but I've already sold it).

The Vehicle

Standard issue cheap piece of junk from Radio Shack. I believe it used to be some kind of truck maybe? Not very large.

The rear power motor is a simple brushed DC motor connected to a gearbox with two settings, high and low. I think the low setting gives more torque but don't hold me to it. The front steering motor is a smaller version of the rear motor. The front wheels are spring loaded, so the front end 'snaps back' to center when the steering motor is not being powered. The battery pack that came with the car says that it's 9.6V, but it consistently reads over 10V whenever I do occasionally get around to charging it.

Control

H-Bridge

Each motor is controlled by a simple transistor H-bridge, which allows a logic signal from a controller or something to turn the motor in either direction. I had meant to use power MOSFETs, but DebCo was out of the parts I wanted so I had to use BJT Darlingtons.

Chuck's Robotics Notebook has a nice tutorial on this kind of H-bridge, and my bridges are basically as shown on this page except for different transistor parts, a slight inversion with the NPN transistors, and my complete lack of motivation to use opto-coupling.


RC car bridge.gif

The most damaging thing you can do to an H-bridge is turn on both transistors on one side of the motor at the same time. This basically creates a short across the battery through the transistors and will quickly fry them. While in the schematic above it might seem that this is exactly what I'm doing, I swear I'm not. The PNP (TIP130) and NPN (2N6387) transistors activate at exactly opposite levels, so wired this way only one of each can possibly turn on at once. The H-bridge for the steering motor is identical in every way.

Sensors

For obstacle avoidance I'm currently trying to make due with two Sharp IR range sensors, which I bought from Hobby Engineering quite a while ago. These sensors have a range of about 2 feet or so and output a voltage from 0-5V based on the range to target detected.

Decision Making

Probably the only thing making this project unique in any sort of way is that at this point I'm not using a microcontroller. The algorithm for the car's decision making process is pretty straight forward, so for now I'm using discrete logic. The analog sensors are being monitored by comparators that fire a logical high when the voltage of the sensor reaches a predetermined level.

I'm thinking that the car should act in the following way:

Left SensorRight SensorAction
LowLowSteering Centered, Moving Forward
LowHighSteering to Left, Moving Forward
HighLowSteering to Right, Moving Forward
HighHighSteering to Left, Moving Backward

Based on this decision table, we get the following 'control' circuit:

Discrete schematic.gif

(Note that this diagram shows LS chips - I used HC chips. The 100K resistors would need to be lowered to maybe 10K if using actual LS chips. The difference is LS chips are TTL whereas the HC chips are CMOS.)

Current Status

  • The car has been built as described above and works - kinda. It works if you define 'works' as "Does what I told it to do." I am currently re-thinking the steering control system - always backing up to the left is less than ideal and the car keeps running into stuff with its tires.

Log

Aug 31, 2009

Built control circuitry. Tried to go to DebCo for some P-channel MOSFETs but they close at fraking 4pm!

Sept 1, 2009

Realized DebCo didn't have any P-channel MOSFETs for sale. Purchased transistors instead; re-designed and finished H-bridge portion of circuit. Demo'd car (as it were) at weekly Hive13 meeting; got some good feedback from other Hive members. I'm considering moving to using a PIC for control, possibly the PIC16F505, but others have expressed the opinion that this would lower whatever cool factor the car currently has going for it.

Current Issues

My stuff is perfect. Everything I do is wonderful. (Too lazy to describe all of the problems the car is currently having, so for now I'll just touch on them in the Next Steps section)

Next Steps

  • Figure out exactly which dust filled hole in the bowels of my apartment my digital camera has fallen into and retreive it so I can take some pictures.
  • Seriously consider adding at least one more forward sensor?
  • Re-position sensors to include the space directly in front of the front tires within their field of view.
  • Replace PNP Darlingtons with higher amp rated versions (low priority).
  • Rethink and hopefully improve steering control design.
  • Layout and solder finalized circuit.