A Computer Driven Train Controller

Article 2 Detecting trains and controlling their DC motors using a computer

As electronics and computer hobbyists, I'd be willing to wager that the majority of readers will at some stage in their lives, have thought about using a computer to control a complex real world task of one form or another. I'd also wager that for most of you, the thought has remained a dream - perhaps it seemed as if it would be too hard or perhaps the time has never seemed right. This is the second article in a series which describes how I set out to do exactly this and how I proved to myself that it is achievable.

At the start of my design, I had intended to be able to control multiple trains on my train set layout simply by programming a "route" for each train and letting the computer do the more tricky task of scheduling and managing their movement. But during the researching, design and construction of the hardware, I soon realised that the concepts which apply to model trains are equally applicable to a far broader range of hobby equipment and that the principles behind the software which controls the train controller electronics could apply equally to other non hobbyist applications.

So even if the control of model trains is not your primary spare time passion, there is likely to be plenty to keep you thinking about the fields of DC motor control, electronics and computing as this series unfolds.

Last month, we explored some of the basic electrical principles of wiring train set layouts and briefly introduced the concepts of centralised train set control using either the block control or DCC methods. This instalment continues to explore the concept of centralised control and looks in detail at the DC motors which are found in trains as well as many other automated models.

With an understanding of the basics and concepts behind us, we'll be able to start describing the circuit in the next article.

Train detection techniques

As alluded to last month, if you want to build yourself a train set capable of being automatically controlled or even partially controlled by a computer, it is important that the computer be provided with a means to obtain reliable information about where the different trains are located at any point in time. As always, this implies the computer must have an ability to detect the presence of a train but it does not necessarily require the need for an added capability to determining the identity of each individual one.

The project presented in this series falls into the first category: its detectors are capable of reliably determining whether a train is in a block or not but they are not capable of differentiating one specific train from another. The software, having been told which locomotive is where at the start of a session, must unambiguously track each of the trains without error as they move around the layout.

Over the years, many hobbyists have devised clever ways of detecting and reporting the location of trains and so there is naturally, more than one option available to us.

Perhaps the most simple and traditional form of train detection is magnetic. The principle behind magnetic detection is that tiny magnetic reed switches are installed between the trackís "sleepers" (or "ties") at various locations around the layout and particularly, at the boundaries between track blocks. If the locomotives contain DC motors with "leaky magnetics", then each time the engine passes over a magnetic switch, the switch experiences momentary closure which can be registered using some straightforward electronics.

However, in order to assure faultless detection in a computer controlled environment, a permanent magnet must be mounted either within or beneath each train. In N scale, this can become difficult when the space within an engine is too small, not to mention the problem of accumulating ferrous grunge below your locomotives and carriages. In order to assure reliable clearance between a below-train mounted magnet and the point rails as the engine traverses sets of points (or between the magnet and the sleepers at the crest of a rise), an exotic low profile magnet and some mechanical modifications to the undercarriage might be required. However "simple is often the best" and the magnetic detection method continues to be appropriate in many applications.

Another of the most popular forms of train detection is optical. Like magnetic detection, optical detection has the advantages that it is independent of the power electronics and detectors can be located anywhere on the layout, regardless of where the block boundaries lie. A common form of optical detection uses a photo transistor in a variation of the circuit shown in Figure 1a. This sort of optical detector is usually mounted between the sleepers of the track and is intended to detect the shadow of the train as it passes overhead. The disadvantage of this sort of detection is that it is prone to detect the shadow of human limbs, lights turning on and off, florescent buzz, or depending on where the main source of light is, even trains passing on adjacent tracks.

simple train detection circuits

Figure 1 Simple train detection circuits

An improvement of the simple optical detector is described in Figure 1b. In this case, an IR (Infra Red) transmitter has been added along with a matched IR phototransistor. Rather than sending a continuous IR beam, if the LED is pulsed at a sufficient rate (say 10 - 50 kHz), in most cases false alarms can be filtered out or avoided. But the disadvantage is that if the LED and transistor are to remain hidden (and Iím particularly thinking of N scale), they may both need to be mounted below the surface level of the layout so that they detect reflections, not interruptions. Reflections can come from many places and so falsely trip the optical detector, including from trains on adjacent tracks or the hands of an observer as some feature of the train set is being pointed out.

Alternately, if modellers are prepared to mount optics where they are visible (so that the IR detectors can again work in beam interruption mode), they will be susceptible to possible interference from nearby detectors. So like magnetic detection, optical detection may also not be the best choice for computer control applications.

The last of the common forms of train detection is known by various names: current sensing, load sensing and occupancy detection. These forms of detectors are often generically referred to as "block detectors" because the output of a current or load sensor is made true or false on the basis of an of electrical load being located anywhere within a track block, even loads as small as about a milliAmp. In my view, load sensing is also the most reliable form of train detection for computer control applications and aside from needing to fit a resistance across some axles of your rolling stock, load sensing does not involve mechanical modification of either the layout or the equipment.

A quick scan of model train literature will reveal that there are very many different types of occupancy detection circuits. Sometimes hobbyists need to retrofit block detectors to existing layouts (as stand alone devices connected at the output terminals of the power supplies) and the block detector design is more complicated because it must cope with reversal of track polarity. If block detectors need to coexist with grade compensating throttles and train speedometers (which each directly measure the back EMF from the DC motor in between rectified AC pulses or PWM pulses) yet another type of block detection circuit is needed. The occupancy detection circuit described in this project is based upon the circuit shown in Figure 1c and is about as straight forward as a circuit of this type can get. Its simplicity stems from the fact that it is able to be integrated directly within the power controller.

The occupancy detector in the train controller uses a diode to isolate the track (and train) from the power supply and a high valued resistor combination (R1 / R2) connected to a sense supply. When an electrical load such as an engine (with a DC motor), a lighted carriage (with a light globe in it), or a regular carriage (with a resistance mounted across an axle) rolls onto the track block, the load quickly causes the voltage across the current sensing resistor to jump. The sense circuit will have detected the train when the voltage across the tracks drops below the sense level. The design works well at all possible power supply output settings and variations of the design can be configured to work with DCC.

No matter what type of detection approach is used, in order to control a train layout from a computer, it is necessary to have as many different points of detection as practical so that trains can be tracked unambiguously and accurately. But knowing the position of both the front and the back of a train is equally important as knowing where the locomotive is (such as when the software needs to delay one train until another train has completely passed).

Unless you only plan to run locomotives without any carriages or cars, it will be necessary to modify at least some of your rolling stock so that several axles along each train present an low enough resistance to trip the block detectors. Typically, long trains should be fitted with resistance wheel sets every few cars and at the very least, in the last carriage or caboose. Assuming that your rolling stock already has metallic wheels, the modification is relatively straightforward and inexpensive and will be described later in this series.

For more ideas about train detection, you could scan some of the model train electronics text books which are available in larger technical bookshops. There's also the web but alas, there are surprisingly few links I've been able to find. Try http://www.geocities.com/ResearchTriangle/Lab/8859/ as an example.

Model train motors

Small scale model trains are universally powered by permanent magnet DC motors. In the design of a power controller, we need to concern ourselves with controlling the DC motor so that a train can be started from a standstill, operated reliably at sustained low, medium and fast speeds and in so doing, ensure that its motor operates satisfactorily within design parameters.

Arguably, the most important power supply design parameters are those which affect locomotive and motor wear and tear and because the voltages used to control model trains are low, this predominantly means wear and tear from heat dissipation. Heat dissipation is caused by resistive, magnetic and frictional losses and at the lower frequencies normally used in model train power supplies, resistive losses dominate. The heat dissipated from a resistor is given by the formula I*I*R and when the current varies with time (like mains AC), we need to use the RMS (Root Mean Square) value of I to work out the heat. We'll see an example a little later.

Although we can usually disregard frictional loss as a source of heat, it merits a closer look for another reason: DC power has a drawback when it comes to starting a motor in a closely controlled manner.

From high school physics, you may remember that friction is greatest when an object is stationary ("static") and an attempt is made to start it moving. As a current is applied to a stationary model train and slowly increased, the train will have a tendency to remain still until its static friction is overcome. At the instant the trainís motor starts to turn, the friction at each of itís moving parts will be reduced to a new value called the "dynamic" value. Because of the reduction in friction just as the train starts to move, there is a tendency for models to lurch off to an ungraceful and faster than expected start.

Another factor contributes to make the situation worse: "cogging" of the motorís rotor. If you have ever attempted to turn the shaft of a permanent magnet DC motor, you may have noticed that the shaft is to some degree, sticky to turn. In fact, the shaft appears to refuse to rest in certain positions and to grab in others and when a train is at rest, this cogging will tend to delay it from starting.

Cogging is caused by unevenly distributed attraction between the motorís permanent magnets and its rotor. In more expensive motors, it is reduced by skewing or twisting the arrangement of iron in the rotor or by removing the iron altogether but for the majority of iron cored rotors, cogging is very difficult to eliminate altogether.

In fact, the lurching start phenomena is made worse still if the power source uses a rheostat (a low resistance wire wound pot) to regulate the speed. Before a motor starts turning, its current will be higher than normal due to the absence of back EMF. While current is greater, more voltage is dropped across the rheostat (because of I*R loss) so the motor will "see" a lower voltage. As soon as the train starts to move, back EMF comes into play, current drops, the I*R loss in the rheostat reduces and more voltage suddenly reaches the motor: trains behave as if their throttle is nudged just as they start to move.

To avoid the rheostat problem, we should choose a power supply with a low internal impedance and dispense with the rheostat altogether. But in order to try to reduce the effects of starting friction and cogging, we need to recognise that the factor which makes a motor spin is torque (turning force) and that a DC motorís torque is proportional to the current. Motors and their trains will remain stationary until the instantaneous torque from the motor exceeds the retarding forces of friction and cogging.

Waveforms which contain AC

Waveforms with a significantly varying component (such as rectified AC) have peaks which are much higher than the average and at the peaks, the instantaneous torque is also much higher. These brief bursts of torque at the peaks are enough to get a train motor to start to turn with a lower average current and it transpires that motor speed is proportional to the average current. So varying waveforms also allow trains to run more slowly as they start.

You can easily see this with one of your own trains if you have a rheostat, a smooth filtered 1 Amp 12 Volt DC supply and a rectified but unfiltered 1 Amp 12 Volt RMS AC supply. First connect the rheostat to the DC supply and slowly ramp up the voltage from zero. Look carefully at the train at the instant it starts moving and then measure the voltage on the track at precisely this time. Repeat the experiment using the AC supply and you'll be surprised at the difference in performance.

Starting with a lower speed and without the lurch of quick acceleration is very preferable if you want your model trains to create an illusion of realistic behaviour so most modern train power supplies (and real world DC motor control systems) introduce some AC component into the waveform. Rectified mains and PWM are the two most common waveforms which are used and when it comes to being able to easily vary the average current and maintain a low impedance power source, PWM is usually the clear choice.

some different DC motor control waveforms

Figure 2 Some different DC motor control waveforms

When using rectified AC as shown in Figure 2a and Figure 2b, the average current is the same as the RMS current and is clearly lower in the case of half wave rectified supplies. So a train powered by the waveform shown in Figure 2a will move faster than one powered with the waveform shown in Figure 2b.

An example of one type of PWM waveform is shown in Figure 2c but there are many others too. For model train applications, the PWM frequency is usually low (< 100 Hz) and the polarity of the control voltage is usually always positive (or always negative) with respect to zero as drawn.

The choice of operating frequency is an important one. If a frequency from within the audible range is chosen, motors and gears could start to behave as annoying buzzers. If we select a higher frequency, inductance and other losses might prevent too much energy from reaching the motor. At some (generally higher) frequencies, model locomotives can sometimes even resonate and be damaged.

If you're really curious about hearing one of your less valuable trains hum, you can try a different experiment. Actually, you could also use an old DC motor out of any toy. You'll need a frequency generator, a low voltage DC power supply (say 5 Volt 1 Amp) and a power MOSFET to chop current to the train on and off. If your power supply has a low enough voltage that your train doesn't speed off and make additional noise, you'll easily hear the buzzing as you sweep the frequency through the audible range.

AC waveforms and heating

With low frequency PWM, there are practically only two values of instantaneous current: on and off. During the ON phase, the maximum current is delivered to the motor and during the OFF phase, the current flow is zero (not withstanding inductive kick back or back EMF). If the frequency of the PWM waveform in Figure 2c is low, the average current is simply the duty cycle percentage multiplied by the peak current and the average dissipation is the same percentage multiplied by the peak dissipation.

The interesting thing is that although different AC waveforms with the same RMS levels may result in the same average current (and the same motor torque and speed), different shaped waveforms can lead to very different levels of resistive heating: heating is a function I*I*R and speed is related to I*R. Because of this difference, the dissipation when using AC waveforms, particularly low frequency PWM, will rise dramatically as we increase speed and weíll see an example later on.

In practice, this means that DC will always result in the lowest motor heating (at identical motor speeds). But high frequency PWM is almost the same as DC.

Most real world PWM applications use higher frequency PWM between 2 kHz and 100 kHz. The frequency is chosen so that it is several times larger than the motorís "electrical time constant" (the product of the motorís resistance and inductance). By using a frequency which is much larger than the time constant, the current never drops to zero during the OFF PWM pulses and never rises to maximum during the ON pulses. The higher the frequency, the more constant the current will become.

With a sufficiently high frequency, the current waveformís shape will be similar to that which would result from a pure DC source and not surprisingly, the heat dissipation when using high frequency PWM is also similar to the low value achieved using pure DC.

If you tried the buzzing motor experiment above, you could use the same set up to confirm that high frequency PWM heats less than low frequency. Firstly run the motor at mid duty cycle for 10 minutes using a frequency of about 50 kHz and then feel it. It should be relatively cool. But run it again for a while at 50 Hz with the same power supply voltage and PWM duty cycle and check the difference.

Even if you just take my word that low frequency PWM causes motors to run hot, why is low frequency PWM popular in model train power supplies when high frequency PWM is preferred for most other motor control applications? There are several reasons.

Firstly, the driving frequency would certainly need to be above 15 kHz to keep trains from audibly buzzing and at this frequency and above, the inductance and resistance of the track and wiring is likely reduce performance: the current path through track and wiring is too long. If the layout is large, the losses may also vary as the train moves along the track and this would be undesirable because the train would tend to speed up and slow down.

Coupled with this, there is such a tremendous variety of model train motors on the market with varying electrical time constants, a frequency as low as 15 kHz would be inadvisable because it would not work well for all locomotives. Thirdly, high frequency PWM is incompatible with "high frequency lighting" circuits which proliferate in the hobby. Finally and perhaps most importantly, PWM waveforms have squared edges and high currents with sharp edges are very likely to interfere with television and radio reception for all the dwellings in the vicinity.

From the perspective of starting model trains realistically, it is clear that rectified mains and PWM are the best. But from the perspective of reducing heat dissipation at higher speeds, it is clear that pure DC is the supply of choice. So we can deduce that the ideal model train power supply would be pulsed when operating from a standing start and at low speeds, pure DC when operating at higher speeds and a hybrid of pulsed and DC for medium speed operation. This is the driving waveform which this computer controlled power supply attempts to achieve and it is shown in Figure 2d.

Motors and generators

Iíve mentioned that motor speed and torque are related to current but if they were a just simple functions of current, it would not explain why trains which are more heavily loaded travel slower and consume more power. To understand why, you need to stop to consider the difference between a motor and a generator and about the concept of back EMF.

If we only think about DC motors and generators, there is actually no difference at all and if you spin the shaft of a permanent magnet DC motor, it will always behave as a generator.

If thereís no difference between a motor and a generator, can a motor behave as a generator at the same time? The answer is "yes" and this is what back EMF is all about.

back EMF in DC motors

Figure 3 Back EMF in DC motors

When a DC motor is switched on, a current will start to flow and the motor will start to turn (Figure 3a). As the motor starts to turn, it generates an internal voltage, called the back EMF and this happens to have the opposite polarity to the battery's voltage (see Figure 3b).

As back EMF rises, the net flow of power is still from the battery towards the motor, but the faster the motor rotates (the less load we place on it), the greater the back EMF. Both back EMF and the generated voltage are indications of the motor's rotational speed and it turns out that the raw voltage level of the back EMF is the same when the motor is being powered by an external voltage as when the motor is being driven at the same speed by a mechanical turning force.

Because the back EMF is effectively in series with the external voltage but has the opposite polarity, it is clear that increasing the back EMF reduces the current and decreasing the back EMF will increase current. A train will draw more power when it ascends a rise (it is operating slower with less back EMF) or pulling a larger number of carriages (also operating more slowly) than it will when it is going downhill or pulling fewer cars (running faster with more back EMF). We can guess that current will be greatest when a motor is stalled (when the back EMF is zero) and least when it is at its fastest (when the back EMF is at its greatest).

As well as directly affecting a motorís current consumption, back EMF also directly affects I*I*R heat loss. Anything which causes a train to run slower and reduces the back EMF causes the current to increase and for the motor to get warmer. Anything that causes a train to run faster and increases the back EMF lets it run cooler. Iím sure that this will be more or less intuitive to most electronics hobbyists but relatively few of us have probably stopped to think about it like this.

You can easily observe back EMF if youíre prepared to conduct another simple experiment. Take an old locomotive (which you donít mind abusing a little) and place it onto a section of unconnected track. If you push it along, you can use a multimeter to measure the voltage across the track. Assuming that the multimeter has a very high impedance, the current which flows will be almost zero and the meter will register the true back EMF.

If you've ever read a comprehensive book on model train circuits, you might have noticed circuits claiming to be speedometers. The first time I saw one, I couldn't believe that an electrical meter connected the power supply could measure the changes in the speed of the train as the train crested rises or pulled greater loads. But these circuits turn out to really work and the trick to them is that they measure the back EMF in between pulses of rectified AC or PWM. During the pulse, the power supply drives the motor and the meter circuit needs to be disconnected but during the off time, the train's motor is behaving as a generator and the voltage can be fed to the speedometer to directly indicate the speed!

Letís look at an example

Earlier, I mentioned that motor heating is far worse with PWM than with other forms of AC or DC and I invited you to experiment. Now that weíve looked at back EMF, we can start to understand why. But if youíre still having trouble believing me, donít feel too alone because when I first encountered all of this motor theory, I must admit that I was quite sceptical too. Quite frankly though, I was amazed when I took the time to perform some simple calculations.

A typical modern model train motor has a resistance of between 5 Ohm and 30 Ohm. It's a little difficult to measure motor resistance because of the way that commutators work but you can get a good indication if you're prepared to risk damaging the motor. Open it up to measure resistance directly at the electrical contacts on the rotor.

One particular motor of mine has a 20 Ohm winding and around 200 mA is drawn from a 12 Volt DC supply when the train (with no cars in tow) is operating at maximum speed. (It's best to measure this with an analogue multimeter.) If you do the calculation, this means around 0.8 Watt power dissipation (P = I*I*R). Some simple mathematics will show that the back EMF must be around 8 Volt for this to be so because Back EMF = battery voltage Ė I/R.

Torque and speed are proportional to current so when this motor is run at half speed, the current will be about half of the full speed current, or 100 mA. Back EMF is also directly proportional to speed and so at half speed, it must be 4 V. When you reperform the calculations above, youíll see that the applied voltage must be 6 V and the power dissipated must be 0.2 W. Now it is apparent that for DC powering, the dissipation at half speed is a quarter of the dissipation at full speed, at least when there is no mechanical load on the motor.

If for some reason, the motor in this example was to stall (so that the back EMF was zero), the current consumed from a 12 Volt supply would be around 600 mA and the power dissipated would rise to more than 7 Watt. In the small confines of an N scale tank engine, 7 watts would quickly cause it to become hot and the dramatic difference between stalled power consumption and full speed power consumption shows how important back EMF really is.

What would happen if the same locomotive was operated from a PWM supply?

At 100% duty cycle, PWM is actually pure DC and so the speed and heating would be the same. But to run the motor at lower speeds, the duty cycle needs to be reduced below 100% which in turn decreases the average current.

As an example, let's assume that we want to run the locomotive in the calculation above at half speed but instead of using pure DC, we want to use low frequency PWM. For half speed operation, we know that weíll need a 12 Volt PWM waveform with a 50% duty cycle and that current will only flow during the ON half of the PWM cycle. We also know that at half speed, the back EMF will be 4 V. Therefore, during the ON cycle, the instantaneous current will be 400 mA (I = (battery voltage - back EMF) / R). The current flowing during the OFF half of the duty cycle will of course be zero so the average current, voltage and dissipated power must be 50% of the peak current, voltage and dissipated power.

Although the locomotiveís speed will be identical when using either 6 V DC or 12 V 50% duty PWM, the dissipated power with PWM turns out to be around one and a half Watt Ė much more power than is dissipated at full speed and eight times the power that would be dissipated if the locomotive was being run from a DC source! DC motors powered by low frequency PWM definitely consume much less power when running at full speed than they do when running slower and this is solely as a result of differences in back EMF.

While we'd like to minimise heating as much as possible, it's almost impossible to stall a model train and so we can live with the little extra heat produced by PWM. But DCC sometimes uses PWM in a different way, specifically when controlling non DCC locomotives.

DCC systems use a bipolar track voltage as in Figure 4b, meaning that like mains AC, the voltage is above zero for part of a cycle and below zero for the remainder. The important difference between bipolar PWM and the regular (unipolar) PWM outlined before is that with bipolar, there is always a measurable voltage across the tracks and with unipolar PWM, the voltage drops to zero in the OFF times.

In order to control their trains, on board DCC decoders first perform a full wave rectification of the bipolar DCC waveform. As the DCC signal is square, when it is full wave rectified it becomes a pure DC voltage without the "humps" of rectified mains AC. The rectified voltage can be converted to low frequency unipolar PWM just like any other pure DC source and the DCC decoders drive the trainís motor just as like any other conventional PWM train power supply.

DCC manufacturers sometimes advertise that their product is able to control a single non DCC locomotive at the same time as the DCC equipped locomotives. But the DCC control signal is a little bit like unrectified mains AC and we know that DC motors don't run on AC. So how can the DCC manufacturers claim this?

some different AC motor control waveforms

Figure 4 Some different AC motor control waveforms

Stop and think about what happens when a model train is powered from rectified 12 Volt AC Ė a unipolar waveform. When a rectified AC voltage is presented to a DC motor, the motor will start to turn and with each consecutive rectified AC "pulse", the motor will receive an additional "push" and turn faster and faster up to its maximum speed. The same thing happens when the driving voltage is unipolar PWM.

But what if the driving voltage is bipolar such as an unrectified AC as in Figure 4a? Instead of a sequence of pushes in the same direction, the motor receives alternating pushes first one way and then the other. The unrectified AC pushes tend to cancel each other out and the train remains stationary. In fact, it will buzz awfully too as the motor vibrates at 50 / 60 Hz, just like a loud speaker cone produces sound as it is pulled one way and then the other. Go on, grab an unrectified 12 Volt power pack and try it on one of your sacrificial trains or motors!

Although the average current of this AC waveform is zero and hence the speed and torque of the motor must be zero, the RMS current will be larger than zero and the heat the motor will dissipate will be in proportion to the RMS current. So the train will stand still, make lots of noise and become awfully hot very quickly.

But there are always two sides to a coin. If you "bias" a DC motor with an AC current and then try to force the shaft to turn, you will notice that the shaft appears to be frozen or "sticky". Applying an AC voltage to a DC motor can be used as a method for braking and this technique is sometimes used in real world DC motor applications to brake or lock them. Normally though, this is not done in the world of model trains.

A bipolar DCC waveform is like unrectified AC: in the first half cycle, it is a +14 Volt pulse and in the second half cycle, it is a -14 Volt pulse (for HO and N scales) so there is always a potential difference across the tracks. The +/- 14 Volt DCC waveform has a nominal 50% duty cycle which means an average voltage and current of zero.

To control a non-DCC locomotive on a DCC layout, the a technique known as "extending the zero pulse" is implemented to shift the average voltage and current either positive (for forwards operation) or negative (for reverse operation). In this mode, a DCC controller can modulate its waveform between the nominal 50% duty cycle (zero average voltage and current) through to a maximum of around 90% (an average of around +12 Volt as shown in Figure 4c) or 10% (for Ė12 Volt reversing as shown in Figure 4d).

Let's go back to the earlier example of power dissipation in the 20 Ohm DC motor. At zero or low speed when there is no significant back EMF. The power dissipated from DCC's 14 Volt bipolar PWM will be almost 10 Watt. This is about 12 times more heating than for pure DC at maximum speed!

As speed is increased, the motor will start to generate back EMF as before but back EMF has a different behaviour when using bipolar waveforms. The back EMF will only reduce the average current during one of the two phases of the DCC polarity. In the other direction, it will increase the average current.

At full speed, the back EMF will be 8 Volt as before and during the positive phase of the bipolar PWM, the current will be 0.30 A ((14V Ė 8V) / 20R). The dissipated power will be 1.8 W. During the negative phase, the current will be -1.1 A ((-14V Ė 8V) / 20R) and the dissipated power a whopping 24 W. The total dissipated power will be just above 4 Watt (calculated using 10% of 24 and 90% of 1.8).

Because model trains are rarely run at their maximum speed, a non DCC locomotive being operated on a DCC layout will generally dissipate at least as much power as a stalled locomotive being powered with full voltage on a DC layout Ė certainly enough power to eventually damage it. Some types of motor are more susceptible to damage than others, particularly high end ironless core motors which are destroyed quickly. But in any case, few plastic locomotive shells could sustain a 4 and greater Watt "fire" in them for more than a brief interval.

In practice, because the normal DCC signalling frequency is a few kHz, the dissipated power will not quite reach the heights Iíve described, but nevertheless, operating non DCC engines on a DCC layout is not advisable for extended periods of time.

If youíre interested in a more thorough yet readable account of DC train motors, you could visit an excellent web site http://www.magicnet.net/~bmetcalf/rr maintained by Bruce Metcalf. The site contains a number of technical and non technical articles on aspects of model railroading, including the design of power supplies and the performance of model train permanent magnet DC motors. If you're interested in seeing a detailed explanation of DC motor power and thermal calculations, visit the web site http://www.micromo.com/03application_notes/tutorial3.asp.

But for a more general discussion of all model railroading topics, the news group rec.models.railroads receives several hundred postings each week and there are always many ongoing discussions, sometimes about DCC or conventional control but always packed with useful information for the beginner. Contributors and questions to the news group are generally enthusiastically welcomed because after all, we are all novices in some aspect of the hobby or another!

If you have Internet access, reading the news group is a great way of anonymously returning to the hobby especially if you believe your spouse will think youíve gone nuts when you openly start talking about trains. It doesnít matter that you go nuts whilst following your hobby using the Internet because "normal people" won't notice what you're doing and you can always "come out" at a later date!

That wraps up the technical background and discussion for the train controller project. Next month, weíll specifically look at the power control sections of the circuit and present the full list of parts. Then in the following articles, weíll study the remainder of the design, its construction, testing and finally the software itself.


Stefan Keller-Tuberg BE (Hons) MEM

Stefan Keller-Tuberg is a professional engineer with an honours degree in Electrical Engineering from the University of New South Wales and a masters degree in Engineering Management from the University of Technology, Sydney. He and his family are presently living in the United States where Stefan works in the telecommunications industry planning service architectures and product evolutions for high speed xDSL and Optical Internet access products. They are enjoying life in the USA but are looking forward to their return to Australia some time in the coming year.

Copyright 2001. Stefan Keller-Tuberg.

Contact me

Return to the computer controlled trainset page.