Jump to content

Computer controlled DCC from scratch.


stevenh

Recommended Posts

Gosh... I need to get a blog up... I also can't believe I only just found this forum...

 

Anyway, my name is Steven and I'm a Japan railways (not just JR :P) nut living down under.

 

Over the last week I built the circuit seen here and hooked it up to my serial port. After a lot of trial and error I found that the server software here and the client RailyPlan v2.0 (Download) work great!.

 

Now I've converted an old german loco as a test and am in the process of wiring my 5-car Micro-Ace Odoriko (bought 2nd-hand off eBay)... it's been a lot of fun trying to work it all out.

 

I'll take some pics and detail the entire setup process if anyone is interested.

 

I'm using Hornby R8215 decoders (motor, headlights (2 funcs) + 1 extra func)... they're nice and tiny and cheap also. they also conform to all the NMRA DCC standards that I need for using the software.

 

When I get the time I also intend on writing a new client that'll be, for starters, a collection of throttles rather than a full layout-management system.

 

Anyway... I've found this forum now, expect a flood of information as I find the time to whip up decoderised japanese locos :)

Link to comment
alpineaustralia

Where are you in Oz?

Mark Newton and myself are from suburbs of Sydney.

BTW, what scale are you running? N scale?

How does your computer actually communicate with the tracks/locos?

Link to comment
Where are you in Oz?

The good old bush capital :)

BTW, what scale are you running? N scale?

Yeah, nearly 100% Japan N Scale.

 

How does your computer actually communicate with the tracks/locos?

Serial cable from COM1 on my machine to the port shown in the left of the first diagram. Then the server software is used to pump data out the port (idle packets, etc...) and a client app connects to the server and starts pushing out real data packets.

 

I've just installed blog software in my webspace and will get a quick and dirty up on it tonight... depending on how my headlights go into the Odoriko :)

 

 

edit:  see blog here http://modelrail.otenko.com/

Link to comment
alpineaustralia

Matey - you're going to need to dumb it right down for me (possibly, the rest of us). I for one am not computer literate.

Did you design the board yourself?

Link to comment

Hi Stevenh - Welcome to the forum and that is why were are here to share information, so go ahead and post and enjoy yourself.

Link to comment
Did you design the board yourself?

No, the design linked to in the first post in this thread is the NMRA DCC standard. It has been created by the DCC Working Group (international group dedicated to standardising the DCC protocol) and is available for everyone to use.

I simply recreated this circuit on a breadboard I bought from Dick Smith and hooked it up to my serial port.

 

Usually when you have a DCC setup, there is a command station (which sends out the 1's and 0's to control the trains) and then a booster which boosts this data stream up to ~16v so that the engines in the locomotives can function. The data output on a serial port on the computer (the old one you used to plug your modem in to) only pushes +5v and so the circuit built simply injects 12v and then pushes this into the tracks.

 

It is then up the other software on the computer to know about what locomotives you have (you program them in) and then allow you to control them by sending data out the serial port, via the booster and onto the tracks.

 

So, in reality, your computer replaces the need for a command station and the booster I have built replaces the need for a (possibly expensive) commercial booster.

Link to comment
CaptOblivious

Seconded: Awesome. But: I haven't owned a computer with a serial port in over a decade (and I haven't owned a PC in over 5 years)! Now I'll have to go buy one of those USB dongles...

Link to comment

Mate, thats awesome. Do you have pictures of these to share with us?

I do, first shot is the development board:

circuit.jpg

This is fairly nasty right now... but I'll be soldering up a first solid prototype shortly.

 

and then my current workbench...

DSC03255.JPG

My Kato Unitrack basic oval is on it's way... My full layout is at the parents house and I haven't had a chance to test this over there yet.

My goal is to get all this going on fairly minimal hardware... DOS if required and then you'll only need to find a 386/486 nasty old laptop to have it running.

 

Seconded: Awesome. But: I haven't owned a computer with a serial port in over a decade (and I haven't owned a PC in over 5 years)! Now I'll have to go buy one of those USB dongles...

Let me buy one first and confim that it will work.. I've heard of issues with data speeds and ... bits-missing from such items and I wouldn't want to make people go out and buy stuff when it's not going to work.

 

Anyway... Blog here:

Homegrown DCC tinkerings... with the full story and pictures.

 

Will keep you updated.

Link to comment
CaptOblivious

This really is superb! I'm beginning to regret giving away all those old PC's I never used...there's a place around the corner that sells refurb'd PC's, and if the cost is less than fleshing out my Digitrax system, I may be going this route.

 

How easy is it to program for, is the real question. With the Digitrax bits, plus JMRI, I can program my layout in Java and Python (yay Python!).

Link to comment
Martijn Meerts

The real questions are, how many Amps can the thing deliver, how warm does it get, and what if you have a layout that's big enough to require multiple boosters?

 

"Computer control" isn't too expensive even if you buy a Lenz or Digitrax central (they have boosters built in, so all you need is a power supply and an interface to the pc). The problem starts when you want automated control. There is no way a computer can safely track a train on the physical layout unless you use a block system, or do feedback with infrared sensors or reed switches. Any of these still need a way to give feedback to the controller/computer. Operating tunrouts also needs extra components.

 

All of that stuff can of course be homemade as well, but then you'd be building circuit boards more than a layout ;)

Link to comment
What do you do for a crust?

Software Engineer here in Canberra... mainly in the .NET space, but wherever required.

 

How easy is it to program for, is the real question. With the Digitrax bits, plus JMRI, I can program my layout in Java and Python (yay Python!).

I'm still new to this area of the system. Currently I can easily control trains... but my application is very primitive. I need to purchase/build one or two accessory decoders and work out the best methods for feedback (as Martjin mentioned). I'm nearly thinking a separate interface will be required to do the feeding back. I don't know if accessory decoders have any further ability than an ACK?

 

How many Amps can the thing deliver?

Currently it's rated at 3A. I've seen a circuit that uses the two bridges in the main IC and that can then deliver 6A... That would require a fan and ventilation though.

 

How warm does it get?

I'll have to get back to you  on this one... currently with around 10mins running one engine back&forth the main booster IC will get slightly warm... i.e. I can easily hold my finger against the backplate (and that's a good thing in this weather.) I have a loop of track and 4 more decoders on order to see what damage I can do to it  ;D

 

What if you have a layout that's big enough to require multiple boosters?

The next task is to have a 'data out' port to bridge boosters... the goal will be to have a max cable length (say 3m between boosters) and then 3m to the tracks in question from the decoders... all this is to be tested when I have my track... I'll create another booster in that time... and then isolate the track into two sections and get it running.

 

 

The problem starts when you want automated control.

I totally agree... I had thought that DCC would be the be-all-and-end-all of Model Railroading... I mean, if you can talk to the train then it should be able to talk back. Well, it can... but it'll still only report to the booster/command station it's wired through to (based on it's current block) and then that unit still wont know exactly where the loco is... especially dependant on the size of said block.

 

I suppose the next trick is to put ethernet chips in the train and just give them all IP Addresses... hah.. that gives me some ideas.  ;)

Link to comment
Martijn Meerts

You could add wi-fi transmitters in them that transmit their location based on a GPS coordinate system for the layout ;) Pretty sure that's hard to build, but on the other hand, that would really require a great deal less wiring. If only the Japanese started getting into some serious DCC, I bet they'd be able to shrink the decoders to half the size of what they currently are, and make them twice as cheap in the process...

 

Btw, does the booster use only standard components, or did you have to program the ic's and such? I seem to remember most circuits for not just boosters, but also occupancy decoders, feedback decoders and accessory decoders all required ic's to be programmed. Back then it was a problem, now it should be quite doable since those programmers don't cost tons anymore =)

 

I've build a few circuits myself as well, but those are based on kits and come with pre-programmed ic's. You get a manual of where everything should go. I've built those to control turnout motors (like circuitron's tortoise), feedback modules, and a lighting controller that interfaces with the pc. Those were easy to build though, just require a lot of soldering ;)

Link to comment
You could add wi-fi transmitters...

Woah, now you're thinking... that's a neat idea... although I've always been a fan of hard-wired stuff. I'm going to investigate ethernet/wifi embedded devices shortly... They already have power-over-ethernet anyway :)

 

If only the Japanese started getting into some serious DCC...

Gah, tell me about it... I understand the whole space-concerns, etc... in Japan and therefore wanting easy to setup/packdown layouts... but DCC rocks...

 

Btw, does the booster use only standard components, or did you have to program the ic's and such?

All standard, although hard to find in Australia. No programming involved.. that's all on the PC side. There are other setups where people have built the command station as a separate device... this was never my goal.

 

...based on kits and come with pre-programmed ic's...

Total cheating :P... I was thinking of designing a PCB for this booster and then providing the kits... makes like so much easier than the hell I went through last night to hack veroboard and build the prototype :)

 

Anyway.. real-work continues... i'll get back to this project, and others, over the weekend.

Link to comment
Martijn Meerts

WiFi may be overkill. Two words: Bluetooth :D

 

Meh, crappy range.. I'd need several repeaters just for Tokyo Station alone ;))

 

 

Btw Steven, nice avatar. I recently bought that loco and the accompanying string of cars =)

Link to comment
WiFi may be overkill. Two words: Bluetooth :D

Valid, but I hate Bluetooth :)... I think it's all the dicks that walk around with their robots ear devices... :)

 

Btw Steven, nice avatar. I recently bought that loco and the accompanying string of cars =)

I loved watching it come in and leave around midday at ShinOsaka station when I was there for 2 months over christmas... Speaking of which, I should throw those photos up somewhere.

I've just found the carriages online (7 of them in a set) but no loco... I wonder if getting the whole set together is cheaper.

Link to comment
Martijn Meerts

The loco is part of a set as well, comes with 2 cars. It's one of Tomix's smaller sets, meant for people who are just getting started I believe. Then there's 2 add-on sets, and additionally you can get a separate dining car with lit table lamps. Numbers are:

 

92240 for the basic set including loco

92241 for add-on set 1

92242 for add-on set 2

8514 for the dining car with lit table lamps.

 

 

Btw Steven, nice avatar. I recently bought that loco and the accompanying string of cars =)

I loved watching it come in and leave around midday at ShinOsaka station when I was there for 2 months over christmas... Speaking of which, I should throw those photos up somewhere.

I've just found the carriages online (7 of them in a set) but no loco... I wonder if getting the whole set together is cheaper.

Link to comment

It's done....

 

After, now months, of work... the short circuit protection works perfectly and the system can deliver up to 5Amps depending on power supply and configuration.

 

See the Blog post here

 

Dsc05573.jpg

Dsc05574.jpg

 

That current box is fairly ugly, so I intend on running to the shops on the weekend to grab something a little more aesthetically pleasing.

 

As for the usage:

boosterdiagram.PNG

 

You can hook up multiple in a chain and also push both outputs to the same segment of track for higher current demands.

 

*wipes brow*... has been great fun :)

Link to comment

You should be able to, but I haven't tried setting it up yet...

I remember failing to install it on Linux and not trying on Windows.

 

Although, the site does say that it can spew out direct commands, maybe even interface with SRCP... I'll have to investigate and get back to you.

Link to comment

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
×
×
  • Create New...