Turntable controller: finalised project proposed

Erik84750 Feb 12, 2024

  1. Sumner

    Sumner TrainBoard Member

    2,846
    6,004
    63
    Looking at the polarity issue to me it isn't where the table is so much as are you exiting it going forward or in reverse. Again referring to this diagram...

    [​IMG]

    ... if the table starts with the same polarity as the indexing track and all of the storage tracks also have that polarity as long as you drive off forward it doesn't care what storage track you are at or which way you went to get there you will have no polarity change needed.

    As soon as you rotate the table to one of the storage tracks in a way that you back onto it you will need a polarity change. The same if you rotate back to the index track and drive off to it going forward.

    Yes, something like the Tam Valley reverser or one from another manufacture will take care of the problem for not much money and always work in the background without your intervention. I'm going to probably switch to that simple solution and then free brain space up for something else ;)

    Sumner
     
    Erik84750 likes this.
  2. peteGSX

    peteGSX TrainBoard Member

    39
    84
    2
    Polarity reversal can indeed be confusing! It messes with my head occasionally still...

    I attempted to document this as best I could on the DCC-EX website as part of the EX-Turntable documentation.

    Not sure if that will clear things up or not but it might help?

    An auto reverser is definitely a simple solution as it will just automatically sort it out for you. We've implemented switching based on angle/step counts as we can "know" when it needs to be reversed, making an assumption on how the tracks are wired of course.
     
  3. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    If I understand @peteGSX well you are using the software approach: accumulating (pos and neg) the steps performed by the stepper to decide whether or not to reverse polarity of the turntable track?
     
  4. Bob Brockhouse

    Bob Brockhouse TrainBoard Member

    34
    33
    3
    To those interested in a DIY auto reverser, have found a design suited to home construction.
    I plan to gather the components and do a breadboard proof of concept.

    To be clear, an auto reverser is not the be all and end all for every turntable . much depends
    on the track plan and the arrangement of tracks to the turntable. The other methods of bridge
    polarity reversing all have merit. My immediate preference for polarity change that is seamless
    and automatic, has to be by the software method, albeit for the complex extra coding required.

    To this end, I commend peteGSX for his insight with the DCC-EX turntable project. Just needs a
    a skilled coder to come up with something similar. Unfortunately can't be me , I have zero
    coding skill. All of this discussion is only relevant to those wishing to construct a turntable using
    the commercial third party slip rings. The commercial turntable kits usually come with some form
    of "split" slip ring that does polarity change automatically, based on bridge rotation.

    So for now, the auto reverser mentioned can be located on YouTube. The detail of components and
    Arduino code can be found with the links shown in the "more" description of the video. Note the
    schematic can only be seen by pausing the video and doing a hand drawn copy, but it is simple.

    YouTube channel is "Invertlogic" - DCC auto reverser- Can it replace an AR 1 ?

    Cheers
     
    Erik84750 and Sumner like this.
  5. Sumner

    Sumner TrainBoard Member

    2,846
    6,004
    63
    Bob thanks for the link. I think I have everything to make one so might try it at some point. He is using that with the older DCC++ so probably would work with DCC-EX and other command stations. The one problem that can arise with an auto-reverser is most command stations sense a short and will shut down the track voltage. As he mentions the auto-reverser has to be faster to react than the command station. Probably the only way to know if his is going to do that is to try it. Probably will. I've seen where some commercial auto-reversers mention this situation.

    I can't think of a situation wiring wise where an auto-reverser won't work with a turntable. It only changes the polarity of the table. Regardless of the track you are driving on from or off to it will change the table to that polarity. I could see a problem if the table is aligned where you could drive on and through the table and off the other side and the tracks on the two sides are of different polarity. Even in that case it wouldn't be a problem if the loco is shorter than the length of the table and wasn't on the table and both tracks all at the same time.

    I'm also having a hard time seeing how to handle every situation of auto-reversing via software based on where the table is. The table can be used to either drive a loco off the table going forward or moving the table to where the loco can back off of it (as it would usually going into a roundhouse). If the table moves to a position where there is a track ahead of it and also directly behind it the loco could drive off forward onto one or back off onto the other. In some of those situations (unless you have very few tracks) the polarity is going to probably have to change for the direction the loco leaves the table. In one direction the polarity is going to need changing and in the other direction the polarity is fine. How does the software know which way the loco is going to leave the table?

    Lay out a drawing with tracks 360 degrees around the pit and mark the polarities of them and the table. Then rotate the table and see how both ends of the table line up polarity wise with the tracks ahead of it and behind it. Will the table polarity work leaving the table in either direction?

    Sumner
     
    Erik84750 likes this.
  6. Bob Brockhouse

    Bob Brockhouse TrainBoard Member

    34
    33
    3
    Sumner,

    My preference change away from using an auto reverser is the loco is moving on the bridge
    before the short circuit is detected. When detected, we have the auto reverser doing the
    polarity change that would reverse the loco direction from the intended and original direction.

    Any such polarity change must not change any layout track. These auto reverses are primarily
    for use on reverse loops, seemingly ideal. But not for turntable bridges as the loco needs to
    move to create a short circuit. Does it not also reverse the intended loco direction ?

    Maybe my thinking is flawed here, just adding more confusion.

    Cheers
     
    Erik84750 likes this.
  7. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Thank you Sumner for that link, I would not have found it.
    Thanks Bob for the reference to that video.

    I am glad we seem to agree on a hardware solution rather than software: it saves me a hell of a lot of programming work, plus how to remember last polarity after shutdown..

    I never was a fan for short-circuit polarity detection (a crude way for detection and always at the hazard of the DCC booster to react faster) but in this case I do not see an alternative. So I am going for this solution too.
    Let's see what the video will teach me.

    Erik

    EDIT: as soon as I am "back on my feet" I will make a proper schematic and publish it here.
    Better then having to refer back to that particular section in the video.
    Or better: modify my current pcb to include this design; in that way no extra controller is needed and since there only is one input (from the ACS712) and one output (to the relay) I think this is entirely feasible... I will see..

    EDIT 2: he is using a bipolar 2N2222, I would rather use a N-channel mosfet: much faster.
     
    Last edited: Apr 13, 2024
    Sumner likes this.
  8. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Interesting question.

    If a loco, moving forward (cab foward) on a track, is lifted and replaced after turning around 180 degrees, does it still move in the same direction on the track (ie cab backward)?
    I can't test right now sorry.
     
  9. Sumner

    Sumner TrainBoard Member

    2,846
    6,004
    63
    Erik please do post the schematic when you have it.

    OK let's address the loco direction deal. First the auto-reversers that I know of and probably the one in the video won't work on DC. Another solution such as a manual DPDT switch would work and probably some other non-switch solutions.

    I'm DCC and was thinking you guys are also, but maybe not. With DCC the loco doesn't care about the track polarity (the polarity is not the same as DC polarity is). If the command station and throttle are telling the loco to go forward it will continue forward regardless of the DCC track polarity or if it changes. His video shows that. The track on either side of that cut in the rails is at opposite polarity before the loco crosses the gap. The loco doesn't reverse directions as it goes across the gap from one polarity to the other.

    The same for the turntable. If the polarity on the table is opposite to what the input track is it will change as soon as the loco drives on and match the polarity of the input track. If the output track is opposite polarity from the table the table will change to that polarity as it drives off. The loco will always continue forward if the throttle direction hasn't changed. If the loco is put in reverse on the table it will drive off onto the output track regardless of its polarity.

    Tam Valleys dual frog juicer (available from vendors here I believe) will work fine as a turntable auto-reverser and probably most other's that are designed for 'DCC'.

    I have a few of their Hex Frog Juices that have 6 frog juicers on them (using them for crossings and reverse loops). If I end up with 2 of the frog juicer circuits not being used I'll use those on the table. If not I might try building one of these as I think I have all the parts to do that. If I didn't I probably buy one for under $35 as the parts would probably cost not much less as you need to buy some in quantity even if you only need one or two and the shipping could add up.

    Sumner

    P.S.
    The loco will continue forward and go back down the track in the opposite direction from the direction it was traveling. The decoder gets the forward or reverse commands continuously and changes the track's AC input to DC and sends that to the motor and keeps the loco going forward (cab forward) even though the polarity of the track changed.
     
    Last edited: Apr 13, 2024
    Erik84750 likes this.
  10. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Yes sure Sumner, as soon as it is ready I will publish it here.
    And I will design it as a stand-alone controller pcb; much more versatile then integrating it in my current turntable pcb.

    Great! That answers Bob's and my question.
    And this would imho finalise the turntable track polarity "issue".
     
    Sumner likes this.
  11. Sumner

    Sumner TrainBoard Member

    2,846
    6,004
    63
    Well actually no ;) as I was wrong about wiring it where there would never be a conflict regardless of if the loco exited the turntable forward or in reverse.

    [​IMG]

    There would be that problem if the track around the table was wired like I initially noted above.

    But wired ....

    [​IMG]

    like Pete posted on the DCC-EX site there is no problem if you can keep track of the table and change the polarity when it is in one zone or the other. I couldn't see it until I added the extra tracks in all four quadrants.

    Good going Pete, if the software sees where the table is all the time you are good to go with a polarity change when going from one zone to the other. I'll still probably just put the auto-reverser on for my application as I'll be controlling the table from a hand controller as I wanted the feel for what a real turntable operator was having to do.

    This has been bugging me and I couldn't let it go until I finally saw the light. My apologize for the miss-information.

    Sumner
     
  12. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Very nice visual representation Sumner!

    But even in your first drawing, an autoreverser would be able to set the polarity of the turntable correct if the turntable would be turned 180 degrees before a loco, present on the turntable, exited.... correct Sumner?
     
  13. Sumner

    Sumner TrainBoard Member

    2,846
    6,004
    63
    Yes with an auto-reverser it would make no difference what the polarity was on any track leading to the table as long as the engine couldn't be on the table and two opposing tracks at the same time.

    I'll set up my roundhouse and two tracks from the main to the table so that if you come in on either of those tracks you could drive straight across into the roundhouse. That would allow an engine longer than the turntable to enter the roundhouse for service. If the tracks were wired like in the final drawing.....
    [​IMG]
    ..... the polarity would be correct for that to happen.

    Sumner
     
    Erik84750 likes this.
  14. peteGSX

    peteGSX TrainBoard Member

    39
    84
    2
    Glad the info was helpful Sumner, it messed with my head a lot until I got it in a diagram and documented.

    For EX-Turntable, we went with a software solution for the simple reason that we know where a turntable is at all times and can adjust polarity appropriately.

    You can, of course, not use that feature and instead either use an existing commercial turntable's split ring feature, or use an auto-reverser.

    We also needed to accommodate horizontal/vertical traversers, and turntables that don't rotate a full 360 degrees as these likely won't need polarity reversal at all.

    These things start to get complicated real soon!
     
    Sumner likes this.
  15. Bob Brockhouse

    Bob Brockhouse TrainBoard Member

    34
    33
    3
    To all who are lashing up this auto reverser, I seek comment on your success or otherwise.

    Would seem there is a bug in the circuit diagram or the Arduino code. It is unfortunate that
    there is no contact detail for the author to verify.

    As presented on the video, I have breadboarded the circuit exactly as given, double checked
    and double checked again. I was confident to see it work as in the video, not to be.

    For those in tune with coding, referring to line 12, what is this "measure and divide voltage"
    comment. I take it to mean do a measurement somewhere and divide. The value must then
    be plugged into line 12 before compiling to the Arduino ? What voltage, where ?

    As a side note, we see the LED functioning on the video, but is missing from the circuit diagram.
    The LED and a 330 Ohm are shown in the parts list, and can be seen on the breadboard close
    up view.

    I am hoping other tinkerer's can report a working example, to verify the integrity of the project
    as presented. If so, I will need to dig a bit deeper into my work. Eliminate some confusion for
    sure.

    Cheers
     
    Erik84750 likes this.
  16. peteGSX

    peteGSX TrainBoard Member

    39
    84
    2
    Just had a quick look, and that vpp is the voltage your Arduino runs at, so Nano/Uno is 5V, and dividing that by 1024 gives that number.

    Two things spring to mind with that software...

    Firstly, if you have an actual short rather than just a loco triggering the auto reverse function, that short is not going to be dealt with very nicely at all. The auto reverse is triggered, and then ignored for half a second, continuously. So, there is no short detection as such. If you're going to be running DCC-EX or some other controller which has short detection, then that should solve that problem. All I'm saying here is make sure you have some sort of sane proper short detection in place to protect things.

    Secondly, speaking of DCC-EX specifically, it's going to depend on how quickly that ACS712 detects the short as to whether or not the DCC-EX system will detect it as a short instead and shuts down track power. We've seen this happen with various auto reversers, but typically it shouldn't be a problem and that would just need testing to see if it's a problem to solve or not.
     
  17. Bob Brockhouse

    Bob Brockhouse TrainBoard Member

    34
    33
    3
    Many thanks peteGSX for your insight. Clarifying the line 12 code settles my curiosity and can
    focus on the other points you have mentioned.

    Given what appears to be a simple and quick project may have traps for the unwary. Your
    comments are noted and valuable (to me) to progress with my build. Great info to have.

    In due course it would be very valuable to hear what success other builders have had.
    Meantime, much to do and again thanks for your input.

    Cheers
     
    peteGSX and BNSF FAN like this.
  18. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Bob, what model of ACS712 are you using? If it is a 5A model then sensitivity (the amount of output voltage in mV/A) should be 185. For the 20A model this is 100, for the 30A model this is 66.

    Adding an output for a LED will be a minor software extra.

    After you comment I looked for the first time at the program; I will give due diligence with that; I don't promise a quick fix, but I will get to the bottom.
    At first sight a few things "do not add up".
     
  19. Bob Brockhouse

    Bob Brockhouse TrainBoard Member

    34
    33
    3
    Hi Erik,

    I have the 5 amp version at 185 mV rating. To all users will say beware of the green block
    connectors. The screws are just butter and strip the screwdriver slots real easy.

    An extra set of eyes is sure welcome, especially on the coding. I have a gut feeling something
    is not quite right in there, just what I need to leave to the more skilled.

    Look forward to your result with thanks. Meantime, trust you are well. Back in Belgium ?

    Cheers
     
  20. Erik84750

    Erik84750 TrainBoard Member

    353
    141
    12
    Hi Bob, many thanks for your query: yes indeed things for me are improving; still needing domestic nursing care for a week or two because of the internal bleed a few weeks ago but my lovely spouse is taking fantastic care of me. And yesterday we got home in Ghent from our Southern residence, a 10hr drive all by her :).

    This morning already I shared this programming issue with a very knowledgeable friend of mine (you may know him from our DCC-EX Nextion throttle project :) ). I guess in a week or two that will have been taken care of.
    I will keep you posted, Erik.
     

Share This Page