Skip to main content

I want to have a latching, 2-state circuit(s) that will respond to the control panel 3-position (Mom-Off-Mom) toggle switches and also to the AIU when either actuate a Switch Track. I have already wired all the five AIU’s to the 57 Switch Tracks, and this required only 46 AIU channels since several Switch Tracks are crossovers and are connected in parallel pairs. I have wired eight of the 46 toggle switches in parallel with the AIU outputs already, and this works fine too.

 

I am actuating the Switch Tracks with 18VAC. When I measure the voltage at the toggle switches momentary contacts, I get 18VAC when either the switch itself or the AIU is actuated, as would be expected. Adding a diode between the multimeter and the toggle switch, I get about 9VDC, as would also be expected.

 

 It has been so long since I have done any design that I do not even remember what components are available, and in some cases how to use them. Below is my conceptual circuit, but I know it needs more to work.

 

I am ready to breadboard the circuit, but believe it would be wise to consult here first.

 

S1 is a momentary 3-position center off switch.

D1 and D2 are the two diodes used per switch to provide the DC set & reset signals for IC1.

IC1 is a ‘D’ Flip Flop (CD4013B) that has set-reset inputs. (I thought that SR or RS flip-flops were available, but couldn’t find any, so I am using the ‘D’ flip-flop. No big deal.)

R1 and R2 keep the inputs from floating, and I don’t know if they are necessary.

LED Drivers. I have no clue of what is available or what I need t drive the LED’s from the outputs of the ‘D’ Flip-Flop.

LED is a bicolor (Green-Red) LED, and I already have all the ones I need.

The 12VDC supply is for the ‘D’ Flip-Flop Vss/Vdd, and for the LED driver and LED.

(I forgot to label the two Switch Track coils shown at the output of S1 and the AIU.)

 

I imagine instead of the CD4012B I could use something like a MC74HC74A.

 

LED ST Indicator 01 DSC06446

 

Any comments and recommendations will be highly appreciated.

 

Thanks!

 

Alex

Attachments

Images (1)
  • LED ST Indicator 01 DSC06446
Original Post

Replies sorted oldest to newest

I forgot to mention, I don't know what LED driver you're using, but you should be able to drive those directly from the flop with a series resistor.

 

Finally, in looking at the circuit, I think I'd probably want some diodes running from the DC supply to each of the inputs to limit the travel to the power supply voltage.  Probably not necessary, but I'm looking for reliability here.

Hey, John -

 

Good points. I wondered about the caps, and I still have some that I can use. And the diodes never hurt, so they will go in as well.

 

Q: Should I ground any of the unused inputs through 10K resistors?

 

I will not use any LED drivers unless I have to; I need to double-check the output ratings of the FF. The 74HC74 may have a higher output rating, and if I decide to use it, I will have to use a 5VDC supply instead of the 12VDC, and probably add resistors between the switches and the FF to limit the R&S signal inputs.

 

EDITED TO ADD:

I checked the 7474 specs, and it can source 25ma per output pin - enough to drive the LED's, so that is what I will use.

 

Roger,

What gets me is that I used to be able to do this stuff as easily as I eating chocolate cake , but now it is like a dream from long ago.

 

Alex

Last edited by Ingeniero No1

Dale, John –

 

I have been thinking about that (wakeup state) from the start, and here is my plan – two options.

 

Option 1. Use a battery to power just the Dual-D FF to keep its last state. The chip by itself should not require much current. I have yet to figure out how to isolate the FF from the LED’s just for the battery backup mode.

 

Option 2. The 74HC74 will have all inputs either High or Low, and all unused outputs not connected. I will have the R and S inputs High(*) through 10K resistors, and also the D input (do not know if the D will need L or H).

 

If I use this option for ‘waking up’, I will apply a pulse at the Clock input at the start of the session, and this will cause all Q outputs to go High or Low, depending on the signal at D. Hence, all LED’s will go Green/Normal.

 

Of course, if I use this option, I have to make sure that when I leave the layout all Switch Tracks have to be Normal to match the LED wake-up condition. But this something I already do now; i.e., at the end of every session, I return all the Switch Tracks to neutral, and if I am not sure when I start the next session, I throw any questionable Switch Tracks to neutral.

 

Dale – switches? Switch Tracks or turnouts, correct? I have 45 Atlas with their standard machines (dual coils) and 12 RCS with the DZ1000’s. The control panel toggle switches are miniature toggles from Jameco.

 

(*) NOTE: Since I will be using the 74HC74 instead of the CD4013B, the input levels to it have to be the opposite of what I showed in the circuit diagram. This means that the inputs will be held High (not Low) and the D1 and D2 have to be reversed to provide a Low signal (from the toggle switches when actuated) to the S and R inputs.

 

Please, please, please – do not be bashful with your constructive critiques, and I thank you for what you have already provided!

 

Here is my control panel: (Click to enlarge) The LED's will be at the actual Switch Tracks - I have LED holders installed there already - show up as small black circles. The toggles on the track turn the track blocks ON/OFF (Up is ON).

 

Control Panel 02 med crp DSC_0400

 

THANK YOU!

 

Alex

Attachments

Images (1)
  • Control Panel 02 med crp DSC_0400

Dale,

Funny you said that. The last HO layout I had (1987-1993) was 100% computer controlled. I used a Compaq with the 8086 and a whopping 10MB hard disc! The program was Quick Basic and Assembly Language. When I started the session, the first thing the program did was to cycle through all the turnouts and set them to neutral. I had not thought of a Shutdown ROUTE as you suggested, but that will work as well! Thank you.

 

Today's questions -

 

Initially, I was going to use a CD4013B, but have decided to instead use a 74HC74 (also a dual D flip flop) because its output can drive the LED’s directly (thanks, John).

 

Whereas the CD4013B could run at 5-15V (or so), the 74HC74 does not like anything over 6v, so I will use a 5VDC regulated supply for it. Also, the 74HC74 requires a negative signal/pulse at the SET and RESET(CLR) inputs.

 

As I showed in my circuit (first post), I was going to connect the common side of the 18VAC supply (for the Switch Tracks) to ground (the negative of the 5VDC supply), and tap the toggle switches momentary contacts (the other side of the 18VAC supply)  through diodes to the SET and RESET inputs of the D Flip Flop. I measured this voltage, and as expected it is around 9VDC (half of the 18). That 9VDC is the RMS value, and I imagine that the Peak value would be around 13V.

 

Anyway, for the 74HC74 I need a negative pulse, so the diodes (D1 and D2) would be inverted from what I showed in the circuit diagram.

 

Two questions:

(1) Based on the above, would I connect the common side of the 18VAC supply to the Plus (+) side instead of the (-) side of the 5VDC supply? This appears correct, but I prefer to ask.

 

(2) The 9VDC/13Vpeak signal from the toggle switches would be too high for the 74HC74 SET and RESET inputs, so I need a resistor of other means to get that signal down to 5v. Any idea of what value resistor may be required?

 

I'll post an updated circuit schematic later today.

 

Thank you once again!

 

Alex

For each input:

R1 10K pullup to +5V

D1 cathode to input, anode to ground

D2 anode to input, cathode to 10K "input" resistor

R2 10K from D2 cathode to switch terminal

 

The input will sit high normally due to the pullup.  When the switch is closed, the negative swing of the voltage will pull the input down until D2 clamps it at -.6V.

 

Disclaimer:  I haven't built and tested this circuit.

Dale,

• You are right! The 18 volt is the RMS of the peak, and the true peak is 18 x 1.414, or 25.4V.

• In the original circuit, R1 and R2 served the same function; i.e., pull the inputs down. And D1 and D2 also had the same function – provide a DC signal to the inputs from the AC present at the toggle switches.

 

Here is the new circuit using both D-FF’s contained in one 74HC74 package.

  

D Flip Flop Ckt-2001

 

In the circuit above,

TO1, TO2: Turnouts (Switch Tracks)

S, S2: Control panel toggle switches (Mom-Off-Mom)

R1 > R4: 10KΩ (Reduce voltage for input) *

D1 > D4: IN4004 (provide DC signal for inputs)

R5 > R8: 47KΩ (pull up inputs to +5V) **

R9, R10: 470Ω current limiting for LED’s

IC1: 74HC74 Dual D-Flip Flop with Set and Clear/Reset

LED1, LED2: BiColor LED's

5VDC: Supply for IC1 and LED’s

18VAC: Supply for Switch Tracks (and provide pulse for S and R inputs to IC1)

 

Questions:

* Will R1 > R4 (10K&Omega be sufficient to reduce the 25V to about 5V?

** Will R5 > R8 (47K&Omega be OK to pull up the inputs to 5V and be small enough to allow the signal from the switches through D1>D4 and R1>R4 pull the inputs down close to 0V?

 

I will breadboard the circuit as soon as I receive the components (don’t have the 74HC74’s yet), but I want to be as close as possible ‘on paper’ .

 

Thanks!

 

Alex

Attachments

Images (1)
  • D Flip Flop Ckt-2001

Just thought I'd throw in what I've been using on my Atlas switches, a low-force SPDT Microswitch (Cherry E61-60H (9 grams), Mouser 540-E61-60H). A piece of bamboo barbeque skewer stuck to the lever with CA gives me a little extra clearance.

 

 

combo

 

This works great as long as you have room to squeeze it in. The cover is folded construction paper stuck together with a glue stick.

 

Regards,

Gary F.

Attachments

Images (1)
  • combo

Gary,

I have been experimenting with low force limit switches as the one you showed, and have also made my own. I am trying to actuate them with the points to make sure that the points themselves, and not the switch machines or linkages, are properly and fully thrown. I have had good success with my home-made version, but they are difficult to install. In the meantime, I will use the scheme we are discussing, which requires local wiring; just within the control panel.

 

Dale, John –

My parts were supposed to arrive today, via USPS, but they didn’t, so I wired the input signal circuit to test it, using Dale’s suggestion and John recommendation. (THANKS!)

 

Here is the circuit (correct, Dale?)

 

FF Input Test0 Ver2 DSC06518

 

Test bench

FF Input Test1 DSC06493

 

Test circuit

FF Input Test2 DSC06492

 

(V1, V2, and V3 are the test points, as shown in the circuit diagram, above.)

V1: 18VAC (supposedly), but it actually is 21.1 VAC RMS, about 30V Peak, 60V P-P

I imagine that with a load it would be closer to 18V.

FF Input Test3 V1 DSC06516

 

V2 with S1 open. Not significant.

FF Input Test4 V2 S1 open DSC06511

 

V2 with S1 closed. Not significant.

FF Input Test5 V2 S1 closed DSC06514

 

V3 with S1 open. (Actual input to ground = +5V, as desired.)

FF Input Test6 V3 S1open DSC06508

 

V3 with S1 closed - input is active. It is negative from the above state, but it still is above ground level. Will it work?

FF Input Test7 V3 S1closed DSC06510

 

I can hardly wait to get the parts!

 

THX!

 

Alex

Attachments

Images (8)
  • FF Input Test0 Ver2 DSC06518
  • FF Input Test1 DSC06493
  • FF Input Test2 DSC06492
  • FF Input Test3 V1 DSC06516
  • FF Input Test4 V2 S1 open DSC06511
  • FF Input Test5 V2 S1 closed DSC06514
  • FF Input Test6 V3 S1open DSC06508
  • FF Input Test7 V3 S1closed DSC06510
Originally Posted by Ingeniero No1:
Any comments and recommendations will be highly appreciated.

Well, if you're soliciting "any" comments, it seems that your circuit only indicates what is being commanded.  I'd think you'd want something that indicates the actual position of the switch.  Perhaps some kind of optical, magnetic, or mechanical detector directly driving the LEDs?  This would make the initialization problem moot since no "state" memory is required.

 

Dale,

"I think your 18V supply should be referenced to ground, not +5V."

I had wondered about this earlier. Just to be clear; you mean one side of the 18VAC connected to ground and not the +5, correct? (As opposed to just the voltage measurement on the existing circuit as it is.)

 

Stan,

You wrote, "I'd think you'd want something that indicates the actual position of the switch."


And I had written on my last post, in reply to Gary's suggestion of the use of limit switches,"I have been experimenting with low force limit switches as the one you showed, and have also made my own. I am trying to actuate them with the points to make sure that the points themselves, and not the switch machines or linkages, are properly and fully thrown."

 

Thx!

Alex

Originally Posted by Ingeniero No1:

And I had written on my last post, in reply to Gary's suggestion of the use of limit switches,"I have been experimenting with low force limit switches as the one you showed, and have also made my own. I am trying to actuate them with the points to make sure that the points themselves, and not the switch machines or linkages, are properly and fully thrown."

Exactly.  What I'd find interesting is how the circuit should be configured depending on the type of position sensor and effort to modify the switch itself. For example, if using a minimal-throw limit button/switch would there be a no-man's land if the switch is not fully thrown.  In such a situation if the circuit output is digital like your FF, then one light will be on, possibly incorrect, and still have the startup issue.  A variation on the FF output might be able to drive your dual-color LED such that both R and G are driven so you see Orange in such a "fault" condition, or neither are driven so it is dark.

Plandis,

Yes, you got that right! That is the final goal: 100% computer control.

(Which begs the question - Then why the control panel at all? Because I prefer to actuate the turnouts with toggle switches rather than scrolling with the DCS remote as I am doing now, and computer control will be about a year away. Besides, the fully functional control panel will be neat.)

 

Stan,

Yes, that would be correct, except that if/when I use my sensors (two per turnout), they will drive the LED's directly - No Flip Flops. If the points are in no-man's-land, neither of the sensors will be actuated and the LED's will be off, which would be an indication of an improperly thrown turnout. I have tried my sensors on three Atlas turnouts and they work fine other than it is difficult to adjust them.

 

Dale,

I tried connecting one side of the 18VAC to ground instead of to the +5V, and that causes the input to be at -5v with no input signal, and at 0v (ground level) with the input signal applied. The 74HC74 requires that the inputs be pulled high with no signal, and then the signal would pull them to ground level. However, it may work anyway since I can always select the Q or not-Q outputs as needed. (I think)

 

<I sure hope my parts arrrive today so I can finally wire the actual circuit!>

Last edited by Ingeniero No1

You are right, Dale; of course it doesn't make sense: I had the scope probes switched around! 

 

Here is the circuit as it now stands, and with the scope ground clip at ground (duh!) and the probe at the 'input': (Note that V2 is measured across a different place from previously.)

With S1 open, V2 = +5v

With S1 closed, V2 = pulses to ground level

 

 FF Input Test V3 DSC06528

 

THX!

 

Alex

 

PS. No, I did not get my parts yet. The USPS tracking said Nov 30, but so far no luck.

Attachments

Images (1)
  • FF Input Test V3 DSC06528

John, I really appreciate your offer, but if I do go ahead, I will have PCBs made; it just is too much wiring to do it 'long-hand'. I am (learning) using ExpressPCB.

 

STATUS:

After lots of fiddling and trying different things, here is where I am:

 

After successful test with one half of the dual-D IC using the prototype board, I hard-wired one complete IC and tested it on the bench and then on the actual control panel. Not good results – the circuit is unstable.

 

On the test bench –

 

The A input (Clr) affects B Outputs.

• A inputs cause A outputs High and Low as expected [OK].

• A Clr-A input causes Out-B > High and (not)Out-B > Low, not as expected [Not OK]. The B outputs will remain as such regardless of subsequent A input signals.

 

B inputs are OK.

• B inputs cause B outputs High and Low as expected [OK].

• B inputs have no effect on A outputs [OK].

  

On the control panel –

With or without the Switch Track machines (solenoids) in the circuit, A and B outputs are unstable; they will not consistently have predictable output states. Inputs at A will affect B outputs, and vice versa.

 

Any suggestions on how to make the circuit stable?

 

Test setup on the bench:

ST-LED-Control Test 01 DSC06553

 

ST-LED-Control Test 02 DSC06552

 

Same board on the control panel:

ST-LED-Control Test 03 DSC06547

 

The control panel toggle switches (only two wired for the LED latch circuit)

ST-LED-Control Test 04 DSC06549

 

The bi-color LED's on the control panel.

ST-LED-Control Test 05 DSC06548

 

Circuit for one Dual D chip. I will need 23 of these, and will have 6 on each of 4 PCB.

STLEDControl01

 

Thanks!

 

Alex

Attachments

Images (6)
  • ST-LED-Control Test 01 DSC06553
  • ST-LED-Control Test 02 DSC06552
  • ST-LED-Control Test 03 DSC06547
  • ST-LED-Control Test 04 DSC06549
  • ST-LED-Control Test 05 DSC06548
  • STLEDControl01

I would start by tying four additional diodes on the set/reset pins to 5V, the anodes going to the IC pins.  You want those diodes to limit the positive excursion past 5V on the input pins going past the IC limits, as well as the existing ones protecting the inputs from going below ground.  Also, the spike filtering capacitors would probably be better directly on the IC pins, allowing the resistor to soak up any large spikes.  Remember, the coils in the switches are putting out a healthy spike at times, those may be causing latch-up of the CMOS chips.

 

It's always annoying when the lab circuit doesn't work in the real world.

 

 

Post

OGR Publishing, Inc., 1310 Eastside Centre Ct, Ste 6, Mountain Home, AR 72653
800-980-OGRR (6477)
www.ogaugerr.com

×
×
×
×
Link copied to your clipboard.
×
×