|
Re: Confusing Issues with Swerve
Quote:
Originally Posted by Calasada
Hey again, thanks again for all your help. Your suggestion didn't seem to work, we just removed it and we got a new problem which i'm fairly certain the additional check was meant to fix: sometimes when the set angle is 0, it notices 180 is more efficient and moves there. But now when we set it to 90, 270, or something similar, the two problematic modules start flickering between efficient and not-efficient movement creating a sporadic movement, along with the aforementioned problem. The strangest thing about this to me is that it only occurs in the front left and rear right modules. Sorry if we're late, but any help is still appreciated.
|
The two modules that are not working are diagonal from each other. I don't know your physical setup but is it possible that the steer motors or the encoder inputs needs to be reversed for those modules? You could plot the error of the PIDControllers. I suspect you will see the error increasing instead of decreasing as you approach your set point. It is possible that when you command 0 that it is actually turning the wrong direction but the controller is tuned and has a dead band such that the module will still stop even approaching the set point from the wrong direction at high speed when it loops around from 360 to 0. When you have the check in places it doesn't oscillate between 0 and 180. When the check is removed you are actually getting stuck at your max error of 180 and as you indicated switching between optimized and not optimized.
__________________
"May the coms be with you"
Is this a "programming error" or a "programmer error"?
|