Author Topic: My DCC conrol console  (Read 2250 times)

0 Members and 1 Guest are viewing this topic.

rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
My DCC conrol console
« on: October 15, 2016, 08:47:42 AM »
+4
Hi:

I'm using DCCpp project, a.k.a. DCC++, with some modifications I made for reading inputs form 4 slider potentiometers, direction switches and emergency stops. It is running on an Arduino Mega. Next, control of the 15 turnouts using servos, controlled by another Arduino.

To program the decoders, I use JMRI, Java Model Railroad Interface. The whole project is free, you only buy the robotic boards (Arduino). Of course being a programmer helps in adapting the original code to one's needs.

Initially I had developed an interface that included an IR receiver and an old CD player remote control besides a LCD display. But I found that controlling trains by pressing buttons doesn't look like the real thing.

So instead I built this console that includes 4 throttles in a fashion similar to the real thing:

https://www.youtube.com/watch?v=W_2WJkEFoEs

The three locos:
https://www.youtube.com/watch?v=aXETJFoLd0I

The layout includes a length dedicated as the programming track. A switch in the console toggles it on/off.

Regards,
Robert



C855B

  • Crew
  • *
  • Posts: 10882
  • Respect: +2421
Re: My DCC conrol console
« Reply #1 on: October 15, 2016, 09:50:12 AM »
0
Very nice! There's nothing quite like the feel of a good-quality hardware slider.

I'm with you on the servos. I'm interested to see where you take it with the Arduino, although I think my approach by necessity will be one decoder node per turnout in most cases.
...mike

http://www.gibboncozadandwestern.com

Note: Images linked in my postings are on an HTTP server, not HTTPS. Enable "mixed content" in your browser to view.

There are over 1000 images on this server. Not changing anytime soon.

Philip H

  • Crew
  • *
  • Posts: 8920
  • Gender: Male
  • Respect: +1658
    • Layout Progress Blog
Re: My DCC conrol console
« Reply #2 on: October 15, 2016, 10:41:36 AM »
0
Cool.  The video is neat too.

Where did you get the sliders - your videos are all titled in Spanish so I assume you are overseas somewhere?
Philip H.
Chief Everything Officer
Baton Rouge Southern RR - Mount Rainier Division.


rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
Re: My DCC conrol console
« Reply #3 on: October 15, 2016, 10:49:01 AM »
0
I'm from Argentina. We use to speak Spanish here...

They are 10K, linear slider pots not hard to find in electronic components shops.

rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
Re: My DCC conrol console
« Reply #4 on: October 15, 2016, 11:08:23 AM »
0
Very nice! There's nothing quite like the feel of a good-quality hardware slider.

I'm with you on the servos. I'm interested to see where you take it with the Arduino, although I think my approach by necessity will be one decoder node per turnout in most cases.

C855B:

Controlling servos with an Arduino is almost straightforward. You can control the direction and angle so any fine adjust is possible. Plus you can add some delay so to make the turnouts change slowly as the real thing.

There is a lot of info here: https://www.arduino.cc/en/Reference/HomePage

Each servo will need 3 wires: +5V, GND and signal. +5V and (common with the Arduino) GND wires will be under the baseboard available for each servo, and there will be a signal wire coming from an Arduino digital pin to each servo. I will use another Arduino Mega (the same board I use for DCC++) because it has plenty of digital pins (54) and I'll need two pins for each servo (15 servos in total). One pin for the switch and another for the signal. And there is a triple turnout that will use 4 pins, 2 for the inverter switch with dead point and 2 for the 2 servos.

Just a mess of wires, nothing too difficult to accomplish.

My source is a couple of PC power sources wired in series for 15V: I take 12V from one and 3.3V from the other one, and a 5V from one source (I could have taken the 15V into a 5V regulator anyway). That 5V source and its GND will power the servos.

There is a switch in my console that turns that 5V source on and I do it AFTER the Arduino is running. Why? Because the servos must be powered AFTER they are already receiving the signal, otherwise they jerk at startup and that can ruin a turnout if the servo arm goes beyoond the mechanical limit of the turnout.

The reaso why I don't use just one Arduino Mega for both tasks (DCC++ and turnouts servos) is that the DCC++ code alter the way some internal counters and timers work and that prevents me from using more that 10 servos, as far as I know. It has to do with electronics and the board internals but this is beyond our scope here.

Regards,
Robert

rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
Re: My DCC conrol console
« Reply #5 on: October 15, 2016, 11:14:05 AM »
0
Here you see how I use the console (or should I call it panel?).

I move the throttle for speed, toggle the switch for direction and press the red emergency stop button. Then I lift the board so you can see the wires and the Arduino Mega itself:

https://www.youtube.com/watch?v=PYK8_Fbi-f4

R.

C855B

  • Crew
  • *
  • Posts: 10882
  • Respect: +2421
Re: My DCC conrol console
« Reply #6 on: October 15, 2016, 11:42:18 AM »
0
... Just a mess of wires, nothing too difficult to accomplish. ...

There is my issue in a nutshell - the mess of wires. I am building a very large layout, roughly 100 linear metres, and therefore require a bus architecture. Also, 325 switches (at last count). However, it would be possible, maybe even desirable, to use a higher-capability central controller with several outputs, such as the Arduino, in concentrated locations like yard throats. The overriding requirement, though, is each controller node would have to communicate via a layout bus (DCC, LocoNet, or LCC) and not with a direct connection to the master JMRI system (via USB, for instance).

I'm familiar with servo operation details and am an old-school programmer by trade (retired), but these days I leave programming to the younger guys... I have trains to run. :D

Good point regarding power-up sequencing, by the way. Thanks for the reminder!
...mike

http://www.gibboncozadandwestern.com

Note: Images linked in my postings are on an HTTP server, not HTTPS. Enable "mixed content" in your browser to view.

There are over 1000 images on this server. Not changing anytime soon.

John

  • Administrator
  • Crew
  • *****
  • Posts: 13411
  • Respect: +3263
Re: My DCC conrol console
« Reply #7 on: October 15, 2016, 02:04:07 PM »
0
Hi:

I'm using DCCpp project, a.k.a. DCC++, with some modifications I made for reading inputs form 4 slider potentiometers, direction switches and emergency stops. It is running on an Arduino Mega. Next, control of the 15 turnouts using servos, controlled by another Arduino.



Robert --- welcome .. it's always good to have another hacker here :)

Philip H

  • Crew
  • *
  • Posts: 8920
  • Gender: Male
  • Respect: +1658
    • Layout Progress Blog
Re: My DCC conrol console
« Reply #8 on: October 15, 2016, 02:49:56 PM »
0
I'm from Argentina. We use to speak Spanish here...

They are 10K, linear slider pots not hard to find in electronic components shops.

Claro que si, pero hay muchos paieses que hablan Espanol en el mundo.  Intonces, no me escrito una nombre aqui.
Philip H.
Chief Everything Officer
Baton Rouge Southern RR - Mount Rainier Division.


rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
Re: My DCC conrol console
« Reply #9 on: October 15, 2016, 02:53:22 PM »
0
Philip:

"no me escrito una nombre aqui"

What did you want to say? It is not correct.

Steve S

  • Posts: 12
  • Respect: +2
Re: My DCC conrol console
« Reply #10 on: October 15, 2016, 05:02:53 PM »
0
Initially I had developed an interface that included an IR receiver and an old CD player remote control besides a LCD display. But I found that controlling trains by pressing buttons doesn't look like the real thing.


Regards,
Robert

If you want a handheld throttle, Dave Bodnar over at the Trainboard forum developed the throttle in the pic below.  It uses a Nextion touch screen, but has a knob for speed control. 

http://www.trainelectronics.com/DCC_Arduino/Nextion_LCD/images/TopPic.jpg

A company named Hammond Manufacturing makes some nice handheld enclosures that should work with it.
http://www.mouser.com/ProductDetail/Hammond-Manufacturing/1553DBK/?qs=sGAEpiMZZMsrGrAVj6eTvQL%2fwQ3TetVEyrjLozHh9H8%3d


Steve S

rva1945

  • Crew
  • *
  • Posts: 34
  • Respect: +8
Re: My DCC conrol console
« Reply #11 on: October 15, 2016, 05:05:06 PM »
0
I know Dave Bodnar works.

Anyway I don't need such a throtle when I could build mine.

Thanks anyway.