Quote:
Originally Posted by mkaa00x
o get the answer for the value of the angle made by the CIM and basically set a value, until angle reaches approximately point A, keep making the CIM spin in 1 direction.
|
Unless you have a "one direction only" requirement, that's not how it should work.
Say you're at an angle of 85 degrees and you want to be at 80 degrees. Wouldn't it be better to go
back 5 degrees than to go forward 355 degrees?
BTW, the C++ WPILib code does exactly that:
Code:
* Set the PID controller to consider the input to be continuous,
* Rather then using the max and min in as constraints, it considers them to
* be the same point and automatically calculates the shortest route to
* the setpoint.