We’re using CANJaguar and PID control on our robot arm’s shoulder joint. The arm is driven by a pair of highly-geared motors, with an encoder directly on the joint. We’re having a very tough time getting the right values for PID, and need some help. Specifically, we feel we need some D to prevent oscillation and overshoot, but have had no success getting any value of D to work.
We’ve been testing different PID values using BDC-Comm, initially with motor power disconnected. We’re trying out different values of P, I and D, and watching the motor output voltage as we move the arm. Our P and I experimentation gives us sensible results, but D seems almost non-functional. We test by setting P and I to zero, choosing a value for D, and the moving the arm and watching the motor voltage. Unless we set D above 10000 (yes, ten thousand) the BDC-Comm voltage display never budges from zero. The max value for D (at least in BDC-Comm) is 32767, so that seems really strange.
BDC-Comm testing with motor connected shows that if I have all three terms set to 0, and stop action set to coast then the arm can easily be moved (obviously). I’d expect that I could then use a D value as a brake, resisting any motion. But, I have to bump my D value up to above 5000 before I get any braking action. If I set D to very negative (-10000) I get an apparent reduction in friction.
Why does this require such enormous values of D? It’s conceivable that if we could use a D of, say, 100000 we’d be fine, but that won’t work in BDC-Comm, and even if they’d work in Java using weird values “because they work” doesn’t seem like the right approach.
Thanks,
Dan
Edit: I think I’ve found the answer, but my three posts to that effect have yet to show up, So, I’m trying this.
Ether pointed me the right way: the problem is our counts-per-second. Arm moves 220 degrees max, directly coupled to a 360 degree per rotation encoder, so that’s only 220 counts total. We want control of motions of a few degrees a second, or a few counts a second. Given the PID iteration time of a millisecond, that won’t work (and is why D is totally ineffective; P and I are probably hampered as well.) Lesson: we gotta get more counts, probably moving the encoder to an intermediate shaft on our gearbox.