|
Re: High speed encoder with slotted / flat end... can't find one.
we have our shooter logic in a 10 ms timed loop (not a waited loop).
We calculate the rate based on 3 loops worth of data. Each loop we drop the oldest data point and add a new one.
Then we average those 3 loops of data and send that into our velocity PID as our actual speed.
(I suppose, looking at this now, we really should just be looking at the rate over 9 loops or 90ms, and get rid of the average. It's a bit redundent.
For our 'enable to shoot' logic, we use an 8 sample average of rate fed into an IIR filter with a .5 constant.
Please, feel free to tell us what we can improve =). I'm an mechanical engineer masquerading as a controls engineer, and systems engineering was always one of my most hated classes :lol:
|