PID Servo Loop rates
21 Aug 2024 13:39 #308288
by Tinine
PID Servo Loop rates was created by Tinine
Hi all,
I see that Linux CNC defaults to 1KHz PID rate.
What do you lose when something like 250Hz is used.
For the first time in decades, I have been experimenting with this 250Hz on one of my own developments and I found that tuning the loop was a breeze and I don't seem to lose anything. Historically I've been in the 1KHz to 4KHz range. I'm kinda liking this.
Craig
I see that Linux CNC defaults to 1KHz PID rate.
What do you lose when something like 250Hz is used.
For the first time in decades, I have been experimenting with this 250Hz on one of my own developments and I found that tuning the loop was a breeze and I don't seem to lose anything. Historically I've been in the 1KHz to 4KHz range. I'm kinda liking this.
Craig
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
Less
More
- Posts: 5000
- Thank you received: 1409
21 Aug 2024 13:57 #308289
by Todd Zuercher
Replied by Todd Zuercher on topic PID Servo Loop rates
If your PC has poor latency, a faster loop could be detrimental to your pid servo loop tuning. I can see how slowing your loop down so that the resolution of latency noise is a smaller relative to the thread speed could give better tuning results.
The following user(s) said Thank You: Tinine
Please Log in or Create an account to join the conversation.
21 Aug 2024 14:16 #308292
by Tinine
Replied by Tinine on topic PID Servo Loop rates
Hi Todd,
Yes I can see that which is why I don't use the PC platform.
I use microcontrollers for motion control and I can achieve ridiculously fast rates but I'm starting with a clean sheet and for fun, I have been playing with this 250Hz rate and pretty impressed.
Granted, my applications typically involve bigger servos and associated transmission systems and so response time is not super critical but hey, I have never experienced such easy PID tuning.
Craig
Yes I can see that which is why I don't use the PC platform.
I use microcontrollers for motion control and I can achieve ridiculously fast rates but I'm starting with a clean sheet and for fun, I have been playing with this 250Hz rate and pretty impressed.
Granted, my applications typically involve bigger servos and associated transmission systems and so response time is not super critical but hey, I have never experienced such easy PID tuning.
Craig
Please Log in or Create an account to join the conversation.
21 Aug 2024 21:41 #308344
by mark-v-d
Replied by mark-v-d on topic PID Servo Loop rates
You lose bandwidth by going to a lower servo PID rate. If that doesn't
matter because the system you're controlling is slow, there is no price
in going for a lower control speed.
With a sampling rate of 250Hz, you can actually measure up to 125Hz. In reality
the limit is usually between 1/5 and 1/3 that frequency before difference between
a sampled and a time continuous system become apparent.
So with 250Hz you're approximately limited to 50Hz of control
bandwidth. To me that seems terribly low. On my own lathe I have a
resonance at approximately 300Hz. Since I have the servo thread running
at 4500Hz (because that's the maximum rate the encoders I use support)
I was able to eliminate that resonance.
On the other hand, what do you lose when going for a higher sampling
rate? The only thing I can come up with is processor time, but that
seems hardly an issue on a modern PC. And I'm doing this on an RT_PREEMPT
kernel, so it's not even Xenomai or RTAI.
matter because the system you're controlling is slow, there is no price
in going for a lower control speed.
With a sampling rate of 250Hz, you can actually measure up to 125Hz. In reality
the limit is usually between 1/5 and 1/3 that frequency before difference between
a sampled and a time continuous system become apparent.
So with 250Hz you're approximately limited to 50Hz of control
bandwidth. To me that seems terribly low. On my own lathe I have a
resonance at approximately 300Hz. Since I have the servo thread running
at 4500Hz (because that's the maximum rate the encoders I use support)
I was able to eliminate that resonance.
On the other hand, what do you lose when going for a higher sampling
rate? The only thing I can come up with is processor time, but that
seems hardly an issue on a modern PC. And I'm doing this on an RT_PREEMPT
kernel, so it's not even Xenomai or RTAI.
Please Log in or Create an account to join the conversation.
21 Aug 2024 23:36 - 21 Aug 2024 23:38 #308349
by PCW
Replied by PCW on topic PID Servo Loop rates
The required PID rate also depends on what you are controlling.
If you are controlling torque, you need a higher PID rate
than if you are controlling velocity (with the drive controlling the
lower level, higher frequency loops)
A typical position mode servo drive may have 3 nested PID (or similar)
loops, from fastest to slowest:
torque command to PWM out
velocity command to torque out
position command to velocity out
If you are controlling torque, you need a higher PID rate
than if you are controlling velocity (with the drive controlling the
lower level, higher frequency loops)
A typical position mode servo drive may have 3 nested PID (or similar)
loops, from fastest to slowest:
torque command to PWM out
velocity command to torque out
position command to velocity out
Last edit: 21 Aug 2024 23:38 by PCW.
Please Log in or Create an account to join the conversation.
Time to create page: 0.093 seconds