Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Model Railway DCC... Post ReplyPost New Topic
Page of 3 Next >>
Author
Message << Prev Topic | Next Topic >>
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6125
Posted: 13 May 2018 at 12:20pm | IP Logged Quote Grogster

Hello folks.

One of the things I wanted to rekindle, was my interest in model railways. I had a layout years and years ago when I was a young teenager, but thought this might be something I could start up again.

I was interested in the idea of DCC and wondered if this would be within the capabilities of the Micromite. If it was, then an E100 with a 5" or 7" LCD and touch controls could be used to drive all the locomotives.

We should also be able to design a tiny DCC decoder for the locos.

Do-able do you think? I expect that the MM2/MM+ chips are fast enough for the 58uS and 100uS pulse widths of the DCC data format, although, a Cfunction/CSub might be needed here. Some additional reading on how DCC works can be found here, although, they don't discuss the actual protocol - that is what I am looking for now.

If the DCC spec cannot be achieved(trade secret perhaps), we could always invent our own simple slower protocol. You really don't need super speed to issue a few command bytes for a system like this. If we invented our own 'MMTC'(MicroMite Train Control!), it would be nice to incorporate feedback to the main controller as the Railcom protocol does, so the controller can get basic information about the train back if requested. This is optional, but would be nice to have.

EDIT: The other option is simple 'Cab Control', where isolated sections of track are wired back to a heap of toggle switches and a master controller. That works OK, but the wiring is massive if you layout is of any size.

Thoughts?
Comments?
Suggestions?

Edited by Grogster on 13 May 2018 at 12:24pm


__________________
Smoke makes things work. When the smoke gets out, it stops!


Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
Lou
Senior Member
Senior Member
Avatar

Joined: 01 February 2014
Location: United States
Online Status: Offline
Posts: 210
Posted: 13 May 2018 at 1:35pm | IP Logged Quote Lou

Grogs,

I have always been interested in model railroad, over the years I have seen some fantastic setups.

It be interested seeing a uMite control the whole thing, especially how you modulate the track voltage and receive to get the signal across.

I will be watching your progress, please keep us posted.

Lou


__________________
Microcontrollers - the other white meat
Back to Top View Lou's Profile Search for other posts by Lou
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6125
Posted: 13 May 2018 at 1:44pm | IP Logged Quote Grogster

Something else I was thinking, was using cheap RF modules instead of modulating the track voltage. This would then form your two-way link to the loco(if needed), and could use any of the cheap RF modules such as the HC-12. Even with a tiny helical on one of those, you would EASILY get the range needed to control even huge layouts.

The track voltage would PROBABLY be 20v AC or so, and never changes. The receiver nodes in the loco can rectify that AC to make the train go forward or reverse.

Then the control commands can just be a simple serial link.

But if it is easier to modulate serial onto an AC voltage for the track, that would also work and you wouldn't then need RF modules. I'm not sure exactly how I would do that though. Perhaps DC and blocking diodes would be a better idea. Anyone got any ideas as to how you would easily modulate data onto an AC or DC track voltage?

EDIT: I have found this circuit. This seems to be perfect, as it is designed to hop onto an existing low-voltage line, and squirt serial data to the other end. Reading......

Edited by Grogster on 13 May 2018 at 1:48pm


__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 549
Posted: 13 May 2018 at 4:59pm | IP Logged Quote panky

G,

The following site may also be of interest - OpenDCC - not a trainee myself but an interested observer.

panky


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
pjmart
Newbie
Newbie


Joined: 13 November 2016
Location: Australia
Online Status: Offline
Posts: 5
Posted: 13 May 2018 at 11:35pm | IP Logged Quote pjmart

Grogs,
I have some experience with DCC systems on model railways so perhaps can offer some further explanation. I believe the original design was based on a multidrop RS485 system. The control signal is a square wave which swings between a nominal +/-14v to minimise noise. The decoder extracts the control information and then rectifies the square wave to give a nominal 12v DC power supply for the main drive, lights, etc. There is a small microcontroller which decodes and distributes power as required. The drive motor is powered using pulse width control via a h-bridge circuit and the micro. The original design was developed by the Lenz company in Europe and then released into the public domain. The AMRA subsequently has developed hardware standards based on this work.

The original development was done some time ago (about 20 years) and does not take full advantage of recent advances in electronics. There are many different avenues currently being investigated and a good source is the free on-line magazine "Model Railway Hobbyist". A similar idea to yours of using the HC-12 /MM2 combination with power taken from the track is discussed / reviewed in a recent edition (Feb 2018 I think). Among the advantages is the ability to get full two way communication which is not possible with standard DCC. The difficulty is to get sufficient miniaturisation to allow it all to fit inside a standard loco.

A less ambitious approach may be to utilize the existing decoders (which can include Sounds) and develop a MM based back end control which generates the DCC output to the tracks, signals, point control, scenery lighting, special effects, etc, all of which are individually addressable. It is even possible to connect back to a pc network and control the whole thing using the open source Java based system known as JMRA and its various derivatives.

Peter
Back to Top View pjmart's Profile Search for other posts by pjmart
 
goc30
Senior Member
Senior Member
Avatar

Joined: 12 April 2017
Location: France
Online Status: Online
Posts: 104
Posted: 14 May 2018 at 1:49am | IP Logged Quote goc30

I am also very interested in this project. I am a former enthusiast of electric trains. Being French, I only know the German standards, but I think it must be easily adaptable
Back to Top View goc30's Profile Search for other posts by goc30
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6125
Posted: 14 May 2018 at 9:01am | IP Logged Quote Grogster

@ panky - thanks for that link. Lots of extra technical info on the original DCC idea over there.

@ pjmart - Welcome aboard!(the forums) Thanks for that information. Yes, the main problem is going to be keeping it simple enough so that any decoder can be small enough to fit inside the model. The biggest challenge will be N-scale. I don't think there is much Z-scale around(6mm gauge!), and I think it would just be physically impossible to cater to that gauge. OO/HO is my preferred gauge, but N has the advantage that you can model more railway in the same space.

@ goc30 -

At the moment, SSOP MM2 and an L9110 H-bridge is the plan for the motor control at the loco, as this will be nice and small, and the 9110 H-bridge is cheap and easy to get. It is relatively low-power compared to some H-bridges(800mA), but most locos should draw less then that, even when pulling a train. My original controllers were 1A 12v rheostat speed control, and I used to drive long-ish trains with that. Each loco is separate, so you could have multiple locos drawing more then 800mA total, and that would still work if you see what I am getting at.

The first step, will be to see if I can get the concept working on the bench. I am still very much liking the HC-12 approach, cos then it is all wireless, and cuts down on the electronics even more - no need for the UART-over-power-wires idea at all.

Put 12v @ whatever amps you like on the track(with protection!), and then just control the locos wirelessly. The HC-12 is a nice small transceiver module, and I don't see any problems getting it to fit. Even the cheap HC-12 fakes would work fine in that kind of setup. It should be small enough to fit in an N-scale loco. I could then have wireless 'Walk-around' type controllers, perhaps built more on another MM2 and SPI LCD with touch(to save money) if you see what I am getting at.


__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
PeterB
Regular Member
Regular Member


Joined: 05 February 2015
Location: Australia
Online Status: Offline
Posts: 77
Posted: 14 May 2018 at 11:38am | IP Logged Quote PeterB

G'Day Grogster et al.
My only train had a key. No EFI there.
My boys had electric trains and with a well worn loco and a few short circuit turns, they behaved much like an industrial arc welder. Lots of EFI.
My question is, are modern locos brushless or is EFI going to be a problem with wireless?
I did think about this when the boys were young but you can't fit many OC71s into a model train.
Peter
Back to Top View PeterB's Profile Search for other posts by PeterB
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6125
Posted: 14 May 2018 at 12:02pm | IP Logged Quote Grogster

It is floating around in my mind - dealing with EFI. Most model railway motors would still be brushed I think. You might be able to get some really exotic(read: expensive!) models with brushless. There will need to be some kind of basic noise suppression on the motor. The 9110 bridge has built-in back-EMF diode snubbers, so that SHOULD take care of most of it.

It is something that has passed through my head though. I don't THINK the RF modules will care, but this is one of the things that will be getting tested when I build the prototype and a short stretch of track to play with the idea.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
goc30
Senior Member
Senior Member
Avatar

Joined: 12 April 2017
Location: France
Online Status: Online
Posts: 104
Posted: 14 May 2018 at 1:26pm | IP Logged Quote goc30

Hi Grogster
One other bridge is L298N Here

another driver TLE9201SG It is a HBridge with spi interface


in (very) old time, I made a card that can work in H bridge mode (with mosfet transitors), and drive cc motors or stepper motors. May be now with ssop, its possible to make same module smaller.

For communication, HC12 is a very good idea



Edited by goc30 on 14 May 2018 at 1:42pm
Back to Top View goc30's Profile Search for other posts by goc30
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6125
Posted: 14 May 2018 at 1:50pm | IP Logged Quote Grogster

Hiya.

L298 is a good H-bridge for bigger motors. It's too big physically though for what I am thinking. Even the PowerSO is to big. Thanks anyway. I do like the TLE9201 though! It is nice and small, but still powerful, so I will read that datasheet some more.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
palcal
Guru
Guru
Avatar

Joined: 12 October 2011
Location: Australia
Online Status: Offline
Posts: 1038
Posted: 14 May 2018 at 3:48pm | IP Logged Quote palcal

Hi Grogs,
I have a model railway setup but it is packed away, has not been used for 50 years but still in good condition. I doubt I will ever set it up again as they take up too much room. I was just surfing around and some new model engines come DCC ready. Here is a couple of sites I looked at.
Here
and Here
Paul.

__________________
"It is better to be ignorant and ask a stupid question than to be plain Stupid and not ask at all"
Back to Top View palcal's Profile Search for other posts by palcal
 


Page of 3 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1250 seconds.
Privacy Policy     Process times : 0.02, 0, 0, 0.11