I thank all who responded to my orig note on this subject. Some of it's a bit deep for me, however, I see in some ideas where generating an error causes the error to go away, whereby there is no error to drive the motor. That is, I would think, a positional device, such as an elevator on a model aircraft. What I trying to do is, set a speed for a motor to run at. Drive the motor with PWM. Compare the motor's actual speed with my setting speed, and if there is an error, change the PWM until there is no error between setting ans actual. One further problem is this darn thing has to be set over a fairly wide range, say a low figure to say ten or twenty times that (e.g. 10 rpm to 200 rpm, which I am achieving now with the set PWM and hope motor runs true to the PWM, which, of course, according to the Laws of the Charters Towers Jocky Club - it doesn't!) What about if, say, the PWM 'setting' is 1000. The 'actual' motor speed 900. (Derived from a speed sensor of immaterial description) Subtract the 'actual' from the 'setting', and, if a negative result, add to the result to the PWM register, or if a positive result, subtract it from the PWM register. (In either case, leave the 'setting' unchanged, and just add to the PWM register, so the next comparison will be made with the 'setting' figure, not the actual PWM register) So, in example, 1000 - 900 = 100. Add to PWM register, which becomes 1100. The motor speeds up, perhaps miraculously to 1000. Then, at next comparison, 1000 minus 1000 = 0. Add 0 to the PWM register and nothing changes, motor continues to run at 1000! Change the setting, or the motor changes, and it will compensate. Won't it?????? It might oscillate a bit, but maybe not much. Regards Howard -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics