There are two connectors for panels, each of which will have a pair of lighted pushbuttons for local control, 2 servo outputs. Power input, with reverse polarity protection. A connector to go to outputs on a controller board to provide dispatcher control of the servos and to lock out the pushbuttons. There are 4 relays, 2 per servo. One controls power to the frog, on and off, and the other controls the frog polarity. So any kind of turnout can be used - before a servo moves, power is cut to the selected frog, then the servo moves, then the frog polairy switches, and finally frog power is turned back on. If not needed, jumpers can bypass the contacts. All centered around an Atmel ATMegas328p microcontroller (same as in the basic Arduino boards, but here just the bare chip and none of the Arduino baggage.)
Next comes the PCB - that’s the hard part, getting it all laid out neatly and efficiently.
The MOSFET is a little trick to get reverse polairty prootection without the voltage drop of a diode (which in the real world is highly non-linear).
Killing frog power is to handle things like the older Walther/Shinohara turnouts where they even had problems with Tortoise contacts when used for DC. I don;t have any, and I’m not using any, but I had this discussion a while ago - I could leave that all off, but it doesn;t free enough pins to say add support for a 3rd servo, so meh, it’s there. I will probbaly build all mine with a jumper and not populate the relay, transistor, protection diode, etc. Or maybe I’ll just design the PCB with a jumper, and should someone want to copy it and use it for such turnouts, they can cut the trace and install the relay and associated components.
The center servo jumper sets both servos to the center position for installation. It’s read at startup and centers the servos and goes into a loop. I have to look at my code again, I don’t know if I periodically check it so you cna remove it and return to normal operation of if you need to reset the program with the jumper off to get back to normal.
The remotes are just digital inputs They will connect to outputs on my C
CirCAD is far from perfect as far as I’m concerned but it does do better than OK and what I like the best about it is it will import my CAD drawings saving a lot of time building up the boards.
Almost any footprint is available from CirCAD ready to go. I have only had to draw one to fit my projects in almost 20 years and I can’t remember what that was.
I’ve never liked working online but it does have its advantages. I got a bug in my CAD three weeks ago and I had to do a reload, that hasn’t happened in over twenty years. The auto dimensioning quit and dove my crazy. The reload fixed what ever got lost. Luckily it didn’t corrupt any drawings. I had taken a Windows 10 upgrade a couple of days earlier and I think it dinged something in the program.
yet you have a diode in the path supplying power to the processor
presumably you kill power to the frog, change the signal to the servo to switch the points and wait some period of time before restoring power to the frogs.
since servos have a specified rotation rate, couldn’t the frog polarity simply be changed sometime after the servos start changing the position, presumably at their mid-point? avoids the need for the relays, circuitry and I/O.
you have 8 I/O lines to control 2 turnouts from either of 2 panels. Are the lighted pushbuttons momentary so that either panel can be used to control the turnout?
Would the lamp in a pushbutton on one panel change if the turnout was toggled on the other panel?
if momentary switches are used, couldn’t you use a single analog input for each servo using the momentary switches from either panel to pull the ADC either hi or lo?
couldn’t a single I/O for each servo be routed to both panels to indicate turnout position regardless of which panel or remote was used to affect the turnout?
and would you be better off with latching relays (> $$) to avoid constantly powering the relay? (looks like the SRD-05VDC-SL-C requires 71 ma).
The extra diode is to keep the servos from sucking down the power to the micro. It may be uncessary - other suggested it a long time ago.
Yes, I could set it up so that it changed the polarity relay when the midpoint has passed. The current way is pretty simple - pull in the power relay (the NC contacts carry the power) start the servo moving. When opposite end of travel is reached, switch the polarity relay, switch the indicator LED, and finally release the power control relay. The only test for servo position in the loop is to see if it has reached either endpoint. They are momentary.
Each panel controls one servo. Panel one is 2 pushbuttons and 2 indicators for servo 1. Panel 2 is 2 pushbuttons and 2 indicators for servo 2. They don;t interact with each other. The panel lights do change if the input comes from the remote connection.
Yes, I could play games with multiplexing and cut it down - look at the Tam Valley controllers, 3 wires to a fascia controller handls 2 LEDs and a pushbutton. Those are toggle pushbuttons, frankly I hate toggle pushbuttons, rather have one for each route. So maybe I would need 4 wires to the panel, 2 IO pins, to drive 2 LEDs and read 2 switches. Instead of the 4 IO lines I am using. But it keeps the code simple, basic checks for button push, and steady state outputs for the LEDs. Plus it’s easy to change what I want to do with the LEDs. Right now, when the centering jumper is on, the LEDs alternately blink, like a grade crossing flasher. They go out when the servo is in motion, but I could easily change that to blink the newly selected position while in motion and then go steady on when the position is reached. Or sub in bi-color LEDs so the selec
so why not use a 2nd mosfet to avoid the diode drop?
if you’re slowly changing the servo signal to drive from one position to the other, then you know when you’re at the mid-point where you could switch frog polarity, but you have no true feedback that the points are in the correct position.
you have 2 relays and drive circuits to unpower the frogs. You could add a jumper/pads to bypass the relay circuit to make it optional
you have pull-ups on the indicator outputs as well?
isn’t this how you intend to use the analog input from the remote? could you explain the input more
what exactly is the purpose of the centering connector?
There was a reason, the first version of ths I drew up more than a year ago and posted to an EE forum for comments. I was planning to do the same with this one.
Well yes, I know where the servo is at all times, but there’s no test for midpoint in the code. Yes, I can add one. I’ve already mentioned using jumpers (or a solid trace that could be cut) to bypass the power relay if not needed.
The pullups are only on the inputs, the buttons. The 100 ohm series resistors are for protection. Each RJ45 on the left is for 1 panel, there are 4 active lines and 4 grounds (by pair, I need to change the pin numbers) 2 are inputs from the buttons, 2 are outputs to the LEDs.
The remote inputs from the right side are all inputs. The remote line is pulled high, as are the locks. Lock line high means the buttons are UNLOCKED - so if I turn on the layout but not the CMRI nodes, the layout will be operational in full manual mode. hen unlocked, the input from the remote line is ignored. When the lock line goes low, the buttons for that servo are locked out and do nothing. The remote input for that servo now determines the servo position, high is normal, low is reversed. Simple digital logic, no analog stuff. I’m just doing digitalread on an analog port - the whole nalog pin vs digital pin is an artificial construct of Arduino, that ATMega328 allows those poorts to be used as analog or digital, they just happen to be the ONLY ones that can be used for analog because that’s where the internal ADCs connect.
The centering jumper puts the servos in their centr position. To make it easier to stick the wire up through the throwbar when physically installing them. Yes, you can move them by hand, but why not set it the right way? You can then power off everything, install the servos, and turn it all back on with the jumper off and it will just work normally.