I was using my picaxe-based PWM contoller {see (old) thread here https://www.009society.com/forum/index.php?topic=1156.0 (https://www.009society.com/forum/index.php?topic=1156.0)) at the Oxford Group's open day in June 2024. I noticed that with "new" chassis, the locos got up to a useful (slow – "scale") speed with a lot fewer "clicks" of the encoder than the older chassis. This meant that I could not control the newer locos as easily as the older ones.
I originally programmed the controller so that the pulse repetition rate was 50 micro seconds (i.e. 20kHz) and the pulse width changed in 1.25 micro second steps.
Using the locos I had out on the day, I counted the number of steps required for each to reach the same subjective (slowish) speed and found that whereas locos on older type chassis required up to 10 or more steps, newer chassis (such as the Kato 11-109 and the chassis for the Kato/Peco small England) required only around 5.
I wondered if I could program the chip to make smaller step changes at the start and increase the step size as the pulses get wider. I discussed the problem with Stephen Rainsbury, who suggested using a look-up table.
And so I did. I messed around with a spreadsheet to find a suitable "transfer curve" relating step number to pulse width. The chart compares the old (linear) version with the new version. I programmed a spare picaxe chip and exchanged it in the controller. A check using my oscilloscope showed that it worked as expected. A test on the test track also showed greater control with the newer chassis.
pwmchartm.png
That's an interesting line of development Hugh (the discussion on the SIG was good too!)
A similar situation exists with radio controlled models. In the early days there were simple "rate" switches that did more or less the equivalent to varying the maximum voltage for the full range of the speed control knob (e.g. full throttle is switchable between say 12 V and 9 V).
There are now also things like "expo" (exponential transfer function) which looks similar to what you have and there are also other programmable speed curves.
I think there is something similar in DCC decoders where the speed steps can have a 'curve' applied to them.