Today we were testing our robot, that have a arm controlled by two motors with independent PID with a 192.4/1 reduction . At some time the robot lost conection for a fraction of a second. When i tried to enable it again, each PID has gone to a diffrent setpoint at a velocity beyond the constraints, breaking our intake in half. I found it strange, because i saw that error before, but the two arms has moved together that time.
Another thing to consider is that when he losts conection, the arm suffered from gravity, making it going down.
Are these 2 motors mechanically linked? If so I would recommend using a follower setup.
Can we see your code? Do you have an I term?
Your failure may be a little more violent than expected but it happens at every end game so design accordingly and take advantage of @jdaming recommendation that the 2 motors are defined as leader/follower.
Those few seconds at the end as the robot sinks seem like an eternity. Use a ratchet or brake on the arm as necessary.
This failure reminds us that you can’t have too many hard limit switches, soft limits and mechanical stops to protect your mechanisms.
here the code. the arm are mechanicaly linked by the shooter , but the motors itself aren’t
We had similar issues last year using a profiled PID controller, but we fixed it by adding a resetController method in your ArmSubsystem. That we called in the initialization of our position.
You would need something like this. (I would recommend making the right and left followers so you only control one, but if you don’t you would likely need to do this on both.)
public void resetController() {
controllerRight.reset(encoderRight.getPosition());
}
Then in your Move Arm Command.
run the resetController in the initialize()
I think this would likely help your problems.
when i tried to use follow, we didnt have conected the arms yet, and the follower motor had a significant drift in a couple interactions. i dint know if the problem would resolve itself with the arms conected, and i have fear to test it and breaking everything
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.