llorvde
Posts: 12
Joined: Sat Mar 05, 2016 6:05 am

Measurement Distance from start point to RC-car

Thu Mar 17, 2016 3:31 pm

I have one problem about measuring distance.

I have one RC- car moving around randomly.(Use random function to move the RC-car)

What I want is ...

the RC-car can measure distance from start point to where the RC-car is.

Assume, there is no obstacles between RC-car and the start point, and the map size is 2m x 2m.

I am looking for a sensor that can handle this problem.

Thank you~~

TheRayTracer
Posts: 51
Joined: Tue Oct 13, 2015 12:23 am
Location: Australia

Re: Measurement Distance from start point to RC-car

Thu Mar 17, 2016 9:18 pm

The following is a serious suggestion. Since your 2x2m area shall not have obstacles, is it possible to attach a string line from your starting point to your RC-car? The starting point will always ensure that the string is tight (ie. no slack). Then you only have to measure the string. I'm sure there's a device out there that could measure how much string is released. It's not high tech, but NASA continue to employ this technique.

Other more high tech suggestions would include a range finder sensor or a sonar sensor or even computer vision if you have fixed cameras.

llorvde
Posts: 12
Joined: Sat Mar 05, 2016 6:05 am

Re: Measurement Distance from start point to RC-car

Fri Mar 18, 2016 2:51 am

Thank you for suggestion..

However, I do not have to measure accuracy distance..

For example, if distance between rc-car and start point is less than 50cm, output is 0..

if the distance is bigger 50cm and less than 100cm, output is 1..

Therefore, the measurement does not have to be 100% accurate....

and in the future, I need to use bigger map... so can anyone give me other option..?

I found Beacon and Blutooth dongle can measure distance..(I know it is not accuracy)..

If I can use Beacon and Blutooth dongle.. what product can be useful for raspberry pi 2..?

TheRayTracer
Posts: 51
Joined: Tue Oct 13, 2015 12:23 am
Location: Australia

Re: Measurement Distance from start point to RC-car

Fri Mar 18, 2016 3:21 am

No worries. In the future to avoid wasting time and a few rounds of correspondents, remember to state your question/problem as accurately as possible. Your RC-car test area has grown from 72'x72' inches to 2x2m to now something larger, and accuracy is no longer important. Yes, use Bluetooth if your area is less than 10 meters.

mikerr
Posts: 2781
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 10:56 am

You could use a sonar ranger at the start point (not on the car).
Then you don't have to worry about car orientation, the sensor distance will either be 2M (arena wall) or less (detected car).
Android app - Raspi Card Imager - download and image SD cards - No PC required !

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 11:57 am

mikerr wrote:You could use a sonar ranger at the start point (not on the car).
Then you don't have to worry about car orientation, the sensor distance will either be 2M (arena wall) or less (detected car).
It should also be possible to use to rangers so that an initial pulse is sent out from the start, is received at the car, and re-transmitted from the car. The pulse from the car is then detected at the start. That gives a highly selective double-hop echo from the car. If reflections from walls can be excluded the straight line distances from start to car can be calculated.
There will be some delay in the (Arduino? Direct connecton?) echo unit on the car so total round trip should be:
T = 2 x AUS + EchoDelay
AUS = (T-EchoDelay)/2
Distance = AUS x SpeedOfSound.

There is an advantage in not needing to know anything about room geometry, but filtering out reflections from multiple pulses might be a killer.

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 11:58 am

PiGraham wrote:
mikerr wrote:You could use a sonar ranger at the start point (not on the car).
Then you don't have to worry about car orientation, the sensor distance will either be 2M (arena wall) or less (detected car).
It should also be possible to use to rangers so that an initial pulse is sent out from the start, is received at the car, and re-transmitted from the car. The pulse from the car is then detected at the start. That gives a highly selective double-hop echo from the car. If reflections from walls can be excluded the straight line distances from start to car can be calculated.
There will be some delay in the (Arduino? Direct connecton?) echo unit on the car so total round trip should be:
T = 2 x AUS + EchoDelay
AUS = (T-EchoDelay)/2
Distance = AUS x SpeedOfSound.

There is an advantage in not needing to know anything about room geometry, but filtering out reflections from multiple pulses might be a killer.

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 12:00 pm

PiGraham wrote:
PiGraham wrote:
mikerr wrote:You could use a sonar ranger at the start point (not on the car).
Then you don't have to worry about car orientation, the sensor distance will either be 2M (arena wall) or less (detected car).
It should also be possible to use to rangers so that an initial pulse is sent out from the start, is received at the car, and re-transmitted from the car. The pulse from the car is then detected at the start. That gives a highly selective double-hop echo from the car. If reflections from walls can be excluded the straight line distances from start to car can be calculated.
There will be some delay in the (Arduino? Direct connecton?) echo unit on the car so total round trip should be:
T = 2 x AUS + EchoDelay
AUS = (T-EchoDelay)/2
Distance = AUS x SpeedOfSound.


Where:
AUS is time for Ultrasonic pulse to travel one leg of the round trip.
T is the total time measured by the transponder at the start.
EchoDelay is the time it takes the echo transponder to generate the echo pulse.
There is an advantage in not needing to know anything about room geometry, but filtering out reflections from multiple pulses might be a killer.

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 4:57 pm

Do you really only want to measure distance, or do you need position?
What are you trying to achieve?
How about painting / laying down a mat of coloured zones on the floor? A simple colour sensor could measure what zone the car was in.

A camera sensor could work, either overhead to ID the car (see coloured ball tracking) or on the car with a 360° view to locate two or more points around the arena, either coloured balls or lights.

TheRayTracer
Posts: 51
Joined: Tue Oct 13, 2015 12:23 am
Location: Australia

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 11:34 pm

PiGraham wrote:Do you really only want to measure distance, or do you need position?
What are you trying to achieve?
How about painting / laying down a mat of coloured zones on the floor? A simple colour sensor could measure what zone the car was in.

A camera sensor could work, either overhead to ID the car (see coloured ball tracking) or on the car with a 360° view to locate two or more points around the arena, either coloured balls or lights.
I like this idea. To expand on the idea a little, you could record the colour of the starting square and capture the colour of the final square to work out the distance. This method would only require a downward facing camera (as the sensor).

User avatar
kolban
Posts: 143
Joined: Fri Dec 04, 2015 1:45 am
Location: Texas, USA

Re: Measurement Distance from start point to RC-car

Sat Mar 19, 2016 11:59 pm

Another possibility might be to measure the rotation of the wheels. In an ideal situation, there would be no slippage between the wheels and the ground. That would then allow us to know how far the vehicle has traveled by determining how much each wheel has turned. Using some trigonometry and maybe some calculus, we could at least approximate a position. I suspect that the knowledge of the position will drift badly over time but it might give us a ball-park. If the motors driving the vehicle are stepper motors you might get more precision.
FREE book on Raspberry Pi usage and programming

https://leanpub.com/pi

TheRayTracer
Posts: 51
Joined: Tue Oct 13, 2015 12:23 am
Location: Australia

Re: Measurement Distance from start point to RC-car

Sun Mar 20, 2016 12:27 am

kolban wrote:Another possibility might be to measure the rotation of the wheels. In an ideal situation, there would be no slippage between the wheels and the ground. That would then allow us to know how far the vehicle has traveled by determining how much each wheel has turned. Using some trigonometry and maybe some calculus, we could at least approximate a position. I suspect that the knowledge of the position will drift badly over time but it might give us a ball-park. If the motors driving the vehicle are stepper motors you might get more precision.

There is an issue with this strategy. Since the RC car will move randomly, the RC car may be commanded to drive in a loop, or u-turn. Thus the RC car may move 10 units away from the starting position, then turn left, move 2 units, then turn left again, move 8 units. Using the above idea, the RC car would have moved 20 units away from the starting position. Where in fact, the RC car is only 2^2 + 2^2 = C^2, C = 2.8 units from the starting position.

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sun Mar 20, 2016 8:15 pm

TheRayTracer wrote:
kolban wrote:Another possibility might be to measure the rotation of the wheels. In an ideal situation, there would be no slippage between the wheels and the ground. That would then allow us to know how far the vehicle has traveled by determining how much each wheel has turned. Using some trigonometry and maybe some calculus, we could at least approximate a position. I suspect that the knowledge of the position will drift badly over time but it might give us a ball-park. If the motors driving the vehicle are stepper motors you might get more precision.

There is an issue with this strategy. Since the RC car will move randomly, the RC car may be commanded to drive in a loop, or u-turn. Thus the RC car may move 10 units away from the starting position, then turn left, move 2 units, then turn left again, move 8 units. Using the above idea, the RC car would have moved 20 units away from the starting position. Where in fact, the RC car is only 2^2 + 2^2 = C^2, C = 2.8 units from the starting position.
That need not be a problem if the steering angle and wheel rotation, or acceleration, are tracked.

PiGraham
Posts: 3663
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: Measurement Distance from start point to RC-car

Sun Mar 20, 2016 8:18 pm

Another option could be to use an optical mouse sensor to measure motion over the ground. Sum all the incremental dx and dy moves detected by the sensor to get the current position. Errors will accumulate, but sine no great accuracy seems to be required it might be good enough.

Return to “Other projects”