Controlling the Booster from Linux
After losing the source code to my DCC Throttle application I decided it was time to get the whole system controlled from Linux (or, in my case, Debian.) I'd known that the DDW Server I'd been using was based off srcpd and that they were more-or-less compatible.
After a lot of tinkering (making sure libraries/compilers/etc... were installed) I finally got srcpd compiled and running.
There is a nice web-app to create the required configuration file which is then thrown in /usr/local/etc/ or can also sit in the same directory as long as you specify it.
It seems that you need to make sure that the 'NRMA/DCC Translation Table' is set to '1'. I have a copy of my configuration file here.
Right, now that the server was running I grabbed Telnet and connected to localhost:4303. I attempted to use the same set of commands as I had with DCCThrottle but to no avail... it turns out the version of srcpd I had installed was based on the 0.8.3 srcp specification... much had changed.
Instead of reading up on what I should be doing differently I connected up dtcltiny 0.8.2.
After a lot of tinkering with compilation/libraries/etc... I finally got it installed. On debian make sure you have qt3-apps-dev and libqt3-compat-headers installed... do this with apt-get. Anyway... I'd done all this on a spare Thinkpad 600E I had lying around (PII 266mhz 256mb RAM) and I'd had a few issues with lag once it was up. I'd turn the headlights off on the control panel and my Twilight Express locomotive would then go dark around 1.5 seconds later. After turning off nearly all debug output I had a relatively stable system... but it does need a lot more investigation.
The next trick will be to investigate building a client on the console... I don't need fancy Xorg to get a gui and an ncurses console app should do. I saw rcsh and rcman and the rest, but python isn't my friend... although it'd be a nice opportunity to learn.
Anyway... all of this was a great learning experience... and I was quite impressed that my old notebook handled Debian and got the locos moving.
EF81 (Twilight Express) Marker Lights
Well, after a successful Decoder + Headlight install I thought I'd attempt to get the reverse marker lights going as well. I'd been told on the JNS forums that these lights are used very rarely in Japan and that explained why the model manufacturers (in this case Tomix) didn't bother to put lights behind them. Despite this there is a 'tube' of clear, but red, plastic behind the marker lights and this means that I would only have to get an LED lined up behind it to get them to work.
So, I went down to the local electronics store and looked for the smallest LEDs I could find...
... and I tell you what, they're tiny... I used the 'helping hands' aligator clips to get the soldering done and initially attempted to wire in one LED behind the lights.
The next issue was wiring... I first used thin insulated wire I'd stolen out of a broken toy shotgun (with laser sight)... and this was OK, but there was starting to be too much piling up on top of the chassis and causing headaches when trying to put the shell back on.
Then I found 'winding wire' for building electromagnets and transformers and this stuff did the trick perfectly! This worked OK, but I could only ever get the brightness I wanted behind one of the lights. Since I wanted to be even I chose to put two lights in there.
After a little electrical tape for insulation and some blu-tac for positioning I had what I found to be success :)
There's a few issues... like the lights moving when you remove/replace the shell... but once it's all together they look great...
...the light seen on coming through underneath isn't really visible in normal conditions... my camera just decided to extend the exposure. Anyway, one end done... the other is still to do.
EF81 (Twilight Express) DCC Decoder Install
Well... This wasn't anywhere near as easy as I was hoping... The Japanese really know how to use every last bit of space in their models and although the full-metal chassis adds a nice amount of weight for smooth running, it is hell when trying to make room for a decoder.
Anyway, that said, everything is in and functioning... there is just a little more to do on making the shell fit back on properly... and a little more to do on lighting. Out of the box, the locomotive does not have reverse marker lights... just the top front headlights. So I'll be purchasing some 3mm red LEDs tomorrow to fix this situation (there is just enough room to install them.)
So, after dismantling the locomotive, reality hit me when I realised how little room there was inside. The chassis is a two-part construction with each side conducting either negative or positive. This was bad... the power came directly off the bogies and into the chassis and then straight to the bushes on the motor. I had to insulate this somehow and get wires in there. I managed to drill through the soft metal chassis and then solder on to the bushes (There are actually removable contacts that slide on, of which I soldered to.)
In the picture above you can see that the chassis fills the entire shell and there is only a few chunks missing where the headlights go. Since I no longer needed the diode/capacitor combo for the original headlights, I could remove the board and use one of the spaces for the decoder.
I went and bought a set of files and got to work at hacking out a space for it to go. After I'd removed enough I decided to quickly tape up the wiring and decoder and attempt to run it...
Well, no problems here... the locomotive ran like a charm... at some very very slow crawls! The Hornby 8215 decoders (although cheap) contain the back emf technology for really low and strong speeds.
So, the next step was lighting... I unsoldered the original 12v globes from their boards and wired them directly to the decoder... they then were taped in place where they used to sit.
There was not much room at all near the decoder, as it had taken the spot of the previous light. In the end it's still too tight and there needs to be a little more room made (more filing.)
These locomotives were not fitted stock with reverse marker lights! They have the clear plastic inside and just enough room to hold a small globe to light them... so I haven't completed this yet until I get them working...
And then I need to find the carriage set for the my Twilight to pull :)
Prototype Booster Complete!
Well... after a night of work (and using my breadboard version as basis) of soldering and drilling I have a prototype! I've used off-the-shelf components to house the board and everything fits nicely... secure... and works perfectly.
The next version will have an override switch (since the current version will only activate when there is data on the serial port) to allow power all the time.
Now is time to use this version as a test for how many amps it can push out... note I'm still using my computer power supply (which is still powering this machine I'm surfing on!) and all is well.
Finally... The going price for one of these will be AUD$65.00.
Anyone wanting one can leave a comment on this post or email me at stevenhoefel at hotmail dot com.
I've also written a new client app... very basic... controls the train that you specify.
Odoriko 185 Series Decoder Install
[From Wikipedia:]The Odoriko (踊り子?) is a limited express train service in Japan operated by JR East which runs between Tokyo and Izukyū-Shimoda or Shuzenji.
The limited express service was inaugurated in October 1981 following the introduction of the then-new 185 series EMUs, replacing the earlier Izu express services from Tokyo to Izu. Services are currently operated by 7-, 10-, and 10+5-car 185 series EMUs, making it the longest Limited Express train running in Japan (excluding shinkansen trains).
The word odoriko means a girl dancer in Japanese. The train service was named after the title of novel Izu no Odoriko (The Dancing Girl of Izu) by Yasunari Kawabata. The stage of the novel is the destination of the train, Izu Peninsula.
I'd bought my 5-Car Micro Ace Set partially damaged (if anyone can tell me where to get replacement pantographs?) and had opened it up on the first night of running due to severe eletrical issues.
After a night with WD-40 and a soldering iron I had the set doing laps at good speed, but every other day it needed a service.
This all boiled down to the way the motor car connects to the tracks. The bogies both conduct both polarities into the chassis which is split in two and electrically isolated. Unfortunately at the point where the bogies touch the chassis was a lot of grime and damaged parts. It seems there were originally two pins that had been snapped meaning the bogies were very loose.
Anyway... all this meant that the electrical connection in the motor car was next to useless since a constant power source was required for DCC and interruptions would play havoc on the data stream from the rails.
I therefore decided that the best method was to slap the decoder in the end car (meant easier wiring of one set of headlights) and have a tiny cable run through (with a plug) to the motor car... This all went fairly smoothly... but I did have to remove the seating in the end car... I'll look into this again shortly.
I removed the 12v globes that originally lit up the car with white LEDs and around 1K2 total resistance to get the level of light emitted in the photo below. This was simply two 680ohm resistors in series to the anodes of both LEDs connected to the Blue wire from the decoder. The cathodes connected directly to the Yellow and White wires for forward and reverse. I initially wanted to use the original light circuit but found that bending LEDs to fit in there would be too tight.
Anyway... the end result is a beautifully running 5 car set with directional headlights at one end and to-be-completed headlights at the other end... should I run wires right through all 5 cars or buy another decoder just for 2 LEDs? ...
Researching a DCC booster circuit and DCC computer control
Ok, after a miriad of attempts to control my model railroads with computers (parallel port to relays, voltage controls, etc...) I decided it was time to go to DCC... I mean... why not use the rails as a data bus and have all the logic inside the locomotives themselves. I had decided that all the european command stations were too expensive and that I would do as some of the references below have done and just use my computer to push out the 1's and 0's. Anyway, after a lot of trial and error I have a working prototype... but stay tuned for something more production ready.
For starters, here are some good references on homegrown DCC Boosters:
- The DCC Wiki
- Michael Brandt's Site on DCC
- Rod Murgatroyd's Booster (And other circuits)
- Haba's Booster
- Mr Paisley's Booster
After searching online electronic stores for parts, I had noticed that there were two basic circuits in use. One used the L298 H Bridge and the other the LMD18200. As I'd browsed across Michael Brandt's site first, I'd realised that it was only necessary to connect a booster to the computer (and Haba's site confirmed this). Although I'd purchased all the components to make the Parallel port logic board, I've still never actually constructed it since it was much easier to just go direct to the COM1 (and also skip all the assembler programming!).
One weekend-long of wiring and re-wiring produced this... It's recommended to build anything like this first on a breadboard as you get the opportunity to just rip it all back out again when you make mistakes... and after a lot of cooked components and other issues... I finally got it all to work. The circuit uses a 12vAC input but I just skipped the initial AC-DC regulator and used the 12vDC from my computer's power supply. This currently allows around 8vDC to the engine and so I'll be upgrading to something closer to 18vDC input when I get the chance... For now, and it's great for testing, it's better to have lower voltages.
Next, Software...
There are a few options here... many in German and many in Linux. I'd found DDL and realised this was the way to go. It is what Haba had been running and therefore must work. I had severe issues compiling it on debian since the code was old and am still not across C/C++ enough to have gotten it going. I then found the binaries and managed to get something running, although couldn't successfully get a connection. (This was also whilst I was using Rod's circuit and so there could well have been too many variables...)
I then hit gold with DDW (DDL for Windows!). I had a few initial problems working out which port COM1 was and then why there was no action... but once my booster was complete and connected everything just started going... I realised that the server alone is no good... it wont send out data without a client connected... client of choice being RailyPlan v2.0 found on theDDW download page.
Now, I'd bought 2 Hornby R8215 Decoders and, based on forums read online, there seems to have been NRMA DCC compatability issues... Let me tell you that these things are gold. They are tiny, cheap and reliable. I've cooked one quite well and it keeps going... it has even emitted the usual burning-silicon smell a few times (when the motor has shorted) and keeps going. The only issue I've had is that the wires unsolder themselves when it gets tooooo hot. :)
The first decoder was installed in my old-reliable German DB loco (model unknown) and it was too easy. Plastic chassis, minimal wiring... simply spliced in. The decoder defaulted to Address '3' and I had it running in no time. Had no headlights or anything else to wire up, so there was no test of functions, etc... here.
This engine ended up being the old-reliable for a very long time for testing purposes of software, etc... that I was about to write. I believe I'm about to realise how easy this first loco install was compared to the little space that exists in Japanese n-scale engines.
I'm currently in the process of Decoder-ing up my Odoriko 5-Car series and will post again once I have the final story.
What a mess... you can see the breadboard up the back being powered by the computer power supply under the desk and my straight run of track.