Let's Make Robots!

Wall Following RC car using 16F887

kenjones1935's picture

Here are two videos of my hobby level radio control car following the wall around a room.  This car uses channel 3 of the radio control system to toggle between RC control and autonomous control.

http://video.yahoo.com/watch/7184507/18716445

http://video.yahoo.com/watch/7169550/18673820

The idea is to hook middle school kids (USA grades 7th and 8th.  ages 11 - 14) into Science, Technology, Engineering and Math.  This offers the speed and excitement of RC car
 racing, the trial and error of RC race car design plus the clear thinking and discipline of computer programming.

 
 THE COMPETITION:  A car race.

 Build an oval race track on a polished wooden gymnasium floor defined on the inside by
 cardboard boxes large enough to echo back a SRF05 sonar proximity detector's signal.

 The race is to lap the track, say, six times;  three by radio control;  three by autonomous control.  Either time trials or multiple cars at the same time.  If the race has multiple cars on the track at one time, some more work must be done on the car to avoid collision.

  I will design and build a PIC kit that attaches to almost any RC car that has Electronic Speed Control (ESC) driving the wheels and a servo driven steering mechanism.  It will use the car's 7+ volt battery, knocked down to 5 volts by the ESC.  There must be a third channel on the RC system to tell the car who is boss.

 I need to borrow, steal, or design a microcontroller programming language that forces the students to think about the signals from the front and side facing sonars and create the corresponding commands to the wheels and the steering.  Presently the 16F887 compiler runs on a WINDOWS PC and communicates to the car via special hardware connected to the USB port.  (Available from MicroChip Inc.)

----------The post below seems to be way ahead of me----------

Author: bendjamin
| Title: I made some similar robots a

I made some similar robots a while ago.  I'll try and post a video of them.  They are designed to race around a track, in other words they are doing wall avoiding so when you make a track with walls on the inside and outside they will go around and around.  I made the robots myself, they are differential steering with a body made from laser cut polycarbonate.  I used the sharp IR rangefinders for navigation and have four on each robot, two forward facing and two side facing. They also have four bumber switches, one pair in front and the other at the rear.

| Link: http://letsmakerobots.com/node/696#comment-43464

What do you all think?

 Ken

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kenjones1935's picture

It has been a while. Some local 'education' folks have taken an interest in my project. This is good.

Here is a new video. It amply demonstrates what happens when we cross the line from 'code inside a PIC' into the 'real world'. The third segment of the video shows that 'simple' threshold adjustment linear with speed adjustment is not enough. We also have control loop bandwidth issues. Looking closely at the behavior and knowing what I know now I think the intermittent problem was the 7.2 volt battery connection.

http://www.youtube.com/watch?v=eGejd1N_Qcc

rik's picture

Excellent progress Ken! That second run has some decent speed and good control! Nice work. Success with your endeavours with the schools.

kenjones1935's picture

I have not been doing well getting our school systems interested in my robocars.  I have no corporate envelope.  Our public schools, by state of Massachusetts mandate, must focus on readin',  writin',  and 'rithmetic.  There is no place in the school day for investigating 'how things work'.  I get the feeling that maybe the 7th and 8th grade faculty members are intimidated by my microPIC's etc.

Meanwhile I am tuning the model car a bit more and plan next to bring the toy car up to standard.

Ken

OddBot's picture

Schools and education systems can be very narrow minded and always blame the budget.
My country has similar narrow minded fools views.

You need all three to write a program. You need all three to design your circuit.

This is why I came to China. They want good education in China.

kenjones1935's picture

OddBot,

The American name of the company that makes my radio control cars is HPI Racing.  My understanding is that it is a Chinese company.  I have been thinking that they might be interested in my project.  The American marketing arm seems totally incapable of answering my questions.

Where in China have you settled?

Ken

kenjones1935's picture

Hello everyone,

If I do not make it onto LMR live today, I want to show you what I have been up to on 'real' television.

Go to:

  http://prometheus.fatv.org/media/1273/Inside_Fitchburg_10511/

It is an hour long show.  I am the guest for the 2nd half which starts at 23:22 minutes.  You can skip the first part if you are not interested in how we will acknowledge this  year's Martin Luthar King Day here in Fitchburg, Massachusetts.

Ken

kenjones1935's picture

Happy New Year all.....

I have added another video to this thread's head pages.  It shows the performance of the 1/10 scale TOY car and two versions of the 1/10 scale MODEL car.

It shows the TOY and a MODEL racing.  The lap counter (me) is lacking, but I think the excitement and the attendent appeal to middle school kids is evident.

http://www.youtube.com/watch?v=swYQBZSgtJg

Ken

Korel's picture

Very interesting and educationnal but hard to control I think. I have 3 RC chassis with the back dc motors and dc steering motors but I don't know what to do with them yet. Watching your videos, it seems like when the car is too fast,the sonar's response is too slow. The steering is a 3 states only (left,right or center) not analog. Is there a way to control the speed and steering variations? Would an Arduino board be able to do this? Thanks for posting your great videos and comments and keep up the good work.

kenjones1935's picture

Korel,

I have found a couple ways to deal with the simplistic controls of toy level cars.  Mine have bang bang servos for steering and straight DC motor control for power.

The driving wheels have three states, full power forward, full power reverse, no power at all.  They have a spring which returns the wheels to neutral - not very quickly nor very accurately.

The steering I modulate by giving little bursts.  Toys have no caster effect and no toe in.  I found that it helped to 'kick' them back to straight.  To turn left I give the servo full power left for 150 milliseconds then I give it 100 milliseconds right (which gets them back to neutral)  then nothing.  What this does is put the wheels in full left for a fraction of a second then kicks them back to neutral.

I am planning a video that connects my BASIC code with the car's behavior.  I hope to have it up tomorrow or Friday.

The model level cars have pulse width modulation control systems.  The Microchip 16F887 provides PWM output.  All that I had to do was to calibrate the systems.  The other advantage to the model level car is an isolated radio receiver the output of which my PIC can control.  This allows me (by turning ON and OFF the transmitter) to toggle which device is in control.

Good luck,  Ken

 

Korel's picture

 

Thanks for your kind and fast reply. My toy car and trucks with big wheels that works the same way as yours,steering and motors. There are a few nodes here on LMR that I saw which gave me a few hints too. PWM and motor drivers seems to be the thing for control. I was thinking of replacing the bang bang steering with a servo and accurate linkages. Here are a few pictures of what I have. One of the truck still have the electronic but no transmiter. Take care my friend happy new year and all the best.

Korel