What is the easiest way to track the location of an object along a path?

Let's say you have a device in a 2D coordinate, with x and y axis.

The job is to always track the location of the device along the x axis. We don't care about the y axis.
To make the job easier, there can be a physical rod-like object along the x axis that contains items to make the job easier. (I don't know what items this object should contain, otherwise I wouldn't be asking the question. I'm only saying you can think of the x axis as a physical object that can be used to aid our task)

The device should know its (rough) location along the x-axis regardless of where it is along the y axis.

A method I'm thinking involves printing patterns or "numbers" along the x axis object, and if the device can recognize the number using object recognition, it will know its location (can be discrete). But there's gotta be an easier way right? I would hate to deal with lights or lasers.

I should add that this "rod" should be flexible. In another word, the xy plane is not flat, but can be "curved". In addition, there might also be a z component. The "device" might deviate from the xy plane a bit, but it should know the closest point along this rod to itself. (so the alignment will not be perfect at all times which is why I don't want to use lasers). Are there magnetic based approaches?

Total length (range) of the rod should be no more than 30cm. At any time, the Euclidean distance of the device from the closest point on the rode is no more than 20cm or so, to give you an idea of the dimensions involved.

Thanks
thanks

Could your object pull a "string" behind it that is running in a pulley with an optical encoder on the pulley shaft?

Could your path have black and white stripes that could be detected by a reflective optical sensor such as a QRE1113 to enable the Arduino to count the stripes and keep track of its position?

...R

Robin2:
Could your object pull a "string" behind it that is running in a pulley with an optical encoder on the pulley shaft?

Could your path have black and white stripes that could be detected by a reflective optical sensor such as a QRE1113 to enable the Arduino to count the stripes and keep track of its position?

...R

Thanks. What about the case where the location is no longer constrained, but I just want to measure the proximity between two objects? The distance is merely the Euclidean distance in space. I searched for "proximity sensor" and found some IR sensors, but those seems to require alignment in order to work, and there cannot be obstacles. I need a solution that'll work even when there is obstacle between the "transmitter" and "receiver", and can return the Euclidean distance between the two.

Any ideas? The distance is on the order of 0 to 300mm, roughly.

thanks

paulwece:
I need a solution that'll work even when there is obstacle between the "transmitter" and "receiver", and can return the Euclidean distance between the two.

Maybe if you tell us what you are really trying to do it would be easier to help.

...R

A web cam.
A raspberry Pi.
A calibration step.
Some coding knowledge (bitmap structure?).

paulwece:
Let's say you have a device in a 2D coordinate, with x and y axis.

The job is to always track the location of the device along the x axis. We don't care about the y axis.
To make the job easier, there can be a physical rod-like object along the x axis that contains items to make the job easier. (I don't know what items this object should contain, otherwise I wouldn't be asking the question. I'm only saying you can think of the x axis as a physical object that can be used to aid our task)

The device should know its (rough) location along the x-axis regardless of where it is along the y axis.

A method I'm thinking involves printing patterns or "numbers" along the x axis object, and if the device can recognize the number using object recognition, it will know its location (can be discrete). But there's gotta be an easier way right? I would hate to deal with lights or lasers.

I should add that this "rod" should be flexible. In another word, the xy plane is not flat, but can be "curved". In addition, there might also be a z component. The "device" might deviate from the xy plane a bit, but it should know the closest point along this rod to itself. (so the alignment will not be perfect at all times which is why I don't want to use lasers). Are there magnetic based approaches?

Total length (range) of the rod should be no more than 30cm. At any time, the Euclidean distance of the device from the closest point on the rode is no more than 20cm or so, to give you an idea of the dimensions involved.

Thanks
thanks

I reckon you need to provide much more details about the whole system. Eg.... application, size of device, what environment, what surface, whether capacitive or inductive grid is allowed on the surface, required accuracy in axis position, whether cameras for observing the object (using image tracking) are allowed, etc.

Robin2:
Could your object pull a "string" behind it that is running in a pulley with an optical encoder on the pulley shaft?

Could your path have black and white stripes that could be detected by a reflective optical sensor such as a QRE1113 to enable the Arduino to count the stripes and keep track of its position?

...R

Can you put magnets of different strength along the line or (rod), and use a magnetometer to track a rough location?

For example, magnet of strength 1 at point 1, magnet of strength 10 at point 2, and so on. Then if the device can sense the direction of the magnetic field pulling on it from the two directions (for example, at point "1.5", it will get pulled by the magnet at point 1 and also point 2 in roughly opposite directions).

Thanks

paulwece:
Can you put magnets of different strength along the line or (rod), and use a magnetometer to track a rough location?

Why not simply tell us what you want to build instead of asking what seem like random questions without any context.

...R

Robin2:
Why not simply tell us what you want to build instead of asking what seem like random questions without any context.

...R

thanks

I'm trying to design a toy involving some small toy cars on a path. The path starts at a starting point A, and I want to know the distance the car is from point A. If the path is straight, I can use something like a proximity sensor, but the path can be S shaped and there might be obstacles that block lasers or other optical methods.

The path is shaped such that as the car increase the path distance from starting point A, the 3D Euclidean distance from A increases also. If I can track either, I'm okay.

I don't want to use a string with an rotary encoder because the user might want to pick up the car. Having a string attached to the car is awkward. I also don't want to have the car count some kind of "steps" as it traverse the path because the user might pick up the car and place it some where else on the path. Even when this happens, I want to be able to track its new location along the path (or the Euclidean distance to the starting point).

Having the car recognizing some pattern on the track is too technically demanding for me now.

That's why I thought of that magnet approach. If I place magnets of different strength along the path at fixed intervals (say, every 2cm), then if the car can track the magnet strength (and/or directions), it should know its rough location. This also do away with strings/wires and is much cleaner.

I'm don't have high requirements for positional accuracy (the car only needs to know which interval it is in) or speed of response. (ie, I don't need to track the location as the car is moving at a high speed, only when it is stopped).

Thanks

This stuff is flexible but only on one axis.

https://www.machine-dro.co.uk/high-accuracy-magnetic-linear-tape.html?gclid=Cj0KCQiA0b_QBRCeARIsAFntQ9ryILwXH_S-yB0Sy2l7OeU_WPHUhkVgjYoh_3JwR5U_Jd6nFoyzCVQaAgHCEALw_wcB

I used to have a minic race car set where th power was picked up from slots in the track, a similar arrangement using this tape may work.
However it is no good if the cars can wander off a fixed path.c

EDIT

Magnetic wire audio recorders used to exist using similar principles , as your resolution in not great perhaps burling recorder wire in your track may work.
Wire is cheap although you would have to build a recorder to pattern the wire.

That's why I thought of that magnet approach. If I place magnets of different strength along the path at fixed intervals (say, every 2cm), then if the car can track the magnet strength (and/or directions), it should know its rough location.

You can try it but my gut feeling is that you don't stand a hope in hell of getting it to work.

"magnets of different strength" - ever tried to buy them?
" then if the car can track the magnet strength" that is a big IF, I don't think you will find a hall sensor that can do that, their is too much of a dynamic range.

paulwece:
I also don't want to have the car count some kind of "steps" as it traverse the path because the user might pick up the car and place it some where else on the path. Even when this happens, I want to be able to track its new location along the path (or the Euclidean distance to the starting point).

I think you are giving yourself a very serious challenge with that requirement. For full size cars (and giants who could pick them up :slight_smile: ) you woud use GPS.

But creating a small-scale equivalent is not easy.

Before GPS ships at sea could pinpoint their position (roughly) by taking bearings from at least 3 known and identifiable fixed points - such as navigation lights or mountains along the coast or islands. You could implement something like that if you had three omni-directional light beacons and had a directional light sensor on the roof of the car that could be rotated and could record the angle at which it detects each beacon.

Much simpler IMHO if the car counts its way along a path and the car owner is disqualified if he picks it up.

...R

Yep....... since there's 2 relatively small cars, may need to use web-cam(s) and image processing methods to try estimate the location of the car. It's going to be some work in identification of each car as well. Eg. put a big square symbol on the top of one car, and put some other very different symbol on top of the other car.

Either that...... or could use some kind of special paint, particular coloured LED, and special cameras, so that there's different visual signatures for the image processing to pick up.

And, as robin2 mentioned already ---- wireless tracking methods, which might require transmitters and/or receivers on the cars and at various beacon base stations nearby. However, you then have to consider the dimension of the region that the cars are going to operate in --- where dimensions are going to dictate various things about hardware that could be used. And you seem to not do some important thing...such as to tell everybody in advance what the important requirements are --- such as a visual diagram or photos that shows what your plan is. Dimensions of the arena, dimensions of car, volume/size of cars, etc.

accelerometer?

why can't magnetometers be used with the magnet approach? l

how about a bunch of hall effect sensors along the track and attach a magnet to the car?

can capacitative sensing work?
thx

How accurate are computer optical mice these days ?

Playing on the desk i wonder if useful information could be derived, even if the mouse (car) is 45 degrees off axis it looks like it could be useful.
Not thought too much about the maths but simple trig may give the required result.

Boardburner2:
How accurate are computer optical mice these days ?

The OP wants to be able to pick the "mouse" up and put it down somewhere else and it knows its new location.

Without that requirement the task would be very much easier.

...R

paulwece:
how about a bunch of hall effect sensors along the track and attach a magnet to the car?

Better idea but look at the range you get with a linear Hall effect sensor, it is not as large as you would hope. Magnetic fields drop off as the inverse cube of the distance.

Capacitive sensing will not work, to know why look up how they work. You will see that your situation is not applicable.

using a rod, on a ball joint to allow flexability is a piece of cake.

Optical mice is one thing..... but there's a need to define the size, weight, volume of the RC car. The OP hasn't provided various important details - not just about the cars, but nearly everything. That's why there's all this open-ended conversation.