Stephen Freeman

Western Thunderer
Many thanks for the informative reply Simon. I certainly see where you are coming from. and I could not agree more about having nothing below the baseboard - on John's layout, there are cupboards under there as everything is mounted on the basboard fronts, including the servos which then drive the points via over-baseboard wire-in-tube whilst the signals plug-in from above. But my point was that the final connection to the servo is independent of the means of transmission from the frame - at some point you have one wire per lever/one wire per servo! Of course I over simplified how John makes the actual servo connections on Leeds - he uses the MERG controllers via a local relay - it is these which are hardwired to the switches via the D leads. A complication is that in addition to the "proper" controls, an over-ride allows the points to be worked from manual switches allowing John to work the layout when none of the rest of us are there!

Having built and fully interlocked four quite large installations for Leeds, (each of them bigger than most people's layouts!) using mechanical, relay and software approaches, I am getting a pretty good idea of the upsides and downsides of each. But if there is one thing I have learned from my involvement with the Leeds project, it is that both problems and solutions tend to be rather special for such a complex situation and things which are fundamental to us might be irrelevant to others.

Regarding interlocking in Arduinos, I use a large struct (though if you know enough about C++ an object might be better) to hold all the data which is created in an XL spreadsheet (to be human readable) and then copied and pasted into the code. The same approach is used for mapping all the I/O connection tables, LED function maps. Push button IDs etc. - the only thing "hard coded" is the logic which is universal and therefore transportable to any layout - so the code contains no "magic numbers" of any kind.

I would be happy to post some code snippets if you (or others) would be interested but since no one asked in response to my Leeds post, I assume no one is bothered.

<on> rant mode
I had a look at the PASSIM project - without wishing to be disrespectful, what a *^*%$ load of cr*p. No wonder there seems to have been no update in a while. I found it totally frustrating: these people do not know the first thing about either signalling or interlocking and have not troubled themselves to learn about it. Worse, they imply no one has ever previously signalled or locked a model railway correctly - I beg to differ and so would many of my modelling friends; one of whom wrote about his interlocked frame in MRJ 35 years ago and has exhibited with it over 50 times since! To PASSIM I say why not start by understanding the principles which have been developed by the real thing over 200 years? There is no problem we face on a model which has not already been solved many times over and it has never been easier to research such things. For my part, I went in my first mechanical signal box 58 years ago, my first panel box 2 years later. And at the age of 14, I spent my Sunday afternoons working a box on an electrified main line (12 trains per hour) whilst the signalman washed his car outside! I built my first interlocked lever frame 54 years ago - and a poor thing it was - and so I reckon to know a bit about the job by now; yet, every new project, every day; I learn more - and never by re-inventing wheels! (my mechanical locking is pinched from the GW!)

If the PASSIM people want to see mechincal locking simulated in Windows, they could look at my own simulations - including 131 levers at Exeter West and the busiest frame I have ever seen - with 94 working levers - at Crow Nest Junction ... Mechanical Signalbox Simulations for Windows

<off> rant mode

Looking forward to further developments...
I only managed 2 boxes, both long since gone, one was a quiet branchline (which is still working no station now) and the other was on the WCML! No levers but I did manage to get the use of the Bell signalling the other box!
 

SimonT

Western Thunderer
Simon,
back at #78 you mentioned supplying a copy of the sketch and circuit diagram. I've just acquired some of the Make It Minature Turnout Actuators to replace some re-usd Tortoises. I have finished the 'lever frame' line of switches with interlocking relays to drive the layout. The discovery of the actuators being servo driven, requires a change of course. The servos will be scattered over three baseboards so I am probably looking at an Arduino attached to the frame and one on each board and a CAB bus to connect them. I'm only looking at signals and points. Any recommendations of suppliers and a copy of the sketch and circuit diagram would be much appraciated.
And Yes, I'll write up the experience here.
T'other
 

simond

Western Thunderer
Hi Simon

Some bits and pieces attached. Please assume that nothing works, and if it does it will be a nice surprise...

It’s still all a bit “work in progress”.

You’ll need to put each .ino file in a folder of the same name - I have no idea why.

unfortunately the circuit diagrams are drawn in an Excel file and I can't upload same, but the picture will help, I hope - this is the two sides of the slave board, with an arduino and a CAN interface mounted one side, along with two 5-way sockets for the CAN bus and some 3-way connectors for the servos.

Arduino servo commands are well covered by the IDE documentation. https://docs.arduino.cc/learn/electronics/servo-motors/

The CAN interface is an MCP 2515 - £0.77 from Aliexpress.
I was going to make some custom boards that simply use the chips that the MCP2515 uses, but I have not yet got around to that. And at 77p...


1747401921645.png

image.jpg

Shout up if I can help with anything

With a bit of faffing I got the servo slave to operate servos, Dapol signals or colour lights. No hardware changes, just a couple of lines of code

Note that the servos do not need to be attached to the slave in any particular order, you just associate each one with a particular lever.

S
 

Attachments

  • turntable_28may17_a4988_subroutines_with_sensor.ino
    12.6 KB · Views: 3
  • Lever_Frame_CAN_control_22jan25.ino
    7.1 KB · Views: 3
  • CAN_slave_31jan25.ino
    8.9 KB · Views: 2
Last edited:

SimonT

Western Thunderer
Simon,
thank you. I thought I was doing quite well reading Rudy's sketches up until now! The first servo is mounted on the layout and tomorrow should bring a servo tester, for a functional check, and an Andruino Uno. I intend to use the existing switches for the points and signals through the relay matrix that provides the back locking; this will need to change from 12V to 5.5V and I will probably have to change the feed to be through the switches and relays so that the pin gets a High signal to trigger the servo. Hopefully with this change I can feed the Andruinos using the existing wiring. I will need to supply a separate 5.5V feed to the layout for servo power.

Next job is to strip down an old ATX computer to reuse the power supply.
Thanks
S
 
Top