PID output not zero

More
23 Oct 2021 19:57 - 23 Oct 2021 20:32 #224027 by Firehunter
i'm currently trying to tune the servos of my milling machine. I'm having a bit of trouble with the pid output. there is continuosly a small error which causes the pid and analog output to never be 0. Changing P, bias or deadband doesn't help. Having a low I value doesn't help, having a larger I value causes the pid output to make a slanted "staircase" line.
I also had trouble with the servo hunting between two encoder counts (linear scales), but this was solved by adjusting the zero offset on the servo drive. The servo drive is an Indramat TDM.

What am I doing wrong?
Attachments:
Last edit: 23 Oct 2021 20:32 by Firehunter.

Please Log in or Create an account to join the conversation.

More
23 Oct 2021 21:04 #224032 by PCW
Replied by PCW on topic PID ouput not zero
I think its pretty difficult to get really precise PID
tuning when the position resolution is so low.

Normally you would expect to have at least 10 counts of
position error so you can get close to linear control in
the error band.

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 17:37 - 24 Oct 2021 17:37 #224108 by Firehunter
Replied by Firehunter on topic PID output not zero
1um resolution isn't good enough?

But if the PID loop has an error, it should try to correct it, right? Or can it be that the servo drive has a small deadband and doesn't respond to the low analog output voltage? Should I try with a much higher I value?
Last edit: 24 Oct 2021 17:37 by Firehunter.

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 18:10 #224110 by PCW
Replied by PCW on topic PID output not zero
Sorry I thought those were imperial units.

You can use a larger I term but note that if you
use any I term you will always dither between
2 encoder counts, with higher I terms speeding
the response time to small errors and the frequency
of the dither. Any dead band will just make the dither
range larger.

So one option is to use a large I term and live
with a micron or two of dither.

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 19:22 #224115 by Firehunter
Replied by Firehunter on topic PID output not zero
Okay, I won't be using deadband. Haven't had any luck with that, neither on my lathe retrofit. It only offsets the error and hunting.

Do you know why the 0.002 error isn't corrected by the P gain?

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 19:37 #224120 by chris@cnc
Replied by chris@cnc on topic PID output not zero
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
/* apply the deadband */
    if (tmp1 > *(pid->deadband)) {
    tmp1 -= *(pid->deadband);
    } else if (tmp1 < -*(pid->deadband)) {
    tmp1 += *(pid->deadband);
    } else {
    tmp1 = 0;
    }
new
/* 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;
    } 
Attachments:

Please Log in or Create an account to join the conversation.

More
24 Oct 2021 20:33 #224122 by Firehunter
Replied by Firehunter on topic PID output not zero
Thanks for your suggestion, but that doesn't really solve the problem I think. I just sets the PID output to 0 while there is still a small error. The PID loop should correct the error and then go to zero.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 14:13 #224267 by Firehunter
Replied by Firehunter on topic PID output not zero
Just did some more testing and tuning. I got a pretty nice f-error graph on all 3 axis. Up to yesterday I had only used the x-axis. It seems that all 3 axis have the 0.002mm offset/error. I tried with some I and D values, but those didn't improve anything.

I don't think this small error will cause any problems during machining, but still it looks weird. If anyone has a suggestion what might be the cause, let me know.

Please Log in or Create an account to join the conversation.

More
25 Oct 2021 14:57 #224270 by PCW
Replied by PCW on topic PID output not zero
If you have enough I term, the error will get corrected but you will have dithering.
Actually it will get corrected even with a small I term but it may take a long time...
(minutes to hours)

Please Log in or Create an account to join the conversation.

More
04 Nov 2021 00:49 #225177 by andypugh
Replied by andypugh on topic PID output not zero

I don't think this small error will cause any problems during machining, but still it looks weird. 


Set the GUI to display commanded position instead :-)

Please Log in or Create an account to join the conversation.

Time to create page: 0.088 seconds
Powered by Kunena Forum