![]() |
Re: High speed encoder with slotted / flat end... can't find one.
1 Attachment(s)
It doesn't look like it's holding the final speed very well (see portion circled in red). Do you have a screenshot with a longer time axis showing if it settles out? |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
![]() |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Tom is looking for 2% p-p (2674 to 2619). |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
![]() |
Re: High speed encoder with slotted / flat end... can't find one.
1 Attachment(s)
Quote:
Blue circle: how are you reading the encoder? Are you using WPILib's GetRate, or are you getting raw counts and dividing by the elapsed time since the last sample was taken? If the latter, are you using actual elapsed time (as measured with a microsecond timer) or are you just using the scheduled period of your sampler? If the latter, did you take any measures (like giving it a higher priority) to reduce jitter? |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
I tried both GetRate() preferred, and then the raw counts against a microsecond timer... I believe this one was the GetRate() and both tests look identical (as I did some side-by-side of both method dumps)... where GetRate() did just slightly improve... but not really significant. At slower speeds this noise was not apparent. A part of me thinks this may be a unique problem that this could be a defected encoder... but I can only speculate, and therefore I think it is good to reveal this to the group in case others may have seen something similar. |
Re: High speed encoder with slotted / flat end... can't find one.
Tom,
It sounds like now you're doing a 9 cycle moving average filter now, we found that going to a low pass filter with a gusstimated gain was superior. We had several other performance issues at that time so I can't say for sure that a moving average is poor for flywheel control, but my controls classes would make me think a low pass is far better. We also found that either running in constant time, or compensating for time in all controls calcs increased stability. "Linearizing" the victors helped us a lot too. These three rather simple changes gave us the biggest bang for our buck, and could be implemented/tested with little time/investment. A complete revamp of the control to any number of things would also work, but I aim for the lower hanging fruit. |
Re: High speed encoder with slotted / flat end... can't find one.
Could you also give us more info on your pid loop?
I see you're commanding velocity with pid, are you doing any other math or tricks? Feed forward? Are using p, i and d? There is a lot of potential for poor velocity measurement/filtering, especially when acceleration is calculated for the d term, to cause jitter along the lines of what ether already said. |
Re: High speed encoder with slotted / flat end... can't find one.
All,
We managed to get quite good speed control (1% from the key, slightly more variance at the lower speed fender) using a 4-line code wheel and Banner sensor. We setup the encoder to average 12 samples and used the rate functions of the WPI library (in LabVIEW). We ran the controller to a certain speed and verified it to within a few rpm with a tachometer, the tachometer readings corresponded quite well to the rpm speed measurements in software. We used a feed-forward term as the primary element in the control, with PI (or, it could be thought of as PD with the output integrated) handling the variance and spin up. We had a cap on the max integral value which was limited linearly by the error up to ~300rpm (from memory), at which point the integral would be cut off completely. The controller ran in a 10ms Timed Task at high priority. The feed forward term was calculated by measuring the speed at 25 throttle points, graphing it, and calculating a best fit curve in Excel, although the precision required on some of the terms is high - We didn't get anywhere close to accurate results until we took some of the constants to 10 or more significant digits. If I were to do it again I might come up with a solution that also considered battery voltage, but the I term can deal with battery voltage issues well enough down to around 11v or so, and we don't shoot while moving, so the battery is never that low when shooting. We attempted a controller without a feed-forward term, using PID only, and the results were less than ideal. Since the I term has to wind up to keep a constant velocity, the gain has to be high enough for it to constantly oscillate slightly and never really settle. |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
We use P ( essentially I in a positional PID) and D to damp the overshoot. We have a limiter on the P windup (I believe it's 1 and -1). You can also see the code on page 22 in this paper: http://www.chiefdelphi.com/media/papers/2695 |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
Would you mind posting the 25 data points? I'd like to play around with it. |
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
Re: High speed encoder with slotted / flat end... can't find one.
Quote:
|
| All times are GMT -5. The time now is 05:55. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi