Control your Meccano models (or anything else) from your Windows PC!
The prototype for this model is one of a 'DSG' class of 24 locomotives built in 1981 by Toshiba for the New Zealand Railways. These locomotives weigh 56 tonnes and have two diesel engines, providing a total of 750kW. In more recent years they have been modified for shunting with a crew of one or two, by the provision of 'refuges' behind the headboards for the safe riding of staff, and a radio-controlled remote system which allows the operator to leave the cab to couple wagons and still be able to drive the locomotive from a distance.
The Meccano model is built to a scale of 1:17 and runs on 2.5" gauge track. Two Richards motors with six speed gearboxes provide the motive power (one per bogie, with only one axle driven on each bogie). The gearing used provides a scale top speed of about 20km/h, while developing enough torque to move six bogie container wagons through four-metre radius reverse curves in a shunting yard.
I wanted to add electronics to be able to drive the locomotive in prototypical fashion, 'by remote'. The model had to be self-powered, as the pointwork in the shunting yard made any idea of insulated rails for power feeding a bit of a nightmare.
The solution came in the form of an infra-red (IR) remote control system from Oatley Electronics. This kit was originally designed for the remote control operation of stereo equipment, and is comprised of a nice handheld remote transmitter unit and an 8-channel IR Receiver Module.
The IR Receiver Module is interfaced to a Pulse Width Modulation (PWM) drive unit, a kit from Dick Smith Electronics designed originally as a light dimmer or motor speed controller for use in cars. With a switching capacity of 10A it easily runs the two Richards motors wired in parallel.
Power is supplied by two lead-acid gel cells of 12V, 1.3Ah, wired in parallel, which store enough energy to give several hours of shunting at an exhibition.
The prototype locomotives have two strobe units on the sloping roof sides of the cab, which alternately do a double flash. I simulated this with a little digital circuit which drives high-intensity yellow LEDs. This circuit is also wired in parallel with the motors, so that the LEDs only flash when the locomotive is moving (as the real ones do).
Figure 1 shows how the locomotive model was wired, and includes the connections to the IR Receiver Module, PWM Module, and Flashing LED Module.
Figure 1: The main circuit diagram (Click to enlarge)
Infra-red Receiver Module
The IR Receiver Module originally had its IR sensor mounted on the circuit board; I removed it to a separate piece of stripboard and connected it to the module via a two-core coaxial cable. The IR commands are decoded by the module and are used to drive eight independent relays, five of which are used on this model. In the figure the contacts of these relays are labeled K1 to K5, and all are shown in their 'rest' state (i.e. controller button not pressed).
To get the model to move, firstly 'Forward' or 'Reverse' direction must be selected by pushing the appropriate button on the remote control. The corresponding power relay RL1 or RL2 operates and self-latches on one of its contacts. The other contact of the power relay sets up the traction motor circuit from the positive supply line, through the motors, to the negative supply line via a MOSFET power transistor in the PWM drive module.
A 'Stop' button is used to release the latched power relay (via the K1 receiver relay), which is necessary when changing direction, and also provides an instant 'emergency stop' function.
Capacitors C1 and C2 wired across the motor brushes are to suppress the electrical noise created by the motors, which could otherwise interfere with the operation of the electronics. Diodes D1 and D2 are fitted to the relays to prevent voltage spikes from being generated when the relays release. These spikes could potentially be large enough to damage the electronics if diodes were not fitted.
Pulse Width Modulation Module
We now need to get the traction motor current going. The PWM Module does this by switching the MOSFET transistor on and off rapidly, at a fixed frequency but variable duty cycle. This technical term means the ratio of the 'time switched on' to the 'time switched off', so that if the transistor is switched on for only a small percentage of time compared to the 'off' time, only a small amount of energy is delivered to the motors so that they turn slowly. As the duty cycle increases, the transistor is switched on for a greater percentage of time, the energy delivered is increased, and the motors turn faster. The advantage of this system is that very little energy is wasted at slow speeds, which would otherwise happen with a resistance-type controller - the batteries last longer!
In the drive module kit I selected, a potentiometer set the duty cycle to a constant ratio. The electronics in the Module created a +5V supply for the potentiometer, and by creating a lower voltage through the potentiometer, the duty cycle could be reduced. I designed a little circuit to replace the potentiometer, so that I could create a variable voltage with the remote control, thus giving me control of the traction motor speed.
Transistors Q1 and Q2 and resistor R4 are effectively the replacement for the potentiometer. The voltage appearing across R4 is determined by the charge on capacitor C3, which sets the base voltage for Q1. When the capacitor is discharged, no voltage appears on the base of Q1, therefore it cannot supply Q2 with base current, and Q2 cannot supply current to R4 to develop a control voltage. If C3 begins to charge up, an increasing voltage will appear on the base of Q1, which will result in an increasing current being passed by Q2, and thus an increasing voltage appearing across R4.
The charging and discharging of C3 is controlled by the 'Accelerate' and 'Decelerate' relays, K3 and K4. The Accelerate relay charges C3 with current for the the 5V supply via variable resistance R1, which sets the acceleration rate. Similarly, the Decelerate relay discharges C3 via R2, so that realistic braking can be simulated. It will be noted that the Stop relay discharges C3 quickly, as well as unlatching the power relays, so that in the event of an emergency stop, the model does not 'take off' the next time a direction is selected.
When no buttons are pushed, C3 remains charged to approximately the amount set by the last button push. It will gradually droop as a very small current is drawn by Q1, but this is not noticeable over a run of several metres. Driving the locomotive is a matter of selecting a direction, pushing Accelerate until the locomotive has moved from rest up to the desired speed (or just jabbing the button if a more gradual rate of acceleration is required), and then letting it coast until bringing it to a halt again by pushing the Decelerate button.
LED Flasher Module
Figure 2 shows the LED Flasher Module. This module is wired in parallel with the traction motors, so that it is energised whenever the model moves. Because a PWM Module is used, the motor supply is a series of 12V pulses of variable width, and the polarity will change with the direction selected. Therefore, a bridge rectifier is required (D1) to sort out the polarity, and capacitor C1 smoothes out the pulses to provide DC to a voltage regulator. This last component regulates the changeable DC to a lower steady voltage of 5V to run the flasher circuit.
The flasher is built around two CMOS integrated circuits; a 4093 (quad NAND gate with Schmitt trigger inputs) and a 4017 (divide by 10 counter).
The first NAND gate from the 4093, together with R1 and C3, creates an oscillator. If these components alone are used, a square wave output with a 50% duty cycle is produced, the frequency of which is determined by the values of R1 and C3. By adding diode D2 and resistor R2, the duty cycle is substantially reduced so that the high time is somewhat shorter than the low time - this property is made use of later in the circuit.
The oscillator drives the 4017 counter, causing its outputs to cycle on and off. The outputs of this particular counter IC are all naturally in the low state, apart from the one signifying the current count, which will be high. After one pulse from the oscillator, the count advances and the next counter output will change to high, and the previous will revert to low. Note that output Q6 is fed back into the Reset input: this causes the counter to be reset prematurely, so that it only counts six cycles of the oscillator before starting again.
Some of the outputs of the counter are combined to drive the LEDs in a particular sequence. Observation of the prototype locomotive determined that the strobe lights operated in a sequence which could be described as...
flash-flash-pause-(flash-flash-pause)-flash-flash-pulse ... etc.
...where the flashes in brackets refer to the second strobe unit. The total number of 'flashes' and 'pauses' in a cycle is six, hence the reason for choosing to reset the counter after six events.
A strobe light is only on for a brief, powerful flash, so in the model this is simulated by combining the counter output signals for a particular LED with the narrow pulse generated by the oscillator, using two more NAND gates from the 4093. Diodes are used to isolate the counter outputs from each other.
Finally, a pair of transistors are used to amplify the low-energy voltage outputs from the NAND gates into high current pulses to drive the high-intensity yellow LEDs, for maximum visual impact.
The fourth NAND gate from the 4093 is not used, so its inputs are connected to the negative supply line to keep it stable.
Figure 2: The LED Flasher Module circuit diagram (Click to enlarge)
Further Model Details
The photos below show the model disassembled to illustrate how the electronics fitted inside.
The first photo shows the 'A' end engine compartment. The IR Receiver Module can be seen, sitting on a white plastic insulator plate. Under this is one of the gel cells, and the battery fuse. To the right of this is one bogie-mounted Richards motor, with a suppressor capacitor wired across the brushes. The coloured wiring loom goes to the 'B' end, and the thick gray screened cable attached to the receiver board goes to the IR sensor, which is mounted inside a cab window.
The second photo shows the 'B' end. To the left is the stripboard which contains the motor direction power relays, and the speed voltage circuitry which controls the PWM Module. Next is the second Richards motor, and behind it is the PWM Module. To the far right is the second gel cell and its fuse, and above this may be seen the power switch on a home-made bracket. This is accessed by little finger through the radiator opening - I don't like the unsightly appearance of switches etc. on a Meccano model! The black wire curving down between the radiator and the gel cell leads to a charging socket hidden under the steps at the end of the locomotive, so that the batteries may be recharged without disassembling the model.
The final photo shows the interior of the cab with the roof opened up. A piece of stripboard supports the IR sensor inside the top of a window, and the Flashing LED Module may be seen attached to the inside of the cab roof.
The list below includes most of the parts required to build the described circuit (including LED Flasher Module) using parts available from Rapid Electronics. Please note that the author used an infra-red transmitter and receiver system from Oatley Electronics and a PWM module from Dick Smith Electronics (see links page for contact details) and that there are no equivalent modules available from Rapid.
Order the above items from Rapid Electronics via our Circuits Shop and help support the Electronics in Meccano website, without affecting the price you pay! Just click on an item for information about it and/or to add it to your Rapid order.
Orders can also be placed by telephoning Rapid on 01206 751 166 or visiting their website at www.rapidonline.com. Prices quoted include VAT at 20%.