Is the linear speed characteristic really linear?

Post all your DCC only problems, solutions and discoverys here.
Post Reply
Bramshot
Posts: 205
Joined: Thu Jul 07, 2016 6:55 pm

Is the linear speed characteristic really linear?

Post by Bramshot »

Hi
I have been trying to set up my decoders (various types) and Rocrail software so that I can set loco speeds as opposed to percentages.
To do this I need to run the loco at full speed at 126 speed steps and as determined by CV5 ( or other method for some decoders), measure it’s equivalent speed by timing over a known distance and applying the scale factor, then tell Rocrail what that value is. Assuming a linear speed curve is set, Rocrail does the sums and you can set a loco speed in mph. However, it is way off. I checked the linearity by setting at half speed (63 steps, according to Dynamis Ultima system) and sure enough, the loco turns out to be running much faster than 50% of the maximum speed. Where applicable, I have set the value of CV 6 ( Vmid, although for some reason the Dynamis thinks it is called Vlo) to the mid value between CV2 and CV5, so it should be a linear characteristic.
Am I doing something wrong or are the speed characteristics really that non- linear.
RAF96
Posts: 830
Joined: Tue Feb 19, 2008 1:39 pm
Location: Dereham, Norfolk, UK
Contact:

Re: Is the linear speed characteristic really linear?

Post by RAF96 »

Have a look at Decoder-Pro package which is part of the JMRI download.
This allows you to adjust the curve according to number of speed steps set by way of sliders (muchlike a music graphic equalizer).
Rob
RAF Halton Brat - 96th Entry
http://www.halton96th.org.uk/robs_rails.html
β-tester
User avatar
Bufferstop
Posts: 13795
Joined: Thu Mar 11, 2010 12:06 pm
Location: Bottom end of N. Warks line

Re: Is the linear speed characteristic really linear?

Post by Bufferstop »

Don't forget what you are controlling is an analogue value and the relationship between voltage applied and motor speed isn't linear, if your chip controls the motor by pulse width modulation (PWM) the relationship between control steps and applied voltage won't be linear either. Unless you have degree level maths and access to something better than a PC it's easier to find the right speed curve by trial and error. It may be different even for outwardly identical motors.
Growing old, can't avoid it. Growing up, forget it!
My Layout, My Workbench Blog and My Opinions
Bigmet
Posts: 10191
Joined: Tue Aug 14, 2007 2:19 pm

Re: Is the linear speed characteristic really linear?

Post by Bigmet »

It would be something of a freak result if you got a linear outcome. Both the speed curve(s) of the decoder and the motor response to the decoder's output are variables, and both can be significantly non-linear.

Obviously there are software products to support obtaining a linear response (or anything else desired) but it is perfectly possible by mk 1 human brain too.

For the purposes of set up work in 28 speed steps because that's all current decoder's have (126 steps are interpolated from the 28 step table, taken care of by the DCC system).
Set CV2 to a value for the 'dead slow' speed desired.
Set CV5 to the timed maximum scale speed desired.
Set CV6 (mid value) at the midpoint between the CV2 and CV5 values, and assess scale speed at step 14. Adjust CV6 iteratively as required until half the CV5 speed is achieved. Then assess linearity; 'quick and dirty' check is to try the quarter points, step 7 and step 21: if these are respectively a quarter and three quarters the maximum speed you have a pretty linear result.

Personally I don't generally use a linear characteristic (other than on my class 08 shunters where every step approximates scale 0.7mph, so that full speed scales 20mph at speed step 28). But the same technique can be used to match non linear speed curves, by making a decision on what proportion of full speed the model should reach at step 14, and matching values at the quarter points: on the basis that acceleration should be much brisker at low speeds, very extended at high speed. I have all the locos on the layout speed and acceleration matched in four operational groups: express, mixed traffic, freight and shunter, so that they operate consistently.

On two RTR models (out of 80) I have had to write custom speed curves due to unusually non linear motor response, which I could not 'bend to my will' by using the speed curve(s) available on the decoders. It was definitely the motors, as both were in models of which I had more than one example, and swapping motors between mechanisms the very non linear response 'travelled' with the motors concerned.
User avatar
Bufferstop
Posts: 13795
Joined: Thu Mar 11, 2010 12:06 pm
Location: Bottom end of N. Warks line

Re: Is the linear speed characteristic really linear?

Post by Bufferstop »

A modelshop I used to frequent sold slot racing motors, the boxes of quite a few had been opened. They had been rejected by members of the slot racing club. The owner was quite happy to sell them and they seemed to be perfectly good double ended motors. Apparently they were hand wound, and the packing slip carried a number for whoever had assembled it. They reckoned that one particular numbered ones were always slower than the others! Probably an urban myth that had spread through the slot racing community, but there was possibly a grain of truth in it.
Growing old, can't avoid it. Growing up, forget it!
My Layout, My Workbench Blog and My Opinions
Bramshot
Posts: 205
Joined: Thu Jul 07, 2016 6:55 pm

Re: Is the linear speed characteristic really linear?

Post by Bramshot »

Thanks for the replies guys.
The notion that the speed curves ( which ought to mean final loco speed as we have no control over any of the other factors that have been mentioned ) are in any way accurate is complete b*******x then. So what is the point of offering them?
I would have thought that the design of the decoder would take PWM effects into account and they would be compensated for to make a linearised output. Silly me, it seems!

I haven’t learned yet how to put multiple quotes in, but here’s my response to some of the points raised;

Bufferstop, I believe that the no load speed of a dc permanent magnet motor is fairly linear with applied voltage. I guess what comes out at the wheels depends on the loading vs the load capability of the motor.

Bigmet, regarding the 28 steps of decoders, are you saying that the interpolation occurs in the dcc controller? I am not sure this is correct as if there are only 28 steps in the decoder, (which I do not contest), there is no code that the dcc controller can send to make the decoder provide an interpolated output, it would only understand 0 - 28, or should that be 0 to 27. I think the interpolation must be done in the decoder. Not that this has any bearing on the issue at hand!

Bigmet, I followed the same procedure that you advised, except that I did not use the 28 steps and it did not work very well. In fact, while changing CV6 to tweak the mid range speed, 85 (the halfway value) was too slow, 100 was a tad fast, but 98 was hugely slower than 100,so there is something very non-linear going on somewhere. Maybe the interpolation doesn’t work too well. I will try it at 28 steps to see what happens. Do you then have to run the decoder as a 28 step one, or can you still use 128?
Another problem is that not all decoders use the same instruction set. I have some of the old type Bachmann ones, with blue shrink fit sleeve, which I think were by Soundtraxx, and they don’t use CV6 at all. If you want to tweak a linear characteristic you have to select the linear one from the family of curves and then use CV’s 66 and 95, if I remember correctly, to scale the top end in forward and reverse, they do not use a mid range value at all. Needless to say, this was all very non- linear.
I have yet to try it with the current Bachmann (Zimo) decoder that I have several of.
I could well try the user programmable curve but not all my decoders support that, either.
User avatar
Bufferstop
Posts: 13795
Joined: Thu Mar 11, 2010 12:06 pm
Location: Bottom end of N. Warks line

Re: Is the linear speed characteristic really linear?

Post by Bufferstop »

Bramshot wrote:.
Bufferstop, I believe that the no load speed of a dc permanent magnet motor is fairly linear with applied voltage. I guess what comes out at the wheels depends on the loading vs the load capability of the motor.
Very much so. Almost all of the calculations you might be taught are for a "perfect" theoretical motor, and supply. As the supply voltage rises, initially the motor does not start to turn, so the current that flows is determined by ohms law (that's linear) but the current flowing creates it's own magnetic field, which interacts with the surrounding field. The magnetic attraction/repulsion is subject to the inverse square law which is definitely not linear. Once the voltage is great enough, that the current generates enough force (the Elctro-motive force, EMF) to overcome friction and inertia the motor starts to turn. Because the motors coils are in the surrounding magnetic field they behave like a dynamo and generate a voltage which is of opposite polarity to the applied voltage, and opposes the voltage driving the motor, (this is the Back EMF) up to the point where the loss in current flow would start to slow down the motor. Which would cause a reduction in the back EMF and so the speed would rise. This results in a balanced state where the motor turns at more or less constant speed. In this condition with no load you get the linear voltage/speed curve, each change in applied voltage causing the motor to find a new balancing point between applied and back EMF.

Unfortunately, for any calculations, if you are still with me, there is never "no load" situation. The friction and inertia within the motor are a load to start with. We never operate our motors with no mechanical load attached, and our power supplies/controllers don't just dish out as much current as the motor will take. As a minimum they have their own internal resistance to overcome, and some sophisticated ones sense and respond to the back EMF from the motor and work with/against it usually to keep it turning at a constant speed if the load goes up.

Any apparent linearity in a controlled system will have been arrived at by trial and adjustment for a particular motor in a specific locomotive. Why provide it? The facility to "tune" the speed curve to individual loco's is far more useful than just establishing a linear response, as Bigmet outlined it allows the motor output to match the behaviour that we want, plenty of torque at low revs to get the train shifting, and if your layout has space to display it "running out of steam" as it approaches it's maximum output. Otherwise driving our trains would be like driving a modern tram, shove the handle forward and wait for it to reach the speed you want. Boring :wink:
Growing old, can't avoid it. Growing up, forget it!
My Layout, My Workbench Blog and My Opinions
Bramshot
Posts: 205
Joined: Thu Jul 07, 2016 6:55 pm

Re: Is the linear speed characteristic really linear?

Post by Bramshot »

Bufferstop, I can certainly see the point of having a user programmable curve so that you can get it the way you want it, and for the less technically minded also include a simple, ready to go scalable one, but I don’t see the point of all the other curves some decoders offer, especially when they apparently wont work the way they are ‘supposed ‘to.
Bigmet
Posts: 10191
Joined: Tue Aug 14, 2007 2:19 pm

Re: Is the linear speed characteristic really linear?

Post by Bigmet »

Bramshot wrote:Thanks for the replies guys.
...Bigmet, regarding the 28 steps of decoders, are you saying that the interpolation occurs in the dcc controller? I am not sure this is correct as if there are only 28 steps in the decoder, (which I do not contest), there is no code that the dcc controller can send to make the decoder provide an interpolated output, it would only understand 0 - 28, or should that be 0 to 27. I think the interpolation must be done in the decoder...
I didn't make a very clear job of it. The 126 speed steps require both a DCC system and decoder to have the 126 step capability. When the decoder is set (by whichever CV29 bit it is) to work in 126 step mode, the DCC system needs an entry in memory associating the decoder address with working in 126 step mode, otherwise the decoder will operate in 28 step mode. The interpolation between the 28 steps is performed in decoder.

I was recently reminded of this after resetting my command station back to factory settings, having filled up the memory with loco addresses of my own and friend's locos that I have tested and/or programmed for them. And there I was wondering why my diesels were no longer running in 126 speed step mode, until the little grey cells remembered...
RAF96
Posts: 830
Joined: Tue Feb 19, 2008 1:39 pm
Location: Dereham, Norfolk, UK
Contact:

Re: Is the linear speed characteristic really linear?

Post by RAF96 »

Bufferstop wrote:A modelshop I used to frequent sold slot racing motors, the boxes of quite a few had been opened. They had been rejected by members of the slot racing club. The owner was quite happy to sell them and they seemed to be perfectly good double ended motors. Apparently they were hand wound, and the packing slip carried a number for whoever had assembled it. They reckoned that one particular numbered ones were always slower than the others! Probably an urban myth that had spread through the slot racing community, but there was possibly a grain of truth in it.
Apologies for staying off topic for a bit longer but the subject could be read across to model railway motors - I used to rewind slot car motors in a previous life and it was part science, part art, part - 'I wonder if...'.
To get a more powerful but peaky motor it would be rewound with thicker wire and less turns. More oomph obviously meant more amps to run it.
For an easier to drive motor for the kids it was mega turns of very thin wire. Less oomph meant less amps to run it.
You can find look up tables on the inter-web showing the wire gauge to turns relationships.
See here for a How-To on rewinding basics. http://www.ncphobbies.com/rewind.html
Once rewound the armatures were bombproofed by soaking the windings in Araldite then carefully balanced on 2 razor blades.
Rob
RAF Halton Brat - 96th Entry
http://www.halton96th.org.uk/robs_rails.html
β-tester
Bramshot
Posts: 205
Joined: Thu Jul 07, 2016 6:55 pm

Re: Is the linear speed characteristic really linear?

Post by Bramshot »

I tried using the user programmable characteristic on a Zen decoder. Total disaster! The decoder will not apply acceleration or deceleration between step 0 and step 1 correctly, so there is a step change of speed at start and stop. Also, when I used a value of 1 for the first step, to try to sort this out, it takes off at full speed at that step, then reverts to the programmed values for the other steps!
I also had a play with the back emf control, as this is bound to affect linearity. All you can do with Zen is turn it off completely or select the speed at which it cuts off. In fact, I would have expected the feedback from this control to help to linearise the loco speed by taking out some of the loading variables. With back emf and the user defined curve, the loco noticeably changes speed as it goes round curves or up gradients (slows down) or down gradients (speeds up), both appearing to indicate that it isn’t actually working. It does not do this when using the standard straight line. Without it and with the user programmed linear curve the loco exhibits very non linear behaviour being faster than expected at the lower speed steps.
I have contacted DCC Concepts about this and will see what they say.
Post Reply