Trains.com

Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

28 vs. 128 speed steps

19383 views
34 replies
1 rating 2 rating 3 rating 4 rating 5 rating
  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Saturday, January 31, 2009 10:01 AM

Cal:

I understand how a decoder can interpolate.  It was an early poster's claim that the interpolation was done by the command station that I could not comprehend.

Now that I know it is, in fact, done by the decoder, I am satisfied.

 

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    March 2007
  • 38 posts
Posted by Calflash on Saturday, January 31, 2009 7:14 AM

Phoebe Vet

I did not express doubt that it was true, I asked for someone to please explain how it works.  I don't understand how the digital instruction set in the decoder can be interpolated.

I never thought about it but it makes sense and I believe it. Interpolation is similar to what your computer does when you resize a graphic esp to make it larger - it fills between "hard" (original) values with ones in between based on a formula. I don't how it works as long as it does.

 Cal

  • Member since
    December 2004
  • 9 posts
Posted by gngoatman88 on Wednesday, January 28, 2009 2:31 AM

CSX Robert is absolutely right.  Thanks for adding that info.

  • Member since
    May 2008
  • 4,612 posts
Posted by Hamltnblue on Monday, January 26, 2009 9:22 PM
The bottom line is that there are 255 "Speed Selections" that are plotted in 14, 28, or 128 Speed Steps. In these speed steps you pick numbers between 0 and 255. If you want the engines half speed to be max you set the highest step to 128. If you use momentum you get all 255 steps over time. Go half throttle with max momentum and it'll take a couple of minutes to get to the voltage representing 128. When slowing you have to plan because a zero throttle is like idling a heavy train and will take plenty of time to slow. Some have an air brake and/or dynamic brake function to simulate lifelike braking.

Springfield PA

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Monday, January 26, 2009 9:19 PM
Most of what gngoatman88 said is right on, but I would like to make a few minor corrections. The decoder can not distinguish between a 14 speed step command and a 28 speed step command, that is why there is a bit in CV29 to tell the decoder whether to expect 14 speed step commands or 28 speed step cmmands. The original 14 speed step command used four bits for the speed, one bit for direction and one bit for the headlight. The four bits would allow for 16 steps. These 16 steps included "Stop" and "Emergency Stop, " which left 14 speed steps. For the 28 speed step command, the headlight control is left out and that bit is used to double the number of speed steps(headlight control is sent in a sperate instruction). Since it looks the same as the 14 speed step command, if the decoder is setup for 14 speed steps and the command station is sending 28 speed step commands, the headlight will turn on and off as you increase or decrease the throttle. If the decoder is setup for 28 speed step commands and the command station is sending 14 speed step commands, turning the headlight on and off will not control the headlight but will slightly adjust the speed. Using five bits gives the potential for 30 speed steps(32 - "Stop" and "Emergency Stop"), but they assigned two values to "Stop" and two values to "Emergency Stop." The reason for this is so that if you send 14 speed step commands to a decoder set for 28 speed steps, the decoder will recognize the "Stop" and "Emergency Stop" commands whether the command includes headlight on or headlight off(if they had used all 30 possible speed steps, if you sent a 14 speed step command with "Stop" or "Emergency Stop" and headlight on to a decoder set for 28 speed steps, it would not stop) .

The 128 speed step command is a completely different format from the 14 and 28 speed step commands, so you don't have to set a bit to tell the decoder to expect 128 speed step commands. It uses seven bits for speed which gives 128 possible values. Subtract out "Stop" and "Emergency Stop," and that gives 126 actual speed steps. I have no idea why they call it 128 speed steps instead of 126.

  • Member since
    December 2004
  • 9 posts
Posted by gngoatman88 on Monday, January 26, 2009 7:41 PM

 Phoebe Vet:  I'm glad it made sense this time.  It looked like people were getting bogged down in bits and bytes and such rather than getting to the meat of the matter.  Sorry my earlier attempt wasn't clear.

  • Member since
    December 2004
  • 9 posts
Posted by gngoatman88 on Monday, January 26, 2009 7:35 PM

PS:  For those more technicallay advanced:  CSX Robert is correct.  There is no standard for how many bits are used to control the motor speed (voltage).  The allowable entries of 0 to 255 I mentioned are for QSI Quantum decoders.  Other decoder makers or other models can have other numbers of bits.  An 8 bit value (one byte) allows numbers from 0 to 255.  If only 4 bits are used, then the number could only be between 0 and 15 inclusive, which is why the early decoders could only have 14 speeds.  If decoder makers want to be miserly in their circuit design but still use 128 speed step mode, they can get by with one byte (8 bits) for both speed AND direction by using an 8 bit SIGNED INTEGER rather than an 8 bit POSITIVE INTEGER.  For example, the QSI uses an 8 bit POSITIVE INTEGER so can allow values between 0 and 255 for SPEED but must use another bit for DIRECTION.  But if an 8-bit SIGNED INTEGER is used, then the value can be -128 to +127 contained in those 8 bits and NO other bit is needed for DIRECTION (negative is one direction, positive the other, 0 is stop).  This is why the 128 step mode actually has only 126 steps.  Why the 14 step mode isn't 15 steps, and why the 128 step mode isn't 127 steps, I don't know.  I haven't dug into it that far.

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Monday, January 26, 2009 7:21 PM

gngoatman88 :

That was a perfectly clear explanation.

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    December 2004
  • 9 posts
Posted by gngoatman88 on Monday, January 26, 2009 7:06 PM

My explanation, although completely correct, was apparently not understood.  I am an electronics and software engineer and perhaps was too technical.  I'll try one more time.  The DCC controller (that thing your throttle plugs into), sends out SPEED INSTRUCTIONS to the decoder.  It can send out 3 different kinds of speed instructions.  One kind is for 14 speed steps, one kind is for 28 speed steps, and one kind is for 128 speed steps.  Each kind has its own format, so the decoder knows by the instruction format which kind of speed instruction it is getting.

The decoder has a SPEED TABLE.  The speed table contains 28 "spots" corresponding to 28 speed steps.  Each spot can be assigned a number between 0 and 255 inclusive.   Once each of the 28 spots (speed steps) is filled with a number between 0 and 255, you now have a complete SPEED TABLE.  If you were to plot out the speed step (1 to 28) versus the data entered for each step (a value between 0 and 255), you would have the SPEED CURVE.  It is simply a connect the dots of speed step versus speed table entry.

How the decoder sets the speed of the motor is:  It receives a SPEED INSTRUCTION from the DCC command station.  The speed instruction tells the decoder what the SPEED STEP is and whether it is to be interpreted as a 14 step speed instruction, a 28 step speed instruction, or a 128 step speed instruction (by way of what format it is in).  If the speed step instruction is of the 28 step kind (this is the simplest case), the decoder looks up the step number in the SPEED TABLE directly (because it has 28 entries, one for each speed step) and there it finds a number between 0 and 255 (that had already been put in the speed table as explained above).  It outputs THAT NUMBER (between 0 and 255) to the speed control circuits.  The speed control circuits DO NOT CARE what the speed step is, they only care what the number is from the SPEED TABLE (a number between 0 and 255), which happens to correspond to the table entry for that speed step.  The circuits that control the motor voltage (ie, speed) are NOT controlled directly by the speed step, but rather by the entry in the speed step table in the "spot" for that speed step.

If a 14 step speed instruction is received, the decoder uses EVERY OTHER "spot" in the speed table to determine what number to send to the speed control circuits.  If a 128 step speed instruction is received, the decoder "fills the gaps" between speed table entries by interpolating between the values in the speed table.  Between this explanation and my prior attempt, I hope you all can understand how this works.  If not, I'm done trying.

  • Member since
    February 2002
  • From: Reading, PA
  • 30,002 posts
Posted by rrinker on Friday, January 23, 2009 9:07 PM

ESU and CT Elektronik talk about '10 bit technology' which infers that the motor is driven with a total of 1024 discrete values - 2^10 = 1024. I would also guess that with at least SOME momentum, you could signal the decoder with 14 speed steps and it still would smoothly ramp up speed as it supplied those interpolated values rather than just jumping from one to the next.

                                       --Randy


Modeling the Reading Railroad in the 1950's

 

Visit my web site at www.readingeastpenn.com for construction updates, DCC Info, and more.

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Friday, January 23, 2009 4:58 PM

Sorry, I had a brain cramp.  A byte is, of course 8 bits, not 4.  My digital education took place in the '60s, and old human brains occasionally have their programming corrupted.

This thread has probably gone beyond many people's ability to comprehend, but I was fascinated by one of the early posts which claimed that the decoders are all 14 or 28 speed steps and that 128 is some kind of interpolation performed by the command station.  The logic seeming to be that since there is no CV setting in the decoder for 128 steps; it must not be in the decoder. Since I cannot understand how that could be done, I asked for an explanation.  Your explanation is the best I've seen so far.

 

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    December 2006
  • From: Lancaster, PA
  • 512 posts
Posted by claymore1977 on Friday, January 23, 2009 4:25 PM

 Ah ha!  A table!  Makes sense, thanks!

Dave Loman

My site: The Rusty Spike

"It's a penny for your thoughts, but you have to put your 2 cents in.... hey, someone's making a penny!"

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Friday, January 23, 2009 2:18 PM
claymore1977
but wouldn't a full Byte (8bits and 0-255) be able to handle 128 steps and still have a single bit left over?
Yes, but to store a table of 128 steps, where each entry can be a value from 0 to 255, would take 128 bytes.
  • Member since
    December 2006
  • From: Lancaster, PA
  • 512 posts
Posted by claymore1977 on Friday, January 23, 2009 1:08 PM

@CSX:

I am no DCC expert, but wouldn't a full Byte (8bits and 0-255) be able to handle 128 steps and still have a single bit left over?  I don't get the 128 steps == 128bytes... especially if all the decoder is going to do is shove the 7 bits into a 7bit DAC and then run the PWM for the motor....

BTW, this is an honest curiosity question... I am always looking to learn sumthin' new.

Dave Loman

My site: The Rusty Spike

"It's a penny for your thoughts, but you have to put your 2 cents in.... hey, someone's making a penny!"

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Friday, January 23, 2009 12:55 PM
The command station does not do any interpolating, it is the decoder that does the interpolating.

There is no set standard for the number of steps in the decoders output to the motor. Since most deocders let you program Vstart/Vmid/Vmax and/or a 28 step table with values from 0 to 255, it stands to reason that most decoders probably have 256 discrete steps in the output to the motor. Some MRC decoders only allow accept 0-32 for Vstart and Vmax(they don't have Vmid or a programmable speed table), so I would assume that they only have 32 discrete steps in the output to the motor, though I could be wrong. I don't know if all of them do, but at least some of the Zimo decoders have 252 steps in the output. I seem to recall seeing where some had 1024 steps in the output, but I don't remeber what brand or where I saw it(you would still only be able to set the steps in the table from 0 to 255, but when interpolating from the table to the output, the decoder would use the finer resolution).

Phoebe Vet

I keep hoping that someone who is involved in the design of decoders will chime in here and resolve this, but apparently they don't hang out in here.

A Bit = a one or a zero

A Byte is 4 Bytes  0-7

So it seems like 28 steps would require 8 Bytes and 128 would require 32 Bytes .  That's probably why they only allow you to load a 28 step custom speed curve.  But somehow it has to be interpolated into 128 steps somewhere in the decoder, not the command station, before it is output to the motor.

You totally lost me here. A byte is 8 bits. The bits of a byte are number 0-7. A byte can store a number from 0 to 255. A 28 step table would require 28 bytes, one for each step, and a 128 step table would require 128 bytes.
  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Friday, January 23, 2009 10:29 AM

I keep hoping that someone who is involved in the design of decoders will chime in here and resolve this, but apparently they don't hang out in here.

A Bit = a one or a zero

A Byte is 4 Bytes  0-7

So it seems like 28 steps would require 8 Bytes and 128 would require 32 Bytes .  That's probably why they only allow you to load a 28 step custom speed curve.  But somehow it has to be interpolated into 128 steps somewhere in the decoder, not the command station, before it is output to the motor.

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    February 2002
  • From: Mpls/St.Paul
  • 13,892 posts
Posted by wjstix on Friday, January 23, 2009 9:20 AM

I seem to remember reading that each CV actually has eight "bits" of information - I know the QSI manuals I have talk about setting CV "57.1" for example. Does that factor into this - when you do a speed curve and assign values to 28 CVs, is the decoder using some of these "bits" to fill in the gaps between each step?? Confused

Stix
  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Friday, January 23, 2009 5:45 AM

I have read that QSI manual that you are quoting.  It says that you can only make 28 entries in a custom speed curve and that the decoder interpolates to fill in the other entries in the 128 step table in the decoder. It does not say that the decoder only has a 28 step output to the motor  I think you are comparing apples to oranges.

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    December 2004
  • 9 posts
Posted by gngoatman88 on Friday, January 23, 2009 4:29 AM

Re: 28/128 speed steps --- The decoder has a speed table with one "column" being speed step 1 through 28 and a corresponding "column" containing a value between 0 and 255 for each speed step.  For example, Speed Step 1 = 0  Step 2 = 9  Step 3 = 18 ... Step 27 = 245  Step 28 = 255 is the default that QSI uses in their linear speed table.

To quote the QSI manual, "If you select 14 speed steps, every other data value is used.  If you select 128 speed steps, extra points will be interpolated between each of the 28 data points to provide a smooth curve..."

The key is that regardless of whether in 14, 28 or 128 step mode, the speed table translates Speed Steps into a value between 0 and 255 to determine motor voltage.  The "mode" just determines how many entries from the speed table are used to control motor voltage, and whether it gets that value directly from the speed table or by interpolation between values in the speed table.  Also, when in 28/128 mode, the decoder "knows" whether it is getting a 28 step speed instruction or a 128 step speed instruction by the format of the instruction and so it can determine which way to use the speed table; directly or by interpolation.

As for my opinion on 28 versus 128 steps, I switch back and forth between the two all the time, depending on what I am doing.  When I use the pushbutton to accelerate and decelerate, I tend to use the 28 step mode because I get tired of pushing the button a million times in 128 mode to speed up and slow down.  When using the knob for speed control, I tend to use the 128 steps for finer control because cranking the speed up and down with the knob is very quick, and I can control my locos to less than 1 smph per step at 128 step mode.  I'll even switch between 28 and 128 or vice-versa while the loco is at speed when the operational needs change as the train moves through the layout.  With momentum turned on, there is no jerkiness when I switch modes so I just crank the throttle up or down to get equivalent speed upon switching modes and go from there.  I don't use 14 step mode at all because it is too course.  I find there is no "best" between 28 and 128 modes, just a difference that makes things easier one way or the other depending on what you want to do.

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Monday, January 19, 2009 2:17 PM

I read that Tsunami Tech Ref.  The quote you supplied only describes the construction of a custom speed table in the decoder.  You can only program 28 points, the decoder will then interpolate the other points in between to create a smooth curve.  It's still a 128 step decoder.

The decoder is what controls the motor.  If it is going to take 128 steps to go from stop to max, it MUST be a 128 step decoder.  Therefore, I guess I don't understand what you are claiming when you say it's only a 28 step decoder that is being interpolated by the command station.  It seems more likely that it is a 128 step decoder that can accept 28 step instructions from the command station and the DECODER can interpolate it into 128.

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    May 2008
  • 4,612 posts
Posted by Hamltnblue on Monday, January 19, 2009 1:59 PM
I use 28 speed steps but also use the momentum setting. It creates a more realistic speed up and slow down. I also use the air brake settings as well as dynamic brakes along with the momentum. It adds realism and fun to running the trains. It takes some time to get used to since you have to plan ahead. At about 70% momentum the engines take about 30 to 40 feet to come to a stop from max speed.

Springfield PA

  • Member since
    February 2007
  • From: Christiana, TN
  • 2,134 posts
Posted by CSX Robert on Monday, January 19, 2009 1:16 PM

Straight from page 52 of the Tsunami Tech Reference:

The loadable speed table may be used in the 14, 28 and 128 speed step modes. When 14 speed step mode is in effect, the DSD will use a curve defined by every other speed table value starting with speed step 1.

When 28 step mode is enabled, the DSD will simply use one table value for each speed step.

When 128 step mode is enabled, the DSD will interpolate 4-5 points between each speed table entry to build a 128 point curve.

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Monday, January 19, 2009 12:41 PM

I have carefully read and understand NMRA RP 9.2.1.  I see nothing in there that says anything about interpolating other than saying that a decoder is allowed to select an intermediate speed step if it gets a speed command one bit different from the previous command thus allowing 56 steps and that speed limitations will be sent in 28 step mode.

Even your own post states that it must be a 128 speed step enabled decoder.

NMRA RP 9.2.1 seems to show 126 speed steps being sent to a 128 step decoder in an extended packet format but that no CVs need to be set to enable 128 step mode in a 28/128 step decoder.

 

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    July 2003
  • From: Sierra Vista, Arizona
  • 13,757 posts
Posted by cacole on Monday, January 19, 2009 9:34 AM

 The NMRA RP 9.2.1 that I referenced explains in nitty-gritty detail how it is done.

The following is a very simplified explanation extracted from the CVP Products' EasyDCC Manual dated 2001:

EasyDCC provides three options available for the number of transmitted speed steps sent to a locomotive decoder.  The 14 and 28 speed step options require programming changes to the locomotive decoder.  The third does not involve the decoder (other than it must support 128 step mode) and is an option in the Command Station setup.

Decoders offer either 14 or 28 speed steps as their baseline option.  You select this option by programming the decoder on the programming track.  

For decoders that support 128 speed steps, no change to the decoder programming is needed.  You simply change the format of the track signal packet at the Command Station.  The 128 speed step packet overrides the baseline setting.

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Monday, January 19, 2009 9:00 AM

I did not express doubt that it was true, I asked for someone to please explain how it works.  I don't understand how the digital instruction set in the decoder can be interpolated.

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    July 2003
  • From: Sierra Vista, Arizona
  • 13,757 posts
Posted by cacole on Monday, January 19, 2009 8:52 AM

Phoebe Vet

In my never ending quest for knowledge and inspired by my desire to understand all things, I would like someone to explain how the DCC system can interpolate 128 speeds from a 28 speed decoder. 

 

Read the documentation that comes with any brand of decoder.  They have only a 28 speed step built-in or user created speed table, not 128.  If the documentation goes into minute detail, it will say something to the effect, "128 speed step interpolated from 28 speed step table."

Also study NMRA DCC Recommended Practice 9.2.1.

 

  • Member since
    September 2007
  • From: Charlotte, NC
  • 6,099 posts
Posted by Phoebe Vet on Saturday, January 17, 2009 7:55 AM

cacole

Decoders themselves have only 28 speed steps.  128 speeds steps is controlled by the DCC system and is merely extrapolated from the 28 speeds that are actually programmed into the decoder.

 

In my never ending quest for knowledge and inspired by my desire to understand all things, I would like someone to explain how the DCC system can interpolate 128 speeds from a 28 speed decoder. 

Dave

Lackawanna Route of the Phoebe Snow

  • Member since
    July 2008
  • 1,206 posts
Posted by mfm37 on Saturday, January 17, 2009 5:44 AM

 I think the confusion may be in the terminology. There's 28 speed steps and then there is 28 step speed tables. They are different as far as decoder settings. Either way the decoder gets 28 speed changes from the command station. How it interprets them and the decoder's output to the motor depend on which method is "turned on" in CV29 of the decoder.

A programmed 28 step speed table could give better control because you will program the output of each step individually. The assumption is that the programmer can do a better job of selecting each step's setting for their own needs.
 

Just about all currently manufactured decoders use 28/128 speed steps. The decoder responds to 28 speed steps . The command station extrapolates the 28 steps to 128.
It gets more confusing when the DT400 only goes to 99. Notice the extra "click" every third digit? That's the extra step being worked in so that you are actually on speed step 128 when the throttle reads 99.

What you see on the DT400 is an option to status edit the address by pressing the  edit key. You are correct that the info is kept in the command station. That info needs to match the decoder's capabilities or settings. If the decoder is set for 14 speed steps, the address should be status edited so that the command station only sends 14 speed step commands to it.

 This actually makes the command station "backward compatible" to handle old decoders. Some of the relics were only capable of 14 speed steps (MRC) and would give erratic operation on 28/128 speed steps. Since all current decoders will handle 28/128 steps it's best to leave that "edit" key untouched.

Martin Myers 

  • Member since
    June 2004
  • From: Orig: Tyler Texas. Lived in seven countries, now live in Sundown, Louisiana
  • 25,640 posts
Posted by jeffrey-wimberly on Friday, January 16, 2009 9:46 PM

jrbernier
Give it a try, but remember that what you are reading is one persons opinion. 

Opinions are like armpits. Everybody has a couple. I'm happy leaving my decoders set to their default speed steps.

Running Bear, Sundown, Louisiana
          Joined June, 2004

Dr. Frankendiesel aka Scott Running Bear
Space Mouse for president!
15 year veteran fire fighter
Collector of Apple //e's
Running Bear Enterprises
History Channel Club life member.
beatus homo qui invenit sapientiam


Subscriber & Member Login

Login, or register today to interact in our online community, comment on articles, receive our newsletter, manage your account online and more!

Users Online

There are no community member online

Search the Community

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Model Railroader Newsletter See all
Sign up for our FREE e-newsletter and get model railroad news in your inbox!