Go Down

Topic: autonomous car algorithm help  (Read 1 time) previous topic - next topic

Gilr

Hello everyone,

I'm planning a small autonomous car project which supposed to drive in boarded area and keep 25cm distance from the fence that used to be the board of the area.(the fence can be any shape and not just circle).
I'm using arduino mega 2560, the car has 4 wheels controled by using the PWM option.
I though about using 2 ultrasonic sensors, the first one in the front side and the second at the left side of the car (the car will drive clockwise and "keep the fence").
I will be happy to get some ideas for possible algorithms to solve the problem!

Thanks
Gil

PaulS

Quote
I will be happy to get some ideas for possible algorithms to solve the problem!
What is the problem? Reading the sensors? Changing the speed of the motors?
The art of getting good answers lies in asking good questions.

Gilr

the problem is how to write the code that will make the car drive and keep 30cm from the fence no matter what shape the fence is (with two ultrasonic sensors one at the front and the other at the side of the car)

thanks

PaulS

the problem is how to write the code that will make the car drive and keep 30cm from the fence no matter what shape the fence is (with two ultrasonic sensors one at the front and the other at the side of the car)

thanks
How would YOU walk along the fence, keeping an arms length away, having one arm out to the side and one sticking out front? How is the arm sticking out front going to help?
The art of getting good answers lies in asking good questions.

Gilr

hi,
the front arm can help me to know when the fence from the front is near and i got to start turnning..

jremington

The algorithm for following a fence is pretty simple. Assuming the fence is on the left,

Check distance to fence.
If you are closer to the fence than desired, steer right.
If  you are farther from the fence than desired, steer left.
Check for obstacles and take appropriate action.
Go back to check distance.


Quote
the car has 4 wheels controled by using the PWM option.
How do you steer?

Gilr

Thank you! I steer by driving faster with the wheels of the other side i wang to steer.
Now i have problem with the turnning radius which is like 1.5m.
Any help to improve it?
Thanks

PaulS

Quote
I steer by driving faster with the wheels of the other side i wang to steer.
The greater the speed differential, the smaller the radius. Turn the inside wheels in reverse to make it even smaller.
The art of getting good answers lies in asking good questions.

TomGeorge

Hi,
How big is this car?

Can you post a picture of it please.

Have you done any code for the car at all?

What is your electronics, programming, arduino, hardware experience?
Is this a school/college/university project?

Tom..... :)
Everything runs on smoke, let the smoke out, it stops running....

MarkT

Have you played with the sensors and seen how accurate/inaccurate/noisy the values they return
are?  You will probably have to code round the imperfections in the sensor data (a lot of robotics
is like this - dealing with imperfect data)
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

AWOL

Quote
the problem is how to write the code that will make the car drive and keep 30cm
The original post said 25cm.
Which is it?
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

Go Up