Wall Following RC car using 16F887

Ome successes

icon10.gif

Some successes

Mucho frustrations followed by some successes. The PC board proto challenge is beyond me for now. Created instead a car that toggles itself between radio and PIC control without using a third radio channel and negotiates a maze that includes both right and left turns.

The auto toggle is a function of the car being out in the clear - not in or too near the cardboard maze. The right and left turns were pretty obvious after numerous stupidities.

I hope to post a video next week.

Thanks again for all your support.

wink.gif



Ken

Prototyping question…

I have successfully prototyped my radio control and/or PIC control car.  I now need to make a reasonable protokit.  I would like to use the basic PICkit 2 board and add another that carries three sonar sensors, a relay, a MOSFET and a 5volt VR.  The easiest way to reach the second board is with J or JR connectors.  I would solder the headers into the holes that line the lower edges of the PICkit.  Trouble is the J and JR that I find are 0.1inch centers.  What are the centers of the PICkit board? Is there a connector header that fits?

Ken

Hey, Ken. Have you had a

Hey, Ken. Have you had a look at Frits’ Wall Racers?

https://www.robotshop.com/letsmakerobots/node/928

Yes, It was from frits that I got my idea

There are a couple basic differences between my car and Frits’

First and formost I can switch between radio control and  PIC control using channel 3 of the radio system.  I use Pulse Width Modulation because I am using the electronic speed control system to drive the big DC motor.  I am pretty sure that this negatively increases the response time when the PIC is in charge.

I am glad you reminded me of Frits’ idea.  I am having a problem kitting my car appropriately for middle school students.  My car is model level.  Frits’ is a toy level.  The difference is $200.00 vs $25.00. 

Considering how easy (for smaller and younger hands than mine) it is to build the Frits design I should seriously reconsider my approach.

Thanks for reminding me.

Ken

Parameter tuning

Tuning the distance parameter like in your video is a recurring task in most navigation algorithms. No amount of planning, designing, modelling of simulating can do that for you. That single number has to be determined in field tests.

And that’s why most of my createions have at least one potentiometer on board. I read it through an ADC input port and calculate a reasonable parameter from that. It saves me a lot of hooking up / reprogramming / retrying.

If not for tuning, I use the potmeter for switching between modes of behavior. Values 0-63 are mode 0, values 64-127 are mode 1, etc. I always have one mode reserved for “Sit still, I want to pick you up without you biting me!”.

Yeah, I could see you were

Yeah, I could see you were going down a different path. I love the idea of being able to switch back and forth via one of the RF channels. I’m actually considering something similar for my Yard Gnome project.

Good luck with your project. It’s great to see people working with kids and students.

I’ve got a servo steering problem.

Guys and Gals,

I have a new problem.  I am trying to go from a hobby level car to a toy level car.  The purpose is to reduce the cost of kitting for school students.  In addition to reducing the cost DC control of two wheel drive makes it easier to implement the sporty racing-like skid steering Frits used.

I purchased (at K-MART) two 1/10 scale toy cars on sale for $25.95.  Original price about $50.  The 1/10 size gives me more room for adding microchip electronics.  I figured the wheels and the steering would be driven simply by DC  with reversing current.  Frits’ DPDT relays controlled by PIC are easy to implement.

WRONG!  The steering servo contains both a DC motor and an angle measuring device which is read by the electronics that comes  with the car.  A total of six wires go to this servo.   Where can I read how this works?  Should I just go back to the store an buy ‘proper’ toy level cars?  Your suggestions would be greatly appreciated.

Ken

Sudden realization

Toggling between autonomous control and radio control is much more complicated for the toy level car than for the hobby level car.  Why?  Toy level drives the steering servo and the wheel motor each with DC  in both directions.  This requires four wires.  There is no common ground.  Hobby level cars use pulse width modulation signals for these two jobs.  Only two wires are required.  The grounds are common.

Toggling between PIC and R/C in toy level requires switching eight wires - four from the radio receiver and four from the PIC.  The same operation on PWM wires requires switching only two wires.

Hmmmmm…  That’s a pretty good argument for sticking to the expensive machines.

Ken

 

 

I think I have a prototyping plan.

icon7.gif

A major break through - I hope…

Here is a proto board that will carry all my parts and then some. Each board has two rows of 62 pairs of bussed 0.1" centers pin holes.

http://www.circuitspecialists.com/prod.itml/icOid/6888

I need 20 paired pins for the forty pin 16F887, 48 paired pins for the 6 sixteen pin DPDT relays, 7 paired pins for the fourteen pin SN7407, 6 isolated pins for the USB device and three isolated pins for the 5v regulator.

The board is 6 and 1/2 by 3 and 1/8 inches. That fits fine on my 1/10 scale hobby level SPRINT (the belt up the middle driving the front wheels is a problem that can be overcome) and my toy level 1.10 and 1.12 scale toy cars.

Is that a plan, or what?

cool.gif



Ken

Printed Circuit vs Solderless technologies…

New unexpected problem.

I have not been able to find socket headers that are compatible with the solderless proto board technology.  All the headers are designed for PC use.  This makes it very difficult to connect my six pin 0.1" centers USB connector device.  It also makes it difficult to connect the servo PWM three pin cord, the Electronic Speed Control three pin cord, and the connectors needed for the radio receiver three pin male headers.

I could cut and strip six 1/2" #22 lengths of solid #22 gauge wire and stick then into consecutive holes.  The female connector would come in perpendicular to the board.
This is not as reliable as 90 degree square header stock, but what choice do I have?
Remember this is for middle school students.

Suggestions anyone?

 

Ken

Cheap vs easy conversion

I take it that this is a problem because you switch between modes outside of the microcontroller? Are you literally rerouting all these actuator wires from one control device to another (from MCU to RX)? Using relays?

The alternative would be to fix all the wiring from MCU to actuators and make the program do the mode switching. This requires that the RF receiver be wired into the MCU and that the MCU acts as a signal procesor during RC mode. This is doable, but probably more complex.

You’ve got it right

It all started with a hobby level car which has proportional control via the radio system.  This is done with pulse width modulation.  My design has the PIC create its own PWM.  These cars are about $200 apiece.  Too much, I thought, for schools.

You are correct.  I do the toy level car with DPDT relays.  Normally I must switch four DC signals just like fritsl did at the beginning of this discussion.  It requires four DPDT relays and a current source (SN7407) to drive the coils.  This was fine until I came across this toy level car with a  return activator switch built into the steering servo.  I think that will work fine if I keep those activator wires attached and powered per the orginal setup.  However, my attention has been diverted.

I have received some help from an organization vested in in the hobby level cars.  I am back to designing a solderless proto system for that design.  It only needs one DPDT switch to toggle between the two signals from radio channels one and two and the two PIC created PWM signals.

Thanks,

Ken

The Electronic Speed Control is messing with my mind

I received a brand new HPI Racing Sprint car.  This is the same model which I have been using.  It is just the most recent version.

I am having a problem with the new Electronic Speed Control a SC-15.  It has some kind of mind of its own.  My old code which told my old car where to go is not working with this new ESC.

Do any of you have the contacts to get me the specs on this “SC-15 ESC WITH REVERSE SPORT CONTROL”.

Does is have a PIC?  Is it programmable?  What are its design algorithms?

Ken

 

 

 

It’s working, but…

It  appears that these new cars suffer from “parsing” rules.

Things must be turned on in the correct sequence OR ELSE!

Here is my latest video.  The car is much faster and much more unpredictable. 

http://www.youtube.com/v/4oFTzyMuSjA

It ran for two minutes all on its own

 

This afternoon I taped a two minute video in which my new HPI Sprint car ran autonomously around and around the inside of our garage.  The radio transmitter was turned OFF during the whole episode.  At no time in this piece  did I interrupt the PIC control with the radio control.  I was operating the video camera.
 
Go to:
 
Imagine this at full RC speed on a middle school gym floor with other cars.  What do you think?
 
Ken

 

Next step in my project.

In order to get someone or something interested in helping make my robocar available to school kids I need a better quality video. I have two HPI Racing Sprint cars.

I have access to an outdoor street hockey rink. Same size and shape as ice hockey only asphalt covered for in line skates. I’m going to see if I can race my cars. Both on the track at the same time hugging the right wall going around turning left. One lap. The probability of the sonars getting their echos interchanged is remote I hope.

They can go up to thirty mph. Real speed - not scaled speed. My PIC may not be able to react fast enough. I create PWM signals using HPWM. The robocar’s reactions seem slower than my fingers on the trigger of the radio transmitter. This is going to be VERY interesting. You guys got any suggestions to add to the excitement?

Ken

random video tips

Some of these tips are also in About somewhere.

Plenty of light makes for better and prettier pictures.
Make your camera standpoint as high as your car is tall.
LMR logo and URL is cool. Having them in the backdrop (as opposed to video edited titles) is even cooler.
Use the Youtube tags to your advantage (and ours).

You were inspired by Frits’ project. Rip a few pages from his book. He knows what he is doing! Did you read about him putting a camera on a broom stick, so he could chase his cars around the room!?

Get a kid on skates holding the camera to follow the car. Better yet, let the car overtake the kid. WOOSH!

I know you don’t have a second car, but boy, that would make a big difference!

Maybe put some toys at similar scale in the video. Don’t be afraid to fake being a film director.

Camera mount on your car?

Edit short clips. Progressively shorter as the race goes on. Suggests acceleration. Edit a version you like to watch yourself, then cut it down to Youtube length. Post both videos anyway.

Maybe need to remember what I learned in college…

Did not work at all as planned…

Sorry for the delay. I have been discouraged. The new HPI Sprint R/C car has an ESC-15 that thinks for itself. The HPI manufacturing/sales organization refuses to give me the behavioral specs. This is a STEM educational project. Not a by guess and by golly exercise in inductive reasoning.

One solution is to make an ESC on my solderless proto board. (Complete with cooling fins?)

My PIC (like the R/C receiver) makes appropriate PWM digital signals. The car wheels want appropriate PWM bi-directional current pulses. Have any of you seen a design I could copy?

Ken

Those are great ideas

THANK YOU Rik for your video production ideas.  I do have a second car, but it is slower than the brand new one.  I now have a pot which defines top forward speed.

A minor set back.  Street hockey season is starting and the rink will get sandy and gritty.  I think I’ll return to some form of gynmasium.

Ken

need some new ideas…I think

icon7.gif

need some new ideas…

I think I have the ESC nailed. I have a procedure for powering up that seems to give predictable robocar behavior.

Do you all have some creative ideas for things to do with this little car? Right now it follows a wall counter clockwise looking down at a leisurely pace. High speed introduces response time problems.

redface.gif

Two sonar proximity sensors can be placed looking anywhere from the car and a pot controls the top forward speed.  Actually three sonars are available.  Trouble is they cost way more than anything else.

I can show you all the code if you like. It is crude, but it works.  PICBASIC PRO.

A thought!  My car, when standing still, can detect motion.  How about a relay race?

Ken