Let's Make Robots!

Robot Wall Racers

fritsl's picture
Finds the hidden racing track in every room.. and races it!
Time to build: 
5 hours

UPDATE: Nothing new, just a small edit.


 

A video in better quality than YouTube & Google is here

How to make Robot Wall Racers yourself, see here

The car-chase was made by holding a camera on a stick, chasing the cars around. Some clips where made by placing the camera on a record-player. All editing was done in the standard "free" program that comes with a Mac, called iMovie. It is a nice program for light editing.. but phew, it was pushed to make this

The second video shows some work with the skid-turning. It also shows improved handling in general.

Notice how it sometimes mis-judges when the wall is not 90 degrees, but has bumps. But also how it handles getting out again :D (Me proud, love this, think it is cool, it drives so much better than what I can do with remote myself)

Of course I could just give it some more space to turn in the code, to drive more "safe", but I kind of like it to be tight :) And notice hw it never bumps into anything else - the polystyrene-blocks would fly right off if it hit them.

I have added an extra battery for more power.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Your home is a racing track, you just do not know it.

Look at your floor where it meets a wall.

Between 30 and 70 cm from that goes an imaginary path, following along the wall.

That is the racing track!

Where the wall meets another wall, or there is an obstacle, the track follows in a smooth path, always 30-70 cm away, on the floor.

The track returns to where you started, you see! :)

It is a full racing track:

You can time how long time it takes for a little robo-car to take one round. You can then try to improve the code, and time it again.

 

If you make the car like this:

IMG_3962.JPG?imgmax=720

One sensor (Could also be infra-red or whatever) looks ahead, another looks to the right. Then code could be something like this:

main:

If something in front, turn left, go to main.

If something closer than 30 cm to the right, turn left, go to main.

if nothing in front and something closer than 70 cm to the right, drive ahead, go to main.

If nothing to the right closer than 70 cm, turn right, go to main.

 

A car is racing your home!

It can be timed how long before passing by the same line again and again.

But a single car is just test-labs, no?

 

Now take 2 cars with the excact same setup as above, let's say a red car & a blue car. Now it get's interesting!

If red car is behind blue car, what does it do?

Well.. Something (blue car) is in front, so we turn left to take over.. until nothing is on the right, so we pull back.. That is trying to take over!

At a point the blue car is turning left because there is something in front.

Then the red car will have the inner track..

 

What is actually going on, is that one car is behind, but is "strugeling" to take over.. when it is in front, the other will fight to get ahead.. and we have a full race :D

You can take Red & Blue and place them next to each other, next to the wall; They will both drive full speed ahead, until a turn, where the inner car will have advantage. But then..

IMG_3887.JPGIMG_3895.JPGIMG_3937.JPGIMG_3910.JPGIMG_3913.JPG

IMG_3921.JPG?imgmax=800

Wall Racers are born, ladies and gentlemen.. I had these 2 cheap RC cars with crap maneuvering abilities, and thought of what I could do with them. Crap - but still; They sort of drive like cars - not like differential steered robots.

It has ben quite simple, have experimented with AZ8222's instead of motor drivers. And just a Picaxe on a standard board, simple and fast.

Of course, when turning angle is not enough to avoid obstacles, maneuvers with reverse and 3-point turns must be done. But this is why we have a microcontroller, and it is not spoiling the fun - on the contrary :)

wallracer_brown.jpg

pir-march07.jpg

 

Comment viewing options

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

I've deleted that line 128 and it works...thanks.

fritsl's picture

Cool. As for your other question, if you post your work in progress it will be much easier to help you; More info means better answers :)

Looking forward to see your project!! Are you making one or two?

Korel's picture

I've made my first robot and you can see it on my avantar icon. I wanted to see if I could make it work and it does but it's very basic for my first one.I will post it. The racer would be just an idea because I have a 4x4 R/C without the transmitter. Also something on tracks would be great as a futur project too....so I'm on LMR everyday reading and watching other's projects and I'm learning with you people. Thanks again this is a great discover for me.

Korel

fritsl's picture

Actually I can not see on your avatar icon that you have made any robots. Have you marked it as "Draft", perhaps?

Korel's picture

I am studying this racing car project and also the code but with the Picaxe editor and the "wall_racer.bas" I'm having a syntax error on line 128 where it says:   rev:  Can you give me a hint,because I'm new to Basic and I've tried a few alt on that line already and it didn't work..

Got my 4 DPDT micro relays.

Also is there a possibility to reduce the speed of these R/C motors?  Thanks.

 

 

 

kenjones1935's picture

Per the fritsl's suggestion I am moving my comments to a new thread.

It is in the Specific System Related/ microchip MPLB forum.

The name is "Wall Following RC car using 16F887".

Thank you fritsl for the idea and for your help.

 

Ken

kenjones1935's picture

Below is a video which captures my RC car running both under PIC control and RC control.  There is still much to be done to make this thing robust and reliable.  This is a start.

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

 

Thanks for your interest.

 Ken

fritsl's picture

How nice, congrats!

You should really post this as a robot now, so all the progress and info can be found there, and not on my post :)

BTW; Either it is because of inteference, or your code has some problems; It looks as if the SRF05's are only making a very few readings pr second? (I count the blinking that I can see)

kenjones1935's picture

Thanks you Fritsl for this great idea!  In hopes of getting more control over the steering and the wheel speed I built your racer on a hobby level car.  It toggles between RC control and autonomous control.

 Everything you said about the difficulties of heavier and faster models came true.  Here is a video of the first attempt at the race track of our local RC car hobby shop.

 http://www.youtube.com/user/kenjones1935#p/a/u/0/seDKRDUdehE

  Ken

fritsl's picture

Cool!

It is really hard to hear what you are saying on the video :)

However, it looks to me that you are not having the problems with the heavier & faster car, but the programming. I remember my very first attempts driving the same way, in bows from the wall.

That is why I programmed as I did, I think you should have a look at the code, it is short, and there is a reason for every bit of it :)

kenjones1935's picture

I used fritsl code on a toy level car a la your design, but my PIC would not drive the relay coils.  While waiting for the SN7407N current driving DIPs to arrive by POST, I moved the code to a hobby level car that has an Electronic Speed Control.  That is what is in the video.  The problem with response time (I am guessing now) is my inability to program the 16F887 to make a Pulse Modulated Wave signal at 50 pulses per second frequency.   The PIC can do PWM, but it tends toward repetition closer to 500 pulses per second. At that 'out of radio control spec' pulse rate I have not been able to moderate the wheel speed.  The ESC can sort out pulse size for wheel travel Forward, Stop, and Reverse, but it seems only to go Bang/Bang - no gradation.  I do not know the electronics of the ESC.

 Thanks for a great idea.  My goal is to hook middle school students into an interest in science and math.

 Ken

fritsl's picture

It can be extremely hard to program up to an ESC; They usually have some form of "intelligence", that can be very hard to code.

I recommend that you start by making sub routines that do the stuff you want; Turn, stop, drive, reverse.. And maks sure that each can be called right after the other, and do what it is supposed to. Usually this takes variables to changegradually within the routine.

I warn you though; this may be very hard. They react strange, and do not like fast changes. However, this way you will be sure that you can concentrate on the fun afterwards. Or make sure where your problem is :)

myblack60impala's picture
I built a simple wall follower robot for maze solving, and I use it in the same fashion as these wall racers. During presentations I like to have a kid (I do a lot of robotics mentoring at a HS school) sit in the floor and let the robot drive around them (circle them) The kids love it, as they feel they are a part of the robots actions, etc. Its like HUMAN - NASCAR!!!  -lol
fritsl's picture
Video of this?
myblack60impala's picture

I try to avoid posting stuff involved with other robotics groups. (There's a big red led sign in the background flashing their web address in the kid/nascar video) But I'll post more robots, and the maze video's, as they aren't as obvious with the other groups name, as the above mentioned video is.

 

kenjones1935's picture

By setting a comparator/counter to interrupt every 20,000 usec (20msec) ie 50 per second I have found a mechanism that is accurate enough to drive my Tomahawk Reverse ESC.  I set up pulses ranging from 1.2ms to 1.8ms.  The wheels respond with full back, medium backs, neutral, medium forwards and full forward.  I am trying to say that the response is not bang bang, but continuous.  This same system also drives the steering servo.

 fritsl, did you ever post the code for your wall racers?  If so, I have not been able to find it.

Many years ago I was coding in assembly, pascal and C.  I am now retired and sitting in front of my  homebased PC.  Gone are all my old corporate resources and buddies.  I have never used BASIC.  Does anyone have a reasonably complex BASIC program that they would be willing to share.  I'd like to get the feel.

 Ken

fritsl's picture

This just strikes me; From the knowledge I have from you, I guess that you are working on perhaps a scale 1:10, some sort of "big" RC.

I must warn you regarding the physics; The cheap distance sensors (not laser or camera, but ultrasound or infrared) have a limited effective distance at max 2 meters in reality, and at it's best.

A heavy car traveling at perhaps just 20 kilometers pr haour is VERY fast to "eat" 2 meters, especially when you are using them to navigate and not just a pure halt.

This is why it is smart with small light cars - and it is fun too if you tune them, as I did, feeding the motors an extra volt. This gives "radical" driving.. where as making the larger ones "radical" and skidding, while only having 1-2 meters to react is impossible IMHO.

You should also consider that driving by nature gives a lot of false readings - this makes it even harder to scale up in inertia with these relative short distance sensors.

PS: Please take any further talks about building to the "how to make.."-page, thanks :)

fritsl's picture

To put it short here are some pointers for you:

At the top of this page, look for "How to make Robot Wall Racers yourself, see here"

At the top of that page, look for

AttachmentSize
wall_racers.bas6.51 KB

 

kenjones1935's picture

Last fall I started to plan, design, and purchase the parts to make a hobby level 1/10 size RC electric car that can run both under radio control and under PIC control.  This car has a Tomahawk Reverse electronic speed control driving the wheels.  I wish to keep that system.

 All is going well.  I have a Microchip PICkit 2 attached to the car.  I have two batteries. One 7.2V for the driving wheels and another 6V pack for the PIC and the radio receiver.

 The RC still works fine.  I am having problems with the PIC control.  I have no access to an oscilloscope.  Under PIC control I can drive the wheels backwards.  I can brake them.  But for some reason I can not get them to go forward.

 Has anyone in this thread accomplished what I am trying to do and has some code that they will share?

 Ken

webmaster's picture

My experience is that it's hard to control the speed controllers with PWM.

A good tip is to use your computers soundcard to see what's going on (see post "you may no tneed an oscilloscope", somewhere)

Check what your old RC was sending to the speedcontroller, and see what you send to it.

Another tip is to take steps one at a time; very slowly work your way through PWM-speeds.

Reason it is hard is that they react on the speed that the PWM is changing..

haptiK's picture

well, in theory it couldn't be that difficult. with components small enough, if they exist, i would assume a fantastic way to do it would be averaging ladar signals, to "paint" the track. an average of the corrections might allow the bots to virtually paint a line to follow it. interesting concept. 

laser range finding and stuff is cool and all but to be sentinent, it's not good enough for learned machines. 

sounds like a fun project! anyone in london want to get into the research with me to make it happen??

processing, openframeworks and opencv would be good places to start with this...

fritsl's picture

I think you should try to make a wall racer first.

I think you will be surprised, when theory no longer works in reality.

Speed and sliding.. a fast sliding robot is something else to program. Try that first, and see if you can make that work at all :)

Then think about mapping.

haptiK's picture

What is needed for these to eventually learn the track? If they learn the track they could fine tune their driving to eventually run the perfect time around the course.

I would be interested to know what you would need to build into the bots  (or sent via wifi to a computer) for this to be possible.

Thanks.

fritsl's picture

Sorry, I am an artie, I cannot answer your techie stuff :)

Anyone else?

ignoblegnome's picture

Hey Frits, check out these: http://battlemachinesrc.com/

Laser tag wall racers, anyone?

fritsl's picture

Uh yes, I'd love to something like that :)

Perhaps it coul dbe fun to just control some sort of canon on a robot, that drowe around without you controlling the driving? :)

Very international.  You have the European-standard advertising on the crash walls, and the good ol' boy NASCAR ideal of "Go fast, turn left.  Mostly."

 Looking forward to seeing the details.

amando96's picture

haha, seems fun both to make an race :)

 

but

"If something closer than 30 cm to the left, turn left." wouldnt he drive into every wall then?

fritsl's picture

You where absolutely right :)

I altered the text, so I think it should fit now. Please mind that it was written before I actually made the robots ;)

1220's picture
you have to coolest ideas!!    --TNT
Mr Clean's picture
Frits you should try to sell this design to a toy company!  I would have loved these as a kid.  I can just imagine the commercial: "Corner drifting action!"  "ULTRASONIC technology!"  "You're friends will think you're so awesome!"
fritsl's picture

If you knew how many told me this, also for the YDM :) And if only the toy companies knew what I could make for hemm :)

Unfortunatly having the good ideas are not enough to penetrate to them, I tried a lot some time ago, but no answers or sandard rejections is all. Have tried third parties, dralers etc etc. Aparently it is not a market very hungry for all my bright ideas.. or something else is wrong :)

But thanks! 

Mr Clean's picture
These are awesome!  If I ever have the know-how I'd love to build a couple of these.  They look like a lot of fun!
fritsl's picture
OptimusTronic's picture
very good, the car response very well
KE7JLM's picture
fritsl's picture

Way Cool!!

(We should race some day)

I'd love to see you making this as a new robot-post - so we could have a place to ask & read more.

I'll try and post some more details soon, I also want to try and organise a proper robot racing competition (by specifying some rules - a bit like the robot football leagues).  At the moment I'm busy trying to finish a PhD
fritsl's picture

Robot-race could be really fun! (Specially since mine can do overtakings)

Only thing is that it is extremely incompatible with the crap low framerate video on the net has. Even HD/100 Hz can have a hard time with it, as not only is speed high - the things are small, so you have to be close to film anything but "little things on the floor" - and this is really not very compatible with the way film / video works in general :)

Need highspeed camera. 

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.

I made them because I occasionally run kids workshops about robots and I wanted an activity that was fun but didn't involve building or programming so I made some racing robots.  The controller (A PIC 18 device)  has eight potentiometers attached (as well as the sensors) and these can be used to control the behaviour.  Basically I can give one to a group of kids and tell them to experiment with the settings and get the robot to race around the track as fast as possible.  The controller also has a mode select switch so you can have several different operating modes and I have included (but not written code for yet) a pair of servo pulse outputs so you can use the controller on an RC car instead of a diff steer bot.  I was thinking of also using these ports to hook up an RC helicopter gyro so I could control the rate of turn more easily (espescially useful on slippery floors)

My robots are FAST, not quite as fast as a good RC car but certainly to fast for most tracks (there is a speed setting so you can tune the motor power) They work best on carpet where they get the most grip.  The algorithms I use for control are various and the mode switch allows you to try out different options.  The most useful one is the PD controller where you make the robot symetrical with sensors at the front and sides in pairs.  You then work out the difference ebtween each sensor in the pair, work out the rate of change of the difference, add the results together and subtract from one motor and add to the other.  This gives you a damped wall avoiding behaviour which works nicely.

I haven't done what the wall racers do yet and given them an explicit mode for following a left or right hand wall, Mine just avoid walls, I think I got half way through writing some code for wall following and got distracted by other things.

Got a video clip of my robots on youtube here:

http://uk.youtube.com/watch?v=PZiweyZEWWM

fritsl's picture
Cool, you should post this as a robot on LMR!
Dencohe's picture
Cant you place the ultrasonic sensors inside and cover it with a heavy spaces metal cloth like they do on top of the sensor and maybe paint it so it doesnt look as bad?
jklug80's picture
I would assume that as long as it has holes for sound to go in and out it should be ok. The more you block it the more of a chance that you will get a bad reading. If you put something in front I would try to make sure it is as close as possible to the sensor and that the holes line up if possible. I would just drill two holes and have the sensor peek through.
Zalzer's picture

Realy like the fact that you have taken radiocontrolled cars and made them childproof, radiocontrolled cars that doesn't drive into thing that's definetly something I think a lot of parents would like and that way they also last longer

Have you thought about hidding the SRF05 sensors indside the car, can't quite come up with a way to hide ultrasonic sensors inside the cars, I can only think of a way to do it with infrared sensors.

fritsl's picture
The SRF's could just be better placed inside the cars.. Only the cars I made are completely filled up on the inside :)

 

I was impressed with your racers, made me want to do my own now :) i was thinking about how close you could get them to the wall,have you tryed putting proportoinal responce into the code, something like

 

x=distance from wall on right;

y=distance from wall infrount;

z=100-((y+x)/10) 

turn Z amount.

I made a wall follower once for university and the idea was it would always stay 3cm away from wall and follow it. i found the type of forumula above was fairly easy and produced good results,might make it more fluid.

 if you have something like excel or matlab you can even find the best turning curves etc.

 Anyways great project and i liked the videos alot.

 Noz

fritsl's picture

Hum.. erh.. thanks.. hmm..

Well - to put it short; I think one thousand nerds out there have tried to make something like wall racers / Microcontroller on an old RC. But failed because they thought they could calculate the way out of things / predict etc like the robots they have experience from.

The thing is; These things (specially the cheap ones) steer like a numb fish, react like a drunk fish, and whip around like fish on speed in a heavy stream. It is NOT like a nice slow little robot. You cannot transmit formulas from "ordinary robots" that behave nice to these things, they will bang into the wall and act crazy if you try. It has to be formulas on how to steer a numb, drunk fish - on speed, in a heavy stream :)

But I will release both code and how-to's asap. I will release a very simple base-version that works (100% the one on the videos, and possibly more videos to come) - and then you can have all the fun in the world by trying different formulas - they take an afternoon to build, and are very cheap :)

Thanks again,

F. 

BaseOverApex's picture
You evidently have most experience, so how exaclty DO you steer a drunk, numb fish on speed in a heavy stream? Is it anything like trying to steer a frightened sheep towards the edge of a cliff while wearing your wellington boots?
fritsl's picture
Walkthrough is comming - with code :)