Large Scale Central

DCC++EX Control

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. 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

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/

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/

Bob,

They do have the uFL version I need. Have you ever programmed them with the Arduino IDE?

If so, what board files do you use, ones from ezsbc, or ???

Steve

Using the Arduino IDE, yes, and have the "esp32 by Espressif Systems installed in the board manager

Bob,

I noodled around on the ezsbc forum and found my answer, They use the Espressif tools:

https://github.com/espressif/arduino-esp32

Steve

Steve said:

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:

Steve,

Thank you for posting this. Your project may be the stimulus I need to resurrect an old project.

About 18 months ago I built a DCC++ system that looked very similar to yours except that I had the Pololu motor shield.
I was using Engine Driver on my phone, with the signal being track fed. The idea was that the system would be made more compact,
and used as on-board for Dead Rail.

The system worked great while it was track fed. However, shortly after that when some modifications were made, everything stopped working. After many hours of ineffective effort, I got frustrated
and put the whole thing in a shoe box and stuck it on a shelf in the garage. I put DCC++ completely out of mind until now.

I will be following your progress and perhaps go find that shoe box…

John

John,

I love your thumbnail! When I was just about that age I had one of those large drycell batteries with screw down connectors that had gone dead. I figured I could put more juice back in by attaching a lamp cord to the terminals and plugging it into an outlet. That experiment started with a LOT of sparks & blown fuses, and finished with a trip to the woodshed.

Steve

(https://www.largescalecentral.com/externals/tinymce/plugins/emoticons/img/smiley-tongue-out.gif)Steve,
a disclaimer, the photo is not me but:

  1. it looks like me at that age
  2. I did this!!!(https://www.largescalecentral.com/externals/tinymce/plugins/emoticons/img/smiley-surprised.gif)

I’m also guilty at about the age of 5 of sticking a hairpin in a car cigarette lighter socket…I had a crinkle shaped scar on my right index finger for years.
This along with the above resulted in immediate punishment that was far worse than the electrical damage !

I’ve gotten my Sparkfun ESP32 ThingPlus converted to being a WiFi server via AT commands.

I haven’t attached it to my DCC++EX station yet as I am rebuilding the perfboard shield to better organize the connectors. But I’ve tried a number of different AT commands and they seem to work:

AT+CIPSTA?
+CIPSTA:ip:“10.11.12.86”
+CIPSTA:gateway:“10.11.12.2”
+CIPSTA:netmask:“255.255.255.0”

I can see it from the network:

$ ping -c 3 10.11.12.86
PING 10.11.12.86 (10.11.12.86) 56(84) bytes of data.
64 bytes from 10.11.12.86: icmp_seq=1 ttl=255 time=22.3 ms
64 bytes from 10.11.12.86: icmp_seq=2 ttl=255 time=44.2 ms
64 bytes from 10.11.12.86: icmp_seq=3 ttl=255 time=66.0 ms

Now I can use an external antenna via the Thing’s uFL connector.

Steve

Bob McCown said:

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.

Following up on myself here, I got DCC++ EX working on my Arduino and Pololu shield. What they don’t tell you is that DCC++EX is not a direct replacement for DCC++, and the mods that you had to do to the motor shield for DCC++ are unnecessary. I added some jumpers to the motor shield, and it now works. Now back to figuring out the throttle. (which I will document in another thread when I get it working)