View Single Post
  #14   Spotlight this post!  
Unread 08-07-2016, 17:18
ollien ollien is offline
Registered User
FRC #5202
 
Join Date: Feb 2015
Location: United States
Posts: 292
ollien has a spectacular aura aboutollien has a spectacular aura aboutollien has a spectacular aura about
Re: What is wrong with my Vision to Gyro code?!

Quote:
Originally Posted by GeeTwo View Post
While the camera will drive to the same location with both of these changes, the reasons and behavior will be different.

By reversing the angle, the physical orientation will move to the correct location, but it will continue to oscillate around that new point, for reasons given in post #2 - Even if it were started right at that physical point at rest, the PID is 180 degrees off target, and will push it one way or the other, starting an oscillation.

If the PID output is negated (or the motor wires swapped), the motor will then be driven towards the desired set point, and the PID should (after a bit of tuning) function as desired, either approaching the set point asymptotically or slightly overshooting with a dampening oscillation.
Got it. Thank you!
Reply With Quote