Pages

Thursday, March 26, 2015

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

 Background

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

Preparing

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).


No comments:

Post a Comment