Thursday, March 26, 2015

How I reprogrammed a Deltang Rx102 receiver to control a DigiSounds diesel soundcard


A couple of years ago, I built a narrow gauge diesel loco from an IP Engineering kit (see How I constructed an IP Engineering Jessie diesel loco). I subsequently replaced its mechanism (see How I improved the mechanism for my IP Engineering diesel) and ultimately installed a DigiSounds diesel soundcard from Peter Spoerer models (see Wynford finds her voice).

When I originally installed Deltang radio control into 'Wynford' (as she was subsequently named), I found the receiver/controllers which were available at the time struggled to cope with the power demands of the mechanism which I was using and so I installed a Deltang Rx102 receiver which was linked to a Brian Jones Mac5 ESC. This served me well until recently, when I decided to rationalise my burgeoning collection of radio controlled locomotives.

I control my locomotives with a Deltang Rx22 transmitter, which can operate up to twelve locomotives independently from one switchable handset. I decided to re-bind the locos to the handset so that the number designated to each loco would match its relevant position on the selector knob of the transmitter. Previously, the locos had been assigned fairly randomly meaning that sometimes I couldn't remember which loco was on which channel. At the same time, I decided to re-program all the receivers so they would be in 'cruise' mode - ie on the loss of the radio signal the loco would continue running at the same speed rather than coming to a halt (ie failsafe mode).

The early version of the Rx102 receiver (v266) which I was using for Wynford was not programmable and so it was upgraded for me by David T at Deltang. The newer version (v110) not only defaults to 'cruise' rather than 'failsafe', it allows the user to reprogram the outputs from the receiver pins.

With the previous Rx102 (v266), the output from the pins was as you would expect from any receiver and so a digital switching device was needed to interpret the signals from the receiver to operate the soundcard.

With the upgraded Rx102(v110), any output pin can be reprogrammed from its default of operating a servo to an on/off output, though pins 6 and 7 are already programmed to operate directional lighting.

I realised that if I could reprogram the outputs from pins 3 and 4 to go 'low', then I could do away with the need for a digital switch.

Reprogramming the outputs


I had already purchased a Deltang Prog4 programming module and installed the relevant drivers and software on my computer (see How I reprogammed a Deltang Rx65b to operate in auto-shuttle mode with a Prog4).

Determining the programming codes

The first thing I needed to do was find out the flash codes needed to re-program the receiver. These are shown on the programming page for the Rx102(v110) on the Deltang website.
Extract from the Programmable settings chart on the Deltang website - Click to enlarge

So, to re-program pin 3, I worked out I needed to send the instruction 1,3,2,3,4 from the programmer to the receiver, ie
1 (to initiate), 3 (= pin 3), 2 (= on/off mode), 3 (= channel 3), 4 (= OFF when the channel is low)

On the Tx22, this would mean that I could turn on and off the soundcard using the direction switch which controls channel 3.

To reprogram pin 4, I worked out I needed to send  1,4,2,5,4 to the receiver, ie
1 (to initiate), 4 (= pin 4), 2 (= on/off mode), 5 (= channel 5), 4 (= OFF when the channel is low)

This meant that I could sound the horn by pressing the bind button (ie Channel 5) on my Tx22

Writing the text files

These codes then needed to be written as text files which is the easiest way for Prog4 to send the information to the receiver. Rx102 can only cope with one packet of information at a time and so two text files needed to be prepared. For this I used Notepad on my PC:

 These were saved, ready for the next stage in the process.

Binding the receiver to Prog4

The Prog4 was attached to the serial lead.

 The binding process was relatively straightforward. Firstly, a bind plug was connected across the signal pins 5 and 7 of the Rx102

The receiver was then switched on. The LED on the receiver flashed rapidly to show it was in bind-mode. The bind button was held in on the Prog4 and the USB plug on the serial lead was plugged into the computer. Once the Prog4 had powered up, the bind button was released.

The LEDs on the Prog4 and the receiver flashed in unison, showing binding was in progress. The LEDs on both then went into 3-flash mode, indicating they were ready to communicate with each other.

The bind plug was then removed from the receiver.

Sending the text files to the receiver

The CoolTerm software on the computer was started up. As it had already been set-up and the settings saved (see How I reprogammed a Deltang Rx65b to operate in auto-shuttle mode with a Prog4), all I needed to do was click the Connect button ......

... and then select Send Textfile from the Connection menu.

I then navigated to where I had saved the first text file and clicked the Open button. The LED on the receiver flashed quickly to show it was receiving the instructions from the Prog4 and the CoolTerm screen confirmed the message had been sent by showing Tx OK.

I then repeated the process for the second text file.

I clicked on the Disconnect button in CoolTerm and unplugged the USB lead from the computer. I also switched off the receiver.

Connecting the receiver to the soundcard

I used a servo lead to connect the signal pins of the receiver to the soundcard. The lead from pin 3 was connected to the Aux input on the soundcard controlling the engine noise, and the lead from pin 4 was connected to the input on the soundcard controlling the horn.

I turned on my Tx22 transmitter and then the receiver and tested that everything was functioning as expected.

The removal of the need for an additional digital switch has given me more room inside the body of the diesel loco. To create further space, I also replaced the ten NiMh batteries with three 18650 lithium-ion batteries and a battery protection circuit similar to that I have used previously with another of my locos (see How I converted a track powered loco to battery radio control).

With the introduction recently of the Deltang Rx65b receiver/controller, there is less need for the use of Rx102 and a third party ESC. However, I am more than satisfied with the level of control which this existing set-up provides and so will be continuing with this into the foreseeable future.

UPDATE - I have now replaced the Rx102 and Mac5 with an Rx65b, using one of the output pads to trigger the engine start/stop feature - see How I installed a Deltang Rx65b in my diesel loco

UPDATE (February 2018) - I have now produced a more detailed step-by-step guide to installing and setting up the software for using a Prog4 module (see How I programmed an Rx102 with a Prog4).

Monday, March 23, 2015

How I constructed a 32mm gauge tank wagon from a kit

Having decided to construct a 32mm gauge feeder from the copper mines to the crusher and loading hoppers on my main railway, I required some stock to run behind the diesel loco which I had converted to radio control (see How I converted a battery diesel to radio control).

I happened to see a kit for a barrel wagon on eBay for £10 from the seller vwmonkeyblue and so decided to invest in one. The kit duly arrived, comprising mostly laser-cut MDF pieces, perspex underframes, plastic wheels, wooden turned barrels and a metal axle. Not bad for a tenner.

The superstructure was tackled first. The two barrel supports and cross member were glued into the slots. I decided to use superglue throughout the build as I was too impatient to wait for PVA to dry.

The plastic underframes were then attached to the chassis floor......

..... and headstocks added to the ends.

The axles were marked-out at 45mm......

.... and then cut to length with a trangular needle file.

One wheel was pushed on the the end of each axle......

..... and the axle inserted into the underframes.

The other wheels were then pushed on to the other ends of the axles with washers between the wheels and fames, a small block of wood being used to push against.

The wheels were then checked for gauge and spun to ensure they were true and friction free.

The solebars were then glued to the underside of the chassis

The supplied copper wire.......

.... was trimmed and bent into coupling hooks.

..... and inserted into the headstock (it was at this point I realised I'd glued the other part of the headstock beneath rather than above the chassis. I should have read the well illustrated and well explain construction leaflet more carefully!

The body was then glued to the chassis and the barrels put into place. These will be glued after painting.
I decided that the mine rolling stock will be bauxite (ie red primer) rather than the grey finish for the main railway.
 [Awaiting photo]

 These wagons represent excellent value for money. I have decided to invest in a couple of their passenger coaches to transport the workers to and from the mines to the main railway. I have already bought a couple of Binnie Husdson skip kits (£9.00 each) and so, for less than £100 I will have bought all the stock, including the loco (£40) needed to operate this railway. This seems like a very cost effective way for someone to venture into the world of garden railway modelling without heavy investment.

Friday, March 13, 2015

How I converted a track powered loco to battery power

Last year, I decided to abandon DCC track power in favour of battery power (see Getting started with battery power). Until then, I had constructed five locomotives from kits or as scratchbuilds, mostly based around LGB 0-4-0 ToyTrain motor blocks. These were used to power such locos as Otto, OHO, Rusty or the ToyTrain diesel which often form the motive power for LGB Starter Sets.

 The first kitbuilt loco on my railway was based on the Peckett kit from Garden Railway Services (GRS) (see How I constructed a Peckett loco from a GRS kit).

After removing the body from the motor block, the DCC decoder was disconnected from the track contacts and the motor, basically the reverse of fitting the decoder (see Chipping a ToyTrain motor block).

I then turned my attention to removing the track pick-ups from the chassis. The baseplate of the chassis was removed by unscrewing four screws.

This revealed the pick-up arrangement.

The skates and their brass contacts were removed. These are a push-fit.

The connecting wires were then removed, again these simply slot into the chassis.

Finally, the spring-loaded carbon brushes were removed. These were prised from their recesses with a small flat-bladed screwdriver.

Now that all vestiges of the pick-up system had been removed .........

The base plate was then screwed back into place. It was important to check that the front and rear wheels are carefully aligned (ie the crank pins are in exactly the same position on each set of wheels). I've found from past experience that if they are even slightly out of alignment, the loco runs erratically.

I then had to decide where to install the batteries. If I had opted for battery power while making the kit, I would probably have inserted the batteries into the boiler and/or saddle tank, but these had been filled with lead weights and then sealed. To remove the weights would have required extensive dismantling and rebuilding, so I looked elsewhere for some spare space. The inside of the cab looked promising and so I experimented with slotting three 18650 lithium-ion batteries into various nooks and crannies.

Two fitted in beside the firebox ..........

..... and the third could be suspended from the cab roof.

I used BluTak to hold them in position until a more permanent method could be found for mounting them. I prefer to use ready-tagged batteries to which I can solder leads. I have heard that it is possible to solder leads directly to the ends of batteries such as these, but given the volatility of li-ion batteries, I'd rather not take the risk of applying too much heat to them. Having worked out their relative positions, I soldered leads which would enable them to be connected in series, with two additional wires (the yellow and the blue) connected to the intervening positive terminals which will lead to the battery monitor module. All connections were shrouded in heat shrink tubing to avoid accidental short circuit.

A disadvantage of ready-tagged li-ion batteries is that I have been unable to find any which include 'protection'. Protected batteries include electronic circuitry which prevents them from short circuit and over-discharging, both of which are bad news for li-ion batteries. However, I found some inexpensive circuit boards on eBay which not only protect li-ion batteries in this way, they also monitor the charging of up to four batteries, to ensure each is balance charged correctly.

I invested in some of these boards, one of which I installed beneath the cab on this loco using a couple of double-sided sticky pads.

Before wiring-up the board and batteries, I installed the charging power socket in the rear buffer-beam, making sure the contacts were clear of the board.

I then decided where the power switches should be installed - one master switch and the other to power-up the sound card when (and if) one is installed. There seemed to be room on the cab floor for the two switches and so two 8mm holes were drilled for them. I found, however, that 3mm thick plasticard was too thick for the threaded ferrules of the switches and so I reamed out a depression with my mini-drill.

The two switches SPDT (single pole, double throw) switches were then wired-up, the terminals being covered in shrink-wrap tubing.

If you are not familiar with shrink-wrap tube, it is bought in bundles of various diameters.

 Suitable lengths are snipped from the bundle and slipped over connections, then heat is applied (I use the flame from a disposable lighter wafted underneath). The tubing shrinks to half its original size, providing a neat and tight layer of insulation around the joint.

I then installed the switches and wired-up the battery protection  board to the batteries and switches, and to the recharging socket.
Wiring diagram (Click to enlarge)
 To facilitate the separation of the body from the motor block for maintenance and so on, I like to use some sort of plug and socket system. A bulk-purchase of some brass bullet connectors from eBay furnished me with connectors and insulation sleeves. Two male connectors were soldered to the motor leads on the chassis. A notch was cut into the footplate of the chassis, to accommodate the switches, and the rear buffer beam was removed to allow the power-level LEDs on the protection board to be seen (see below).

Two female connectors were soldered to the motor leads on a Deltang Rx65b receiver/controller. An additional two wires were soldered which will be used at a later date when/if a sound card is installed.

The power leads to the receiver/controller were then soldered into the existing circuitry (see wiring diagram above) ........

...... and covered in shrink-wrap tubing.

The bullet connectors were then connected and the leads and receiver tucked away inside the body. 

The loco was reassembled. By pushing a small screwdriver through a hole drilled in the chassis footplate, I can press the button on the protection-board which illuminates the power-level LEDs on the board. These give an indication as to how much the batteries are discharged.

The loco was then given a few test-runs to check everything was operating as intended.

When putting the loco under maximum load, I found the gears slipped. I had noticed when removing the pick-ups from the motor block that the worm wheels were well worn (see above photos) and so decided to replace them. Fortunately, I had a brand new motor-block to hand and I decided that, rather than just replacing the wheels, I'd replace the whole motor block - the new one was manuafctured in Germany whereas the previous one was manufactured in Korea and I know from experience that the German motor blocks are better quality.

The motion was removed from the old motor block which was then modified to fit. It was then fixed in place and tested once more.

To ensure that she was functioning as intended, I gave her a thorough and punishing set of test runs, on a day when the sun was shining.

In response to some enquiries on forums, I decided to do a continuous run to see how long the batteries last. I ran the loco with a train of eight wagons continuously for 5 hours and 20 mins before the protection board cut the power.

Apologies about the blurred images but these were taken as dusk was falling about four hours into the test.

I have also found that the protection board seems to cut the power if the batteries are charged at anything over 0.5A which seems peculiar as the blurb for the boards indicates the maximum charge current is 8A.

I still have another two track-powered locos to convert - a Hunslet, built from a GRS kit, and a scratchbuilt Fowler diesel. Both these locos have less space inside than this loco and so will present their own challenges when it comes to finding space for batteries. However, li-ion batteries now come in all sorts of shapes and sizes and so I am confident I will somehow solve these problems.