Why no DIY Solid State DCC Auto-reversers?

newt749 Sep 2, 2017

  1. newt749

    newt749 TrainBoard Member

    16
    6
    16
    Okay, I've searched the web and looked at dozens of sites with examples of auto-reversers. All of them either use the currently available commercial units, such as the AR-1 or PSX-AR or similar, or they provide a basic electronic circuit with relays to switch the phase/polarity. Most of the DIY type also tend to be slow, affecting sound decodered engines, or making engines shudder for a moment as the power is switched.

    What I am looking for is an electronic circuit which would allow for DCC auto-reverse. The circuit would ideally have electronic, solid state switching (could be MOSFET) rather than a mechanical relay and be easily controlled/programmed using either an Arduino Uno or Mini. I know that commercial units use a PIC but I am looking for something that doesn't require extra programming and I have access to Arduinos already.

    I guess that I am just really surprised that in all of my searching I haven't found one such device. I find it hard to believe that there isn't someone out there who hasn't designed a simple circuit to perform auto-reversing on a DCC layout for the DIY crowd. Yes, I could just buy a commercial unit but I'm basically cheap and find the building of stuff to be much fun.

    Anyone have any ideas?

    Rob
    Hampton, New Brunswick
    Canada
     
    wturczyn likes this.
  2. Point353

    Point353 TrainBoard Member

    2,881
    7,612
    71
  3. newt749

    newt749 TrainBoard Member

    16
    6
    16
    Thanks for the link but I guess I should have been clearer. What I was after was an auto-reverse circuit for a reverse loop. I found quite a few circuits like the one you suggested but they all controlled a train on a point-to-point layout with the train running back and forth.

    I'm really after something that will auto-reverse a loop. It doesn't have to activate a switch like a PSX-AR and a tortoise but I'm sure that an Arduino could handle that too.

    Rob
    Hampton, New Brunswick
    Canada
     
  4. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    The available autoreversers are so much better than what you could put together (most have a bit of logic in them to make them work better) that it would be silly to make one, that's the general consensus.

    If you build something simple, then you will find it won't work as well as the commercial ones, and you'll probably spend almost as much for less function.

    Greg
     
  5. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    If you really want to make your own using an Arduino, the easiest and best way would be to simply build a booster (there are a few already done), and to achieve the polarity switch, all you need to do is invert the low level control signal to the motor driver board.

    Dave Bodner has a booster design(with an LCD and other extra stuff), and there's on on the the model train forum (http://www.modeltrainforum.com/showthread.php?t=108481). Again, the only thing you need to do is invert the control signal to the MD board. The easiest way to do that is one external TTL IC, just a 74LS86 Exclusive OR gate.

    The above boosters just use the Arduino to monitor current(which is output by the MD board), so the logic to do the reversal is simple.....once the overcurrent is detected, perform the reversal, which should resolve the overcurrent. If it does not withing a short time, then it's a real overcurrent that's not caused by the reverse loop.

    I'm building such a reverser as part of a DCC++ extension to support multiple power districts(total of 8), so I supply the DCC signal, so my reverser won't work except on my system, but the logic is the same.
     
    wturczyn likes this.
  6. Greg Elmassian

    Greg Elmassian TrainBoard Member

    325
    62
    17
    Not to belabor or impugn your implementation, but modern autoreversers do a lot more than just detect the overcurrent, but actually analyze the amount, the rise time, the duration, etc.

    This makes them a lot smarter and won't false trigger on things like caps charging in sound units, etc.

    So, you get what you pay for. Now of course if you use an Arduino, the possibilities are endless, since you can write this kind of analysis code.

    But again to the question posed, a "good" kit would most likely involve a microprocessor and access to the code, and many people in the hobby are just not up to this.

    Bottom line the money "saved" is probably not worth it.

    Greg

    (clearly if you build one that does exactly what you want and it handles 8 districts, then the economies of scale enter)
     
  7. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    The system I'm implementing uses the same smoothing algorythms as the original DCC++ code, so yes, it does some analysis of the current sense voltages.
     
  8. newt749

    newt749 TrainBoard Member

    16
    6
    16
    crusader27529 I would like to hear more about your plans. I hadn't really thought about using a booster as the core of an auto-reverser but I think that I can see where this would be possible. Would you use some sort of solid state device, say a MOSFET, to do the actual switching of the DCC signal phase or would the Arduino handle that in some way?

    I looked over Dave Bodnar's booster with interest. I really like what he is doing with small Arduinos.

    Rob
     
  9. crusader27529

    crusader27529 TrainBoard Member

    247
    167
    11
    Using the IBT-2 which uses the BTS7960 chips, there are only 2 signals used....the enable and the DCC signal. The DCC signal needs to be inverted so only one part of the H-bridge is turned on at a time (the design I referenced uses a single transistor inverter circuit), but I use a 74LS04 for inverting the signal.

    Having said that the simplest and easiest way to invert a signal (DCC in this case) is to use an XOR gate (74LS86) that's controlled by an Arduino output. BTW, I use the NANO, not the MINI or MICRO versions because the pinout locations vary depending on the manufacturer of the part, but the NANO is completely defined and stable.

    Anyway, if one of the inputs to the XOR gate is the DCC signal(before the inversion), the other input to the gate will cause the output to invert if it's set to a logic high/true. My design receives the DCC signal from a remote PCB which actually has the DCC Arduino on it......the referenced designs use the DCC signal in the track to regenerate the booster input.

    Here's a sort-of current document on what I'm building.....I just ordered the second version of the main PCB and the reversing PCB.
     

    Attached Files:

    wturczyn likes this.
  10. newt749

    newt749 TrainBoard Member

    16
    6
    16
    Thanks, this holds a lot of promise for my needs. I have a friend who is much better at electronics and Arduinos than I. I'm going to show this to him and see what we can do.

    Rob
     

Share This Page