I am looking for devices that might provide a solution for an idea I have. Here is the closest analogy I can muster for the proposal. Consider a train with 26 cars where "A" is the engine and "Z" is the last car (formerly caboose for those of my vintage). I am sure camera technology is now used for this but here is the idea. I want to display to the Engineer, the angle between all 26 successive cars. On straight track it would be 180 degrees for all 25 couplings. While rounding a bend, each pair would show an acute angle on one side and obtuse on the other while rounding that bend. When all 25 angles are 180 degrees again, the last car has rounded the bend. This would also be great when pulling off onto a siding to let another train pass. When cars "Y" and "Z" are showing 180 degrees again, the train is clear of the main track. So how do I measure such angles remotely and transmit the angle (car #s should be simple) to a microprocessor in the engine?
Brewsterblock
For measuring an angle, one could use a linear potentiometer with a lever arm mounted on the shaft and another lever arm attached to the body.
An Arduino could measure the pot value, compute the angle and transmit the data by radio, or through wires.
Interesting idea. The next point to consider is power, these devices will require power and environmental protection for starters. For example using round numbers assume each unit requires 1 Amp at 5V, not a lot but now add 100 cars, you are at 100A / 500 watts and of course there is voltage drop on long wires. What happens if it fails, just one sensor or the whole system.
Two distance sensors, a known space apart, on the back of one car and aimed at the other car. From the difference in distance, you can calculate the angle.
That's the easy part...
Anyway, analogies fall apart quickly. Maybe just tell us what you want to accomplish?
What gauge?
Could the trucks be coupled to a sensor (magnetic encoder) inside the car?
Would one sensor per car suffice?
Magnetometers (Adafruit selection) and LoRa radios on each car seems like enough to collect all the different headings. Then you could difference them and get the relative angles between cars.
Thanks gilshultz. All very good points. Have to be like the song "Accentuate the Positive, Eliminate the negative, don't mess with Mr. In Between!
Thanks Jremington. That's the kind of thing I need. I am pretty much a novice with no idea what's out there beyond my Uno starter kit.
Hey cedarlake. I tried math/geometry/trig. at which I excelled in high school. Unfortunately that was in the 1960s! Seem to have forgotten a lot. We had never heard of a Radian back then for example! Have to stick with the analogy for now. It's close enough.
No problem.
We need to take two measurements of the distance between cars to get the angle. We will space two distance sensors (could be laser, ultrasonic, radar, etc) a distance of D1 apart.
The angle between cars can be calculated if we know two things: the difference between the measured distances between cars and the distance between the two distance sensors themselves. Refer to the diagram.
The difference between the measured distances forms one side of a triangle, and one of the other sides is the distance between the sensors. Using trig, we know that the angle, theta is the arctangent of the fraction of those measurements:
theta = atan(D2/D1), where D1 is the spacing between the distance sensors and D2 = X1 - X2.
X1 is the distance from one sensor to the other car, and X2 is the distance from the other sensor to the car. if X2 = X1 then the cars are in a straight line and the angle is 0.
Make sense?
Hey Cedar. Thanks for clarifying. I had a similar diagram but the measured distances (x1 and x2 in your schematic) were not perpendicular to the faces of the cars. Seems to me in reality they would record the shortest distance to each other. So I drew lines between each transmitter/receiver pair (long side, short side) but that actually made it simpler once I saw your arctan idea. In fact I ended up with what I believe would be called an isosceles trapezoid assuming identical cars & distances. Top and bottom (2 bases) and slopes (2 sides) being perfectly symmetrical. Won't bother with my version because I now see the right angled triangles and tangent I needed.
Thanks again.
Cool solution.
If the distance sensors have large sensor angles (ultrasonic 15°?), won't the effective D1 shrink by a factor of cos(theta) as the angle increases and the return is the closest perpendicular distance?
In your diagram, it would be as if the sensors were mounted on car #2 at D1 distance apart, and detecting the end of car#1, and the effective D1 would be D1*cos(theta)
Either way, you'd probably need a calibration cycle and record all the X1 and X2 distances at theta=0 and take into account their differences.
Yes, but we've already been told that the whole "train car" thing is an analogy anyway. The devil is in the details.
After seeing Cedar's diagram I re-drew mine - would still appreciate a 2nd look at my
rusty math. See Drawing A attached
Assumptions
- 2 pairs of distance sensors: A,B & C,D mounted symmetrically on both cars. This assumes
the pairs of sensors can detect the shortest distance between each other. - Distances (varying) between them can be measured
- Known fixed distances: LA; AC; CI on similar boxcars.
- All of these right angled triangles share the same 3 angles: Theta, Beta,
and 90 degrees: EIH; ACX; LAF; MFB
Selecting small triangle ACX and angle theta, we know the hypoteneuse AC, the base CX, and the height AX. So any of arcsin, arccos and arctan could be used in a similar manner to arctan in Cedar's reply. Thanks again CedarLakeInstruments
In any of the triangles we know Beta + Theta + 90 = 180. Thus
Theta = 90-Beta.
At point H, 3 angles form 180 degrees.
180 = 2 x Beta + delta
delta = 180 - 2 x Beta.
delta/2 = 90 - Beta = Theta from (above).
Thus the angle we want: Delta = 2x Theta.
What I really need now is what sensors can I use for this, Arduino Uno R3, and my limited Embedded C knowledge.
Thanks. Brewster
Common distance sensors don't work in pairs, and typically report the "first return" data for a target within their field of view. That is: "A" might detect "M, and "C" might detect somewhere around "B".
There are active sonar systems where the target replies with its own ping, and you measure the time between the sent and the received pulse, but I've only known of them used in water.
Thanks DaveX. For sure the few tutorials I followed used a single sensor which bounced back. Will have to look at different geometry. I have never done anything with GPS coordinates. Perhaps something in just the X and Y directions (ignoring any height from the track) could give the angle if the transmission were fast enough?
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.