# A Linear Throttle, The Next Generation



## toddalin (Jan 4, 2008)

OK, we all know that the speed of our trains is not directly proportional to the voltage, and I've proposed that it is proportional to the power and based on the difference in the square of the voltages. This is intuititive with observation and is supported by data.

The next step (_*are you listening manufacturers?*_) is then create a throttle that would allow for a linear increase in speed, in accordance with the dial on the throttle.

So if full voltage is 24 volts, and this runs the trains at 100 scale mph (smph), we would like this to be "10" on the dial.

When we turn to "9" on the dial, ideally, we would _like_ the trains to run at 90 smph. Similarly, if we turn the dial to "5" the trains should run at 50 smph, etc.

But, most throttles put out voltage near linearly across their dial. Again assuming that 24 volts equates to 100 smph, if we turn the dial to "9" and the throttle puts out 21.6 volts (i.e., 0.9 x 24 volts), the trains would run at 81 smph. Similarly, if we turn the dial to "5" and the throttle puts out 12 volts (i.e., 0.5 x 24 volts), the trains would run at 25 smph. At "1" on the dial we would like the trains to run at 10 smph, but at only 2.4 volts (i.e., 0.1 x 24 volts), your train won't even budge.

Therefore, the next generation throttle should include an algorithm that lets you scale the throttle dial to the power level (square of the voltage)so that the speed of the trains would increase linearly across the dial.

Again assuming 24 volts is 100 smph:
"1" = 10 smph = 7.59 volts
"2" = 20 smph = 10.74 volts
"3" = 30 smph = 13.15 volts
"4" = 40 smph = 15.18 volts
"5" = 50 smph = 16.97 volts
"6" = 60 smph = 18.60 volts
"7" = 70 smph = 20.08 volts
"8" = 80 smph = 21.47 volts
"9" = 90 smph = 22.78 volts
"10" = 100 smph = 24.00 volts

The "Smart" throttle would then recognize that different engines operate over different voltage ranges so would allow you to set the top voltage and all of the other voltages would fall in line according to the algorithm.

So if you set the top voltage at 18 volts for "10" on the dial, then "5" would rescale to 12.73 volts and the trains would run at half speed of the top of the dial ("10").


----------



## riderdan (Jan 2, 2014)

Are you just suggesting that the throttle response should be strictly linear? In that case, how would you handle extremely low speeds for switching?

I'm curious about why you feel this is needed.


----------



## toddalin (Jan 4, 2008)

riderdan said:


> Are you just suggesting that the throttle response should be strictly linear? In that case, how would you handle extremely low speeds for switching?
> 
> I'm curious about why you feel this is needed.


I am suggesting that the speed is linear to the difference of the squares of the voltages and the throttle response should consider this rather than just being a linear voltage increase. _This makes the trains respond much more linearly with the coorosponding settings on the throttle which is exactly what you want for low speed maneuvering. _This method would give you far more response for low speed switching.

Lets say that the train won't even start to move until it "sees" 7 volts. Lets say the power pack can supply 24 volts. So on a scale of 1 to 10, at "1" on your throttle you get ~2.4 volts, at "2" you get ~4.8 volts and at 3 you get ~7.2 volts and your train starts to move. So you've wasted settings "1" and "2" and practically all the way up to "3" (almost 30% of the entire throttle dial is being wasted).

Now consider my proposal. At "1" you're getting 7.59 volts and your engine has already started moving with very little waste of the throttle. Need to go slower, dial it down to just below "1".

Also, recognize that as you go further toward the lower end of the throttle, the changes on the dial have a bigger effect on the voltage where you need bigger changes to effect the same change in speed. This will really increase the response in that area of the throttle.


----------



## East Broad Top (Dec 29, 2007)

Something like that--on an analog throttle--would be difficult to set up on a per-locomotive basis. You'd have to program the throttle each time you set a different loco on the track based on start voltages, top speed, gearing, etc. You'd need a memory on the throttle to store each locomotive's unique speed curve, so you can recall each loco at a push of a button. I can't see anyone jumping through all those hoops each and every time they put a new loco on the rails. 

We already have something kinda similar in the form of the Trackside Revolution. You can set your start voltage, top voltage and to a limited extent adjust the speed curve. How many folks who are running that system as a generic analog throttle for the track (not as an on-board controller) actually set up those settings, let alone adjust them for each specific locomotive?

I wonder if those who are that OC about a "proper" relationship between speed and dial position are already using command control where they have the ability to program speed curve specific to each individual locomotive on its own unique decoder. 

Having said that, I also say "bring it on!" Just because I don't think it would be all that popular doesn't mean I don't think it'd be cool if done right. We've got lots of things in this hobby which for I see very limited appeal, but are pretty slick for those who use them!

Later,

K


----------



## Greg Elmassian (Jan 3, 2008)

Get DCC or run MTH DCS.


----------



## toddalin (Jan 4, 2008)

East Broad Top said:


> Something like that--on an analog throttle--would be difficult to set up on a per-locomotive basis. You'd have to program the throttle each time you set a different loco on the track based on start voltages, top speed, gearing, etc. You'd need a memory on the throttle to store each locomotive's unique speed curve, so you can recall each loco at a push of a button. I can't see anyone jumping through all those hoops each and every time they put a new loco on the rails.
> 
> Having said that, I also say "bring it on!" Just because I don't think it would be all that popular doesn't mean I don't think it'd be cool if done right. We've got lots of things in this hobby which for I see very limited appeal, but are pretty slick for those who use them!
> 
> ...


 
Thanks for the thoughts.

Actually, it could be relatively easy to implement. Consider that when you turn up the volume on your stereo, although it sounds linear, you are actually adjusting the level though a logrithmetic curve that is built right into the potentiometer. A logrithmetic curve also an exponential factor, albeit a factor of 10.

It would be a matter of someone producing/finding a potentiometer with the proper curve to fit the "squared" function.

And, you wouldn't have to do it separately for every engine to fit that engine to take advantage of the linear relationship. If your current power pack goes up to 24 volts and you would burn your engine out at 20 volts, would you turn it all the way up or use discression? Same thing here, except the dial-to-speed stays linear across the face of the dial, or at least much more so than using a simple linear relationship.

Also consider that people will pay >$500 for an analog BridgeWorks power supply where something like this could be included at nominal cost even if implemented with digital assist.


----------



## East Broad Top (Dec 29, 2007)

The linear relationship between the physical position of the throttle to voltage is easy enough to accomplish, certainly. (I'd probably use a microprocessor as opposed to a logarithmic pot, since it's customizable.) I don't know if that by itself would be "revolutionary" enough. I don't know that most people are that "dialed in" to the change in speed of their train in proportion to the position of the knob to where they give it much thought beyond not going "too fast." 

The strength of such a system would be in tailoring the 0 - 10 throttle scale to match the prototypical speed range of whatever locomotive you're running. I can see a system where you slowly increase the throttle until the locomotive begins to move, then hit a "set start" button. This would then assign that start voltage to "1" on the throttle. Then you increase the throttle until the locomotive is traveling at what you would consider its maximum prototypical speed. Then you'd hit the "set max" button. That would assign that voltage to the "10" position on the throttle. Bring the throttle back to zero, hit the "apply settings" button, and you're now off and running with a speed scale tailored to that locomotive spread over a 0 - 10 scale. 

You could then "save" each of these settings into a memory, indexed by road number or whatever for easy recall. 

The one thing you probably couldn't do would be to assign a specific scale mph reading to a throttle position, since the locomotive's speed at a given voltage will vary based on load. But at the very least, you've got a generally-prototypical speed range dialed in, and you can safely hand the throttle to someone who might otherwise suffer from Lionelitis and know your locomotive will not be flying off the rails. 

Later,

K


----------



## DKRickman (Mar 25, 2008)

Greg Elmassian said:


> Get DCC or run MTH DCS.


I have to agree. I suggest that it is far more practical to have each locomotive respond in a linear fashion to a non-linear throttle control, instead of the other way around. For one thing, all the parts are already on the market and designed for model railroad use, complete with manufacturer and community support. For another, making a linear throttle (I'm referring to the user interface, not the power supply) which is properly tuned for every locomotive would be a major undertaking. Not only does each locomotive respond differently, but they will also respond differently in different conditions - load, temperature, etc. DCC with BEMF takes care of all of that.

While I use and like DCC (indoors, in HO in my case), I am not one of those who insists that it is the end-all/be-all and that everyone should use it. However, given your stated desire (simple, intuitive, linear throttle control) DCC seems to be the best way to get there today.


----------



## toddalin (Jan 4, 2008)

Greg Elmassian said:


> Get DCC or run MTH DCS.


 
Sure, because this is so much simpler than just turning a potentiometer 

*Speed Tables*


With that, I decided to work on the speed tables first. My command stations use 128 steps, and my decoders are all set to 28/128 speed step operation, so I’ll be using the “advanced” table in the Digitrax decoders, CVs 66 through 95. This is an implementation of the table described in the NMRA’s RP 9.2.2., and consists of 28 individual steps, plus two “trim” CVs (66 and 95) used as multipliers for forward and reverse, and another (CV65) used to “kick start” a stationary train. The multipliers default to 128 (0x80), which is 100% per the Digitrax documentation, so I don’t need to change those. The table itself is scaled from 3% to 98% in even steps of about 3.5% by default (values 8 to 251).

Note: the NMRA didn’t say what the values in the speed table’s various CVs mean specifically (correction: oh yes they did), so what works for Digitrax won’t necessarily work for anyone else. Some adjustment is likely. However, that’s always going to be the case for any new decoder, as the behavior of the model depends on the specifics of the motor and drive train, which is likely to vary even between “identical” models.

My goal with speed tables is to have the throttle setting on my DT400 throttles relate to the scale speed of the train in some predictable manner. I may use two different scales: one for narrow-gauge trains limited to 130 kph, and another for the Shinkansen and high-speed narrow-gauge trains. To do that, I’ll have to allow for the fact that the throttle setting displayed is a 0-99 scale, but the throttle value (“speed step” to be formal) sent to the decoder is a 0-127 scale, and the two are roughly linearly related by default (so 99 equals 127, and 50 equals 65, which I learned using JMRI to monitor commands sent on the LocoNet as I adjusted the throttle).

For EMUs, I’ll either have 99 mean top speed for that model of locomotive (e.g., 95 kph for the DE10), or I’ll have it mean 130 kph as the top speed of the class. The latter has the benefit that all of the EMUs (except for a couple of high-speed models, and the Shinkansen) would use the same scale. I haven’t yet decided if I want a linear scale (e.g., if 99 = 130 kph, then 50 = 65 kph) or if I want to have a wider scale at the low end (e.g., use 0-80 on the throttle to mean 0-50 kph or so, so I have finer grain control at lower speeds). More thought is needed on that before I get to final programming although I’ve summarized my current rough plan below.



*Calibration*


I also need to figure out how a throttle setting sent to the decoder gets mapped by the speed table into a locomotive speed. This is going to vary for each train, or at least each class of train, due to motor and gearing differences. But once I work out a system for calibrating the scale, it should be fairly easy to adjust from one loco or EMU motor-car to the next. So, what do I need to set the speed table to, for “99” on the throttle, or “127” on LocoNet, to equate to a specific top speed like 95 kph? 

I started with the DE10, and set it on the Bachrus speedometer cradle to see what 100% equated to, before enabling the table. Unfortunately, the DE10 is just too light for the speedometer to work reliably at high speeds, and the wheel kept losing contact, causing erratic and too-low readings. I eventually gave up, and put the loco on my test track loop. 

On the test track, which is 2,268mm long, I ran the loco at top speed and timed one loop with a stopwatch, calculating scale meters/second, and then converting that to scale kph. Run at maximum throttle on my Zephyr (which equated to a throttle setting of 126 being sent to the decoder; apparently my Zephyr won’t send 127). This came out to around 250 scale kph, just slightly fast for a locomotive with a prototypical top speed of 95 kph! 

I set the speed table to a value that I thought would proportionally get me close to 95 kph. When you lower the top slider, it lowers all of the ones below it to be no higher, so I ended up with half the throttle’s range set identically, which made testing easy. Unfortunately it was still way too fast (loco speed doesn’t appear to be linear with the decoder settings). Much experimentation later, and I discovered that a setting of 61 (out of 255) gave me a speed of 93.9 kph, while 65 gave me 98.5 kph, so the ideal setting would be close to 63, except that JMRI’s slider wouldn’t let me set that value.









JMRI Panel with Speed Table Setting used to test maximum speed (capped at 126/255 in this example)



*Track Voltage*


While I was doing that, it struck me that what the decoder is doing is letting through a percentage of track voltage (yes, that would have been obvious if I thought of it, but I had my mind on other aspects). Now that’s nominally 12 volts, but it’s going to vary, perhaps by as much as 20% due to loss in wiring and track joiners, so I’m never going to be very precise here. I’d like to aim to be within a few scale kph in my configurations, so trains on adjacent tracks set to the same “speed” will actually be going close to the same speed. But even if all my trains are set to 100 kph +/- 2 kph, in reality they could be going anywhere from 80 to 100 kph by the time I allow for variable loss in the track voltage.

And while thinking about that, it struck me that my bench system is a Zephyr that puts out ~13.9 V DCC, while my layout uses a more precisely adjusted DCS100, that’s putting out a real 12.0 V DCC (both of those drop under load). That could introduce a 15% speed reduction from bench to layout, even before allowing for track loss.

So I took my train, going its scale 93.9 kph at what turned out to be 13.7 V DCC, and ran it around the layout, averaging 59.3 scale kph in one loop at full throttle. That was a 37% reduction, which was rather dishearteningly large. I suspect the problem is a combination of more variation in track voltage on the layout than on the short, and very clean, test track, plus non-linearity in the motor itself. In short, 24% of something 1-2 volts less than 12 volts, is probably turning the motor significantly slower under load than 24% of ~13.7 volts. It could actually be linear, if my track voltage is around 10 volts, but I didn’t think it was that bad. Later testing convinced me that motor behavior follows the speed table settings fairly linearly, so I’m less certain why there’s such a large change going from 13.7V to ~11V.

Similarly, I ran my Chūō E233, and found that on the Zephyr the default top speed was a scale 249 kph. With speed table enabled, and top speed limited to 102/255, the top speed on the Zephyr test track was a scale 158 kph. On the layout it was a scale 104 kph, although there were a couple of spots where it slowed down (the DE10 didn’t have this problem, so I’m unsure of the cause, but the E233 seems to have less reliable electrical pick-up).

What this means is that I’m going to have to use the actual layout to calibrate my decoder’s speed settings. That’s a nuisance, not least because it takes a very long time for a train to make a loop at prototypical speeds: the outer loop of the layout is 8,527mm long, which in 1:150 scale is 1.28 scale km of track, or for a Shinkansen in 1:160 scale that would be 1.36 km. A commuter train going 110 scale kph takes about 42 seconds for a full loop. It also suggests that I’m better off with a linear scale, since I’ll need to calibrate fewer speed settings per train (maybe 1/4, 1/2, 3/4 and full).

Before I make a final decision there are two more things I need to check out: how properly-calibrated BEMF affects this, if at all, and how much variation there is between the DE10 and one of my EM13-equipped EMUs.



*Load and BEMF*


One problem with the speedometer-based testing, and one advantage of test-track testing, is that speed could vary depending on the load, and the load depends on the other cars in the train. A “light” engine with no cars will move faster than one pulling a twenty-car freight, and similarly an EMU with ten cars is going to behave differently from the motor car alone. To really get throttle to equate to speed, I probably need to test using a “typical” size train. Or at least, that’s my theory.

(comment: some of the following description of how BEMF works is wrong, see the BEMF page for a corrected description)

Back-EMF is a decoder feature that adjusts the voltage sent to the motor as the demand varies with a constant throttle setting, to try to maintain the motor at a constant speed. It’s basically sensing an indicator of the motor load (the current drawn by the motor) and using that to provide more voltage when the motor is under heavier load, as it is when starting or climbing a grade). Enabling BEMF will interact with load, so I’m going to need to work on the BEMF testing using a similarly “typical” train to start, although if it works as promised a light engine and a loaded one should run at the same speed for a given throttle setting (on the same track voltage).

In most decoders, the BEMF control algorithm needs to be calibrated to the specific model of train, which is something of a trial-and-error procedure. I’ve written it up on a BEMF page, so I won’t repeat the details here. I’m going to start with the speed table set to be a linear table from zero to a scale 120 kph (measured on the layout). Then I’ll adjust BEMF as per the directions, and see if taking away the rest of the train has any effect on speed. I’m rather hoping it doesn’t, as that will allow me to re-calibrate BEMF and the speed-tables independently of each other.

And that’s likely to be important for some trains, as BEMF for trains run in a consist can require a different set of settings from BEMF for trains run independently (because the two motors fight against each other and can confuse each other’s control algorithms). And a couple of my 10+5 sets will run in a consist since they have two motor cars in the train.

Note: the TCS M1 decoder’s BEMF is self-calibrating, which would be nice, except that given what I know about the complexities of the algorithm involved, I don’t think it can be effectively self-calibrating for all trains. And with no way to override the self-calibration, I’d be left with the choice of turning it off if it misbehaves. Some of my planned decoder testing is to see if I do have any problems with the M1.



*Calibration II*


So, I need to test under load, on the layout, and with BEMF enabled and tuned. So first, the train goes on the test track and gets BEMF tuned both alone and with a prototypical string of cars. This immediately ran into a hitch: configuring BEMF is, per Digitrax, a trial-end-error process where you enable it (via CV57, although by default it’s already enabled) and then adjust first CV57 up from 128 until “surging” occurs, then adjust CV56 up from 48 until “oscillation” occurs. I got both of them to 255 without seeing any problems. I’m fairly sure it was configured properly, and it may just be that the DE10 is too light, free-running, and responsive to have any problems with the servo loop.

I need to configure it with a load, but the DE10 presently lacks couplers, so I set up the Chūō E233 and ran it to see how a ten-car EMU reacts. Oddly, it ran just the same as the DE10 in the sense that I couldn’t get BEMF to misbehave, and wound up with both CVs set to 255. On the other hand, running it on the track it clearly slowed on hills, so CV55=6 is too low. But Digitrax says to adjust that one last. That’s where I am at present: preparing to experiment with BEMF settings. I have a provisional speed table that lets the E233 run at realistic speeds, although it’s not a final speed table by any means.









E233 Speed Table for Testing BEMF (112/255 equates to ~120 scale kph on my 12V layout)



*Interesting Speeds*


So what speeds matter in a speed table? That’s going to depend on the trains being run, and the rules of operation that apply to them (e.g., what does “slow” or “restricted” speed mean for a given type of train). Here’s a list of some typical values for Japanese trains:

Shinkansen-only:
- 320 kph: Newer Shinkansen top speed (my E5, among others)
- 300 kph: Top speed of the 500 Series, often limited to less
- 275 kph: Top speed of many Shinkansen
- 240 kph: Top speed of older Shinkansen, such as the E4

There are a couple of other speeds (e.g., 260, 265) I’m omitting from this list since they’re so close to other speeds.

All Trains:
- 160 kph: Top speed of some narrow-gauge trains
- 130 kph: Top speed of Mini-Shinkansen on converted lines, and many other trains
- 120 kph: Top speed on many commuter lines
- 110 kph: Top speed for “Class A” express freight and many commuter trains
- 95 kph: Top speed for “Class B” express freight
- 75 kph: Top speed for “Class A” dedicated freight, and “Reduced Speed” per signal
- 50 kph: Approximate meaning of “Caution” indication on signals
- 25 kph: Approximate meaning of “Restricted” indication on signals

Signals can mean different speeds on different lines or railroads, so the above is rounded somewhat.

The other factor is that Shinkansen are 1:160 scale, but all of my other trains are 1:150 scale. So do I use the lower settings for 1:150 scale speeds for all trains, so a Shinkansen will run at the same “restricted” speed as a commuter train, from the perspective of the observer? Or do I ignore the problem since the variation is within my error range at low speeds, and just set the Shinkansen using 1:160 so the top speed is correct for the scale of the model?

And I have a dozen speeds, but many of my trains will only need to run at the lowest four or five of these. I’m tempted to divide my 0-99 scale up using a simple (and somewhat approximate) “divide by two” approach for the bottom 8 values (with individual trains limited to their maximum). This would mean my DE10 would hit 95 kph at “47” and not go any faster at higher settings, giving up half the range. But my M250 would hit 130 at “65” before reaching it’s limit, and a throttle of “80” would mean 160 kph (but would mainly be used by Shinkansen). All trains would then react to a “caution” signal with a throttle setting of “25” (50 scale kph). Above the “80” (160 scale kph) setting, the scale could be linear up to the maximum for the train (so “99” would make the E5 go 320 scale kph, and the 500 Series go 300 scale kph, but it would still make the DE10 go just 95 kph).

One variant of that would be to make “90” equate to 275 kph (since it’s so common as a line maximum), with a linear scale below it and a different linear scale above it to the train’s maximum.

I need to think on that some more before I program the final speed tables, but that’s how my thoughts are shaping at present.


----------



## Greg Elmassian (Jan 3, 2008)

I just use 128 speed step mode, and calibrate each loco to match scale speed to the speed step. speed step 1 with 1 smph is slow enough for me.

Yes, many of my locos will not go 126 smph (128 speed steps are 0 through 126, 127 is reserved), but so what, in fact I set my custom speed tables to "stop" at the prototypical top speed...

So on my layout, if you look at your throttle and it says 37, then it's a pretty good bet that the train is going almost exactly 37 scale miles per hour.

I have digital speedometer designed by Dave Bodnar, and it has a "hoop" that will sit astride the tracks for measuring speed, and also a wireless module that rides in a hopper car that gives real time speed readout wirelessly.

Greg

(many of us have been doing this and have gone through the motions and done the above years ago, but it's nice to see it written up... just as long as you don't claim to have invented the procedure ;-)


----------



## Torby (Jan 2, 2008)

Perhaps easier to achieve would be to feed back the loco speed and have the receiver regulate that rather than the voltage to the motor. Oh wait, don't some systems do that?


----------



## Greg Elmassian (Jan 3, 2008)

See post #5


----------

