Jump to content
 

DCC++ Arduino based DCC controller


Recommended Posts

I decided today was the day to sort out the Arduino stack for the DCC++ base station. I put the boards together to check how much clearance each required and made spacers from plastic tube. 4 spacers per level, just high enough to stop each board shorting on the one below - that ethernet jack is the big problem. I wanted the pins to go in as much as possible, obviously. One of the spacers requires a relief cut into it because the Mega has a header right next to the mounting hole fouling any spacer used there... more excellent design.

 

I would have used M3 studding if I had it, but I don't, and I don't have an M3 die. I did have a spare welding rod and a 5BA die so I made some 5BA studding instead. 6BA would have been better but welding rods are the right size for 5BA. This required a diversion to make a split collet for the lathe as my 3 jaw chuck doesn't grip anything smaller than about 5mm. It was a bit of a dodgy process all around but it came out usable.

 

I turned up 4 button feet threaded 5BA to sit under the base plate and made short spacers to hold the Mega off the base plate because it has lots of protruding tags and pins beneath it.

 

The Mega itself made a good drilling template for the base plate, a 3mm drill going through the holes cleanly.

 

The stack is much better now and could go into an enclosure with a power supply using the these studs and spacers.

 

I tried it out tonight, burning the unmodified code (except to change the comms to ethernet) to the Mega and using the latest JMRI as a programmer and throttle. It worked well! I tried the programming track for the first time and changed the address of my loco and it was good to see that works too.

 

I used a converted PC power supply for the motor power and powered the Mega from the USB cable. If I put it all in a box I'll try to incorporate both power supplies in the box from a single power input.

 

Regards,

David.

 

 

post-1936-0-06510700-1469269183_thumb.png

 

post-1936-0-46205900-1469269276_thumb.png

 

post-1936-0-49408600-1469269328_thumb.png

 

post-1936-0-60931600-1469269381_thumb.png

Link to post
Share on other sites

With the base station pretty well sorted apart from a case and power supply I had another look at the throttle.

 

The big problem I have with the throttle is mounting the controls and connecting them to the Arduino. Unfortunately I didn't manage to solve that.

 

But I found a few bugs in the software and made a few tweaks, and was able to drive the loco with the throttle.

 

I am seeing a problem where the base station occasionally stops responding to commands from the throttle but I won't worry about trying to fix that unless I get the throttle hardware sorted out. Looking at the messy, fragile, mess that is the throttle at present doesn't make me want to work on it.

 

The throttle can handle 8 locos, selected by the red buttons. I won't have even that many in the forseeable future, but given I'm writing the software I could change to a numeric keypad if required.

 

The rotary encoder is used to speed up/slow down, and pressing it sets the speed to 0 and changes direction.

 

There should be an emergency stop switch on the panel but I only added the code today. After triggering it I find I need a way to switch the track power back on! I'll probably just reuse the same switch and make it act like a toggle.

 

The missing component is another switch bank that will operate functions 1-8 of the current loco. My Hornby Jinty loco have any use for so not much to see.

 

So how do all you Arduino people mount the various components and do neat, reliable wiring back to the Arduino? Desolder the headers everything comes with and do point to point wiring or something? I admit to being a software and schematic person. Actually putting all these bits together isn't my thing.

 

Regards, David.

 

post-1936-0-29160800-1469339500_thumb.png

 

post-1936-0-04188500-1469339825_thumb.png

  • Like 1
Link to post
Share on other sites

So how do all you Arduino people mount the various components and do neat, reliable wiring back to the Arduino? Desolder the headers everything comes with and do point to point wiring or something? I admit to being a software and schematic person. Actually putting all these bits together isn't my thing.

 

In my view, this is one of the largely ignored consequences of the 'Arduino Generation'. It's all very well being able to buy a few general purpose modules on the cheap, but then to be able to turn them into a reasonably presented and practical product is an entirely different matter.

Most of the posts about Arduino and the like seem to come from people who have no end of good conceptual ideas as a result of bit of background programming knowledge, but then lack the hardware experience to take the next step. This is not a criticism, merely an observation based on what I read on forums like this, and see at work. Discipline specialisation may be good for productivity on a commercial basis, but for hobbyists it tends to limit the options. 

Personally, I work the opposite way round. As a mainly hardware engineer I design from scratch from the ground up, on the basis that the shape, size and arrangement of the eventual hardware construction is equally, if not more important than being able to program the thing later on. 

For me, it is rare to use any ready made modules except where there is an obvious advantage in doing so. This is especially so where such a design is expected to be supported for a considerable length of time. Manufacturers are renowned for making items obsolete at the most inconvenient times! 

Far better to include and assemble just the bits you actually need for your own requirements than to have to disassemble and rearrange someone else's general purpose items which are not necessarily designed with that in mind.

Link to post
Share on other sites

  • 2 years later...

Hi...If you want to use an ESP8266-12E you in theory could but you would be limited to just one motor shield and only PROGRAMMING or OPERATIONS signal. The Signal Generator code would also need to be heavily adjusted as the current code requires all four hardware timers to generate the two DCC signals. The ESP8266-12E only has one hardware timer so an alternative approach would be required where you use a Boolean flag to say "first" or "second" call when flipping the direction pin state *AND* picking up the next bit to send. The timer setup was possible because of its great pcb design and pcb assembly by the manufacturer. The current code uses two timers, one for direction pin flip and one for picking the next bit to send. It might work but as I don't have an ESP2866-12E to test with I don't know how much work it would take exactly.

 

Edited by PatenLowe
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...