fourtytwo wrote:Hi Albert
I foresee a potential problem in your application and that is these track circuits are designed to be used in a common return system where the common return is system ground. The first important point is the track circuit bias must always be +24V relative to common return. The OCC signals are also referenced to common return. In my case with floating transformer secondaries and a simple transistor controller there is no issue as each controller has a simple DPCO reversing switch at its output connecting either pole of the controller to common return as required. However in your Arduino based PWM controller if it contains a DPCO reversing switch at it's output the Arduino 0V will not always be at common return potential hence the same Arduino cannot be used to sense or act upon the track circuit OCC signals. Hope this makes sense.
It's been so long since I set up the original version of this project that I forgot to mention that the traction current is not sourced directly from the Arduino. Sorry if this has complicated mattersThe PWM pins drive an L793D which can control a separate power source:
The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide
bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to
provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are
designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well
as other high-current/high-voltage loads in positive-supply applications.
I'm presently using it to provide four uni-directional channels but when I get onto end to end layouts each L293D can provide a pair of bidirectional feeds.
If (big if!) I understand what you have said so far, this should solve the problem because the arduino board power is totally isolated from the final PWM output. I'll need (and have) a total of three wall warts: one (5v) to power the Arduino, one (12v as at present ) for traction power and one (12v again) for the bias voltage.
There are some things on your circuit diagram that I don't think directly concern building the circuit I need:
The two lines of text starting with 'PULSE'
The section at bottom left marked 'for Spice test purposes only' (I guess this represents the loco motor)
the line '.model SW....' at the bottom
the '.tran... ', '.param...', and 'step param...' lines up at the top'
Does the line marked 'rail' near rhe bottom of the main diagram indicate the layout power rail?
What point on the diagram represents layout the common ground rail?
What point on the diagram goes to an Arduino input pin and what does 'occupied' signal look like?
What point on the diagram goes to Arduino ground?
You may have gathered that I am decades out of practice at reading analogue circuit diagrams. Sorry.
Thanks for all your help so far.