Wall Following RC car using 16F887

Bang bang controls for toy level RC cars…

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

 

Sorry - a typo

I meant to say that the STEERING wheels have a spring which returns the whells to neutral - not very quickly nor very accurately.

Hi Ken

 

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

 

 

 

 

 

 

I’ve actually made three robots.

This morning I realized that I have actually made three different robots.  Three different RC cars with three different physical charcteristics dictated this.

First I built the 1/10 scale model level car based on an HPI SPRINT.  It has detailed miniature suspension and handling features, great speed, and proportional control systems based on pulse width modulation.  My PIC kit for this car is simple because the controls are digital signals.  All that is needed is the PIC and a DPDT switch.  The switch - under PIC control - selects which PWM signals (those from the PIC vs those from the radio receiver) go to the steering and driving electronics.  The PIC code is quite simple because of the car’s capabilities.  At $200 - $300 for the car and my kit this seems too expensive for our public schools.

Second I built a 1/12 scale toy level car.  This is the same as fritsl made only with a solderless proto board.  This car has bang bang controls.  It requires the PIC, the SONARs and four DPDT relays to steer the DC current into the correct connections.    It runs slowly enough for the PIC and the SONARs to keep it within reasonable behavior limits.  It can be stopped in mid ‘flight’  by turning ON the radio transmitter.  The price is right for our schools, but I feel the car is not fast enough nor exciting enough.  It is also too small to carry my KIT under the car skin.

Third I built the 1/10 scale toy car.  This car is much faster than the 1/12 scale toy.  It too has no proportional controls.  The added electronics kit is the same as the 1/12 car, but the code needed adjusting.  ie the 150millisec pulses.  I think the $50 car price is within budget.  My KIT is complex because of the four relays, but hopefully doable by a dedicated teacher and class.  The engineering is interesting because, as one of my videos shows, the behavior is a bit unpredictable.  Maybe if I had some help and a more sophisticated program ------

Ken

I wish I could help with the

I wish I could help with the code but it is not my strenght. What is the language of the PIC ?

As I can see you have some good skill working with RC cars. Relays for switching are not as good as pwm for smooth operations.

I will keep up your progress Ken and see what you’re up to. Take care.

Korel

New video - three robocars

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

My television segment is on Video On Demand

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

New video - progress and issues…

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

Pretty fast!

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

Thank you, Rik for your support

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