James K. Roberge: 6.302 Lecture 20

Search transcript...

PROFESSOR JAMES K. ROBERGE: Hi. Today I'd like to do what I'm sure as my own favorite example of the application of some of the concepts that we've been talking about throughout this series to a system. In particular, I'd like to look at how we can use some of these ideas for speed control of a model train engine. I've been virtually a lifelong collector and operator of model trains, and this is a way of combining a profession with one of my hobbies. I don't worry about those little tiny trains, HO and N gauge and all those sorts of things. I mean real trains, Lionel trains. I think this is the only kind of train that a person should really collect. Along that line, incidentally, if any of you have real trains hidden away in your basement or attic, I'd be very happy if you'd contact me. I'd be pleased to make an offer for whatever collection you have.

But I think that if we go back and look at some of the things that the Lionel Corporation has done, I think Joshua Lionel Cowen, when he ran the corporation, certainly knew how to attract the fancy of children and probably MIT professors. For example, here's a car which was sold in large quantity-- and the technology really isn't very high. It's a little searchlight car, and what you have is a little light and a reel for the cable that powers the light. It, of course, picks up its primary power from the tracks. The technology obviously isn't very high, but I think the detail, and you can get insight into the personalities of people who designed this by looking at one particular feature. Searchlight, the reel, the wire-- well, when we go to put the searchlight back on, anybody could just wind up the reel by hand. But if it's a Lionel toy, you get a little crank, and when you go to wind up the reel, why, you do it this way. And it's that sort of touch, I think, that makes these really classic toys.

Anyway. I have a dream that, to this point, is sort of unfulfilled, like many dreams. But it revolves around finding a way to control, independently, the speed and direction and behavior of a large number of trains on a single layout. The problem, of course, is that all trains receive power from a common track. You put a common voltage on all the trains on a single track-- there's various schemes that I'm sure many of you are aware of for blocking off sections of the track and that sort of thing, but those are all sort of cumbersome. And what I eventually hope to do is get a setup where I'm able to totally independently control a large number of trains on a single layout.

And I've had most of this running at one time or another. The way I do it is to put a little carrier on the track and weave in sort of a rather complicated time division multiplex scheme, that the time phases commands for a large number of independent trains, and the commands tell the trains things like the speed at which they should run, what direction they should run. It enables me to light lights, and turn them off remotely, and operate all these wonderful operating cars that Lionel Corporation made, again, remotely.

One of the pieces of that system is a need for good speed control of the engines that you're using. And in particular, that's what this demonstration will focus on. I don't have the time division multiplex scheme here, but I do have the speed control system, and that's really a good illustration of some of the ideas that we've been discussing. That's what I'd like to demonstrate.

The problem is as follows. Here I have a standard Lionel engine, which I'm actually running from this power supply. Lionel normally runs their trains off a C. They use a transformer, a variable transformer, as the power supply. The motor that Lionel uses is a little universal motor, so we can certainly use direct current to power that motor, and that's what I'm doing here.

I have one of the problems that even an electronic system can't cure, which happens to be the train off the track. But let's see if we can straighten that out.

All right. Here we have the standard Lionel engine running from a DC power supply. Now, there's several problems, from a purist operator's point of view, one is this that there's a fairly small dynamic range of speeds over which the train will operate satisfactorily. There's certainly a maximum speed that occurs when the train falls off the track, but there's also a lower limit. If we slow the train down, it's very difficult to get the engine to run reliably. It will, at times, stop. The motor tends to cog. It's very hard to get it to run predictably at a low speed, and you'd like to have it run at a low speed, so you can bring all these wonderful operating cars up to the stations at which they operate, and so forth. And that's, as I say, a difficult thing to do with a standard Lionel engine.

Furthermore, consider what happens if you have a layout that includes mountains and whatnot. And while we get the engine to run fairly reliably this way, let's consider what happens if we have it climb a mountain. So here's our mountain. And now, of course, we have the anticipated problem, where the engine doesn't go very well uphill, but goes like mad downhill, and that again is something that a purist operator is a little bit disturbed by. And what I'd like to look at is a method that will allow us to control the speed, independent of the grade that the engine is on, or other changes in load applied to the engine. And furthermore, that same technique will give us a method that allows us to move fairly slowly, and gets around some of the cogging problems that the usual engine has when we ask it to run at a very low speed.

The technique is to measure the speed of the engine, and I'll describe in a moment how we accomplish that. But to measure the speed of the engine, and then build a feedback system that makes the engine run at a prescribed speed. And I have an engine that incorporates these features here. There's a few pieces of hardware necessary to do this, yet it all does fit inside a standard Lionel engine. I am able to get a shell on top of this, and in fact, I'm able to get the receiver, which is not included here, I'm able to get the receiver for the time division multiplex scheme inside the same shell. We'll see how much better this one performs.

In order to do this, rather than change the voltage to control speed, I apply a fixed voltage to track, and the speed control system that's built into the engine controls, then, the speed of the engine, using the fixed voltage on the track as its power supply.

Here we have the engine. Again, the same hill. We notice the much greater uniformity of speed that this engine exhibits. I can change that speed, in this case, by simply changing an adjustment on the engine, but of course, in my dream layout, I do that via the time division multiplex telemetry scheme. A side benefit of this is that I can command quite a slow speed, and once again, have the feedback system control the engine in quite a predictable way, so we can crawl uphill and downhill with very little evidence of cogging.

If we ask it to go slowly enough, we will run into some problems, but again, it certainly works far more reliably than the unmodified engine. It starts with a basic Lionel engine. I use the same motor as was used in the Lionel engine, but add the electronics in order to affect speed control. Let's go back to a more reasonable speed.

Well, I'd like to look at the system that does this. And this is really an example of a phase lock loop of the general kind that we discussed last time. What we have is a loop that I've indicated here. We have to have a method for measuring the speed of the engine, and the way that we do that is to count commutator pulses from the electric motor that powers the engine.

Lionel motors are constructed with a commutator that has only three segments. If we look down at the end of a commutator, we find out that it's circular. Here's the axle for the motor, or the shaft for the motor. The commutator, the motor turns this way. And the commutator simply consists of three pieces of separated copper, like so. And in operation, there are two brushes that span two pieces of the commutator like this. That sort of commutation is rather pour. There's a fair change in current as you go past a break in the commutator. And as a result, you get a very large spike when the motor commutator goes over a brush, and you get six of these spikes per revolution. There are two brushes, three segments in the commutator. Every time you change the segment with the brush, you get a spike. And so you get six large spikes in operating current per revolution of the armature of the motor. That, of course, translates to some distance traveled, reflecting the gear ratio on the sides of the wheels, and that sort of thing.

But those spikes are quite easy to detect, so you can use that as your indication of speed. And you can use those commutator pulses, appropriately shaped by some sort of a pulse network, to really mechanize a phase lock loop. And the phase lock loop looks something as follows. I use an up-down counter as the phase comparator. I mentioned that last time. That's one technique for doing a phase comparison. You really keep track of the total number of cycles different between the commanded frequency, and the frequency that comes back in. So what I do is apply a command proportional to the speed at which I want the engine to run, to the up-line on an up-down counter, and I come back from a measurement of motor speed through a pulse circuit that detects the commutator pulses I mentioned earlier, turns them into digital kinds of pulses, and I apply those pulses to the down control, or the down count line, on the same up-down counter.

The net result is that the numbers stored in the up-down counter is a measure of the total excess of command pulses over the total number of pulses that I have gotten, reflecting motor revolution. Ideally, if the motor had gone exactly the same amount, the correct commandment displacement, if you will, the net count in the up-down counter would be 0. If the count, ideally, were positive, actually, this does not count from both positive and negative. But higher counts stored in the up-down counter indicate a greater number of pulses commanded. A lower count indicates that the engine has basically caught up. We've gotten a larger number of pulses, proportional to motor revolution.

In my particular system, I use a 6-bit up-down counter, so I have resolution to a part in 2 to the sixth, or a part in 64. I apply those 6 bits to a digital-to-analog converter, so at this point, I get a voltage that's proportional to the net count in the up-down counter. And I use that voltage to drive a power amplifier, the input to a power amplifier. And the power amplifier then applies power to the motor. Again, as we complete the loop, the motor now turning gives me an average frequency of commutator pulses. Those pulses are shaped, converted to digital form, and we close the loop in that fashion.

If we go to make, again, a linearized block diagram for this system, we have our command pulses here, F sub C. And this is the frequency at which we're commanding the engine to run. We have the down pulses. Very conveniently, if we consider our speed in radians per second, if we use that as the units for our shaft velocity on the motor, why, we find out that since we get 6 pulses per revolution, and since 1 radian per second is 1/5, 1/6, or about 1/6, 1 over 2 pi revolutions per second, a 1 radian per second speed gives me a net 1 pulse per second from the pulse shaping circuitry. So the feedback path in this digital kind of feedback system that links speed in radians per second to down pulses, is just about unity. It's actually 6 over 2 pi. Those are the down pulses.

The up-down counter subtracts down pulses from up pulses, and the net count in the counter is the integral of the frequency difference between these two signals. Of course, as we have in a normal phase lock loop, the phase detector, in this case, the up-down counter, is measuring the net slippage in phase, if you will. That's the integral of the difference between these two frequencies. So we get a 1/s that links the difference between these two frequencies to the state of the counter.

Again, in a block diagram, it sort of implements what's going on here, ignoring the quantization intrinsic to the D-to-A converter, and some of the sampling problems with this pulse kind of feedback scheme, we take a number of proportional to counter state, or a voltage proportional to counter state, and amplify that, do some compensation. The power amplifier also includes provision for compensation. We apply that to our motor, the voltage that's been modified by the compensation, the transfer function that we use for compensation, apply that to the motor.

The transfer function for the motor is approximately first order when the variables are voltage in versus speed out. You recall that if we use total shaft position as our variable, we'd have an integration between motor voltage and total shaft rotation. If we use shaft velocity as our output variable, then we get a first order time constant as shown, some constant. And then a time constant, reflecting the fact that if we put a constant voltage, a step of voltage on the motor, it would take a little while for the motor to accelerate to final value.

The numbers in our system, if we go and now look at the loop transmission for this sort of a system, the numbers are roughly as follows. The overall scale factor, including the conversion factor of the D-to-A from counts to the D-to-A output voltage, the gain of the power amplifier, and the constant associated with the motor, the overall scale factor works out to be about 20 radians per second per count, and that lumps all of these constants together. So the transfer function from here to here, where the dimensions are radians per second per count, is 20 divided by s.

If we make a loop transmission plot of that system, at low frequencies-- this is the usual Bode plot, the magnitude of blue transmission versus frequency. At low frequencies, we're going as 20/s. The mechanical time constant for the type of motor that's used in that engine is about 1 radian per second. You might question whether that's not a function of the load applied to the engine. Certainly the mechanical time constant also includes any inertia that might be reflected back to the armature. We have to make some sort of a calculation reflects load inertias back to the armature.

When you go through that, you find out that the acceleration time, or the time constant associated with the motor, is really virtually independent of the total load. There's enough of a gear reduction between the motor and the cars, if you will, if you take into account all of that, that the principal inertia load seen at the armature of the motor is really the armature inertia itself, rather than the load reflected from any load the train may be pulling. So this time constant of about one second is pretty much independent of the number of cars we're pulling, and that sort of thing.

So with that, we get a loop transmission that looks something as follows. The 1/s roll off, or 20/s roll off, at low frequencies. An additional poll at 1 radian per second. We would then cross over, since we're dropping off as 1/s squared. If this were the total dynamics of the loop, we'd cross over at the square root of 20, about 4.5 radians per second squared, and we'd have only about 12 or 15 degrees of phase margin, because we'd be crossing over a factor of 4.5 above the second pole in the loop transformation. So if we built our engine without our speed control system, without any compensation, this is the kind of Bode plot we'd get.

We compensate by adding a lead type transfer function. This is a very likely candidate for lead kind of compensation. And actually, for reasons that I'll describe in a moment, why we want a fairly small alpha in the lead network, I actually use an alpha of 4, and put the zero in at about 3.5 radians per second. Crossover, then, if we keep track of the numbers, crossover occurs at about 7 radians per second, roughly one cycle per second. And then because the alpha, the lead network is only 4, we get finally a roll off the second pole in the system at about 14 radians per second.

Again, if we keep track of the numbers involved, we find out that we increase the phase margin of the system to something like 40 degrees by adding this lead network with an alpha of 4. So we convert from a system that originally had a phase margin of maybe 12 degrees, to a new value of something on the order of 40 degrees, a far more stable system. Of course, the system operates when we, for example, have an increased load on the motor, when the motor is going uphill, when the engine has just turned the corner and is going uphill, we find the motor tends to slow down a little bit. Consequently, we accumulate additional upcounts. The reference frequency doesn't change. The command frequency doesn't change. The motor slows down a little bit. We increment the net count in the up-down counter. That gets converted, applies a higher voltage to the motor. Similarly, when we round the corner and go downhill, the motor overspeeds just a little bit. The load is greatly reduced when we go downhill. We get additional pulses off the commutator. That, in our up-down counter, decrements the up-down counter. We apply a smaller voltage to the motor, and so we get that sort of speed control.

We can look at the engine and see at least some of the hardware that allows us to do this. Here we have the motor itself in here. This is this little universal motor, the wound commutator as well as a wound field out here. I happen to operate them in series in this particular application. But that's the standard Lionel motor, simply geared to the wheels.

This is the up-down counter and the D-to-A converter, the logic in here-- all this runs of CMOS sorts of logic, which means that if I get a momentary power interruption, I can store enough power to run the CMOS for a second or two on a capacitor, so I don't lose track of the state for brief power interruptions, which are fairly frequent in this kind of a system, as you might imagine. So here's the up-down counter, and the D-to-A converter-- actually, the D-to-A converter is simply a resistor network running off the CMOS. CMOS makes a very nice switch, and so I use that technique to do the D-to-A conversion. And the power amplifier is back in this rear section, a reversing relay in here, which I haven't exercised, but there is a reversing relay. And the power amplifier itself, and I'll talk a little bit about how that works later.

The bottom board is simply the circuit that gives me the command pulses. In the usual, normal system, this would be replaced by the board that receives commands via the time division multiplex telemetry system. So for our purposes, we have a board here that provides speed pulses. The frequency of those pulses is controlled by the potentiometer on the board, but that's simply for demonstration purposes.

I'd now like to look at the behavior of the engine other than on the track. We've seen then it runs quite well on the track, but I'd like to look at sort of more usual step responses of the thing. So for that reason, I'll mount the engine here and simply apply power to it. I as yet have not turned on the power supply, but I'll put power on the engine.

What I'm then going to do, in addition to the free running oscillator that supplies command pulses, I have another input to the oscillator so that I'm able to modulate it, to frequency modulate the oscillator. And so what I'll do here is take our signal generator with a very low frequency square wave, a square wave at a fraction of a hertz, and I'll apply that to the modulation input on the generator that's getting me the frequency, or commanding the frequency of operation, or the speed of operation, of my engine. So this gets us a way of modulating the speed.

There's also a provision on this little board that, as I say, is really included only for demonstration purposes. I have a rough analog measure of speed available on that board. I have a one-shot that's triggered from the motor pulses, the pulses that are derived from the commutator spikes. I average the output of that one-shot. The one-shot multivibrator gives us a fixed width pulse every time we get a commutator spike. Those pulses are converted to standard amplitude, and then averaged, go through a low pass network that gets an average value for the pulse train. That average value is proportional to speed.

The reason I didn't use that as a speed measuring scheme is simply that we get some additional low-pass characteristics out of the averaging network. That's perfectly all right to observe the speed, but if we use that information as part of the loop, we'd have additional stability problems. So I do have provision in here for monitoring the speed of the engine. And getting an analog measure, which we can display on the oscilloscope.

Now let me put power back on this thing. And I believe you can hear the change in speed. There the engine's going faster. There it's slower. Here it goes faster again. Slower. Faster. And we can look at that same transient on the oscilloscope. We have a storage scope, since this happens fairly slowly. Well, there's one shot, one transient. We're about 2/10 of a second. I believe the scale is 2/10 of a second per division. Yes. And we're looking at a measure of engine speed, as I say, derived via this one-shot and smoothing network.

We notice that that's not a transient anything like we've seen before. This really reflects the real world. When we're dealing with mathematical systems, we can draw very nice second-order kinds of responses. We get very, very pretty-looking responses. Here we have a mechanical system that was designed for a very real purpose. It was designed to entertain children. It was designed to be very reliable, very rugged, and sell for an incredibly modest price.

And you might imagine, when you put those constraints together, for example, you don't end up with the best-quality gears in the world. You end up with gears that have a good deal of backlash. You end up with a motor that has a remarkably high friction level. The commutation is not very good, so the torque isn't particularly uniform over the revolution of the motor. There are a whole collection of mechanical kinds of problems, none of which influence the reliability of the system, or affect it adversely at all, when it's being run in its normal mode.

But we see the effects of that on the oscilloscope trace. If we look at that trace, rather than seeing a nice kind of second-order sort of response, we see all kinds of toothy things that has nothing to do with the basic dynamics of the system. Those are just little imperfections that reflect things like backlash in the gear train, and stiction in the mechanical portions of the system, and that kind of thing. So those little ripples on the leading edge have very little to do with the fundamental dynamics of the system. The rise time is reflective of the crossover frequency of the system, but those little ripples really are aberrations of the consequence of imperfect mechanics.

Furthermore, they're basically different every time we do it. Let's look at another trace. It will trigger in a minute, presumably. And that's a little different than the last one. We're not on the same portion of the gear pass, for example, when we apply the pulse this time, or apply the step change this time. We can do it again. If we keep it up, we at times can get very, very nice-looking ones that almost do look like the textbook kind of second-order responses.

There's not a bad one. There's just a little bit of ripple on that, but we don't see the really bad performance that has to do with gears chattering and so forth. But at times, we get the very bad ones, as well. I think the first one that I had up was an example of a very bad one. There's one that has some little wiggles in it. But it's different every time, just reflecting the vagaries of the motor. There's a particularly toothy one that we got this time.

Well, right now, we have the engine running as I have described it, and with all of its real world imperfections. But this is compensated. If you think this trace is ugly, let's go back and see how much worse things are when we eliminate compensation in the engine. What I will do is get rid of the lead network that gives me this characteristic by simply removing a capacitor, which is responsible for giving me this lead type transfer function, I can end up with this sort of a loop transmission magnitude of a system that has only the 12 or 15 degrees of phase margin.

I do that by removing a capacitor. The compensation is actually buried down inside the power amplifier. As I mentioned earlier, the power amplifier for the motor is in this portion of the configuration, and buried right in here is a little capacitor, an electrolytic capacitor, actually, which is the thing that's doing the compensation. Now, let me pull that out.

And now we can notice a very different behavior to the system. And we can hear it. We don't have to, as yet, look at the oscilloscope trace. We can actually hear the engine pulsating. There's a startup transient. And we hear it pulsating. We didn't hear that before. When we had the system adequately compensated, we didn't hear-- you can actually hear the speed changes, the overshoots. We can show the same thing a little bit more scientifically if we now look at the speed transient, look at motor velocity.

Now here we have a basic ring. We also, of course, have the teeth once again. We clearly haven't eliminated the mechanical imperfections by doing this. But here we see a very definite rocking. In addition to the little spikes that are reflective of the mechanical imperfections of the system, we have a slow rocking at something on the order of one cycle per second, or maybe a little less. I indicated that we cross over in this system at somewhere on the order of 4.5 radians per second. That's an estimate. Maybe a little bit under 1 hertz. We notice that to the extent we can measure the basic frequency of oscillation, it goes maybe 5 divisions or so on the oscilloscope, or roughly 1 second. So somewhere around 1 hertz.

Let's get a few more traces, if we can. Again, we have the perturbations from the mechanical imperfections, particularly as the speed changes. The motor overshoots. It now tries to slow down, and momentarily, the gears disengage. You get the teeth in that area. And you see, then, the gentle rocking later on that's reflective of the basic low phase margin of the system.

We'll do another one. Again, the same thing. A nonlinear response, because we have no way of slowing down the motor. The power amplifier that I have can only accelerate the motor. The best it can do is stop accelerating, and reduce the motor voltage, and let the friction of the system slow it down. So it's non-linear. It turns on better than it turns off. We're looking only at the positive transition here. But when we come around the corner, when the motor has to slow down to recover from an overshoot, there's a non-linearity there-- there we get a response, where we see quite clearly the oscillations.

Not sure if I can trigger easily on the falling part of the wave form, too. Let's try that. It won't trigger on that, so let's go back.

But again, we see the much poorer transient response, and we get very good audible indication, as well. Let's go back to the better damped one. And I think now I really have to use glasses to be able to get enough depth perception to get the capacitor back in its hole.

And here we see the very much better response, or hear the very much better response, we'll see it in a moment, the results when we have adequate phase margin in our system. Again, we're now back to the well-damped case. We get just a little bit of overshoot. We still have the mechanical imperfections, but the considerably better performance that we get this way. That's a fairly nice response. Again, almost like a textbook second-order response, with just a little bit of additional ripple associated with it. So there we had a particularly fortuitous set of circumstances. There we had a rather bad one. Another good one.

All right. Let me pull this down, put the train back on the track, and then I'd like to discuss one or two of the practical considerations that are necessary to make a system like this work acceptably.

There's an additional mechanical imperfection that involves wheel slippage on an incline that's this great, and that happened, you notice, when it started up. The engine actually got up to speed very rapidly. The motor got up to speed. There's some slippage on the track at this incline, and so the thing didn't actually physically start to move. That's not nearly as much of a problem when it's running normally, once it's gotten up to speed. This is so much better than the alternative, the usual use of the usual Lionel engine. You can really get into the spirit of this thing, when you have an engine that really responds as you might hope it does.

Let me talk a little bit about some of the practical implications for a system like this. First of all, you recall that I mentioned, we used the lead network with only an alpha of 4, a very small value of alpha that doesn't give us much positive phase shift. It gives us a maximum positive phase shift at its point of maximum phase that's what, the sine, or the arc sine, of 3/5, the angle whose sine is 3/5. And that might be 30 degrees, or somewhere under 40 degrees, I guess. So we don't get very much positive phase shift out of this network.

But the reason for using that small a value of alpha is as follows. Remember, a lead network has higher high-frequency gain than low-frequency gain. That's the implication. I use this lead network in conjunction with the power amplifier. The driving signal for the power amplifier is a staircase kind of a thing. It's coming from a D-to-A converter. And the peak the magnitude of those steps are a significant fraction of the maximum voltage applied to the motor. At least the amplitude of the steps, when the D-to-A converter changes state, are each a couple of percent or so of full-scale amplifier output.

Now once we go through the lead network, the transition is accentuated because of the greater high-frequency gain of the lead network, compared to its low-frequency gain. If I had a large alpha, the power amplifier would be saturating, or cutting off, every time we get a transition out of the D-to-A. We get a number of transitions when the motor is running at 5,000 RPM. We get something like 500 pulses per second. And so we'd have the amplifier spending all of its time banging into the stops one way or the other, if we had a large value for alpha in the lead network, and that's not a very satisfactory situation.

So in an attempt to improve that, we go with a rather small value of alpha. We found out that we do get acceptable stability. The imperfections that result from inadequate loop stability are completely masked by the mechanical imperfections when we used the alpha of 4. So that's an acceptable value for alpha.

I mentioned earlier that the way that we do the digital-to-analog conversion is to simply come from a register, which is actually off the up-down counter directly off the up-down counter through a resistor network. I use a binary weighted resistor network. I use the CMOS logic really as the switches for the D-to-A converter, and that makes a very, very nice sort of a system. So one of the little boards in here, in association with the logic, simply has six resistors on it, and those provide the D-to-A conversion.

There's a question as to how do we do the power amplification. A Lionel motor takes something on the order of an amp and a half to operate, under normal load conditions, at maybe 10 volts or thereabouts. So we have to put somewhere between 10 and 20 watts into the motor. Furthermore, again, my grand plan involves running more than one motor per engine. You can really climb the highest mountains and whatnot if you have more than one motor, so I anticipate normally using at least two motors per engine, or back-to-back diesel, something like that, and I'd like to run them off a common power amplifier. So I have to have a power amplifier that maybe can put out 25 watts, or something like that order, to power my engines.

The difficulty there, of course, is that of heat sinking. If you build a linear amplifier, a linear power amplifier, if you recall, sort of looks like a variable resistor between the power supply and the motor, or whatever load you're driving. It's a problem that's common to audio amplifiers or any other kind of amplifier. If you build a true linear amplifier, it's lossy. If the output voltage is half the supply voltage, you're putting an equal amount of power in the control element and into the motor, in this case. And if we had to be able to get 20 watts or so into our load, we'd be dissipating that kind of power in the controller.

Well, that's unacceptable. You just have trouble getting 20 watts work of heat sink on an engine like this. I would like to be able to get the cover on the engine. The underside is pretty much taken up with wheels, and I have a little weight in addition, just to get the engine a little bit of weight, this block that you see running by, and between the two sets of wheels is just a little brass weight. But I don't have room for a heat sink, and still be able to cover the engine with a shell.

One solution to that sort of thing is to use a switching amplifier. And the technique that I use for that was one actually pioneered by Professor Bose, which is illustrated here. We have a supply voltage, and the motor, which I'm sort of loosely indicating as an inductor, plus some loss, and there's actually a back generator and a couple of other things, but we can use a very simplified model that consists of an inductor and some loss in the motor. And what we now do is modulate this switch. At some very high frequency, I run the switch at 100 kilohertz or thereabouts. And when the switches close, we have the motor directly connected to the supply voltage.

Build up current in the inductor. You then open the switch. Current was flowing in this direction, through the switch to ground. The motor on the voltage flies back. You catch it on this diode, so you continue motor current that way. Later you, once again, close the switch, apply power from the power supply. Providing you do this operation fast, at a high frequency, compared to the fundamental time constant of the LR, the inductance and the resistance in this loop, you end up with effectively constant current. You're modulating your switching fast enough so that you end up with effectively constant current in the motor.

The nice part about this is, of course, that when the switches close, there's current flow through it, but no voltage, and so you get no power dissipation in the switch. Conversely, when the switch is open, there's voltage across it, but no current flow through it, so there's no dissipation in the switch element, to the extent that it's an ideal switch. Again, we use a Schottky diode to power here, so the power loss in that diode is fairly small. The net result is, we can build an amplifier that puts out 10 or 20 or 30 watts, and only dissipates 2 or 3 watts internally, and so I don't have this problem of getting rid of a large amount of heat that I would if I used a linear amplifier.

People have known about switching amplifiers for a long time. The control scheme is a sort of an interesting one, which I won't get into in detail here. But basically, what you do is derive, figure out the average motor voltage with simply a low pass filter. Now remember, we're switching at something like 100 kilohertz, so we can get the motor voltage with a filter here that is a time constant of a millisecond, or even a short time constant. From the map, we can get a very good estimation of the average motor voltage. And we can then close the feedback loop that changes the duty cycle of the switch in order to force the average voltage on the motor to be equal to our command.

And so what we do is apply our D-to-A output, the output from our digital-analog converter, to this sort of a switching amplifier. We close the loop around the switching amplifier with this little low-pass filter that effectively forces the average voltage on the motor to be proportional to the voltage from the D-to-A converter.

The technique for affecting duty cycle control is the part that was suggested by Professor Bose. In fact, he has a patent on it, as I recall. And you find out, as I say, I won't go into this in detail, but I do discuss it in the book, I believe in chapter 11. You can use a Schmitt trigger. And what happens then, you apply your command to one side of the Schmitt trigger. When that voltage, the command voltage, exceeds this RC voltage, why, you close the switch. The voltage on the capacitor begins to increase. When you have the switch closed, you've got the full supply voltage, at this point. The capacitor voltage begins to ramp up a little bit. Pretty soon it exceeds the hysteresis on the Schmitt trigger. The system switches, the switch opens up, the thing flies back. You have basically 0 volts here. The capacitor voltage begins to ramp down. Again, you exceed the other transition point on the Schmitt trigger, once again, close the switch.

So you build a free-running oscillator by going from this output through a Schmitt trigger, back to the switch. And if you go through the numbers associated with that loop, you find out that of course the loop works to force the average voltage on the capacitor to be proportional to the command. So that's the way I do the power amplifier. And by using a smoothing network here, again, recognizing the very great difference between the frequencies of interest for commanding the motor, which are several hertz, and the switching frequency, which is 100 kilohertz or thereabouts, you can very easily use a slightly more sophisticated network in here, get lead kinds of characteristics out of the power amplifier. The place where I actually do the amplifier compensation is in the power amplifier by an appropriate modification of the elements in this portion of the network.

So as I indicated at the outset, I think this is probably my favorite demonstration. Shows that in addition to doing all of the wonderful things we thought we could with feedback, we can also use it just to have fun.

This concludes my series on an electronic feedback systems. I certainly enjoyed doing it. If any of you would like to contact me, I welcome that, and you can get a hold of me care of the Department of Electrical Engineering and Computer Science at MIT. Thank you.