View Single Post
  #48   Spotlight this post!  
Unread 22-02-2012, 20:39
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Speed PID Function

Quote:
Originally Posted by Ether View Post
Are you suggesting that round-off errors using double precision floats cause instability if using RPM?


Perhaps, wrong choice of words. Consider this: if the system can, in fact, go up to 1000 RPM, the initial error when starting up from rest is 1000 RPM. In order for you to get the appropriate output from -1 to 1, your P constant will need to be about 0.0001. Now, that is not accurate at all, but trying to demonstrate that the constant will need to be tiny. But if that same system was measured in FPS (You are using RPM to derive this, so it will be the same accuracy as measurement), you will only be getting FPS up to 14 FPS at most. You have less of a range to work with, so the P can be about 0.1 instead. I was just pointing that out because his picture showed the P to be 0.3, which is way too big for a system measured in RPM. Just tuning it would be easier and I doubt the round off will have much errors using doubles.

Of course, always check your inputs and outputs to be in range.
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.