Quote:
Originally Posted by bartv
Hi,
You have a very small kP value, likely just enough to move the arm when gravity helps (hence the observed motion on the way down). You also don't have an integral. The integral term is used to increase the effort the longer a position error exists.
I.e., lets say you start with the poteniometer at 0v -> an error of 3v. The controller will apply 3*.07 = .21% - > 2.1v at the talon. What would move the arm? If 2.1v is not enough, it will never move. If you had an integral, it would start adding more power the longer the error existed. The kD term is only useful for sudden changes (derivate) in position, which you are not getting at the moment (plus you zeroed it).
Try increasing the kP variable, and adding an integral. Have you looked at the PID class provided?
Cheers,
Bart
|
The value is definitely not enough to move the arm, we had an issue earlier where the code was always sending a high value to the motor and it swung hard enough to almost break someone's arm/the robot, so we cut it down for testing. However, the issue is that the arms are getting literally 0 power before they pass that 3 mark- When I print the pid value I get 0 and the motor lights don't turn on till it passes that mark.