Hi, I'd like to adjust the three K values for a self-balance robot using onboard, potentiometers. The pots would be the clicker-type, probably with ten click-steps.
Do the K values need more than a 10-step range of adjustment?
I think most PiD code uses doubles not integers, do they run from 1.1 to 1.9 or are they a wider range of values such as from 1.1 to 20.9?
If Pid K-values are a very wide range, then a potentiometer probably isn't the most accurate way of manually adjusting. If that's the case I'll try sending typed-in values on the fly.
You will need some experimenting...
The value of K may be any value... but if you do an analog read, your reading will be in range 0-1023.
If you send out a pwm, your output will in between 0-255. If both are true, a first guess for K would be in the range 0.1 till 1...
Yes, I wasn't sure if a linear analogue pot would be difficult to keep track of how far I'd turned it so I'd have an idea of what the ideal setting value would be.