DCC Polarity-Phase Auto Reverser

ajkochev Dec 14, 2022

  1. ajkochev

    ajkochev TrainBoard Member

    193
    486
    20
    Planning on having a turntable on my new layout and need a way to swap polarity when the loco goes for a 180 turn on it. I could do this with a toggle switch but I'd like to see what automated options are out there. Google search hasn't yielded much but I might not be searching the correct terms.

    I will be doing N Scale and using DCC-EX as my command station. I'm also in the US and would prefer a manufacturer there rather than pay shipping overseas but I'm willing to look at all options.
     
  2. Sumner

    Sumner TrainBoard Member

    2,882
    6,128
    63
    Almost any of the DCC auto-reversers would work I'm going with Tam Valley's ( HERE ) but other most other manufactures would work also.

    Sumner
     
    ajkochev likes this.
  3. Cowman

    Cowman New Member

    9
    12
    2
    +1 for Tam Valley auto-reverser. I put one on my tt about 4 years ago, works flawlessly.
     
  4. ajkochev

    ajkochev TrainBoard Member

    193
    486
    20
    Thanks everyone. Think I'll give the Tam Valley Dual Frog juicer auto reverser a try.
     
  5. wvgca

    wvgca TrainBoard Member

    499
    305
    21
    depends on whether you want a mechanical reverser, possibly with a fixed current level, or one with solid state relays, and adjustable current trip level ??
    there are a lot out there
     
  6. BigJake

    BigJake TrainBoard Member

    3,369
    6,605
    70
    SPROG makes an auto-reversing booster (SBOOST). It can also be jumper-configured as a non-auto-reversing booster.

    SPROG also makes their dual output Pi-SPROG 3 Plus DCC system (expansion "hat" for a Raspberry Pi computer which runs JMRI) The hat's secondary output can be configured as a programming track, primary bus duplicate, or auto-reversing primary bus duplicate. The secondary bus is unaffected by shorts on the primary output, except as needed when configured for auto-reversing.

    SPROG products are made in UK, but are available directly from their US distributor (with US-compatible power supplies), sprog.us.com, which also has a list of representatives/retailers in the US and Canada.
     
  7. Erik84750

    Erik84750 TrainBoard Member

    360
    152
    12
    Or you can make an auto-reverser yourself.

    I designed, made and debugged an autoreverser that does not require short-circuit detection but instead is using presence detection right before and right after the loop entry.
    Currently the design is done for two detectors outside the loop and two inside but a change to just total two detectors is easlly done in the software. I may provide such a version if requested.

    Requirements:
    1. 1x ATTiny85 on a Digispark board (+/-3USD)
    2. to be added: presence detection (I use differential optical detectors).
    3. PCB, you can make this yourself with the included documentation.

    EDIT: differential optical detectors work regardless of the intensity (or non-intensity) of ambient light.
     

    Attached Files:

  8. BigJake

    BigJake TrainBoard Member

    3,369
    6,605
    70
    Erik,

    What are the disadvantages of using over-current detection for auto-reversing?
     
  9. Erik84750

    Erik84750 TrainBoard Member

    360
    152
    12
    What are the advantages of "overcurrent detection"?

    And your defintion is not really correct: the commercial auto-reversers need a short circuit to act.

    Inducing a fault condition (short circuit) to take action other than shutting down power is similar to driving through a red light in the hope of not having an accident.

    Why make things difficult when a simple presence detection can solve the issue?
     
  10. BigJake

    BigJake TrainBoard Member

    3,369
    6,605
    70
    First of all, the conventional auto-reverse detector is usually triggered by a "short circuit" condition, but the detector is in fact an over-current (current above some acceptable threshold) sensor. With the exception of Arc-circuit detectors for AC power, there are no "short circuit" detectors, only over-current detectors.

    Secondly, a short circuit is not a fault unless it causes the system to fail to act as desired, such as by shutting down. If interrupted before such shutdown occurs, the short circuit is not a fault.

    Commercially available power supplies require fault-handling ability (excessive current for longer durations that might create damaging or dangerous results) built into them already. It's a necessary feature of any safe, reliable, successful product. There is no damage to the power supply from creating an over-current fault that the PS has to be designed to handle in the first place. Given an auto-reverser removes the short circuit condition, even before the power supply's own short circuit protection acts, what is the disadvantage of using over-current detection to auto-reverse track polarity?

    A current sensor and threshold comparator (whether hardware or software), with a power switch to reverse polarity, is far simpler, less expensive, and easier to wire than multiple occupancy sensors, a processor and software to try to figure what might be about to happen, on top of the same power switches to reverse polarity.

    Additionally, some DCC command stations already have all the hardware required to implement an auto-reversing power district, using current detection, if they have separate main and programming track outputs.

    I am not a user of DCC++EX, but I have submitted, at the request of others here, a proposal for their development team to implement an over-current-based auto-reversing track output (normally used for a decoder programming track) in their software, using no external/additional sensors, only the built-in current sensors/monitoring already used for decoder programming and general over-current protection anyway. The only cost of doing so is software, accomplishing the polarity reversal in the waveform generation routine, so no additional track power switches are required!

    The Pi-SPROG 3 Plus DCC system already includes a convertible programming track, secondary power district, or auto-reversing district output, in addition to the main track output.

    However, what I am missing is if there are additional use cases that location detection can handle, that over-current cannot? That, if present, would be an added (and perhaps valuable) feature of your proposed.

    On the other hand, are there situations, particularly at start-up (e.g. existing location of trains/locomotives) that would cause problems with a state-based presence detection solution? What happens if a presence detector detects a locomotive that was moving away from the boundary when power was last removed (shut down). At subsequent start up (much later,) how does it know whether the locomotive was moving away from the boundary, or toward it, until the train (perhaps moving very slowly) triggers an additional occupancy detector? I suspect this may be why you originally had dual/tandem occupancy detectors on both sides of the boundary, to detect direction of travel, that you now believe may be optional.

    Correct initialization in all situations, including startup, is the bane of all state-based systems. Stateless systems (like an over-current-based AR solution) do not have this disadvantage.

    An over-current based AR system will resolve the situation automatically even if the system powers up with a locomotive shorting the auto-reversing boundary. If the polarity is already correct at power-up, then no over-current will exist, and the system will not reverse the polarity. If the polarity is incorrect at power-up, then the polarity will be reversed to match. How much more could you want?
     
    Erik84750 likes this.
  11. jhn_plsn

    jhn_plsn TrainBoard Supporter

    2,683
    3,073
    76
    Be mindful of the frog juicers when used with fast short protectors like the PSX.
     
    BigJake likes this.
  12. Erik84750

    Erik84750 TrainBoard Member

    360
    152
    12
    Andy, thanks for that extensive and concise reply.

    To make distinction between "over-current" and "short circuit" is semantics: when a locomotive crosses the reversing loop "barrier" of opposite polarised DCC track, and stating that a "over-current situation" precedes a "short-circuit situation" is bizarre at the least. What doés happen is that the standard short-circuit protection circuitry acts within about 50ms on a short circuit. And an autoreverser's only "strength" is that it detects ànd acts on this short circuit faster than the power supply's short circuit circuitry.

    Claiming out of thin air that something is "easier and simpler" without fact is easy: of course a short-circuit (or lets keep it at "over-current") based circuit needs to use hardware: software just is too slow. The fact that I use a controller makes indeed for most people a barrier for implementation. But the use of a presence detection does exactly what needs to be done: detect the presence, in a specific area, of a condition that requires the polarity of a reversing track to be reversed.
    And four, or in some case just two, presence detectors, is not the hardest thing to implement.

    Copying ideas is easier than out-of-the-box thinking.

    Here you have a valid point Andy (y).


    This is right; on power up, a detection-based system is not fast enough to react (MCU startup time). But even then the controller-based system I propose will set polarity correct, even with track power down. So in the very rare cases when this would happen, there would indeed be a short-circuit; whereas in the commercial systems there would be short circuits (damn, I should have said "over-current" ;)) everytime a loco passes the boundary of a reversing loop.
     
    Last edited: Dec 18, 2022
  13. BigJake

    BigJake TrainBoard Member

    3,369
    6,605
    70
    I'll say this: I admire your dedication to your project!

    Whether it is successful will depend on your own criteria for success. It will not likely be commercially or widely successful, because it will be too expensive to implement on a per-installation basis, compared to available, reliable means, whether as part of a unified DCC system, or as an add-on subsystem.

    Unless perhaps you can re-use occupancy detectors needed for trackside signaling anyway, and only adding a sensor for directional purposes. Then, for a complete system with signals, it may not be too much more expensive materially, but more complex software needs more maintenance, which needs more effort (and cost) to provide as a supplier.

    Actually, this might be an interesting project to try to implement with NMRA's Layout Command & Control (LCC) system, available on some DCC command stations, as well as add-on systems (e.g. RR Circuits). LCC is designed to operate either stand-alone (nodes can communicate with/control each other), or managed/controlled by a central processor, usually running JMRI, etc.
     
    wvgca likes this.
  14. Erik84750

    Erik84750 TrainBoard Member

    360
    152
    12
    Why do you state it would be more expensive?

    The controller (ATtiny85 on a Digispark board) costs about 3.5 USD, the pcb can be manufactured for 50pce @ 1 USD plus shipping. The board is so tiny that 50 can be fit onto 5x 100x100mm pcb's), and the opamp IC goes for 10c/pce.
    Total cost: +/- 5 USD.
    Plus the time and pleasure of beating commercial systems, both in cost and in performance.

    What ís a hurdle is the software installation, probably a bit complex for non-electronics/software people. But even then..

    Re-use of available/existing detectors is a non-issue: of course that can be done.



    But on a side note: what amazes me is that so few people really are interested in solid, well-debugged and tested systems and projects on this (or other?) fora. As an example too: the past year I had participated in the development of a Nextion-based handheld controller. It represents work that surpasses by far anything else available for that purpose, yet not many seem ready to spend the time or interest in hardware that uses a Nextion display, a rotary encoder and a controller (Uno, Pro Mini, Nano, ESP8266 or ESP32) and software as easy to install as it is to program an Uno.
     
    Sumner and rcmodeler like this.
  15. BigJake

    BigJake TrainBoard Member

    3,369
    6,605
    70
    Regarding the "cost" compared to a plug and play auto-reverser: Power supply? Mounted in box, w/labelled connectors & cables (don't forget reliable connectors), SW pre-installed, instruction manual printed in multiple languages, warranty, retail seller mark-up, product support. Oh, and don't forget ESD protection on dang near every exposed interface! Your prospective customers are consumers, not electronics experts. There's a lot more that goes into a product than R&D and a working proof of concept (not even what I would call a prototype of a commercial, shelf-ready product).

    Its the same difference between the DCC++EX system (by all reports, an excellent system) and commercial, entry-level DCC systems. Most hobbyists (not necessarily most on this board) do not want a system they have to assemble, install SW on/for, etc. before they can run trains with it. Heck, how many won't even bother with JMRI and a USB interface for their plug and play NCE/Digitrax/etc. system?

    The only really new DCC system (not including minor upgrades of existing products) from an established DCC supplier in the last ?? years is the CS-105 from DCS, and it is rather expensive (but with a ton of features!) My point is, most of the market will pay for an off-the-shelf, take-it-home-and-plug-it-in system, rather than assembling their own, etc.

    As for a choice between your solution, or a tried and true over-current based auto-reverser, most hobbyists will probably choose the latter. It's simpler to understand, set up and use: wire up the power input (the DCC bus is already in the neighborhood), and the switched DCC output to the reversing section, and you're done. The KISS principle in action.

    Look, I'm not trying to downplay the effort and creativity in your auto-reverse solution. It is impressive! But impressive will never beat good enough, especially when impressive is more expensive (including occupancy detection) and less familiar, but still doesn't do any more than 'good enough' does. Product Development 101.

    I actually think your idea might be a good match for LCC: LCC already has the sensors and controls, the communication between modules, and rudimentary logic (enough to run complex signals) which could control a board that can reverse DCC bus polarity (that might even be in an available LCC module.) Since the whole idea of your approach is to decide to reverse polarity before it is needed, such switches could be relatively slow (e.g. relays.)

    Your example of Nextion is telling. As I saw it, Nextion was to be a direct competitor to existing cell-phone throttle apps that already had established their market presence. The same physical throttle feature is available for the price of a USB volume control, and a 3D printable fixture for phone and knob was also developed and shared free of cost. Nextion simply did not provide enough added functionality to overcome the competition's momentum.

    Let's face it, most model railroaders are not willing to deal with the hassle to use some very innovative solutions already out there. While that should not discourage us from developing innovative solutions to real shortcomings in existing DCC equipment, it should temper our expectations of making them commercially viable.
     
    Erik84750 likes this.

Share This Page