How do you power accessory servos

WillemT Feb 7, 2019

  1. WillemT

    WillemT TrainBoard Member

    55
    40
    7
    After many years (far too many) I can now run trains again. Having completed my mini DCC++ controller (see here) I finally got stuck in and started building a new, smallish (1200 x 1800) layout - about the fourth restart in the last few decades.

    With Fase1 down (a small classification yard, loop around the periphery and a reverse loop) including 15 turnouts, I now need to control those turnouts - hence this post.

    Since my DCC++ controller is mobile only, the plan is to have a separate buss for accessories. With that in mind I have on breadboard: An enhanced accessory only version of the DCC++ base station, running on an ATtiny84, plus a 328P version of the planned accessory decoder. I am currently skipping the in-between DCC++ driver plus opto-isolater by connecting the base station's DCC drive signal directly to the Decoder DCC input. The decoder supports 6 servos and all is working as planned.

    This brings us to me needing advice/input from the more experienced RR modellers. Before I can proceed to building any decoders I need to make decisions as to powering the servos.

    There will eventually be around 30 servos. These little critters are not exactly frugal when it comes to current consumption. So, how do you connect and power them?

    Powering them off the DCC bus would be ideal. Reducing the wire clutter is a prime reason for using DCC decoders. However, that would require a rather hefty driver for a single DCC bus. An alternative would be a separate 5V power buss - one more bus. Some suggestions are a small power supply per servo, AC power cables all over the place - yikes, and rather expensive. Next could be a power supply per Decoder, down to about 5 larger supplies - still a lot power cables. Another possibility is to use multiple DCC drivers with their own buss each supplying, say, 3 Amp or so (I can go to about 5 Amp drivers relatively inexpensively).

    How do you guys with a lot of servos handle it? What are your experience as to power requirements? Any ideas/advice will be appreciated.

    Willem
     
  2. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Most commercial & DIY servo decoders have a separate DCC & 5V input. This way, your CC is protected from problems/ shorts on the modules. Usually when you power up, the servos jitter and draw a lot of power till the wait state. If during operations you throw a series of turnouts in one go, it will then also draw a lot power, which the CC can't supply. Commercially you can get decoder for one up to 16 servos and power for the servos. Some even include provision for signals and/or live frogs. DIY there is a lot on the wwww. Most also include 5V power circuit. On this board you can have a look at Geoff's effort in 17 servo Arduino. Or look in to I2C servo ( PCA9685: https://learn.adafruit.com/16-channel-pwm-servo-driver?view=all) setups. Paco (http://usuaris.tinet.cat/fmco/home_en.htm) has a simple and easy to set up 4 sever decoder. You'll find this circuit and adaption of it on www.
     
  3. WillemT

    WillemT TrainBoard Member

    55
    40
    7
    Hi Pieter. Thanks for the reply. Apologies for this late response, I have no real excuse.

    Yes, I am very aware of the general trend in the industry when it comes to powering servos. I also own a PCA9685 from adafruit (unfortunately the shield version). It does not quite allow what I am aiming for when it comes to controlling servos - maybe me not understanding it properly - and it needs a processor to drive it in anycase.

    Electronics and RRing, to me, is a synergy. I therefore am a die hart DIY when it comes to both. I need electronics to control my railroad, and need the Railroad to motivate the design and building of electronics.

    Geoff Bunza's 17 channel decoder provided me with a lot of ideas, and showed me how to a use and manage CVs in a decoder. I can only manage 6 servos per decoder since I need 3 pins per. One to drive/pulse the servo, one as a status bit and one to manually toggle the servo direction - 18 pins in total. By providing a status and toggle option I can, for example, automate turnout direction using a single detector in the frog side approach tracks.

    Since I am using a separate DCC bus, with a modified accessory only driver/base station, my interest initial was to find if anyone has used the DCC bus to also provide power to the servos and what their experience was. Judging from the response maybe people do not use servos.

    I am now able to read and write CVs from/to my accessory decoder via the DCC bus running in Mains/Operations mode, the only way to address individual decoders without having to connect them individually to a programming buss (I am also using a dedicated CV to read the turnout status from the decoder - necessary because of the additional manual option). This will probably make it impractical to provide high current via the DCC bus at the same time. I am, however, going to test that. I currently accept that I will most likely have to provide power via an additional 5V power buss.

    Willem
     
    Last edited: Feb 14, 2019
  4. Pieter

    Pieter TrainBoard Member

    152
    46
    10
    Some of the DIY modules draw the power for the servos from the track. If it is only upto maybe 8 servos and a few engines, a 2 to 3 Amp CC shouldn't have a big problem handling it. It adds a 7805 to the module to supply the power for the servos. But the much better way is that the modules uses a octo to isolate the DCC signal and a separate power supply input for the module. Quite a few of them also provide to daisy chain the modules.

    If you CC has a Xpresnet bus (or X-bus) there are TCO modules (up to 105 turnouts per module) for it. This way you can use your throttle and buttons to control your turn outs. And even with software, connected via a PC to your CC.

    During the week I came a cross a site or two where they advice against using I2C model railway to set servos. Main reason is that it has to be near the Arduinos (few cm) and electronic noise has a great influence on it. There is also a lot of suggestions of how to get a round it but nothing that is 100% successful.

    Have a look at this link: https://forum.arduino.cc/index.php?topic=315457.15 Similar to what you are working on. The one thing they have discovered it that not all the Arduinos (Uno for example) are equal. The different CPUs used in the boards have been messing around with the compiling of the code. The final code is near the end.
     
  5. WillemT

    WillemT TrainBoard Member

    55
    40
    7
    I do use an opto to isolate the DCC signal to the processor. Using a 7805 is OK if you only draw low current, like for the decoder electronics. There are however more efficient linear regulators than that - though more expensive. If I am to drive a servo from the DCC line I will definitely use a buck converter for the heavier current. I just need to first check how any higher current effects reading of CVs over the DCC bus. In the end, running a 5V supply line is most likely the better solution.

    No Xpresnet or any commercial type bus available here. Also no mobile decoders on the accessory DCC line. I2C is used between the controller and DCC "base station", or more accurately, driver - all short distance on the same PC board. Decoders are strictly only DCC driven and powered.

    I am familiar with the thread you quote. I do however think they over complicate things big time. I do use the VarSpeedServo library but my controlling code in the loop is about 15 lines with 6 more in the main servo driver routine - that's it. I use a servo queue as shown by Geoff Bunza in his 17 channel decoder - a lot of good ideas there. All works great with properly controlled attach and detach of servos. Also, all programming is done using ISP and I have not experienced any problems with any of the processors I use - ATtiny 85 & 84, Atmega 328P or Atmega 32U4. The only real issue is debugging - no serial coms. I use a I2C driven LCD display for that.

    The one thing I have not given a lot of thought is how to control all the servos/turnouts eventually. I definitely am not going to type in servo addresses. I am thinking more along the lines of some graphic interface. All in good time though.

    Willem
     

Share This Page