Silicon ChipCommand Control For Model Railways; Pt.2 - February 1998 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Deflation has been with us for a long time
  4. Feature: Surplus Mania: Hot Web Sites For Bits by Adrian Cuesta
  5. Feature: Understanding Electric Lighting; Pt.4 by Julian Edgar
  6. Project: Multi-Purpose Fast Battery Charger; Pt.1 by John Clarke
  7. Project: Telephone Exchange Simulator For Testing by Mike Zenere
  8. Project: Command Control For Model Railways; Pt.2 by Barry Grieger
  9. Order Form
  10. Product Showcase
  11. Serviceman's Log: The TV set that smoked by The TV Serviceman
  12. Project: Demonstration Board For Liquid Crystal Displays by Rick Walters
  13. Project: Build Your Own 4-Channel Lightshow; Pt.2 by Leo Simpson & Rick Walters
  14. Vintage Radio: Clean audio for old Henry by John Hill
  15. Feature: Radio Control by Bob Young
  16. Book Store
  17. Feature: Computer Bits by Jason Cole
  18. Market Centre
  19. Advertising Index
  20. Outer Back Cover

This is only a preview of the February 1998 issue of Silicon Chip.

You can view 29 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Understanding Electric Lighting; Pt.1 (November 1997)
  • Understanding Electric Lighting; Pt.1 (November 1997)
  • Understanding Electric Lighting; Pt.2 (December 1997)
  • Understanding Electric Lighting; Pt.2 (December 1997)
  • Understanding Electric Lighting; Pt.3 (January 1998)
  • Understanding Electric Lighting; Pt.3 (January 1998)
  • Understanding Electric Lighting; Pt.4 (February 1998)
  • Understanding Electric Lighting; Pt.4 (February 1998)
  • Understanding Electric Lighting; Pt.5 (March 1998)
  • Understanding Electric Lighting; Pt.5 (March 1998)
  • Understanding Electric Lighting; Pt.6 (April 1998)
  • Understanding Electric Lighting; Pt.6 (April 1998)
  • Understanding Electric Lighting; Pt.7 (June 1998)
  • Understanding Electric Lighting; Pt.7 (June 1998)
  • Understanding Electric Lighting; Pt.8 (July 1998)
  • Understanding Electric Lighting; Pt.8 (July 1998)
  • Electric Lighting; Pt.9 (November 1998)
  • Electric Lighting; Pt.9 (November 1998)
  • Electric Lighting; Pt.10 (January 1999)
  • Electric Lighting; Pt.10 (January 1999)
  • Electric Lighting; Pt.11 (February 1999)
  • Electric Lighting; Pt.11 (February 1999)
  • Electric Lighting; Pt.12 (March 1999)
  • Electric Lighting; Pt.12 (March 1999)
  • Electric Lighting; Pt.13 (April 1999)
  • Electric Lighting; Pt.13 (April 1999)
  • Electric Lighting, Pt.14 (August 1999)
  • Electric Lighting, Pt.14 (August 1999)
  • Electric Lighting; Pt.15 (November 1999)
  • Electric Lighting; Pt.15 (November 1999)
  • Electric Lighting; Pt.16 (December 1999)
  • Electric Lighting; Pt.16 (December 1999)
Items relevant to "Multi-Purpose Fast Battery Charger; Pt.1":
  • Multi-Purpose Fast Battery Charger PCB patterns (PDF download) [14302981/2] (Free)
  • Multi-purpose Fast Battery Charger PCB pattern (PDF download) [14302981] (Free)
  • Multi-purpose Fast Battery Charger panel artwork (PDF download) (Free)
Articles in this series:
  • Multi-Purpose Fast Battery Charger; Pt.1 (February 1998)
  • Multi-Purpose Fast Battery Charger; Pt.1 (February 1998)
  • Multi-Purpose Fast Battery Charger; Pt.2 (March 1998)
  • Multi-Purpose Fast Battery Charger; Pt.2 (March 1998)
Items relevant to "Command Control For Model Railways; Pt.2":
  • Model Railway Receiver/Decoder Module PCB patterns (PDF download) [09105981/2] (Free)
  • Model Railway Command Control PCB patterns (PDF download) [09102981/09103981] (Free)
Articles in this series:
  • Computer Bits (December 1989)
  • Computer Bits (December 1989)
  • Command Control For Model Railways; Pt.1 (January 1998)
  • Command Control For Model Railways; Pt.1 (January 1998)
  • Command Control For Model Railways; Pt.2 (February 1998)
  • Command Control For Model Railways; Pt.2 (February 1998)
  • Command Control For Model Railways; Pt.3 (March 1998)
  • Command Control For Model Railways; Pt.3 (March 1998)
  • Command Control For Model Railways; Pt.4 (May 1998)
  • Command Control For Model Railways; Pt.4 (May 1998)
  • Command Control For Model Railways; Pt.5 (June 1998)
  • Command Control For Model Railways; Pt.5 (June 1998)
Items relevant to "Demonstration Board For Liquid Crystal Displays":
  • LCD Demonstration Board PCB pattern (PDF download) [04102981] (Free)
Items relevant to "Build Your Own 4-Channel Lightshow; Pt.2":
  • 4-Channel Lightshow PCB patterns (PDF download) [01112971/2] (Free)
  • 4-Channel Lightshow panel artwork (PDF download) (Free)
Articles in this series:
  • Build Your Own 4-Channel Lightshow; Pt.1 (January 1998)
  • Build Your Own 4-Channel Lightshow; Pt.1 (January 1998)
  • Build Your Own 4-Channel Lightshow; Pt.2 (February 1998)
  • Build Your Own 4-Channel Lightshow; Pt.2 (February 1998)
Articles in this series:
  • Radio Control (January 1998)
  • Radio Control (January 1998)
  • Radio Control (February 1998)
  • Radio Control (February 1998)
  • Radio Control (March 1998)
  • Radio Control (March 1998)
  • Radio Control (April 1998)
  • Radio Control (April 1998)
Articles in this series:
  • Norton Utilities V2: hard disc maintenance for your PCs (January 1998)
  • Norton Utilities V2: hard disc maintenance for your PCs (January 1998)
  • Computer Bits (February 1998)
  • Computer Bits (February 1998)
  • Computer Bits (March 1998)
  • Computer Bits (March 1998)

Purchase a printed copy of this issue for $10.00.

Design by BARRY GRIEGER Part 2: the Command Station Last month we introduced the concept of Command Control which enables as many as 16 locomotives to run on a layout with simple wiring. This month we describe the heart of the system – the Command Station. The Command Station is the brains of the Protopower 16 System. It powers the handheld throttles, interprets their com­ mands and encodes the throttle information onto the correct channel of the serial data stream. Most importantly, the Command Station drives the Power Station and this feeds the power and the serial data stream to the track. In effect, the Command Station modulates a DC power supply (the Power Station) so that the 5.2V serial data signal is superim­posed on top of a constant DC to form a composite track voltage of about 16V DC. This track voltage is constant over the entire layout. To understand the operation of the Command Station we need to refer to the block diagram of Fig.1. This looks unrecognisable to any model railway buff but don’t worry as it will all be explained. We will start with the master clock. Because the Protopower 16 must provide a stable serial data stream it needs a crystal oscillator timebase and this is the master clock. It controls the timing of all functions in the Command Station. Run your model railway with Command 36  Silicon Chip Fig.1: block diagram of the Command Station. Key sections are the 16-channel multiplexer, the pulse width modulator and the master clock. The LED display consists of four LEDs which flash at a slow rate to give an indication that the master clock is working. The master clock drives two circuit blocks, a 5-bit counter and a triggered ramp generator which we’ll come to in a moment. The 5-bit counter has a number of functions. First, it controls the 16-channel analog multiplexer. That is a mouthful but it can be thought of simply as a single pole 16-position switch which is being continuously rotated. The multiplexer accepts the signals from each of the 16 handheld throttles and feeds them through, one at a time, to the pulse width modulator. Secondly, the 5-bit counter drives the synch decoder. If you refer back to Fig.2 on page 32 of last month’s article, you will see that the serial data stream consists of 16 pulses followed by a synch pause, followed by another 16 pulses and so on. Well, the 5-bit counter generates the pulse stream and the synch decod­er generates the synch pause. Going back to the master clock, we noted that it also drives the triggered ramp generator. The ramp signal from this is fed to the pulse width modulator (IC8b) which compares the selected DC signal from the multiplexer with the ramp signal. The result is a vari­able width pulse corresponding to the throttle signal for each channel. After the synch pause has been added to the pulse train from the pulse width modulator, the output signal is fed to the line drivers. These are essentially op amp buffer stages which are used to drive the Power Station and its auxiliaries. Also shown on the block diagram of Fig.1 are the various power supply functions. Circuit description Now that we have a broad overview of the circuit, we can discuss the circuit diagram of Fig.2 and we’ll look at each section in much the same sequence as we have for Fig.1. IC1a, a 2-input NOR gate from a 4001 quad package, is con­nected as a crystal oscillator, using a 32kHz watch crystal. IC1a drives IC1b which buffers the signal before it is fed to one half of a 4520 dual synchronous Control February 1998  37 38  Silicon Chip Fig.2: this circuit accepts the signals from up to 16 handheld throttles and encodes a serial data stream with bursts of 16 width modulated pulses. it occurs between clock pulse 16 and clock pulse 20 and has a duration of four clock pulses. It separates each burst of 16 pulses. Triggered ramp generator binary counter. The output is taken from pin 6 and is a square wave with a frequency of 2048Hz. The 2048Hz signal is fed to IC12, a 4020 14-stage counter which drives four LEDs. This counter divides the 2048Hz signal by 512, 1024, 2048 and 4096 and the LEDs then flash on and off for periods of 1/8, 1/4, 1/2 and 1 second respectively. Actually, this part of the circuit is a bit of a gimmick and could be omitted, if you want. The 2048Hz signal is also fed to the base of transistor Q1 which buffers the signal to provide the master clock. 5-bit counter Pulses from the master clock, Q1, are fed to two 4-bit 74C163 synchronous binary counters, IC3 & IC4. They are cascaded together to create a 5-bit counter with the ripple carry of IC3 (pin 15) connected to pins 7 & 10 (enable P and enable T) of IC4. Outputs QA, QB, QC and QD (four bits) are taken from pins 14, 13, 12 & 11 of IC3 and used to control two 4051 8-channel multiplexers (IC6 & IC7) which together form the 16-channel multiplexer depicted in Fig.1. Pin 3 of both 4051s is commoned, to form the output of this 16-way switch. Synch decoder Now the question is, if we only need 4-bits from the coun­ter to control the 16-channel multiplexer, why do we need a 5-bit counter? Isn’t the second 74C163, IC4, unnecessary? We do need IC4, for the following reasons. In our Proto­power 16 application, we need to count to 16, pause and then repeat the count sequence, where the “pause” period acts as a means of synchronising the pulse train. This is achieved by detecting a count of 19. Outputs QA & QB of IC3 (pins 14 & 13) are fed to NAND gate IC5a, along with QA, pin 14 (QE?), of IC4 (ie, 1+2+16=19) to detect the 19th count. The output from IC5a (pin 9) is then used to clear both counters to zero. From the pulse timing diagram of Fig.3 it can be seen that QA of IC4 (QE) acts as a synchronising pulse as We now come to the heart of the circuit which constitutes the triggered ramp generator and the pulse width modulator, both based on IC8, a TL072 dual FET-input op amp. Clock pulses from the collector of Q1 are coupled to a differentiating network consisting of the 220pF capacitor C10 and 12kΩ resistor R5. The differentiator generates positive-going spikes at the leading edges of the clock pulse and negative-going for the trailing edges. Diode D3 passes the positive-going spike and blocks the negative-going, to drive op amp IC8a, which is connected as a voltage-follower. Basically, it just acts as a low-impedance buffer. IC8a’s output is AC-coupled via capacitor C11 to the base of transistor Q3. Each time a positive spike is fed through to Q3, it turns on to discharge capacitor C12 at its collector. In between each discharge, this capacitor is charged from the con­stant current source comprising transistor Q2 and the two diodes at its base. By using a constant current source to charge capacitor C12, we obtain a linear ramp waveform. Pulse width modulator Op amp IC8b is connected as a comparator to become the pulse width modulator. The inverting input, pin 6, is fed with the triggered linear voltage ramp, while the non-inverting input, pin 5, is fed in turn with the signal voltages from the 16-channel multiplexer (IC6 & IC7). Remember that the multiplexer sequentially switches 16 voltages, each representing one handheld throttle. Therefore as each of the 16 throttle voltages is compared with its corres­ pond­ ing linear ramp voltage, the width of the resulting output pulse will be varied accordingly. The output of IC8b is AC-coupled by C14 to IC9b, a 7406 open-collector inverter. However, readers will note that in our serial string of 20 pulses, there are 16 which enable the multi­ plexer and four pulses which represent the synch pause and these latter four must be blanked out. This is achieved as follows. The Parts List for Command Station 1 PC board, 162 x 101mm, code 09102981 1 10-way PC-mount insulated terminal block 1 16-pin header 1 16-pin IC socket 1 32.768kHz watch crystal 1 100Ω trimpot (VR1, Bourns 3386 or equivalent) Semiconductors 1 4001 quad 2-input NOR gate (IC1) 1 4520 dual synchronous counter (IC2) 2 74C163 or 4163 binary counter (IC3, IC4) 1 4023 triple 3-input NAND gate (IC5) 2 4051 1-of-8 multiplexers (IC6, IC7) 1 TL072 dual FET-input op amp (IC8) 1 7406 hex inverter with open collector outputs (IC9) 1 LM324 quad op amp (IC10) 1 LM358 dual op amp (IC11) 1 4020 14-stage binary counter (IC12) 2 PN100 NPN transistors (Q1,Q3) 1 PN200 PNP transistor (Q2) 4 1N4148, 1N914 small signal diodes (D1,D2,D3,D4) 1 orange LED (LED1) 1 green LED (LED2) 4 red LEDs (LED3-LED6) 1 7812 12V 3-terminal regulator (REG1) 1 7805 5V 3-terminal regulator (REG2) Capacitors 1 1000µF 25VW electrolytic 3 10µF 16VW electrolytic 5 1µF tantalum or PC electrolytic 1 0.22µF MKT polyester 11 0.1µF monolithic or MKT polyester 1 .01µF MKT polyester 1 220pF ceramic 2 47pF NPO ceramic Resistors (0.25W, 1%) 1 10MΩ 1 3.9kΩ 1 220kΩ 9 1kΩ 1 100kΩ 1 560Ω 2 51kΩ 1 470Ω 3 12kΩ 1 390Ω 2 10kΩ 1 150Ω February 1998  39 Fig.3: this is the timing diagram for the circuit of Fig.2. synchronising pulse is taken from the 5-bit counter via IC9a. Because IC9a has an open-collector output but no external pull-up resistor, it effectively 40  Silicon Chip works as a switch to shunt any signal at its output to ground when its input is high. In effect, synchronising has been added to the pulse train by IC9a. The resultant signal is inverted by IC9b which also per­forms a level translation to give a 5V peak-peak amplitude. This signal is inverted again Fig.4: install the parts on the Command Station PC board as shown in this wiring diagram, starting with the smaller components and working up to the larger parts. Make sure that all polarised parts are correctly oriented. by IC9c and its output is effectively halved by a voltage divider consisting of resistors R14 & R15. The signal is fed to IC10. Line drivers IC10, an LM324 quad op amp, is set up as four identical voltage followers. Their outputs are used to drive either the Power Station or an Auxiliary Power Station, which supply power to the track. dividers connected across the +12V and +5V supply rails. Using this system, only five wires are needed to connect each hand throttle. The hand throttles will be discussed later in this series of articles. Finally, there are two 3-terminal regulators, to provide the +5V and +12V supply rails. This completes the circuit de­scription. Let’s now discuss the construction of the Command Station. Two op amps on the circuit remain to be discussed. They are in IC11, an LM358 dual op amp (these are virtually the same op amps as in the LM324). IC11a & IC11b are connected as voltage followers in such a way as to provide three output voltages, +8.8V, +5V and +1.2V. These voltages are fed to the handheld throttles. The +5V actually comes from the 5V 3-terminal regula­tor REG2 while the other voltages come from resistive voltage PC board assembly All the components, with the exception of the power trans­former and Table 1: Resistor Colour Codes ❏ No. ❏  1 ❏  1 ❏  1 ❏  2 ❏  3 ❏  2 ❏  1 ❏  9 ❏  1 ❏  1 ❏  1 ❏  1 Value 10MΩ 220kΩ 100kΩ 51kΩ 12kΩ 10kΩ 3.9kΩ 1kΩ 560Ω 470Ω 390Ω 150Ω 4-Band Code (1%) brown black blue brown red red yellow brown brown black yellow brown green brown orange brown brown red orange brown brown black orange brown orange white red brown brown black red brown green blue brown brown yellow violet brown brown orange white brown brown brown green brown brown 5-Band Code (1%) brown black black green brown red red black orange brown brown black black orange brown green brown black red brown brown red black red brown brown black black red brown orange white black brown brown brown black black brown brown green blue black black brown yellow violet black black brown orange white black black brown brown green black black brown February 1998  41 This is the completed PC board for the Command Station. It accepts the signals from the handheld throttles and produces a serial data stream which is super­imposed on the supply voltage to the model railway track layout. Note that the final version differs slightly from this prototype board. Fig.5: check your PC board against this full-size etching pattern before installing any of the parts. 42  Silicon Chip Fig.6: these scope waveforms show the triggered linear ramp waveform at pin 6 of IC8b (top trace) and the 16-pulse burst and sync pause at pin 2 of IC9b (lower trace). The ramp waveform has a frequency of 2048Hz, as controlled by the master clock. The waveform on pin 2 of IC9b is fed to the line drivers in IC10. Table 2: Capacitor Codes ❏ ❏ ❏ ❏ ❏ ❏ Value IEC Code EIA Code 0.22µF   220n   224 0.1µF   100n   104 .01µF   10n  103 220pF   220p   221 47pF   47p   47 bridge rectifier are mounted on a PC board measuring 162 x 101mm and coded 09102981. Begin by carefully inspecting the PC board for any defects such as shorts, open circuit tracks or undrilled holes and cor­rect as necessary. Our suggested assembly procedure is to progressively in­stall components relevant to particular circuit sections, power them up and test and then move to the next section. The component layout for the PC board is shown in Fig.4. With this in mind, install all the links first and then the 10-way insulated terminal block at one end. Now install the components for the +12V and +5V power supplies. In particular, install the 2200µF filter capacitor, the 3-terminal regulators (REG1 & REG2), the associated 1µF and 10µF bypass capacitors, LEDs 1 & 2 and resistors R20 & R21. Fig.7: these scope waveforms shows the effect of setting the throttle of channel 5 to maximum reverse. As you can see, the fifth pulse after the sync pause is quite narrow with respect to all the other channels which are set to STOP. The lower trace shows the relevant channel 5 pulse with an expanded time base. You will need a DC power supply which puts out at least 16V. Now connect +16V to the V+ terminal on the connector block and the 0V line to the 0V terminal. Both LEDs should light up and you should be able to measure +12V from REG1 and +5V from REG2. Now install the components concerned with the master clock, This means IC1, IC2, IC12, LEDs 3-6, the 32kHz watch crystal and associated components. IC sockets are optional but are only really worthwhile for the more expensive ICs. Make sure the LEDS are oriented correctly and the same applies to the ICs. Check your work carefully and then apply power. LEDs 1 & 2 should light up as before and the other four LEDs should flash. LED6 should turn on for 1-second intervals, LED5 for 1/ -second intervals, LED4 for 1/ -sec2 4 ond and so on. This display confirms that the master clock is functioning correctly. If the LEDS don’t light in this way, double check your work for errors and don’t proceed any further until this part of the circuit is working as it should. Now you can install IC11, resistors R16-R18 and capaci­tors C16 and C17. Then reapply power and check the +8.8V (Re­verse), +5V (Stop) and +1.2V (Forward) terminals on the connector block. Next, install IC10 and resistors R14 and R15 (adjacent to IC9). Then apply power and check to see that +2.5V is present at pins 1, 7, 8 & 14 of IC10 and at the S1, S2, S3 and S4 terminals on the connector block. Now install the remaining ICs and a 16-pin socket for the 16-pin header. This accepts the signals from the handheld throt­tles. Install the three transistors, four diodes and the remaining ICs, resistors and capacitors by following the component layout diagram of Fig.4. Double check your work for any errors, eg, diodes and tran­ s istors incorrectly inserted. When satisfied that all are cor­rect, apply power and switch on. As before, all LEDS should either light or flash continuously. Setting up You will need a conventional analog multimeter set to read 10V DC or more. Now measure the voltage at TP A, adjacent to pin 7 of IC8. If you can’t see this IC, it’s located in the top lefthand corner of the PC board in Fig.4. Adjust trimpot VR1 so that the voltage at TP A is +6.2V. This ensures that the pulse waveform with no input signal has a mark/space ratio of 1:1. This completes the Command Station. Next month we will discuss and build the Power Station and throttles. February 1998  43