Quote:
Quote:
|
The max value for D (at least in BDC-Comm) is 32767, so that seems really strange
|
I would assume this maximum exists because the D value is stored in 16 bits. (2^16)/2 = 32768
|
Sorry I wasn't clear: the exact maximum is unsurprising (in a binary world), but that it is so close to the useful value (and may even be lower than the best value) was surprising.
Quote:
According to this post, D is multiplied by the difference in error, not by the (difference in error)/(sample time). Since the PID in the Jag runs at 1000Hz, that factor of 1000 needs to be in your D gain. That's my guess.
What's the resolution (counts per degree) of your encoder, and how fast are you moving the arm (degrees per millisecond) when you're looking for a voltage?
|
I think you've hit upon the answer. We're using a 360 count/rev encoder (one count per degree) which is connected directly to the shoulder joint. We'd like good regulation with the arm moving a maximum of 220 degrees or counts per second, which is about .2 counts per PID iteration. Even with 4x encoding, that's less than one count per PID iteration. Regulation needs to continue down to less than 10 degrees or counts per second, or about 1 count every 100 PID iterations. That's gotta be problematic.
Our two motors drive Banebot 16:1 gearboxes, which are both plugged into a single 6:1 Andymark Toughbox driving the shoulder. Moving the encoder to the output of one of the Banebot gearboxes would cut the required D term by a factor of six, which might be enough. Moving the encoder to the shaft of one of the motors would be even better, but I don't think that's possible with our motors.
Lesson: if you want reasonable PID control, you need to have a reasonable number of counts per second on your encoder.
Thanks, all!
Dan