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

0 Members and 1 Guest are viewing this topic.

Ed Kapuscinski

  • Global Moderator
  • Crew
  • *
  • Posts: 24738
  • Head Kino
  • Respect: +9250
    • Conrail 1285
0
I was thinking about that classic NTRAK/TTRAK problem of DC/DCC interaction when you've got parallel tracks using different schemes and crossovers between them.

It's easy enough to deal with DC/DC or DCC/DCC issues, but I haven't seen the solution for DC/DCC crossover protection.

I think the reason is that it's a fairly unique use case that most "thinkers" are hopefully will eventually go away. I wish it would too, but we're not there yet, so I've been brainstorming on it.

The core problem is that it's not a simple "if short circuit cut the power" situation, and I have a feeling the industrial and commercial applications for this type of thing aren't common enough for us to benefit from.

That got me thinking: could an aduino be used to do this? I haven't gotten into that world enough to really know.

It'd need to monitor one voltage meeter to see if there's AC on it (ie, the DCC signal). Then it'd need to watch the other to see if there's DC on it. THEN it'd need something to sense when there's a short (which you'd get if you had something across the crossover, right?). If there's a "yes" to all three conditions, it'd need to trip a relay to kill the power.

That'd do it, right?

Do any of you know if this would be possible?

bigdawgks

  • Crew
  • *
  • Posts: 216
  • Respect: +188
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #1 on: February 23, 2024, 05:13:54 PM »
0
What exactly about such setup would cause a short? Also I assume that any short in either circuit would work regardless of what causes it? Maybe I'm missing som context because I've never tried mixing DC and DCC but my understanding of a "short" is exactly that - a short circuit (ex. current flowing across the rails with no resistance)

peteski

  • Crew
  • *
  • Posts: 32943
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5336
    • Coming (not so) soon...
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #2 on: February 23, 2024, 05:21:09 PM »
+2
One thing you never want to do is mix DC and DCC. Ever!
By "mix" I mean connect live DCC track with DC track.
. . . 42 . . .

Scottl

  • Crew
  • *
  • Posts: 4844
  • Respect: +1515
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #3 on: February 23, 2024, 06:12:49 PM »
+2
I have an Arduino set up for frog juicers that could effectively be modified as a circuit breaker.  There are cheap and easy AC current sensors available (about $2 each).  You read out the current and flip the frog when it exceeds a "short" threshold (say .2A or so).  Remember, we are dealing with a single locomotive on the frog at once, so the current is lower than the consist.  With a circuit breaker, you just turn off power to the tracks with a relay, so the block with a short is turned off.  Not sure about a threshold, but in principle you could set it low and just increase it as you need to.

I'm not ready to share the system but it is pretty easy with only a few components and minimal code.  No circuit boards or soldering either.  I'm working on an octo-juicer right now (8 frogs) but the principle is the same, code just cycles through reading current for each frog.  Need to figure out how to power all the relays (potentially) with a Nano or similar.  Trying to keep it simple but this seems to be a problem.

jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #4 on: February 23, 2024, 08:24:12 PM »
0
Ed, precisely what is the problem that you want to address and how do you want to address it?

A DCC locomotive crossing into a analog block isn't much of a problem at all in my opinion.  Depending on whether the decoder is programmed to function on analog voltage the locomotive will either move like a DC locomotive or stop.  It won't get damaged or damage anything.

A DC loco that crosses into a DCC block will buzz.  In my experience if removed from DCC power within 10-15 seconds it will suffer no obvious damage, unless it has something unusual like a custom Richmond Controls lighting effect board that runs on DC, in which case such lighting effect board will likely get fried. This is a somewhat legitimate problem. However it is not a short circuit and cannot be protected against with anything that works on a principle of overcurrent.   As long as your power supplies are isolated and your blocks are double-gapped there is no short circuit of any kind in either of these situations.   This means Scott's frog juicer is unlikely to work.   On the plus side this means nothing besides the DC locomotive needs any kind of protection to prevent damage or keep from catching on fire.  (I.e the rails and wiring are safe)

So if you're wanting to protect DC trains from running inot DDC blocks, you could probably do something that would sense if the voltage on the other side of the crossover is different from the voltage on the side with DC power, and if it is it could open a relay to kill power to the frog when the turnout is through.  The voltage sensing part would be beyond me but otherwise I could probably draw up that circuit for you.  This would obviously have to be done for every turnout, and I'm not sure that's what you're looking for, as it means everyone in the T-Trak or NTrak group would have to participate to protect the whole setup.

If you want something that detects the condition you don't want centrally from the power sources I'm struggling to envision how that is physically possible to detect.  I don't know if it would be physically possible, for example, to run the DCC through something that  could detect the difference between a DC loco and, say, lighted passenger cars, and only shut down for the former.

FWIW our club runs DC and DCC on a common rail system using old fashioned block control for DC, in spite of Peteski's not-foolish-but-ultimately-not-absolutely-necessary advice.  We do have to have Digitrax boosters with optically isolated Loconet for this, but I don't believe that would be true if we weren't using common rail.  So I speak from experience.  Other than the dude with the Richmond Controls in his loco nobody has suffered a loss from running into the wrong block with the wrong type of power.  YMMV, I guess.
« Last Edit: February 23, 2024, 08:26:48 PM by jagged ben »

peteski

  • Crew
  • *
  • Posts: 32943
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5336
    • Coming (not so) soon...
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #5 on: February 23, 2024, 09:05:46 PM »
0
If one insists on having a live traveling loco cross from DCC control to DC, it would have to be done more like a reversing section rather than a short section of the crossover turnouts.  Otherwise one of the model's trucks will be powered from DC while the other is getting DCC signal.  That doesn't sound kosher to me.  Even still, how will the loco behave at that point?  If the DC track polarity is opposite to the direction of travel in DCC, we likely have some interesting dance happening.

 As far as mixing DC and DCC, just because you can, that doesn't mean that you should. YMMV
. . . 42 . . .

bigdawgks

  • Crew
  • *
  • Posts: 216
  • Respect: +188
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #6 on: February 23, 2024, 09:07:52 PM »
0
The problem I see with attempting to transition between DC and DCC track is that once the locomotive bridges the gap between them they're no longer electrically isolated. I'm sure that could potentially confuse the decoders, but I'd also be worried about potential damage to your command station if you are suddenly feeding a DC voltage through its track circuit.

mmagliaro

  • Crew
  • *
  • Posts: 6368
  • Gender: Male
  • Respect: +1871
    • Maxcow Online
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #7 on: February 23, 2024, 11:51:50 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?

jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #8 on: February 24, 2024, 12:02:38 AM »
0
If one insists on having a live traveling loco cross from DCC control to DC, it would have to be done more like a reversing section rather than a short section of the crossover turnouts.  Otherwise one of the model's trucks will be powered from DC while the other is getting DCC signal.  That doesn't sound kosher to me. 

Generally no one insists on it but it happens by accident.  However it's also actually a feature, according to Digitrax.  Have you not heard of 'brake on DC'? 

Quote
Even still, how will the loco behave at that point?  If the DC track polarity is opposite to the direction of travel in DCC, we likely have some interesting dance happening.

True.  But if the polarity is the right direction, and analog mode is turned on, the loco will just keep on going.  Or it may gracefully slow to a stop with the lights on if deceleration is set for the brake on DC method.  Either way it's not a disaster by itself. 

Anyway none of this is the problem.  The problem is DC locos crossing into DCC.

jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #9 on: February 24, 2024, 12:04:32 AM »
0
The problem I see with attempting to transition between DC and DCC track is that once the locomotive bridges the gap between them they're no longer electrically isolated.

Precisely what is the problem with them not being isolated? 

Quote
I'm sure that could potentially confuse the decoders, but I'd also be worried about potential damage to your command station if you are suddenly feeding a DC voltage through its track circuit.
 
This is just not an issue.  See above.

jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #10 on: February 24, 2024, 12:12:40 AM »
0
...

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?

I do not advise using any track power supplies that don't have overcurrent protection for shorts.  I also don't advise using track power supplies that aren't isolated from mains power by transformers.  But most off-the-shelf sources sold for the purpose have those things.  So if that is a given, a loco bridging the gaps between DC and DCC power will not in and of itself cause either a short circuit or an overcurrent on either source.   Ya'll can stop worrying about that so much.

Now if you want to protect your DC locos from possible damage from DCC power they're not design for, that is a discussion, see above.  But in my experience RTR DC locos from the last 35 years or so aren't very easily damaged by DCC power.    It just ruins the suspension of disbelief when they run into a DCC block. 

peteski

  • Crew
  • *
  • Posts: 32943
  • Gender: Male
  • Honorary Resident Curmudgeon
  • Respect: +5336
    • Coming (not so) soon...
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #11 on: February 24, 2024, 12:18:16 AM »
+1
  But in my experience RTR DC locos from the last 35 years or so aren't very easily damaged by DCC power.    It just ruins the suspension of disbelief when they run into a DCC block.

Coreless motors  can get damaged by full voltage alternating-polarity DCC signal (because of the type of windings they use). They can overheat, but that is not immediate.They would have to be exposed to the DCC signal for a longer time.

Coreless motors are being used in some models for several years (even in models from Bachmann).
. . . 42 . . .

jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #12 on: February 24, 2024, 12:37:49 AM »
0
For sure I'm not saying that it is a bad idea to protect your DC locomotives from encountering DCC voltage.  Perhaps I'm saying that it's lower stakes in most cases than some may think.  But not a bad idea, no. 


jagged ben

  • Crew
  • *
  • Posts: 3249
  • Respect: +500
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #13 on: February 24, 2024, 01:01:02 AM »
0
The more I think about this, the more I think the following may be all you are asking for.

It'd need to monitor one voltage meeter to see if there's AC on it (ie, the DCC signal). Then it'd need to watch the other to see if there's DC on it. THEN it'd need something to sense when there's a short (which you'd get if you had something across the crossover, right?). If there's a "yes" to all three conditions, it'd need to trip a relay to kill the power to a section of track on each side of the gap.

You don't need to detect a loco bridging the gap, which is the near impossible part, because you don't desire for things to get to that point anyway.  It's easier to just stop the loco from getting there in the first place. 

Assuming the Arduino can distinguish between DC and DCC voltage on two inputs, and power a 2-pole relay, it seems doable.  (I have no idea if it can do those three things.)   You could program it to drop power if the DC voltage is the polarity to run a loco towards the DCC section.  In either direction.  If the two inputs are both getting DCC, or are both getting DC of matching polarity, the relay keeps the track powered.

I imagine there is a simpler circuit that could do it but I'm not enough of an electronics whiz to figure it out.   
« Last Edit: February 24, 2024, 01:03:21 AM by jagged ben »

greenwizard88

  • Crew
  • *
  • Posts: 289
  • Respect: +63
Re: Next electrical question: Arduino powered DC/DCC circuit breaking?
« Reply #14 on: February 24, 2024, 04:47:50 AM »
0
I blew out a dc power pack when I accidently connected it to a track with dcc power. I support this endevor.