Quote:
Originally Posted by Tom Line
I wanted to sum this information up for some of the team members (since a couple of the kids on my team didn't understand a lot of things in this post).
First - the getrate implementation (at least in labview) oscillates because it has a very short time period. To obtain a more stable rate, you canput the calculation function in periodic tasks and run it at its own loop speed.
|
...or you could set the encoder to 1x, if you haven't done so already
Quote:
This function should be:
(current encoder count - past encoder count) / loop time = count rate
To smooth this rate further, you can average the samples over several loops, or you can extend the time (calculate the count over 2 or three loops and the time over 2 or three loops). Both may give you somewhat delayed results, depending on your loop rate.
|
I think taking readings every execution cycle and filtering them would be a better solution than taking readings only every n
th cycle. Can anyone comment on that?
I believe what Jared showed was that you need to accumulate the output of the PID.