Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:16 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : PC sound card and DCC?

Author Message
KiwiJohn
Guru

Joined: 01/12/2005
Location: New Zealand
Posts: 691
Posted: 11:13pm 03 Nov 2012
Copy link to clipboard 
Print this post

Gentlemen, (and ladies?), it seems such a long time since I posted on The Back Shed but maybe that will change..

I am working on a project right now to control a model (Lego) train layout with NRMA standard DCC protocol. I have opened a few of the 9V train motors and installed a DCC decoder chip in them and I have a fairly basic DCC 'command station' to send control commands to the trains on the layout.

Unfortunately the command station is a real pain the .... to use. It has only one throttle control for all trains so controlling the speed of a train is not just a matter of turning the appropriat know, oh no, on this particular one I must first press the 'loco' button, then input the train's address number (up to four digits) then press the 'loco' button again then I can turn the knob. Of course in real life what has usually happend by that time is that the train has cannoned off on a curve and is lying on the carpet more or less reduced to its component parts (it is Lego so it can come apart quite easily!).

So, the plan is to write PC software with a number of individual train controls on a touch sensitive screen. I have that software written, it can handle 14 trains at once (which is about 10 more than I will ever have going at once).

DCC is a scheme of frequency modulated AC at power levels, about 12-15V, and current of a few amps.

My scheme is to have my control program create .WAV files which are passed to the sound card the output of which goes through a zero crossing detector (741 op amp) and then to a bipolar motor driver chip (which I forget the number of right now).

This project is at the testing stage but so far the 3 little men on the DCC enabled railways' jigger have declined to respond to my control signals! I do not know if the next little tweak will make it burst into life or if I will spend weeks on this before putting it all away in the cupboard.

For those who dont know about DCC, it is a scheme where the power carries the command signals which are decoded by chips on the target model trains etc. It is very robust as far as signal drop outs etc are concerned. No matter how extensive the model train set and how many locomotives there are there is no need to run wires everywhere as everything is carried by the current in the tracks. Unfortunately there is no really useful scheme I know of for the trains to signal their status back.

The decoder chips rectify the track current (after extracting the command data) and drive the locomotive motor with PWM, Typical decoders can control train speed and direction (forward/reverse) and a few optional functions including train lighting, decouplers, and sound effects etc. Incidently, because the track is always live at full voltage power can be tapped off to run trackside lighting etc and the trains themselves will have full lighting and sound effects even while the train is stopped.
Trackside decoders can be used to control points/switches/turnouts (whatever they are called where you live).

The commands are sent in data packets which are continually repeated with the decoders ignoring packets not addressed to them.

This system has been around for a few years, about 15 or more, and I have always been suprised that hobbiests have not found alternate uses for these handy little chips which allow just about any number of motors and other circuits to be powered and controlled with just two wire. I think there is some system like this used to wire modern tour buses and some motor cars but I dont know much about it.

You may be wondering why I am messing with the analogue sound cards, good question, that is the only way I can see to get reasonably time sensitive data out of a PC without special interface boards. Perhaps there is another way but I dont know it where the latency of Winderz is concerned.

KiwiJohn
 
KiwiJohn
Guru

Joined: 01/12/2005
Location: New Zealand
Posts: 691
Posted: 11:32am 04 Nov 2012
Copy link to clipboard 
Print this post

It works! Sort of....

I put the little railways jigger aside and put one of the other locomotives on the track and suddenly it burst into life? Forwards, reverse, fast, slow, panic stop, the little loco responded to them all.

Not to say the software is perfect, and neither is the hardware, my track voltage is a little low using an old PC power supply but I really need about 16volts DC so I need to resolve that otherwise I cant run the 12volt trains at more than a crawl. (Lego trains were made in 4.5, 9 and 12volts excluding the more modern ones that carry batteries.)

Software needs some work as the speed control is a bit unpredictable, maybe because the differing options for the number of speed steps the decoders can handle.

But the theory works!
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024