Project MAX


Create an autonomous vehicle that avoid obstacles using 1 proximity sensor and 1 servo.


Main components for the platform:

  1. Nikko Doge RC Truck from Fry’s ($15).
  2. SBC28DC PIC controller module from Modtronix.
  3. daughter board to interface between the module and other peripherals.
  4. servo.
  5. MaxSonar-EZ1 ultrasonic range sensor.

Additional tools:

  1. solders
  2. Microchip ICD2 programmer/debugger


I started working on this project in mid March ’09, and since then I have kept a record of my progress. Now, after achieving certain result, I want to share my experience online.

The project started as a machine vision experiment I want to explore though servo, range finder, and some programming. After reading some online article about amature autonomous vehicle competition, my objective took an off course ride and end up become this Project MAX – autonomous RC truck.

The project is still work in process, but I try to split it into different stage. Here it is…

Stage I: Create physical platform of the truck and interconnections.

The Nikko RC truck is very simple to control; it doesn’t have variable speed or steering. I took it apart and found the control signals.
Drive: +5V high.
Reverse: +5V high.
Left: +1.5 +5V high.
Right: 1.5 +5V high.

I solder the wires and decide to control them direct from the PIC digital I/O pins., since the I/O pins outputs +5VDC already. For the steering signals, I plan on using simple voltage divider to reach the +1.5V from the +5VDC output. I found out for some reason +1.5V does not drive the steering motor. So I use +5VDC to control it.
Here is the picture of the main control circuitry on the RC truck.

The daughter board sits against the PIC module. The daughter board act as a I/O boards for all the interconnections and power. In the future I am planning on adding GPS module and XBee module to monitor data wirelessly.
One thing I did not at account of is that, I did not think of spacing needed for ICD2 debugger connector to the PIC module.
img_14631 img_1464
Because PIC module sat inside of the daughter board, thus there is not enough height for such a big ICD2 connector. At that point, I had everything connected and soldered! So I had to take everything apart and start over.
Now I flush the ICD2 connector’s side on the PIC module with the daughter board. To do that, I rotate the PIC module 90 degrees to avoid the standoffs that was blocking the way.
Now the PIC module is on top of the daughter board and the voltage regulator is at the bottom. This gives easy access to the module, and protects the roughly connected breadboard and voltage regulator.
img_1518 img_1520

The servo is put in the front of the truck behind the bumper for protection, and it is secured by some hot glue. A challenging part is how to mount my ultrasonic range finder onto the servo’s rotation plate. I came up with using steel wires bended into some sort of stand. It is the cheapest way and allow me to adjust the sensor’s angle in the future.

So this is my current configuration. Now I have to work on the coding and avoidance logic.

Stage II: Develop logics to analysis obstacle and open space direction.

At this stage all the control logics are in place; the servo panning control, sensor ADC input, and truck maneuver control. Right now I am trying to write the logic where it will recognize at which direction is more spacious, and the truck will turn toward that direction.
There are a lot of project online about building a self avoiding robot. It is actually pretty simple with multiple sensors looking at different directions, mainly consist of 3 sensors looking at front, front-left, and front-right. The data from the sensors are discrete and allows simpler programming to determine the obstacle. It only need to compare among sensors’ output to determine which direction is not being blocked by objects. If all of them are blocked, the robot will backup and turn, and repeat.
It is much difficult to program a sensor with horizontal panning. The collection of the sensor’s data forms a continuous  line  resembling a 2-D machine vision.  Below is an example of what my truck is seeing:
White area is the object in the from, and the dark area is the empty space.  On the Top, the 1st row of numbers is the positions of the sensor, I extracted 10 data points out of the 90 degrees of the panning motion. The 2nd row of numbers is the range at each unit step position.
To determine which direction is more spacious, first I am using a smoothing method called Single Exponential Smoothing to get a more obvious trend line. Then I am going to try to figure out how to determine the slop of the “line”, and then with a positive or negative slop I will find the direction of the more spacious region.

To be Continue….

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: