Author Topic: Next electrical question: Arduino powered DC/DCC circuit breaking?  (Read 2183 times)

0 Members and 1 Guest are viewing this topic.

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #30 on: February 24, 2024, 06:43:57 PM »
0
Arduino?

Perhaps this will be useful.  It tells whether the voltage connected at the input is AC or DC, and lights one or the other LED, and powers or drops out a relay.
And yes, this works, and yes, I have PCB layouts for it. 

Two of these and you know whether each track is DC or AC.

Now, what do you want to do with that information?


Can it detect if both AC and DC are present?

mmagliaro

  • Crew
  • *
  • Posts: 6368
  • Gender: Male
  • Respect: +1871
    • Maxcow Online
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #31 on: February 24, 2024, 10:00:53 PM »
0
No.
It goes to one state or the other.
In fact, I think for what is needed in this application, that circuit is overkill.
You could put a relay across the tracks with a small cap inline to block DC, and it's default state would be "DC".
If the DCC is on the rails, it would pass the cap, and flip the relay, indicating "DCC".
You now have two relays that will either be in the same state or not.  And if they are not, you have to decide what you want
to do with that info.   So yeah, you can forget that schematic and just do this with a simple relay and cap across each track,
and then do "something" with the relay contacts when they are not in the same position.
Anything that is completely off would still indicate "DC", but so what?  The key here is what happens when the power is on.
I would argue that if one track is powered from DCC and the other track is off, you probably still don't want a train
going through the crossover.


Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24745
  • Head Kino
  • Respect: +9272
    • Conrail 1285
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #32 on: February 24, 2024, 10:18:34 PM »
0
Ed, If I understand you correctly, you aren't trying to allow an engine to cross between the DC and DCC side and just work.
What you want is summed up in final statement:
"If there's a "yes" to all three conditions, it'd need to trip a relay to kill the power."

I don't think you really care whether there is DCC on one side and DC on the other.  What you really care about is just cutting the power if there's a short, where "short" means excessive current draw, no matter what causes it.     And you need to be able to detect this fast enough that you cut the power before anything like the DCC booster is damaged (assuming that it doesn't just trip its own overload protection).  What else about this am I missing?

That's exactly it.

I don't want to enable the crossover, I just want to make sure nothing expensive blows up if it happens.

mmagliaro

  • Crew
  • *
  • Posts: 6368
  • Gender: Male
  • Respect: +1871
    • Maxcow Online
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #33 on: February 24, 2024, 11:29:27 PM »
0
That's exactly it.

I don't want to enable the crossover, I just want to make sure nothing expensive blows up if it happens.

Ah, okay.  So if one loop is DC and the other is DCC, everybody is happy to let them run that way, as long as nobody throws a turnout so that there is now a crossover between the two, right?  Is it okay if somebody errantly throws the turnout and everything
comes to a screetching halt when they do that, even if a train isn't going through crossover at that moment?

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #34 on: February 25, 2024, 12:23:40 AM »
0
Okay guys, how about this...

Buy two stationary DCC decoders with constant voltage outputs (probably 12VDC).  The other parts needed are a latching relay and a momentary push button.  The relay power contacts need to be rated for at least the DCC booster max output (5A?).  (You really only need a single-pole relay for one DCC rail but if you want to be complete you can use a 2-pole relay for both rails.)  The relay coil voltage needs to be whatever the decoder function output is (again, probably 12VDC).  The decoder output has to be enough mA to drive the coil.

Connect one decoder to the DC power output.  (I guess there's a possibility that the DC voltage could damage the decoder, but I think that's unlikely and probably you can find one that this isn't true of.)  Connect the relay coil that opens the relay to the decoder function output.  Program the DCC system to always have the function output on.  Run the DCC booster output through the relay contact(s).

When everything is normal the decoder just sits there doing nothing.  The relay coil to open the relay gets no power so the DCC system powers the track.  Now the problem occurs: a loco bridges the gap, you now get DCC voltage on the DC powered rails.  The decoder connected to the DC rails picks up the DCC signal, powers the coil that opens the relay, and cuts DCC power to the track.

Now there's one additional trick: the relay needed to be latching because otherwise when the DCC power is cut the decoder loses power and no longer keeps a normally closed relay open.  So now your latching relay needs to be unlatched.  This is where the other stationary decoder comes in.  Connect it to the DCC output through the momentary pushbutton. Once the loco that caused the problem has been moved, use the pushbutton to reset the DCC power.  When you power on the second decoder it's own output is connected to the other relay coil and unlatches the relay.

(Alternatively, you could just use a 12VDC source with the pushbutton, instead of a second decoder.  That would requires less DCC setup but then you've got to get that power from somewhere.  You pick.)

Assuming this works well, you could put this altogether on a portable board or a box that just has DC in and out and DCC in and out. (or additional input for 12VDC power).  You just need to have a note about the decoder function address, and enable that function output on the DCC system and test before you starting running.  If you have multiple DCC boosters you need one of these setups for each booster (with different decoder addresses).

My only question are how quickly and reliably the decoder will get the DCC signal and react to open the relay.  Also I can't speak to the potential damage to the DC powerpack in testing.  Make sure it's short duration I guess, and always use a DC powerpack that's okay with getting DCC voltage that long.

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24745
  • Head Kino
  • Respect: +9272
    • Conrail 1285
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #35 on: February 25, 2024, 09:25:29 AM »
0
Ah, okay.  So if one loop is DC and the other is DCC, everybody is happy to let them run that way, as long as nobody throws a turnout so that there is now a crossover between the two, right?  Is it okay if somebody errantly throws the turnout and everything
comes to a screetching halt when they do that, even if a train isn't going through crossover at that moment?

Yep!

Maletrain

  • Crew
  • *
  • Posts: 3546
  • Respect: +606
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #36 on: February 25, 2024, 10:23:07 AM »
0
It seems like this is getting over-engineered.

Why not just put a shorting jumper across the rails of the diverging route of each crossover turnout?  Then, if the power-routing turnout gets manually thrown to the diverging route, the short shuts down that loop until the turnout is restored to straight-through direction.

Jumpers would be cheap and easy to see to assure they are in-place on every crossover turnout.  With a little bit of engineering, it should be easy to solder a couple of snap-on clips to a piece of PCB board so that they would just snap onto code 80 railheads.

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #37 on: February 25, 2024, 10:31:52 AM »
0
It seems like this is getting over-engineered.

Why not just put a shorting jumper across the rails of the diverging route of each crossover turnout?  Then, if the power-routing turnout gets manually thrown to the diverging route, the short shuts down that loop until the turnout is restored to straight-through direction.
...

Because that's not a short.  It won't trip any source's overcurrent protection and it won't work. 

Maletrain

  • Crew
  • *
  • Posts: 3546
  • Respect: +606
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #38 on: February 25, 2024, 10:38:12 AM »
0
A connection across rails with opposite polarity/phase, powered by the same power source isn't a short?  Please explain your reasoning.
« Last Edit: February 25, 2024, 10:56:15 AM by Maletrain »

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #39 on: February 25, 2024, 10:57:54 AM »
0
A connection across rails powered by the same power source isn't a short?  Please explain your reasoning.

Ah, I misread and thought you meant jumpers from the DC rails to the DCC rails.  Sorry.

Now that I understand what you meant, that's a great idea, at least for the DCC side.  You could even do them on top of the rails and decorate your jumpers with little blue safety flags and a figure in an orange vest.

I say 'at least for the DCC side' because I think overcurrent protection and indication behavior on DC powerpacks is a lot less predictable.  So you probably want to make sure with your power source that it behaves relatively predictably and that operators know how to recognize the symptoms.

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #40 on: February 25, 2024, 10:59:33 AM »
0
But the DC side is also the less important side IMO.

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24745
  • Head Kino
  • Respect: +9272
    • Conrail 1285
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #41 on: February 25, 2024, 11:11:34 AM »
0
Sorry guys, I guess I didn't explain all the background.

I'm trying to figure something out for a TTRAK layout. One of the big unwritten tenets of TTRAK is that it's accessible for modelers of all levels. From the recently retired guy who just a Bachmann set because his family needs him to find something to do to the boy genius who's 3D printing his own Unitrack.

That means we have zero control over what people do on modules so requiring turnout modifications is not possible.

In that same vein, the idea of scheduling "DCC time" is similarly antithetical to the idea of accessibility and "come as you are".

At the same time, because the club is making the investment, I really want to protect that investment from user error to the best extent reasonably possible.

Thanks for all the discussion guys!

The idea is that because the club is providing the infrastructure

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24745
  • Head Kino
  • Respect: +9272
    • Conrail 1285
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #42 on: February 25, 2024, 11:13:23 AM »
0
But the DC side is also the less important side IMO.

Almost certainly. DCC components are almost always more expensive to replace.

The more I think about this the more I think that just using DCC circuit breakers might actually be enough to protect "the expensive stuff".

jagged ben

  • Crew
  • *
  • Posts: 3256
  • Respect: +501
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #43 on: February 25, 2024, 11:20:46 AM »
0
Sorry guys, I guess I didn't explain all the background.

I'm trying to figure something out for a TTRAK layout. One of the big unwritten tenets of TTRAK is that it's accessible for modelers of all levels. From the recently retired guy who just a Bachmann set because his family needs him to find something to do to the boy genius who's 3D printing his own Unitrack.

That means we have zero control over what people do on modules so requiring turnout modifications is not possible.

In that same vein, the idea of scheduling "DCC time" is similarly antithetical to the idea of accessibility and "come as you are".

At the same time, because the club is making the investment, I really want to protect that investment from user error to the best extent reasonably possible.

Thanks for all the discussion guys!

The idea is that because the club is providing the infrastructure

Okay but can you not at least assume that turnouts are power-routing?  That's part of the T-Trak standard, right?  In that case Maletrain's idea will work great.

Maletrain

  • Crew
  • *
  • Posts: 3546
  • Respect: +606
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #44 on: February 25, 2024, 11:42:46 AM »
0
The T-Trak standard is Kato #6 turnouts for the mainlines.  Kato #6s are always power-routing. 

Kato #4s can be either, based on positions of a couple of screws on the underside.  Mine have always been power-routing out of the box.  T-Trakers who want to use Kato #4s are directed to do some mods on the turnouts (filing points and stock rail notches), so specifying that they must be power routing isn't any substantial additional burden.  But, there is the problem that the instructions are backwards, so some might inadvertently be made non-power-routing.  But, that can easily be checked with a multimeter.
« Last Edit: February 25, 2024, 11:46:13 AM by Maletrain »