# Trajectory Path from 2 Distance Sensors

1. Feb 10, 2012

### PvT Inventor

I would like to determine the equation describing the trajectory of an object using data from 2 distance sensors. I figured out how to do this if the sensors take simultaneous measurements but this cannot be done without generating crass talk between the sensors. The object moves too far when the sensors are set to their fastest sequential measurements, so I cannot assume that the measurements are simultaneous. Here's the givens:

The whole problem can be done in 2 dimensions (XY coordinates).
The path of the object is that of a projectile without air resistance so it follows a parabolic path so we that the equation for the object path is quadratic and the object follows all rules for a falling object.
Both sensors are on the y (vertical) axis and the lower one is on the origin.
I am only interested in the path when the object is in "positive" space (both x and y positions are positive).
The sensors return both distance to object and time of measurement but cannot measure simultaneously.
The sensors measure the nearest object within a 20 degree cone, so they cannot be "aimed" parallel to each other, making the problem fairly simple but only uses 2 measurements to determine the path.
The minimum time between measurements is about 5 ms and the object is moving around 5 m/s, so each sensor can take multiple readings.
Maximum range is about 2 meters.
The object is falling and will not pass through the origin, but I see no reason why the problem can't be done in reverse by just reversing the timeline.

What I am really after is the angle of the object path as it passes through the X-axis, but this is easy to obtain if the trajectory equation is known. I can deal with the error in sensor measurements if I know the path equation, so what I need is a theoretical way to determine the path from the distance measurements. Any thoughts on how to approach this problem would be greatly appreciated!

2. Feb 10, 2012

### xts

Just take (for every time) several consecutive measurements (a bit earlier and a bit later) from both detectors and perform least square fit of second-order trajectory to estimate the position at the given time.

3. Feb 10, 2012

### PvT Inventor

That is basically what I did when I thought both sensors could measure simultaneously (or close enough to be considered simultaneous). For simultaneous measurements, it is easy to find the XY coordinates for each pari of measurements. Now I get data that is like this:
D1 at time 1, D2 at time 2, D1 at time 3, D2 at time 4. I do not know exact direction of the distance either (plus/minus 20 degrees).

I think to do what you are suggesting you need to have measured points in the XY coordinate plane, and I don't have that.

4. Feb 11, 2012

### xts

You must assume that trajectory is of the form:$$x(t)=v_{x0}t+x_0,\quad y(t)=gt^2+v_{y0}t+y_0$$, then express your distances as a function of $(x,y)$, take 5 points and solve those 5 equations system to obtain $(g,v_{x0},v_{y0},x_0,y_0)$ or (better) take more points and perform least square fit over those 5 parameters in order to minimize sum of squares of differences between measured and predicted distances.

5. Feb 11, 2012

### PvT Inventor

I think that concept will work! I was messing around with those equations plus a few others and just couldn't figure out how to put it all together so that I don't increase the number of unknowns with each sampling point. By the way, I am not playing on doing this on some other planet so we know g, leaving 4 unknowns and then I need a minimum of 4 sampling points. I will likely get many more so will then do a least squares fit to get the trajectory. Thanks for your help and I'll follow up when I sit down and work it all through and see how it turns out.

6. Feb 12, 2012

### xts

Good luck!
You may want to make a plot of the computed (fitted) trajectory against raw data to see if your idealisation (no friction) really works. If you find some systematic discrepancy, then you can try multiple fits for partial data, e.g. points 1-9 gives you estimation of trajectory parameters at point 5th, points 2-10 at point 6th, 3-11 at 7th, etc.
There is no simple rule telling how many points you should use for each estimation - it depends on many factors (how good is your theoretical model), but generally it is good idea to keep at least 5 data points more than no of parameters in each set (for your case 9 points). But if you have large amount of data and they follow the theoretical curve well, much bigger number of points (e.g.30) per dataset may work better.
WHat is the best - you must find by trial and error.