Pages

Monday, November 16, 2015

How to Program RC Trains / Deltang Receivers

Introduction

This article aims to provide you with sufficient information and ideas to begin the process of reprogramming Deltang receivers. It focuses primarily on Rx60/61, Rx65 and Rx102 receivers as these are the ones I have used most extensively in my locos. However, the general principles laid out here apply to the majority of RC Trains / Deltang receivers. It assumes you already have a working knowledge of RC Trains / Deltang radio control equipment and can make effective use of the input/output pads on RC Trains / Deltang receivers. If you are unfamiliar with RC Trains / Deltang equipment or the use of pads on receivers then you might find these articles useful:
I have been using Deltang / RC Trains radio control equipment to control my fleet of battery powered 16mm scale garden railway locomotives since 2013 (see An evaluation of Deltang radio control equipment). In that time I have explored many aspects of this well engineered and versatile system. I would hasten to add that at the time of writing this blog posting I have no connection with Deltang, other than being a very satisfied customer. However, I would like to thank David Theunissen (Mr Deltang) for the help and guidance he has provided through my journey. I have only skipped across the surface of the capabilities of Deltang gear and its programming potential, but hopefully this tutorial will help others to get started.

Subsequent to writing this blog posting, I set up a small online company manufacturing and distributing radio control receivers and transmitters based on the Deltang system. However, for health reasons I was unable to continue running the business and it has now been handed over to Phil Partridge. For more information see RCTrains.co.uk.

This article covers the following aspects of programming:

Preparing to program

The first stage in the process is to find the right settings for reprogramming your receiver. It is very important to make sure you find the correct model and version number for your particular receiver. RC Trains / Deltang products are continuously being developed and evolved and so you need to check which model and version you have.

To find the model number look very closely on the the circuit board, the model will be etched on it somewhere in very tiny writing. You may need a magnifying glass if your eyesight is anything but 20/20.
You can see that this receiver is an Rx61b

....while this is an Rx65b

Once you have the model (eg Rx60a, Rx61c, Rx65b, etc), then you need to find the version number. This is usually written in gold felt pen on the largest chip on the board. For example, these Rx65b's are both Version 611

 .... while the Rx61b shown above is Version 603.

Armed with this information, you are now ready to access or download the programming options for your particular receiver.  However,  before starting the process of programming, it is advisable to check the features for your particular receiver to check that it is not already programmed to do what you want.

 To do this you must go to the Deltang website and then scroll down the list of receivers until you find your model number. Click on the link to the details about your receiver. If necessary, you might also then need to click another link to find information about the particular variant of your receiver (eg whether it is pre-programmed to respond to the Tx22 or whether it is designed to operate with a standard joystick transmitter).

Check the chart and the information to see if your receiver already comes with the feature(s) you are wanting. If not, follow the link on the page to the 'Paperclip settings'. For example, the paperclip settings for the Rx61d allow you to:
  1. Perform a 'Hard reset' (factory reset).
  2. Change motor control between 'low off' and 'center off'.
  3. Enable/disable LVC (eg: when using Nicads, NiHMs, LiFe cells).
  4. Enable/disable Selecta.
  5. Enable/disable Cruise Control/Failsafe.

Programming with paperclip settings

As indicated above, a limited range of settings can be reprogrammed simply by connecting together two of the pads on a receiver when it is turned on.

For example, any of the Deltang Rx6x v611 receivers (eg Rx60, Rx61, Rx65) can have the following settings reprogrammed in this way (see Paperclip settings).

Factory reset 
Returns the receiver to the 'as bought' default settings. This is useful if you make a mess of programming your receiver and want to start all over gain. Alternatively, you might remove a receiver from one loco and want to use it in a different way in another loco.

Enable/Disable Selecta 
Turns on or off whether the rx works with Selecta knob on a Tx22 (or Tx23) transmitter. These transmitters can control up to 12 locos independently, depending on the position of the Selecta switch on the transmitter. Receivers can be bought ready programmed to respond to the Selecta settings on the transmitter. Alternatively, a non-Selecta-enabled receiver can be reprogrammed to work with the Tx22 or Tx23 transmitters.

Low off / Centre off speed control 

You may have wondered why Deltang transmitters have a direction switch when, by default, the speed knob controls both speed and direction. You can reprogram the receiver so that the speed knob controls just the speed, with the direction switch changing the loco's direction. This would enable the full swivel of the speed knob to be used for controlling speed - giving fine control when shunting for example.

LVC - Low voltage cut-off. 

Deltang receivers are designed, by default, to work with lithium batteries. They detect which size of li-ion or lipo battery is connected and cut-off the supply if the voltage in the battery falls below the requisite safe level. However, this can be inconvenient if you are powering your loco with NiMh or alkaline batteries. This paperclip setting allows you to disable the LVC feature.

Cruise control / Failsafe
As Deltang Rx6x receivers are designed to be used primarily with trains, they have cruise control as their default. This means that if the loco loses the signal from the transmitter (eg when running through a tunnel), the loco will continue running at the same speed until it regains the signal from the transmitter. Those controlling model aircraft, cars and boats usually prefer their models to stop when they lose the transmitter signal (ie 'failsafe'), to avoid accidents or to stop their model disappearing into the far blue yonder. You might prefer that your loco remains under your control at all times and so cruise control can be disabled and the receiver programmed for 'failsafe'.

Menu
 At the time of writing, this option is under development. It is intended for use with the Tx72 and Tx74 transmitters which use the Selecta knob to reprogram receivers with twelve different settings.

How to reprogram a receiver using paperclip settings

As suggested by the title, two pads on the receiver are connected together using a paperclip, length of wire or any other conducting material, while the receiver is being switched on. The pads to be connected are shown on the paperclip settings page of the RC Trains or Deltang websites. For example, on Rx6x receivers, to change the Cruise/Failsafe settings, Pad 1 and Pad 4 need to be connected together.
Pads 1 and 4 connected on an Rx65a
The LED on the receiver will flash a number of times dependent on the setting being reprogrammed (eg twice in 1.5s if Cruise Control is enabled), to indicate that the reprogramming has been successful. Once reprogrammed, the receiver is switched off and then back on again to operate normally.

And that's literally all there is to it!

The programming chart

If the paperclip settings do not cover what you want to do, somewhere on the page will be another link to 'Programming' options. The link is usually at the top of the page or sometimes at the bottom. The link will take you to another page containing a chart something like this:

2. PROGRAMMING OPTIONS:

Level 1

Level 2 Level 3 Level 4 Level 5 Information






Menu 1
Motor

Output number: Output type: Channel number: Other:  
1 1-2 = H1-H2 1 = Center off
(1ch, half each way)
[M-TYPE-1]

1-18 = Channel
Forward and Reverse with one control
(-100% < 0 > +100%)
(eg: 1,1,1,1 = Menu1, H1, Center off, Ch1)
1 1-2 = H1-H2 2 = Low off
(2ch: speed + direction)
[M-TYPE-2]

1-18 = Channel
Throttle
1-18 = Channel
Direction
One control for Throttle (0 ~ 100%)
Second control for Direction
(eg: 1,1,2,1,3 = H1, Low off, Ch1 Throttle, Ch3 Direction)
1 1 = H1+H2 3 = Combo
[M-COMBO]


1 = Disabled
(H1/H2 controlled separately)

2 = Enabled
(H1/H2 work as one)


Parallel two outputs for higher current handling
When enabled, H1 settings control H1 and H2
(eg: 1,1,3,2 = H1+H2 used as one output)
(eg: 1,1,3,1 = H1 and H2 controlled separately)
(followed by several more rows on successive pages

This is an extract from the programming options for the Rx65b (version 611). At first this information may seem somewhat overwhelming, but I found that I soon got used to tracking down the information I needed. To see a more detailed explanation of any particular feature, click the link in the third column (eg  [M-TYPE-2] ).

Let's assume you want to reprogram your receiver so that you can turn on and off the directional lighting feature from your transmitter. Normally, an LED connected to Pad 1 will come on when the loco travels forward and an LED connected to Pad 2 will come on when it travels in reverse. The DIR_LIGHT_2 feature allows you to turn the direction lighting feature off (and back on again) using, say, the bind button on your Deltang transmitter. A quick consultation of the chart for receiver will reveal something like this:

Menu 3
Led, On/Off,
Serial,
Automation
Pad number: Output type: Channel number: Switch Action:
3 1 5 = Control settings
[DIR-LIGHT-2]

0 = Auto
1-18 = Channel

Controlled with a channel:
Latch (toggle)
1 = Ch low
2 = Ch high
Momentary
3 = Ch high on
(mid/low off)

This row of the table will give you the coding needed to reprogram the receiver:

3, 1, 5, 5, 1

Let's examine what the code numbers actually mean
3 = Menu 3
1 = Pad Number 1 (reprogramming Pad 1 usually also affects Pad 2)
5 = Control setting for directional lights 2
5 = Channel number 5 (the bind button controls channel 5 when not used for binding)
1 = Latch the output when the channel goes low

Hopefully, most of that will make sense apart, maybe, from the last setting. Because the bind button, which controls channel 5, is a button rather than a joystick or a speed knob, it is either on or off. When it is pressed it sends a 0v (or 'low') signal to the receiver. The direction switch (Channel 3) has three states - Left (or Up) - Centred - and Right (or Down). When in the centre the switch does nothing - it is disconnected. When it is switched Left (or Up) it goes 'high' (ie sends 3.5v to the receiver) and when it is switched Right (or Down) it goes 'low' (ie sends 0v to the receiver). (Note: Your direction switch might be wired the other way round (Up=Low, Down = High) depending on whether you bought it readymade or made it from a kit).

Once you have extracted the code you are ready to start programming.

Programming with a transmitter (including the Deltang Tx20)

I have summarised how to program a receiver with a Tx20 in this video.

 In more detail, there are really three stages:
  1. Noting down the programming information for your receiver from the Deltang website (see above)
  2. Putting the receiver into programming mode with the transmitter
  3. Programming the receiver with the transmitter

Getting the program settings you need

This is covered fully in the section above. For each feature which needs to be reprogrammed, the settings will need to be extracted from the chart and the process of programming repeated.

Let's assume we will be re-setting the Direction Lights as indicated above. The code will therefore be ....  
3, 1, 5, 5, 1

Putting the receiver into programming mode

Whether using a Spektrum DSM2 joystick transmitter or the RCT-Tx20 or Deltang Tx20, the first job will be to make sure the transmitter is bound to the receiver. All RC Trains / Deltang Rx6x receivers go into bind mode after about 20 seconds if they do not detect a transmitter. The transmitter then needs to be turned on with the bind button held down. The LEDs on the receiver and the transmitter should now flash in unison to show they are binding and will then come on steadily once bound. Occasionally, the bind process needs to be repeated if binding wasn't successful the first time.

Once bound, turn off the receiver. If not already on, the transmitter now needs to be switched on.

With a standard Spektrum DSM2 transmitter, the left and right sticks (Channels 2 and 4) now need to be pushed towards the centre of the transmitter and held in place.

With the Tx20, Channels 2 and 4 are on the two push buttons. These need to be held down.

With the sticks or buttons held in place, the receiver is now switched on. The LED on the receiver should flash rapidly to show that it is going into programming mode. When the buttons and sticks are released, the LED should flash once, with a 2 second pause between each flash.

The receiver is now ready to receive its instructions. The single flash shows its current setting for the first column of the table on the Deltang website - ie the first column currently has a setting of 1. We want this first value to be 3 (for menu three). To advance the flashes you push the Elevator (Ch3) joystick downwards on a DSM2 transmitter .......



..... or move the Direction switch to the left (or down) on the Tx20. [Note My Tx20 was built from a kit and so I mounted the direction switch so it switches left and right. Yours might be mounted so it moves up and down]

The LED should now start flashing twice, with a 2 second pause. We need this first value to be three and so we need to advance the flashes again, by moving the stick down or the button left once more.

Once we have changed it to three flashes, we need to confirm that this is the value we want in this first column by moving the joystick upwards ........
.... or moving the direction switch to the right.

The LED should flash rapidly while the stick or switch is deflected to show it has accepted the setting. When the stick or switch is released, the rapid flashing should stop. This now moves us to the second column. The LED should now be flashing once and then pausing. As we need a value of 'one' in this second column, all we need to do is ACCEPT this setting, so the joystick needs to be moved upwards or the switch moved to the left.

We are now in the third column of the chart. This value needs to be five. So we go through the ADVANCE process to increase the value to five.

NOTE - If you advance too far (to, say, six flashes) then keep advancing. Eventually the flashes will return back to one-flash and you can start all over again.

Once the LED is flashing five times, you accept this which moves us on to the next column. The next column also needs to be set to five-flash. Follow the same procedure until you reach the final column, where the value needs to be one-flash.

NOTE - Depending on the settings already in the receiver, the number of flashes in each column as you move on to it will vary. As indicated above, if you need to reduce the number of flashes in a column, keep advancing until eventually the number of flashes cycles round to one-flash again.

When you have reached the end of the columns, the LED will go out for a couple of seconds and then come back on solidly without flashing. You can now test your receiver to see if the new function works as you expected.


Programming with a Deltang Programma module

Over the years, I have worked with Prog1, Prog3 and Prog4. Prog4 is the easiest to use but the most difficult to set up. Prog3 is still available and works in a similar way to programming with a transmitter (see above) and is a bit of a fiddle to use but dead easy to set-up.

A couple of years ago, I made a video showing how to reprogram a receiver with a Prog1. The same principles apply for using Prog3 and Prog 4, and so you might want to watch the video before ploughing through the written explanation below. Note, that when I made the video, there were no paperclip settings for such things as Cruise and Failsafe and so these had to be reprogrammed 'the long way'


Programming with a Prog3

After having worked out the code which needs to be transmitted to the receiver (see above), the first stage in programming is to power up the Prog3 and bind it to the receiver.

The Prog3 needs a supply of anything between 3.5v and 10v. I power mine with 6v supplied by a pack of four AA alkaline batteries, a switch and a servo plug

I connect the power lead to the seventh row of pins (ie the rightmost row, looking from the pins end of the Prog3), making sure that the +ve lead connects to the middle pin and the -ve lead connects to the lowermost pin.

The receiver is put into bind mode (with Rx6x receivers, turn on and wait for around 20 seconds until the LED flashes rapidy - with Rx10x receivers, two pins need to be connected together with a bind plug prior to the rx being turned on (the pins depend on the particular rx)). The bind button is pressed on the Prog3 before being turned on. The bind button is then released.

Once the receiver has been bound, it needs to be turned off while the programming codes are set-up on the Prog3.

We'll use the code for re-setting the Direction Lights as indicated above........  
3, 1, 5, 5, 1

The first five sets of pins on the Prog3 represent the five columns of the programming chart. And so, the first set of pins (ie the leftmost pins when looking at the Prog3 from the pins side), need to programmed with the value 3.

You will need the two bind plugs supplied with the Prog3 (a small red one and a large black one with a loop of plastic) to program the Prog3 with the new settings.

Because the Prog3 remembers its settings, unless you are starting with a brand new unit, the pins may already be set up with varying numbers of flashes. To see the flashes already set on the first pin, connect the large bind plug from the top pin (signal) to the bottom pin (-ve).

The LED on the Prog3 will flash a number of times and then pause. It will then repeat the flashes. The next time it flashes there will now be one more flash than before and then repeat the same sequence of flashes. For example, if the first pin has already been set to two-flash, it will flash twice, pause, and then flash twice again. It will then flash three times, pause and then flash three times once more.

Remove the bind plug.

Connecting the smaller bind plug from the topmost pin to the middle (+ve) pin will decrease the number of flashes by one with each cycle.

We need the first pin to flash three times. Use whichever bind plug is necessary to change the number of flashes to three, and then immediately remove the bind plug. Re-connecting either of the bind plugs will enable you to check that the number of flashes is correct, provided you remove it again immediately after the LED has finished flashing for the first time.

The next signal pin (pin number two) now needs to be set to one-flash. Use the bind plugs to change its setting to one-flash (ie by incrementally increasing or decreasing the flashes).

NOTE: Zero-flash is denoted by a faint glow from the LED

Signal pin three needs to be set to five-flash, as does pin four. And pin five needs to be set to one-flash.

NOTE: Pressing the bind button at any time during this re-setting process will save the settings

When you have reset all the pins to the correct number of flashes, you are ready to pass this information to the receiver. Turn on the receiver and wait until it shows it is communicating with the Prog3 (the rx LED should either be flashing three-flash, then pause or be on steadily, dependent on the receiver you are reprogramming).

Press the button on the Prog3 briefly.

 The LED on the rx should flash rapidly for a second and then go back to either three-flash or steady state. If the LED did not flash rapidly, try pressing the button on the Prog3 again.

Assuming you have successfully reprogrammed your rx, you must now turn off the Prog3 and the rx. Then turn on your normal transmitter and then the rx and, provided you have reprogrammed the rx properly, it should now behave in the way you have just reprogrammed it.

If you make a mess of the reprogramming you can return the rx to its factory settings by using the paperclip method of reprogramming (see above)


Programming with a Prog4


I have covered programming with a Prog4 in two previous posts - see How I reprogrammed an Rx65b to operating in auto-shuttle mode and How I reprogrammed an Rx102 to operate a DigiSounds soundcard 

The Prog4 takes a little while to set-up on your computer and I know some modellers have found it problematical to get the Prog4 working satisfactorily. It took me a couple of attempts to get the software to communicate with the Prog4. Eventually, I discovered that I needed to buy a different USB to RS232 converter lead. The two leads looked identical, but for some reason, the first one did not seem to connect the Prog4 correctly.

Once the software had been set-up, programming with the Prog4 is relatively straightforward. Creating a text file is a lot less fiddly than counting LED flashes.

Conclusion

For me, the ability to reprogram Deltang receivers greatly enhances their versatility and hence the ways in which they can be used. It also means they are very cost-effective - rather than having to buy additional bits of kit to enable a receiver to interface with other devices such as soundcards, the pads on receivers can reprogrammed to provide precisely the sort of output needed by a device. Programming has also allowed me to make use of receivers' built-in features such as the Rx65's auto-shuttle mode - again, saving me additional cost of a separate auto-shuttle module and increasing the receiver's flexibility. For example, I am planning to reprogram a couple of receivers in locos to operate in station-stop mode which will mean, on balmy summer evenings (remember those?), I will be able to set a train running around the main loop and watch it automatically slow down and wait at each station before moving off again. All that for no extra cost (apart from one reed switch in the loco and a magnet for each station approach).

I do hope you find this information useful and that it will enable you to explore and unleash the potential of Deltang radio control equipment more fully. Remember the old Chinese proverb - "Every journey must start with the first step". I hope this article will enable you to take your first step.



Friday, November 13, 2015

Progress Report 62

Introduction

 This time of year is always a bit slack in the garden. With trees bordering my garden, and hedges and shrubs in the garden itself, the railway gets covered with a layer of leaves throughout the autumn. During the occasional running session at this time of year, I can find that within ten minutes some sections of track get covered with leaves again after having been cleared, and so I tend to avoid extensive operating sessions - even when the weather is mild.

The permanent way has, however, received some attention since my last report - the track has been re-ballasted at Bulkeley and some minor adjustments have been made around the railway where running has become somewhat unpredictable.

On the lineside, work has started on producing the four water towers needed for the railway - two at Beeston Market, one at Peckforton and one at Bickerton.

On the rolling stock front, since my last progress report in September (see Progress Report 61), my attention has been focused primarily on adding sound to some of my locos and all my locos are now housed in a display cabinet when stored in the house.

I have also prepared some beginners' guides to Deltang radio control, which I hope will be useful to those venturing into this fascinating and very satisfying aspect of our hobby.

 Permanent way

Just like the real thing, track ballasting is an ongoing process on my railway. Although I like the way my track steadily becomes overgrown with groundcover plants such as Mind Your Own Business (Baby's Tears) and moss, from time to time I decide a section needs its ballast replenishing - usually where the groundcover is less rampant and the existing ballast has become eroded.

The track at Bulkeley Station had lost most of its original ballast and so needed attention.

The first job was to hoick out the moss, soil and remnants of the original ballast. This was done with a flat bladed screwdriver and a stiff paintbrush.
Once this had been done, a mix of sand, tile cement and alpine grit was spooned on and then dry-brushed into and around the track.

This was then 'watered' with a watering can, into which a few drops of washing-up liquid had been added. Normally, the detergent is sufficient to break down the surface tension of the cement mix, but for some reason this particular brand of tile cement resisted all moisture.

Eventually, I had to stipple the water into the cement with a paintbrush to ensure that the water had properly wetted the mixture. I have no idea which this particular brand was so resistant to being mixed with water, unlike the my previous experiences with tile cement. 

However, despite the additional work involved, the ballast eventually looked the part and was left to harden for a couple of days.

Lineside

A start has been made on producing the four water towers needed by the railway. I decided that two water towers would be needed at Beeston Market, one at the end of the platform and one beside the engine shed. Another tower would be needed at Peckforton; the station about half way along the line. The fourth tower is destined for Bickerton, the furthermost terminus of the line.

After searching for commercially produced towers and kits, and deciding they were prohibitively expensive for my restricted railway budget, I then cast about the net for photos of suitable prototypes. Eventually, I homed in on the tower on the West Lancashire Light Railway - a delightful little narrow gauge railway which I have visited during one of its annual galas (see The WLLR entry on my Narrow Gauge Railways Blog).

Whilst I liked the tank, I decided the towers on my railway would have been constructed either from the local sandstone or, in the case of the tower at Peckforton, from wood as there is a timber yard at Peckforton Station.

I started with the tower at Peckforton as my prototype. The tank was constructed from 2mm thick plasticard - the circular brace being cut from a plastic test tube and the bolt heads supplied by Cambrian Models.

The pipework was made from three sections which were in a pack of novelty drinking straws. The support strut and valve operating linkage was fashioned from brass rod and a length of chain.

The wooden tower was constructed from stripwood 'sleepers'.

The water tower now just needs painting, staining and weathering.

Unfortunately, I ran out of bolt heads and so construction of the remaining three water tanks has been put on hold while I await fresh deliveries. There were a lot more bolt heads (ie 80) than anticipated  - even though I simplified the design from the original.


Rolling stock

Storage

Until now, my locos have perched precariously on the edge of various bookshelves in the living room and study. I decided not to store them in the garage where my rolling stock is housed (see How I constructed storage sidings in the garage), mainly for reasons of security. I also felt that storing them in the conservatory where I have my workshop was inappropriate, given the wide variations in temperature which it experiences. And so, they are stored in the living room - where also any visitors to the house and I, can admire my handiwork (such that it is). My wife suggested that we purchase a display cabinet (she's probably fed up with the stock littering the bookshelves) and so we are now the proud owners of one of IKEA's best-known items of furniture - a Billy Bookcase - with glass doors.

Hopefully, this will also stop the dust from accumulating on the models while they are not being used.

Sound

Having recently experimented with making my own sound system using a cheap greetings card sound module (see How I used a Greetings Card module to produce sound for my Simplex diesel), I decided to explore other options for adding sound to three more locos.

Technobots / Alan Bond Programmable Soundcard
Having already installed an MTroniks / Peter Spoerer digital soundcard in my IP Engineering Jessie loco (No. 8 - Wynford) - see How I added a sound module to a diesel loco, I decided I wanted a different sort of sound for my other large diesel - Fowler No. 7, Tollemache). I happened across the Technobots / Alan Bond programmable soundcard which was developed for the model boating fraternity. What impressed me was its ability to reprogram the sounds, and so I invested in one.

It took a little experimentation to interface the card with the receiver, but the loco is now equipped with quite distinctive sounds (see How I installed a Technobots programmable soundcard in my Fowler diesel)


MP3 soundcard
 When I made a video of a day in the life of Peckforton Station, I dubbed the sound of a Model T Ford on to the video for the arrival and departure of my Ford(ish) Railmotor. I really liked the appropriateness of these sound effects and so was determined to find a way of replicating these sounds when I equipped the railmotor with a sound system. Having had a couple of MP3 sound units in my Project Box for a couple of years, I felt this was an opportunity to make use of one of them (see Using an MP3 player to provide sound for my Railmotor).


The sound files were edited using the marvellous open source sound editing program - Audacity - which is as easy to use as a word processor.

Alan Bond digital soundcard
Finally, after corresponding with Alan Bond over the installation of his programmable sound card in my Fowler diesel, he kindly invited me to test-run one of his latest creations, the FE101, a soundcard which uses digitised recordings of real engine sounds. He equipped me with a card on to which the recording of a Simplex locomotive had been recorded and I installed it into the small IP Engineering railcar which is used by the permanent way department on my railway.

For more information see How I installed an Alan Bond FE101 digital soundcard in my IP Engineering railcar - pending

Operation and Control

Operating sessions
With the continuous battle against falling leaves, operation tends to take a back seat at this time of the year. However, before the onslaught of arboreal detritus, I did manage to get a couple of decent operating sessions in, making full use of data from my freight handling program

I tried to use some slightly different vantage points for this video and show a variety of train movements.

Once the 'leaves on the line' situation became too dire, I switched my attention to providing guidance on my blog for others in the use of Deltang radio control equipment. The equipment supplied by Deltang is extremely versatile and the receivers which are designed for use with garden trains are packed full of features. They can also be reprogrammed, enabling them to be tailored to the needs of individual modellers. However, the sheer volume and sometimes the complexity of the information provided on the Deltang website can be quite daunting for those starting out with Deltang equipment and so I decided to produce a series of guides.
  1. Getting started with Deltang radio control equipment for garden trains
  2. Making use of the output pads on Deltang receivers
  3. Programming Deltang receivers
To complement the final article which I have just completed, I made a short video showing how receivers can be re-programmed using a Deltang Tx20 transmitter.

Conclusion

Having been out in the garden today, shooting a short burst of video and sorting out various maintenance jobs, I've now reached the stage where I'm preparing for over-wintering the railway. The station buildings were taken inside today, and I've cleared the majority of leaves from the line to avoid a build-up of rotting vegetation. In a couple of weeks' time, when all the leaves have been blown off the trees, I'll prune back the more vigorous shrubs and mow the grass for the last time before the spring. I find the winter months to be somewhat depressing, though I am hoping we get a decent fall of snow this year - so far in the railway's history, I've got only one fairly short length of video footage of the railway in the snow!

Friday, November 06, 2015

Creating an MP3 sound sytem

Introduction

As part of my ongoing investigations into sound systems, I thought I would have a go at 'modifying' a self contained USB MP3 player to provide a sound system for my Ford(ish) Railmotor.

 It turned out to be a relatively straightforward conversion requiring very few additional components - a voltage regulator to provide the power and the sound files which were mostly downloaded from the internet.

Pros
  • Relatively cheap - mine cost about £5.00 a couple of years ago. I notice there are several variants of this still available on eBay for around £6.50. I paid for some of my sound files (around $10), but it could have been done with free sound files or my own recordings
  • Comes complete with micro SD slot, amplifier, loudspeaker, battery and case (even includes a built-in FM radio)
  • Loud enough to be heard across the garden
  • Easily adaptable
  • Plays 'real' sound files to produce quite high quality sound
  • Plays very long sound files (a 1Gb SD card could hold around 18 hours of sound effects)
  • You can make and play your own tailor-made sound effects
Cons
  • There is about a pause of about 1 second when switching between tracks
  • Requires a little bit of time and effort to make the modifications to the player and the edit your own sound files
  • Not much else, really
I control my player remotely from my Deltang Tx22 transmitter through a Deltang Rx61b receiver, though any receiver which provides outputs from the direction switch (Channel 3) could be used.

Dismantling the MP3 Player

 At first, I couldn't see how the gadget fitted together, but after reading an article by Mike Jeffries in the December 2014 edition of the Garden Rail magazine in which he dismantled a similar sound system, I realised it wasn't too difficult.

The base was prised off with a small flat-bladed screwdriver.

It was held in place by some sort of silicone based glue which was still quite gummy, but with some gentle persuasion it became detached. At the same time the plug for the speaker disconnected itself from the socket.

The wires to the battery were snipped off. I wanted to be able to remember which wire was attached where as there was nothing printed on the circuit board indicating how the battery should be connected.

The two screws holding the circuit board to the base were removed.

The lithium-ion battery was glued to the underside of the speaker and needed a fair bit of leverage to become free .......

In the end, I sliced the plastic sleeve and removed the battery from it as I was anxious not to damage the battery case.

 The speaker grille was prised away from the case, bringing the speaker with it. Again, this was held in place with silicone-based adhesive.


Connecting the circuit board to the receiver

 The switches which enable the user to move forwards and backwards through the MP3 files on the card were held in place on the circuit board with a large blob of hot-glue.

This needed to be very carefully cut away to avoid damaging the board or the delicate contacts on the back of the switches. 

 Scrutiny of the board revealed that the left hand contacts (viewed from the back) on the switches were connected to ground (ie the negative side of the battery), so leads were carefully soldered to the contacts on the right of the 'next' and 'previous' switches using the thinnest wire I could lay my hands-on.

To check that these wires would act as triggers to move forwards and back through the tracks on the SD card, the board was wired up to the speaker and a 4.5v battery. The ends of the flying leads were then touched on to the negative terminal of the battery and, reassuringly, the player moved back and forth through the tracks.

Powering the MP3 player

 The MP3 player runs off 5v and as the loco is powered by a 12v battery I needed to find a way of powering it. As there is plenty of space in the railbus I could easily have added another 4.5v or 5v battery pack and linked the negative leads of the two battery packs to ensure the 0v logic signals would still work. However, I like to keep things simple when it comes to recharging and so decided it would be easier to make a voltage regulator circuit using an LM7805 voltage regulator. There is plenty of guidance on the internet for making this circuit - eg http://www.learningaboutelectronics.com/Articles/How-to-connect-a-voltage-regulator-in-a-circuit.

Mine was mounted on a small piece of stripboard and covered with some clear heatshrink sleeving as the mounting plate of the regulator is 'live'.

I decided not to clamp the regulator to a heatsink, even though the regulator did run quite hot when I wired everything up and turned the sound up to full power. To reduce the current draw I replaced the 4 ohm speaker which was supplied with the MP3 player with a small 8 ohm speaker. The voltage regulator still gets quite warm but now not alarmingly so.

Tailoring the receiver output pads on the receiver

 The receiver installed in my railbus is an Rx61b (v603) as it was installed a couple of years ago. The programming information for this older version of the Rx is still there in detail on the Deltang website and so I could see from the chart for the Rx61b-22-v603, that pads 4 and 5 provide 3.3v outputs in response to Channel 3 (the direction switch on Deltang transmitters).

Item

Setting Details
P1 output

Servo
Bind button (Ch5)

Slow-motion servo for coupling
Press bind button to open coupling
Release bind button to close coupling

P2 output

Front Light
(auto)

Led needs current limiting resistor

P3 output

Rear Light
(auto)

Led needs current limiting resistor

P4 output On/Off
Direction switch (Ch3)

Item being switched needs current limiting resistor
Switch right for ON (center/left OFF)

P5 output On/Off
Direction switch (Ch3)

Item being switched needs current limiting resistor
Switch left for ON (center/right OFF)

P6 output On/Off
Bind button (Ch5)

Item being switched needs current limiting resistor
ON while button pressed, OFF when released (momentary)

P7 output On/Off
Bind button (Ch5)

Item being switched needs current limiting resistor
Toggle ON/OFF each time button is pressed (latching)

P8 output IR4

Battery voltage telemetry
Infrared led needs current limiting resistor

I was already using Pads 2 and 3 for direction lighting and Pad 4 to turn on and off the interior lighting, and so I needed to find another way of turning the lighting on and off. Normally, I would use the bind button (Ch 5) for the loco whistle or horn but decided I could manage without the horn if I included it in the sound files for the engine sound (see below). I therefore soldered wires to Pads 4, 5 and 7. The outputs from pads 4 and 5 could be used to move back and forward through the tracks on the SD card (provided I inverted the outputs from 3.3v to 0v) and the output from Pad 7 could be used (without modification) to operate the interior lighting.

To invert the outputs from Pads 4 and 5, I made up a couple of transistor inverter circuits with a 2N3904 transistor and a couple of resistors (See How I trigger soundcards with a Deltang receiver.)

The two transistors, together with the four resistors, were mounted on a small piece of Veroboard as I found that the legs of the transistors were a little fragile.
The output leads were connected to the push button leads on the MP3 player and the inputs connected to pads 4 and 5 on the receiver.

All that was needed now was to find or create the sound files needed for the railbus.

Creating the sound files

After some experimentation, I decided I could simulate all the situations needed for the railbus with five sound files:
  1. 20 minutes of silence
  2. Engine start and idle (for 20 minutes)
  3. Horn, gear grind and acceleration through the gears to running speed ( for 20 mins)
  4. Decelerate, brake squeal and idle (for 20 mins)
  5. Engine shut down
I decided to include 20 minutes of silence as there will be times when the railbus is stationary before I get around to turning it off manually. Also, I didn't have a spare switch or channel on my Tx22 transmitter which I could use to switch the MP3 player on and off remotely.

From 'silence', I could then advance to the 'engine start and idle file' using the direction switch. When ready, I could then advance to 'the acceleration and running file'. The distance between my stations is such that I would never need to run the bus for more than ten minutes and so a leeway of 20 minutes running sound would be fine. The bus tends to run at a fairly consistent, slowish, speed and so there seemed little need to vary the speed of the running sound by a great deal. Approaching stations, I could then advance to 'the decelerate, brake and idle file' and leave the railbus on idle for as long as necessary. Using the direction switch I could therefore either move to the next 'engine stop file' which would automatically advance round to the first 'silence' file when it stopped playing, or I could move back to the previous file and go through the acceleration and running sequence again.

For more information on how I created the sound files see How I used Audacity to create sound files for my Ford(ish) railmotor.

The Railmotor in action

Once everything had been wired-up and tested, the speaker was put into a small sound chamber made from some 2mm thick larch veneer. This, together with the circuit board was mounted in the roof of the railbus power car (suitably insulated from accidental contact with the lighting bus bars).

Of course, after all this work, the railbus required some extensive testing.


I'm considering ways in which I could overcome the 1 second pause when I change tracks. It might be possible to program a Picaxe micro controller to trigger some sound on another soundboard for a second or so to mask the silence (eg a horn, a backfire or even a chunk of miscellaneous engine sound).

I am quite happy to live with the hiccup in the sound for now - after all, I run my railway mostly for my own pleasure and am mostly the only audience for my operational sessions. When I make videos (such as the one of the test run above), I can quite easily shoot the video to avoid the pauses or them edit out.