Large Scale Central

DCC++EX

Hi,

I see that all the DCC++ posts are getting a little stale - so I thought I’d start one on: DCC++EX.

They picked up where DCC++ left off They have created a very nice website for support.

I am converting my deadrail system from MTH DCS to DCC++ to allow control with JMRI Dispatcher.

Here’s my DCC++EX progress so far:

12v PS on left, buck regulator top middle.
Arduino Mega with Arduino motorshield and 128x64 OLED display.
Arduino Mega with ARD-DCCSHIELD

I have a WiFi board showing up Friday. I also have a buck/boost regulator showing up

Friday. This will be used to get the 18V I need for the G-scale locos. Then the existing

buck reg will be used to provide 7V to power the 2 Megas.

I can run the HO BigBoy around a small circle track, blow whistle, etc!

This setup is for my DCC++EX R&D. The actual deadrail cars will be similar

to this. only with a single MEGA, single channel high-power motor driver and wifi shield.

=============================================================================================

Please note:

As of 7-6-2021 this thread is 4 pages long. I have made a few mistakes, and quite a few changes,

as I’ve progressed in the designs. Read the thread through to the end before making anything based

on these posts. Some of the intermediate designs had flaws that could harm your equipment!

I assume no liability for any damages caused by either my hardware designs or software… caveat emptor.

=============================================================================================

Steve

Nice. I have a DCC++ arduino going, but haven’t converted over to DCC++EX yet, due to (last I looked) support for the motor board that they recommended for DCC++. I will get around to it eventually, but there are so many projects on the plate right now.

I have a design for a handheld throttle around the nRF24L01 working with DCC++, at least rudimentarily. I want to make an add-on that you can just wire up and go.

Thanks Steve. I have rail-powered DCC, and it has many limitations. After KOPS last weekend, I’m considering options for hand-held wireless control, so I’m interested in what you come up with.

Bob,

Out of curiosity, which motor shield are you using with DCC++?

Steve

Steve said:

Bob,

Out of curiosity, which motor shield are you using with DCC++?

Steve

I’m using the Pololu shield. Works great for DCC++, but for DCC++EX they say it’s “Tinkerer level” and apparently needs some hacking to work.

Bob,

Their claim is that the current sense capability of the Pololu MC33926 Motor Driver is too low.

I found this:

nathanb
Pololu Employee
Jul 2017

Thank you for your detailed post. In general, we do not expect the type of current sensing mechanism the MC33926 uses to be very accurate for that kind of measurement.

If you look at the “High-Side Current Sense Feedback” section of Table 4 in the MC33926 datasheet 38, you can see that getting zero feedback output with 300mA of motor output is a possibility.

I would expect this to be an issue for DCC++ or DCC++EX. Do you use it for programming? I have to admit a whole lot

of ignorance about DCC, and CV programming in particular at this point. The arduino shield I’m using should have

enough current for programming, and the dealrail cars will only have to provide a main track.

So for deadrail I expect to use a combination of one IBT_2 board and one Pololu ACS724 (10A+) for current sense.

Does that make sound reasonable?

Steve

I was using it to program through JMRI, yep. I wonder what the issue was, because the Pololu shied was one that they recommended for DCC++. Not a big deal, Ill just buy a supported shield, but frustrating.

Anyway, looking forward to seeing your progress. The fact that a lot of electronics in the model RR world can be done by yourself for a few dollars is pretty neat.

Bob,

I own 4 Pololu shields at this point. I bought them 1-1/2 years ago on the DCC++ project’s recommendation

expecting to get into DCC++ then, but as you know I’ve been busy laying track (https://www.largescalecentral.com/externals/tinymce/plugins/emoticons/img/smiley-wink.gif)

I bought the Arduino motor shield when getting back to it (but with DCC++EX this time) wanting

to go with the “path of least resistance”. I think the issue with the Pololu is that the minimum

signal of that part is 0, but the “typical” value is good enough to work. So for some people it

works OK, but for others…

I HAVE to go with something else for the dead rail cars, as I need at least 5 amps and I only

need the main track output as I wont be programming engines with their dead rail cars,

and can’t afford extra space for equipment I wont be using.

Steve

I don’t know much about DCC++EX but I do generate DCC using an Atmega328. It’s at logic level (5v) obviously, so I just use one of these to ‘boost’ it to ‘real’ DCC.

https://makermotor.com/pn00218-cyt3-cytron-13a-dc-motor-driver-md13s/

It’s not tiny, but it has a pretty small footprint (for 13A!) and fits nicely in all my locomotives.

I’ve tested it with the TSU4400, the ESU 5XL and the TCS 501, all 5 amp decoders in a dead rail situation with a 14.8v lipo.

The yellow wire on the Cytron control cable goes to the DCC logic level, the white wire is 5v and the black is ground.

Martin,

I don’t see provision for current sense on that board. Do you use another circuit for that?

Steve

No, I don’t need current sense. Not sure why you would, is that a provision of DCC++EX or something?

Martin,

Don’t know if DCC++ used it, but DCC++EX does it on the main track to prevent damage to the engine

if too much current is drawn. Kind of a software fuse.

DCC++EX apparently also does it on the programming track to detect ACKs, but I haven’t gotten that

far in my understanding yet…

I’ve been wondering if a fast blow 5amp fuse would be “good enough” . I already use such a fuse in

the wires between my control/battery car and the loco.

Actually I use one of these to keep the output of the batteries at a constant 18V. It also has settable current

limiting so that’s “protection #1”. The 5amp fuse is “protection #2”. This device also has a setting for an

under-voltage level at which point it cuts the current completely. This protects LI-ion batteries from being discharged

beyond their safe minimum limit.

Having DCC++EX monitor current and cut it when over-limit would be “protection #3” (belt & suspenders & ???)

Steve

I use one 5A fuse in between the battery and the rest of the electronics. The decoder pulls what it will, it will shut down if it overheats. I run dead rail and my DCC address is fixed at 3 so no need for a programming track. Any decent Lipo pack has discharge protection, I’ve run mine down to a dead stop with no ill effects. I guess you can never be too safe though, it depends on your level of comfort. I do balance charge my batteries and have one of those fancy ‘smart’ lipo chargers. I also do a yearly teardown of my locos and check for battery swelling, etc. So far so good, I have maybe 7 converted locomotives. About 4-5 years now, various usage, one pack swelled a bit so I replaced it but that’s it, knock on wood :slight_smile:

Martin,

I was a little leery of battery packs, smart charges, balance charging, etc.

So I decided on a setup that gives me more control

First I use these individual cells.

They are hard to find (big demand) and the prices are all over the place. There are

counterfeit versions out there, but the real ones are quality - Beware!

I charge them with these chargers. (I think this model is EOL)

The charger gives me a good idea of the cells condition, and I just replace one cell if necessary (so far it hasn’t been).

But this means I need the previously mentioned board to protect them when used as a “pack”.

I have the DCC++EX recommended ESP8236 wifi module installed and working. I can use WiThrottle on my IPad

to control the station. I had to upgrade from WiThrottleLite (free) to the full WiThrottle ($10) to get a track power button (https://www.largescalecentral.com/externals/tinymce/plugins/emoticons/img/smiley-yell.gif)

I used an ESP8266 ESP-01 Serial WiFi Wireless Adapter Module + ESP-01s board. This board uses the AT command set

to talk to the ESP thru a serial port. This code looks NOTHING like the standard connect/accept/read/write code usually used.

I need to use a board with a uFL (external antenna) connector because of both the distances involved and the terrain (trees,

mountains, etc.) on my dead rail cars. But converting all that AT command code to standard network code would be a nightmare (https://www.largescalecentral.com/externals/tinymce/plugins/emoticons/img/smiley-cry.gif)

Bob, you have experience with the ESP32 mcus… would it be sensible to use something like this

and then load this code onto it? Presumably this would give me something that responds like the ESP8266 board…

Steve

Take a look at PainlessMesh https://github.com/gmag11/painlessMesh It is a library that works with the ESP8266/ESP32 boards, and takes care of the networking for you. The example code shows the callback methods that happen on connect, RX, etc. It’s been real easy to use.

Bob,

I took a quick look, but I don’t see anything that would make dealing with the existing DCC++EX wifi

stack any easier. DCC++EX uses the ESP AT command set for its programming model. What I need is

a uFL wifi board that can speak the AT command set. The goal is to touch none (or as little as possible)

of the existing DCC++EX wifi code.

Steve

Oh, I think I understand now. Its sort of the same thing I want to do with the nrf24l01 modules. My current plan is to have a second Arduino (mini, micro, something) that is the dedicated throttle receiver, that converts whatever I work out for my throttle protocol, and speaks AT commands out the serial lines, into the Arduino that’s running DCC++.

Bob,

Yes. In my case its to replace the ESP-01s (ESP8266) that DCC++EX uses with ESP AT commands

with an ESP32-WROOM-uFL speaking ESP AT commands.

My research shows that the ESP32 AT commands are a superset of ESP-01s AT commands.

I’ve ordered a pair of the Sparkfun ESP32 Things, and have downloaded the esptool.py package and

the v2.1.0.0 ESP32-WROOM-32_AT_Bin_V2.1.0.0.zip file.

It appears it will be as simple as plugging in the ESP32 Thing to a USB port and then:

esptool.py --chip auto --port /dev/tty.usbserial-0001 --baud 115200 --before default_reset \

–after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size 4MB \

0x0 factory/factory_WROOM-32.bin

Steve

I haven’t used the Sparkfun boards, but I’ve been using the ESP32 dev boards from EZSBC for a few years. I like them because they expose all the IO pins of the ESP32.

https://www.ezsbc.com/product/esp32-breakout-and-development-board/