I had the same problem. I solved by changing the deadband term in pid.c file. With this modification has the deadband a real unit. If the position +/- deadband -> PID force to zero. My first idea was to round the encoder feedback. In wood are 5µ not necessary.
But after 4 months i can say this modification works. The following error is near the same like without deadband and in stop position no vibration. For test you could exchange the file pid.so in folder /usr/lib/linuxcnc/modules/
I spoke
here
with Andy about this. He mean lincurve could also usefull to affect the PID. But i was happy with this solution an not searching more.
I change this lines in file pid.c
old
Code:
/* apply the deadband */
if (tmp1 > *(pid->deadband)) {
tmp1 -= *(pid->deadband);
} else if (tmp1 < -*(pid->deadband)) {
tmp1 += *(pid->deadband);
} else {
tmp1 = 0;
}
new
Code:
/* apply the deadband */
/*check if pid.error positiv and < deadband*/
if (*(pid->error) >= 0 && *(pid->error) < *(pid->deadband)) {
tmp1 = 0;
/*check if pid.error negativ and < deadband*/
} else if (*(pid->error) <=0 && -*(pid->error) <= *(pid->deadband)) {
tmp1 = 0;
}