Go Down

Topic: Detect the position of a modelrailroad turnout (Read 4383 times) previous topic - next topic

minitreintje

Hi everyone,

I am building a DCC servo decoder for my modelrailroad and I have a problem I can't fix...
The servos drive the turnouts however they need to know their endposition.
Most commercially decoder uses software limits for each servo which you have to set manually.

I want to automate the process with some kind of probe that you can connect to the Arduino, the Arduino drives the servo and when the endpoint is reached (read: detected by the probe) the position is saved in the EEPROM.

The problem is the probe... My turnouts their switch rails are connected to the GND, otherwise I could clip a crocodile clip on it and check if the I/O input goes LOW. Does somebody an idea to build a probe?

This the turnout: (Marklin C-rail)


Cheers,
Dylan

Grumpy_Mike

Many many years ago when I did this I just used a very small solenoid to change them.

In English these are known as "points" not a "turnout".

Robin2

Do you want something that will be permanently attached to each turnout or do you want something portable that you just attach to a turnout during the setup phase?

If the layout is unpowered during the setup phase could you connect a wire to the point (turnout) blade and another to the running rail so that the Arduino detects a switch close when the blade reaches the running rail?  The wires could connect to the rails with crocodile clips.

Another option might be to program in about 120% movement and have some flexibility in the connecting rod from the servo arm to absorb the excess.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

minitreintje

It's only for the setup phase of course. I don't want to use buttons to calibrate the servo's end positions.
The problem is that the point is connected to the GND in the turnout, without modifications I can't use that.

I thought about a slide pot that follows the point move...


Cheers,
Dylan

Robin2


It's only for the setup phase of course. I don't want to use buttons to calibrate the servo's end positions.
The problem is that the point is connected to the GND in the turnout, without modifications I can't use that.

I thought about a slide pot that follows the point move...


I think you are getting the jargon mixed up. A "point" and a "turnout" are the same thing - the thing in your photo.

I call the moving rails the "blades" of the point.

If the rails are used to pass power to the loco wheels I can't understand how any of them can be connected to GND. In many situations the moving blades are used to switch power from one direction to the other. Perhaps you can post a diagram showing how yours are wired.

If you use a slide pot don't you have the problem of calibrating it. Are you thinking of having a single pot that you manually move from point to point.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

floresta

Quote
I think you are getting the jargon mixed up. A "point" and a "turnout" are the same thing - the thing in your photo.

His terminology is that which is typically used in the US.  Since he's in neutral territory he can take his choice!

Of course you both realize (realise) that you don't just want to determine when the moving parts first strike the fixed parts, you have to go further to apply some pressure so that the flanges don't get in between the two.  I hope I am understandable  without using any jargon. 

In American English: You don't want to stop when the points first strike the stock rails.  You have to apply some pressure so that the flanges don't pick the switch when approaching a facing point.


Don

KenF

How about a little man holding a lever.  The bottom half could be fixed with a pivot point at the hips.  This will allow his body to move as the lever moves.  Once the points get to the end their travel, the lever will stop.  Under momentum his head will want to continue moving (thus flexing the spring that holds it to his body).  When the spring gets to the end of it's travel, it will snap the head back into place.

Inside the head you could have a simple ball bearing, dangling from the top of the scull by a thin wire.  At this critical point, this pendulum will impact on the inside of the head.  This could then feed an interrupt on the arduino.

Or am I overthinking this?

minitreintje



It's only for the setup phase of course. I don't want to use buttons to calibrate the servo's end positions.
The problem is that the point is connected to the GND in the turnout, without modifications I can't use that.

I thought about a slide pot that follows the point move...


I think you are getting the jargon mixed up. A "point" and a "turnout" are the same thing - the thing in your photo.

I call the moving rails the "blades" of the point.

If the rails are used to pass power to the loco wheels I can't understand how any of them can be connected to GND. In many situations the moving blades are used to switch power from one direction to the other. Perhaps you can post a diagram showing how yours are wired.

If you use a slide pot don't you have the problem of calibrating it. Are you thinking of having a single pot that you manually move from point to point.

...R


You're thinking in 2rail, the points/blades are their isolated however I have 3rail Marklin. The turnouts are connected with a small black piece of metal.
I will move the pot slide manually.

@everyone
Of course I have to add some pressure on it.

Cheers,
Dylan

graynomad

Quote
Or am I overthinking this?


Probably :)

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Shpaget

The problem with your approach is that the flanges are permanently electrically connected to the rails in the underside. I don't see a way to separate them without braking the mechanism.

This is not exactly the solution you want, but I faced pretty much the same issue.
This is how my colleagues and I went about it.

http://backo.hr/web/hr/fotografije/fotografije/08-11-2012
The servo is driven to a predetermined position, programmed via computer. The servo positions are held in a decoder that controls 8 servos.
The servo has a magnet on one of its arms that triggers a reed contact which is placed in such a position that when triggered it confirms the servo has turned via a feedback module so that the software running the layout knows that the turnout/point is in proper position.
You could put two of them or limit switches to tell the servo when it has reached the desired position. The original turnout/point mechanism has a plastic spring that provides a bit of pressure and pushes the flanges/moving bits into the rails so accuracy isn't crucial. A few millimeters here or there is fine.

Robin2

Just another idea ...

Could you make something (a little block of metal - or wood or plastic with a metal contact attached - which fits snugly between the point blades and moves with them. And make another piece which straddles the non-moving rails (but is electrically isolated from them) and provides a contact point for the moving part to touch when the point blades move to one side (or maybe both sides. What I have in mind is something which snaps in place on a point in a few seconds and provides the contact points for a detector circuit.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

minitreintje

Thank you all for your replies...

@ Shpaget

Your solution is amazing! Do you have some DXF files or something?
This is better then my idea, the turnouts have then feedback and it's compatible with every Märklin C-rail turnout.

Cheers,
Dylan

vaclav

Few questions and some suggestions.
One to show my age - since when remote switches / turnouts ( I really do not care what residents of Upper Wizbangia call them) are controlled by servos? (Perhaps to avoid the "snap" switching?) In my days they operated / snapped using solenoids.( My Z scale remotes are operated that way still)
Electric motors are pretty vociferous when stalled - so why not monitor the current when the end points are reached? Or some kind of clutch to slip - like cordless drills use noways.

And then there is little reflective module used for distance measuring, maybe it would work here from the position of your servo. It  would probably not measure the points movement directly. But that seems to be overkill since your initial goal is to determine the mechanical limits to start with.

But you probably need to measure one switch and than use the limits positions on rest of them.

PS Switch to live steamers!

Shpaget

#13
Sep 28, 2014, 09:17 pm Last Edit: Sep 28, 2014, 09:20 pm by Shpaget Reason: 1
This is pretty much the only thing I have:
https://drive.google.com/file/d/0B_533dN6yFSUNk5INGhTN3NrbmYtMlZycFlOOVZhVTZoZ3g0/edit?usp=sharing

It's a PDF with the 1:1 scale drawing for the main plexiglass board that carries everything. I'm having it laser cut in a local business. I sent them a sketch with the dimension and they did the CAD drawing which I never asked for. I never had the need for it, sorry.
https://drive.google.com/file/d/0B_533dN6yFSUa1pBcUg0UVFqdW5JaGhuckxidUY1OXQ1anJr/edit?usp=sharing
This is the original drawing I sent them. Note that there are a few errors in it and that it's not complete, but it should give you a starting point. If in doubt, use the drawing in the first link since it is more accurate.

The shape fits every Marklin C-track turnout (left, right, straight, curved, three-way, crossing) so, if you are going to replicate it, stay inside those dimensions. Unfortunately there are no mounting holes shown since they are drilled by my colleague. He had a reason he wanted to do that part himself, but I can't remember what it was.

As for servo decoders, I'm using http://www.modellautobahnen.de/shop/dc_car_modellbahntechnik_servodecoder_betriebsbereite_baugruppen/_servodecoder_bis_2_wege_8_servos__dcc_und_motorola_140318.html
Feedback is done via http://www.ldt-infocenter.com/shop/en/Feedback-modules/s88-feedback-bus/16-fold-feedback-modules/

Vaclav,
Solenoids are still used today and that is still the way original Marklin mechanism is made. However we had lots of problems with them and decided to take them all out (which is not a small thing to do since there are more than 300 turnouts on the layout). We tried using Wiessmann turnout motor, but the build quality of it turned out to be utter garbage. So we decided to build our own...

vaclav


This is pretty much the only thing I have:
https://drive.google.com/file/d/0B_533dN6yFSUNk5INGhTN3NrbmYtMlZycFlOOVZhVTZoZ3g0/edit?usp=sharing

It's a PDF with the 1:1 scale drawing for the main plexiglass board that carries everything. I'm having it laser cut in a local business. I sent them a sketch with the dimension and they did the CAD drawing which I never asked for. I never had the need for it, sorry.
https://drive.google.com/file/d/0B_533dN6yFSUa1pBcUg0UVFqdW5JaGhuckxidUY1OXQ1anJr/edit?usp=sharing
This is the original drawing I sent them. Note that there are a few errors in it and that it's not complete, but it should give you a starting point. If in doubt, use the drawing in the first link since it is more accurate.

The shape fits every Marklin C-track turnout (left, right, straight, curved, three-way, crossing) so, if you are going to replicate it, stay inside those dimensions. Unfortunately there are no mounting holes shown since they are drilled by my colleague. He had a reason he wanted to do that part himself, but I can't remember what it was.

As for servo decoders, I'm using http://www.modellautobahnen.de/shop/dc_car_modellbahntechnik_servodecoder_betriebsbereite_baugruppen/_servodecoder_bis_2_wege_8_servos__dcc_und_motorola_140318.html
Feedback is done via http://www.ldt-infocenter.com/shop/en/Feedback-modules/s88-feedback-bus/16-fold-feedback-modules/

Vaclav,
Solenoids are still used today and that is still the way original Marklin mechanism is made. However we had lots of problems with them and decided to take them all out (which is not a small thing to do since there are more than 300 turnouts on the layout). We tried using Wiessmann turnout motor, but the build quality of it turned out to be utter garbage. So we decided to build our own...


Wow.
Is that for real 300 turnouts @ 60 euros each? And it cannot tell the end position ?
I like my "idea" more and more - optical recognition, at worst Bluetooth "senders" for few $ each.
Back to coding.


Go Up