Auto tuning of PIDs?
11 Aug 2015 03:02 - 11 Aug 2015 03:03 #61282
by delco
Auto tuning of PIDs? was created by delco
I'm in the middle of trying to tune the servos on my project and in reading it looks like A LOT of people have issues with tuning their systems. It also seems like A LOT of trial and error and basically just messing around with stuff until you think you're close enough.
I've seen a few programs and systems on different operating systems/applications that auto tune servos. From what I've read around here it doesn't seem like there's a program like that available to LCNC users despite the seemingly huge need for it. Does anyone know what it would take for such a program to be implemented? From what I've read so far it looks like it would basically be just be a few 2nd order differential equations, probably set up in some kind of linear algebra matrix then a way to scrape data from the halscope and something to temporarily enable/control servos. That being said, I don't totally understand what's needed to tune a servo so I might be grossly under estimating it.
Has anyone already tried this?
I've seen a few programs and systems on different operating systems/applications that auto tune servos. From what I've read around here it doesn't seem like there's a program like that available to LCNC users despite the seemingly huge need for it. Does anyone know what it would take for such a program to be implemented? From what I've read so far it looks like it would basically be just be a few 2nd order differential equations, probably set up in some kind of linear algebra matrix then a way to scrape data from the halscope and something to temporarily enable/control servos. That being said, I don't totally understand what's needed to tune a servo so I might be grossly under estimating it.
Has anyone already tried this?
Last edit: 11 Aug 2015 03:03 by delco.
Please Log in or Create an account to join the conversation.
11 Aug 2015 03:45 #61283
by PCW
Replied by PCW on topic Auto tuning of PIDs?
The most important thing about tuning is knowing what you are tuning.
Do you have velocity or torque mode drives?
Velocity mode drives are much more common on CNC systems and quite easy to tune
For velocity mode servos (where the velocity PI loop is in the drive itself) , most of the LinuxCNC side of the
tuning is done with FF1 which is simply set to 1.0 if the scaling is correct (PID output scaled in machine units per second)
The rest of the tuning steps for velocity mode drives are straightforward:
Increase P until you get oscillations and then reduce P by about 30%
Adjust FF1 for minimum following error during medium speed cruise
Adjust FF2 for minimum error during accel/decel
Do you have velocity or torque mode drives?
Velocity mode drives are much more common on CNC systems and quite easy to tune
For velocity mode servos (where the velocity PI loop is in the drive itself) , most of the LinuxCNC side of the
tuning is done with FF1 which is simply set to 1.0 if the scaling is correct (PID output scaled in machine units per second)
The rest of the tuning steps for velocity mode drives are straightforward:
Increase P until you get oscillations and then reduce P by about 30%
Adjust FF1 for minimum following error during medium speed cruise
Adjust FF2 for minimum error during accel/decel
Please Log in or Create an account to join the conversation.
11 Aug 2015 16:39 #61293
by andypugh
There is an auto-tuning version of the PID component
www.linuxcnc.org/docs/html/man/man9/at_pid.9.html
Replied by andypugh on topic Auto tuning of PIDs?
From what I've read around here it doesn't seem like there's a program like that available to LCNC users despite the seemingly huge need for it.
There is an auto-tuning version of the PID component
www.linuxcnc.org/docs/html/man/man9/at_pid.9.html
The following user(s) said Thank You: delco
Please Log in or Create an account to join the conversation.
11 Aug 2015 22:42 #61296
by delco
Replied by delco on topic Auto tuning of PIDs?
@andypugh
Ha Of course there is! What sorts of applications is this typically used on?
@PWC
This might be a dumb question but what do you mean by oscillation? I keep seeing this term being used in various descriptions of PID tuning along with graphs of what appear to be degrading sin waves but when I set my HALcope to look at the pins used in the HALscope tutorial and then adjust the P setting, the gantry either runs away or slowly comes to a stop.
In my head, when you say look for oscillation, I should be seeing the axis moving back and forth and the position pin on the scope should be some kind of sin wave. That doesn't really make sense though, I know I'm misunderstanding something, all my waves are square.
Ha Of course there is! What sorts of applications is this typically used on?
@PWC
This might be a dumb question but what do you mean by oscillation? I keep seeing this term being used in various descriptions of PID tuning along with graphs of what appear to be degrading sin waves but when I set my HALcope to look at the pins used in the HALscope tutorial and then adjust the P setting, the gantry either runs away or slowly comes to a stop.
In my head, when you say look for oscillation, I should be seeing the axis moving back and forth and the position pin on the scope should be some kind of sin wave. That doesn't really make sense though, I know I'm misunderstanding something, all my waves are square.
Please Log in or Create an account to join the conversation.
11 Aug 2015 23:05 #61298
by PCW
Replied by PCW on topic Auto tuning of PIDs?
If you get a runaway , that usually means that you have the feedback backwards
This needs to be fixed before you attempt to tune
If your input scale is correct, (DRO reads properly)
you need to flip the output polarity (how this is done depends on the hardware)
This needs to be fixed before you attempt to tune
If your input scale is correct, (DRO reads properly)
you need to flip the output polarity (how this is done depends on the hardware)
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds