dcc++ ex and wi throttle

sidney Feb 1, 2022

  1. sidney

    sidney TrainBoard Member

    1,245
    2,116
    38
    well update i could not find a thing wrong with my track and wires. i stayed up all night tracing and testing every piece. im sure its in the pi4 . i was looking at a video where the ma's was increased but i can not find that in the code. they had increased it from 300 to 750 max . in reviewing that video it sure sounded like what im going through. at this point i dont know what is going on except i can not get this thing to work . ive done everything by the book , every stinkin detail and im still at the complete loss of control and even when i power off the jmri the locos still run at the last speed set untill i unplug the main power.....
    #1 WHY DOES MY MAIN COMPUTER WORK JUST FINE WITH THE ARDUINO ??????
    #2 WHY DOES MY NCE POWER CAB WORK JUST FINE ?????? both from jmri BUT as soon as i plug that pi4 in everything goes not well
    Is it like steve said a power issue (ie not enough juice to the pi4 ) ive tried both a pi4 power pack and and from the monitor supplying the power.
    here is excatly what happens .. locos short out, flipping of the turnouts short it out, i get the yellow power button , i lose all control of the entire system, i have to un plug the main power, reboot and all is good untill #1 loco shorts out #2 turn out is thrown.......it seems the ARduino is working fine but the problem is in the pi4 ... DO i need a pi 4 with 8gb . do i need to supply more power to the pi4 like maybe 9 volts. if i had a spare to fry i would try that....i just dont know ive done everything that has been said and nothing works. ive reloaded the sd card many many times and ive tried every dcc++ image from old to newest ( and it seems to update them selves to the dcc++ex every time too ) witch i dislike) im tired going to get some sleep now 24 hrs of testing repeat testing and losding and reloading the sd card no results.......
     
    Sumner likes this.
  2. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    Sorry to hear that there is no for sure reason at this point. Here are a few questions and comments that you might think about.

    1. Which Peco turnouts are you useing? From one source "The Peco Electrofrog turnouts are power routing right out of the box and therefore are not DCC Friendly. However, they are designed to be easily be converted for DCC operations." Also might check this out in general and the Peco part here for sure ( https://dccwiki.com/DCC_Friendly_Turnout ). From some of the reading I've done the power routing turnouts some times don't power routed since the rail that makes contact (points) doesn't make good contact. If that happens then I could see where maybe they might work with DCC and not cause a short???

    2. DCC++EX is on the Arduino and controls the track power and how it reacts to shorts. The Pi has nothing to do with that. It is only there to let you use JMRI and things like DecoderPro, the wireless phone throttle via WiThrottle and the hotspot the Pi creates and anything else you want to use in JMRI. Also JMRI has no control over the track and what to do if it shorts. All of that is in the Arduino and the DCC++EX program/sketch running on it.

    3. Knowing #2 I'm having a hard time seeing how the Pi is in the equation unless it is sending a command to DCC++EX that is causing a problem.

    4. When you aren't using the Pi and using the laptop or other computer how are you running trains? If using the phone are you now using the home network? I assume the computer is connected to the Arduino with a USB cable?

    5. If it is a problem with the turnouts then it shouldn't matter if the Pi or the laptop is connected to the Arduino.

    6. The PowerCab might not be a sensitive to a short lived short.

    7. Is it any loco or only one? Sounds like it might only be one turnout, yes/no? If more than one always the same one?

    8. Don't put 9 volts to the Pi. If anything go to a power supply with more amperage like the one ( HERE ).

    9. You don't need a Pi 4. I run a Pi3 but had to go with a SD card over 8 gig (using a 16) with the latest image file from Steve (which seems to work great).

    Bottom line is there has to be a reason and I'll bet it finally will come to light. I'm betting on it is a turnout problem unless they have been modified to work with DCC.

    Get some rest and back on it. I'm betting that you will. Where are you? Maybe someone near you has a Pi you could try. I does sound like that might be the problem also for whatever reason.

    Sumner
     
  3. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    All Raspberry Pi 3 and 4 models need 5V. DO NOT use any power supply voltage other than 5V for the R-Pi.

    The Pi 3 only needed 2.5A of current, but the Pi 4 needs a solid 3 amps. The supply sold by Raspberry Pi for the Pi 4b is a good choice, and has the correct USB connector for the Pi 4's power jack (USB-C). Do not use that power supply for anything but the Raspberry Pi.

    No, you do not need an 8GB R-Pi. The standard 2GB model has plenty of ram for JMRI, etc.

    I can tell you this: If the Pi4's power is not being shared with anything else (it shouldn't be shared!), there is no reason it could be shorting out your track. That is a track/turnout, track wiring, motor-driver board, or motor driver board power supply problem.
     
    Sumner likes this.
  4. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    I'm thinking you may have a grounding problem, especially if your raspberry Pi is connected to a monitor while it is also connected to the Arduino. Normally, the Raspberry Pi power supply reference (local "ground") is floating, but connecting the R-Pi to other things can "anchor" the R-Pi's ground to theirs. If it is connected to multiple things that have different ground levels, then problems can occur.

    Would it be possible for you to draw a diagram of your system and all power supplies, showing how they are connected to what?
     
    Sumner likes this.
  5. sidney

    sidney TrainBoard Member

    1,245
    2,116
    38
    awwww coffee sure does taste good :)
    sumner
    #1 i use kato turn outs.
    #2 the arduino works perfectly from my computer. window 11 was windows 10
    #3 i dont know , but i do know steve todd said to use the pi4 power brick witch i did and that did work for a bit after him saying that leads me to a power problem within the pi4.
    #4 im running trains through the computer from JMRI in the computer and the phone throttle is wireless to the computer with no problems.
    #6 the power gets a short it shuts down right away as soon as i clear the short it fires back up.
    #7 its dont matter where on the layout a short comes from and i run 3 locos same ones... NOTE ( i did notice that the pi4 with JMRI will not run my sound locos at all but just the lights turn on ) but the nce and the JMRI on my computer will run those locos.
    #8 i just ordered an bench power supply so i can regulate amperage. ive used the pi4 power brick 5v@3a and no change in problem.
    ive had about 4 cups coffee now and im back at it...... i have two locos the pi4 JMRI image will not run but the nce power cab and the computer (desk top) with JMRI will run those locos , so that tells me there is a power problem... Now if the Arduino is the one supplying power and i have 12 volts @ 12 amps feeding that then i should not have a power problem at all. if any thing i have too much power;;;........

    BigJake the pi4 's power is not being shared . ive used the official pi4 power brick recommended by steve todd and that worked but for just a lil while.
    #1 i have not tried using just the pi4 with out a monitor attached , BUT i have separated the power supplies (IE 1 power supply just for the pi4 and 1 power supply just for the monitor. Ill try the pi4 with out the monitor. NOTE EDIT i have to have a monitor......
    MY track is all kato and it fine no shorts any where (i tested all night log till early hrs this am )
    i will say that the locos that will not run at all with the pi4/jmri setup is my sound locos just the light will turn on BUT they do run with my desk top computer with jmri installed on that and also will run with my nce power cab. i have runn 6 locos at a time with those two.
    Ill try to draw up some kind image as what i have hooked up. (warning im no artist :D)

    Thank guys i know its a drain as im very tired of not being able to figger this out. I do appreciate the help very much. i must know why its not working for me.
     
    Last edited: Mar 8, 2022
  6. sidney

    sidney TrainBoard Member

    1,245
    2,116
    38
    photo /drawing as requested
     

    Attached Files:

  7. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    [​IMG]

    i would not power the Arduino via the Pi. It is ok to do that when you connect it to a computer to download a sketch/program to it but not sure it is ok to then power it when it is running with the motorshield and such drawing power from it. I wonder if that is pulling more amps than the Pi is happy with. I do see where they say you can power it from a USB port but still wonder if that is too much for the Pi.

    I power mine off a separate small power supply like ( THIS ).

    What voltage is the Pi getting? Can't figure for sure from the picture. I'd get the Pi off the monitor but seems like maybe you did say it is on its own power source now. I power all of those things separately myself. They go to a power strip and after shutting the Pi down I turn the power strip off and the monitor and Arduino then also go off.

    Jake might be onto something if you are sharing power and such with the Pi in the mix.

    Sorry about the Peco mix-up. I should of gone back and checked better,

    Sumner
     
    BigJake likes this.
  8. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    I think I see a problem... (hopefully the problem)

    I assume the photo was taken when you were earlier powering the R-Pi from the monitor, and that the R-Pi is now powered from its own >= 3A power supply.

    The R-Pi's USB port is powering the Arduino, and from that, the logic on the motor shield (not the motor driver itself, that's obviously powered separately from 12VDC ).

    The R-Pi has very little power for anything external on its USB ports, besides a keyboard, mouse and a thumb drive*. When the Pi goes down due to insufficient power, the Arduino goes down with it, which would prevent the the Aurduino's motor driver from providing track power**.

    Is it possible to power the Arduino from other than its USB host? If so, you could do that (provide a separate 5V power supply for the Arduino).

    Otherwise, I would suggest getting a Powered USB Hub (e.g. a hub that has it's own power supply for its downstream ports). Any powered hub should be plenty fast to handle the data rates to the Arduino, along with the keyboard, mouse, a thumb drive, etc., if you want. The USB hub provides the power for the downstream USB ports and whatever is plugged into them.
    1. If not already/permanently connected, connect the USB hub to it's power supply.
    2. Plug the hub's power supply into an AC power strip*** or outlet.
    3. Connect the host/upstream port on the hub to the Pi's USB port.
    4. Connect the Arduino to one of the hub's other, downstream ports.
    Turn on, or plug in, the power strip, and see if this works.

    *Powering the R-Pi 4b with more than 3 amps doesn't help. Its power management system will shut down if the Pi (and anything else it is powering) draws more then 3 amps. The R-Pi is a low power system and is not designed to provide power to a whole system (beyond they typical keyboard, mouse, thumb drive, etc.)

    **The track bus previously may not have been shorting out, but simply losing power when the Arduino lost power. A 12 amp short would smell a bit, methinks.

    ***It is best if everything is plugged into a switchable power strip, so you have a single place to shut all the power off/on (at least once you get everything working). However, that means you have to 'shutdown' the R-Pi OS before turning off everything with the power strip.
     
    Sumner likes this.
  9. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    An Arduino will run on five but I would put a 9 volt power supply on it like what I gave a link to. That is what I'm using and I believe what a lot of people use. 9 volts is in the middle of the range they recommend.

    From their store:

    The board can operate on an external supply from 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.

    Sumner
     
    BigJake likes this.
  10. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    THIS! ^^^

    Get a separate power supply for the Arduino as Sumner recommends. Besides providing the recommended operating (not just programming) supply voltage to the Arduino, this offloads the R-Pi from providing power, and removes the need for the powered USB hub I recommended.

    I don't have any experience with Arduinos, so I was not aware of the power situation for them. That's the value of our community of practitioners!

    I wonder if there is a "Best Practices" article/site online (or maybe we should create one here) for Arduino- and Raspberry Pi-based model railroading?
     
    Sumner likes this.
  11. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    I might be wrong but the only DCC Command Station that fits the above combination would be the older DCC++ or now DCC++EX. Running/using a Pi is optional with DCC++EX as you can run it with any computer or none at all. The older DCC++ need JMRI on something at least to run a throttle although that isn't entirely true either. If someone made one of Dave Bodnar's wired or wireless throttles they could connect directly with the Arduino running Greg's DCC++ with no computer being needed.

    So probably here or the DCC++ sub-forum would be where to possibly have a 'Sticky' thread created???

    Sumner
     
    BigJake likes this.
  12. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    I was thinking some industrious folks may use Arduinos for ancillary purposes on their layouts (signals, animation, lighting control, etc.)

    Since I only have one DCC system, it is used for the layout and programming decoders, and I don't consider JMRI optional for the latter (but of course it is optional, just like A/C is optional on automobiles in the south: you could get along without it, but why?)

    Heck, JMRI Decoder Pro was the clincher for me getting back into model railroading with DCC!

    And if you are already comfortable with an Arduino running trains, then using a Raspberry Pi to run JMRI seems an affordable, logical extension. But it is certainly not the only option.
     
    Sumner likes this.
  13. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    I love the Pi and would hightly recommend one to anyone but right now with the shortages it isn't good if you are looking for one at an affordable price. I've seen different estimates on when they might catch up and even on the official site it looks like it will be a while before there are enough out there where suppliers aren't going to be gouging buyers :(. What in the past has been a very inexpensive computer is for now not the case.

    Also agree that having access to Decoder Pro is a must. For someone who builds one of Dave's throttles ( I was close) they don't need a computer to run the Command Station with the throttle but they always could still attach one when they wanted to run JMRI.

    Sumner
     
  14. Rick Norell

    Rick Norell TrainBoard Member

    37
    11
    2
    Hmmm, sorry to budge in here... I was planning on powering the arduino Mega with the USB from my laptop (5V and typically 0.5A). I need to have the laptop plugged in at all times to run JMRI so makes sense. However, I do recall that the UNO should NOT have a USB connection PLUS another external connection (say 9V). Is the Mega the same, can't have both? You seem to imply that 5 volts is inadequate for the arduino, is that true if 5 volts from USB?
     
    BigJake likes this.
  15. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    Raspberry Pi 400s are readily available...

    Same electronics, less one USB 2 port and the camera/embedded display interfaces, but with keyboard, 4GB RAM and a great heatsink.
     
    Uncle peanut butter and Sumner like this.
  16. BigJake

    BigJake TrainBoard Member

    3,310
    6,379
    70
    I searched the web about this, and got different answers. It sounds like the Arduino automatically switches its power source from USB to power input when power input >= 7V.
     
    Rick Norell likes this.
  17. sidney

    sidney TrainBoard Member

    1,245
    2,116
    38
    guys ive have separated all units to there own power supply's and still did the same thing . IE pi4 with its own power supply and Arduino with its own power supply and the monitor with its own power supply and i still have the same results.... there is something with that pi4 and steve todds image i cannot figger it out. but if i use jmri on my winodws computer everything works great .
    From what ive seen my locos doing is there not getting enough power because the intermountain with sound will not run at all with the pi4/jmri... but when connected to my computer jmri to Arduino its runs very well.....ive got a few more things to try. im waiting on a bench top power unit to test voltages and amps. wish i had a way to test the power packs volts and amps from each one.....

    Big Jake yes the Arduino switches from usb power to what ever power you plug into the other power dohicky (cant think right now)
    I think the system when shorted in some fashion shuts its self off but can not recover its self if that makes any sense. last thing i can try is remove my pi4 from my 3d printer and see if that helps
     
    Rick Norell and Sumner like this.
  18. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    I have DCC++EX on both a Mega and an Uno. Both have a standalone ($10) 9 volt power supply connected to the input on them and also are connected to the USB port on the Pi (or another computer) running JMRI (that port is also a powered port). So they are both connect to a powered USB connection and an external power supply. This is very common and actually the recommended way to do this. As Andy mentioned the Arduino will automatically use the appropriate port for power.

    The following from Arduino's site ( HERE ) is true for both the Mega and Uno....

    Power
    The Mega 2560 (and Uno) can be powered via the USB connection or with an external power supply. The power source is selected automatically.

    External (non-USB) power can come either from an AC-to-DC adapter (wall-wart) or battery. The adapter can be connected by plugging a 2.1mm center-positive plug into the board's power jack. Leads from a battery can be inserted in the GND and Vin pin headers of the POWER connector.

    The board can operate on an external supply of 6 to 20 volts. If supplied with less than 7V, however, the 5V pin may supply less than five volts and the board may become unstable. If using more than 12V, the voltage regulator may overheat and damage the board. The recommended range is 7 to 12 volts.
    ....

    My thought is that for $10 or less put a reliable power source to the Uno or Mega and then you don't have to wonder about what the USB port you are connected to can put out.

    Sumner
     
    Rick Norell likes this.
  19. Sumner

    Sumner TrainBoard Member

    2,841
    5,994
    63
    Good idea. I had started to think that I might have a Pi that I could loan you to test with but I'd use the other Pi you have. Would save a lot of shipping costs. It is looking like maybe the Pi is the problem. I don't think it would be the image file since you have put new and old ones on.

    The one thing that doesn't make sense is the difference in the way the sound loco runs. Sounds like the Command Station isn't putting out enough voltage or more likely the amperage needed when connected to the Pi but that voltage/amperage doesn't come from the Pi or the computer.

    If you have a meter take a voltage reading on the track with no loco, one with the Pi and another with the computer. I have my meter set on AC and the 20 volt scale. I get about 11.2 volts with a 12 volt power supply connected to the motorshield. Since the DCC voltage isn't a true AC or DC voltage we don't get a true reading but it should be one to see if there is a difference when using the Pi vs. the computer. Then you could repeat with the sound loco on the track powered up.

    Sumner
     
    Last edited: Mar 9, 2022
  20. Ash

    Ash TrainBoard Member

    106
    67
    8
    That agrees with what I have experienced. I now use a 9 volt wall wart with barrel connector.

    Connect the USB for data. Power the Arduino Mega using the barrel connection at 7.5-12 volts as shown on the DCC++EX site.

    And don't neglect track wiring.
    https://dcc-ex.com/reference/wire-gauge.html#why-is-wire-size-important
     
    Sumner and Rick Norell like this.

Share This Page