Odd velocity mode servo tuning issues
- Juckix
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 0
16 Jul 2019 15:49 #139567
by Juckix
Replied by Juckix on topic Odd velocity mode servo tuning issues
Reading through the pid.c code made things a bit more clear. So for anyone in my position:
The pid component is designed to use a commanded value and its error to adjust its derivative, such that the error is minimized. In this case the value is the position and the velocity is the derivative. Here is a simplification of the code:
This makes it pretty clear why FF1=1 when scale is normalized to machine units, as cmd_d will be the velocity in correct units and therefore does not need to be scaled. It also makes it clear that even with P=0, the output should still be mostly correct.
And I read through the configuration and in fact x-vel-cmd is not connected with anything, does removing that line matter then?
The pid component is designed to use a commanded value and its error to adjust its derivative, such that the error is minimized. In this case the value is the position and the velocity is the derivative. Here is a simplification of the code:
output = bias + (pgain * tmp1) + (igain * error_i) + (dgain * error_d);
output += (command * ff0gain) + (cmd_d * ff1gain) + (cmd_dd * ff2gain);
This makes it pretty clear why FF1=1 when scale is normalized to machine units, as cmd_d will be the velocity in correct units and therefore does not need to be scaled. It also makes it clear that even with P=0, the output should still be mostly correct.
And I read through the configuration and in fact x-vel-cmd is not connected with anything, does removing that line matter then?
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17997
- Thank you received: 4841
16 Jul 2019 16:33 - 16 Jul 2019 16:35 #139577
by PCW
Replied by PCW on topic Odd velocity mode servo tuning issues
if the x-vel-cmd signal is unconnected to motions commanded velocity pin,
thats likely your problem.
If you connect the PID components command_deriv pin
to any net (even an undriven net), the PID component uses that as a source
of the command derivative (velocity in this case), but if the PID components
command_deriv pin is left unconnected, the PID component will calculate
the command derivative itself
Probably the easiest thing is to just comment out the line that connects
the PIDs command derivative pin to the unused signal
thats likely your problem.
If you connect the PID components command_deriv pin
to any net (even an undriven net), the PID component uses that as a source
of the command derivative (velocity in this case), but if the PID components
command_deriv pin is left unconnected, the PID component will calculate
the command derivative itself
Probably the easiest thing is to just comment out the line that connects
the PIDs command derivative pin to the unused signal
Last edit: 16 Jul 2019 16:35 by PCW.
Please Log in or Create an account to join the conversation.
- Juckix
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 0
16 Jul 2019 16:35 #139578
by Juckix
Alright, I'll do that and post again once I have some results. This same issue is present on the Y and Z axes as well, so that will be something to investigate. This has been very informative so far.
Replied by Juckix on topic Odd velocity mode servo tuning issues
if the x-vel-cmd signal is unconnected to motions commanded velocity pin,
thats likely your problem.
If you connect the PID components command_deriv pin
to any net(even a undriven net), the PID component uses that as a source
of the command derivative (velocity in this case), but if the PID components
command_deriv pin is left unconnected, the PID component will calculate the command derivative itself
Probablt the easiest thing is to just comment out the line that connects the PIDs command derivative pin to the unused signal
Alright, I'll do that and post again once I have some results. This same issue is present on the Y and Z axes as well, so that will be something to investigate. This has been very informative so far.
Please Log in or Create an account to join the conversation.
- Juckix
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 0
18 Jul 2019 11:32 #139783
by Juckix
Replied by Juckix on topic Odd velocity mode servo tuning issues
pid.command-deriv was disconnected, velocity at 10V was measured in open loop and entered into the .ini, and PID parameters were set to FF1=1 and P=0 and now behaviour is as expected. See the following commanded/feedback velocity and f-error graphs for jogs on X and Y with the new settings.
As you can see the velocity is quite noisy, which was true during open loop testing too. Should I fine-tune FF1 somehow to make sure it is exactly correct or is it enough to have it almost right?
Now I'm also wondering if you have any good tuning strategies for the rest of the PID terms for velocity mode drives, starting from a correctly set FF1 parameter.
As you can see the velocity is quite noisy, which was true during open loop testing too. Should I fine-tune FF1 somehow to make sure it is exactly correct or is it enough to have it almost right?
Now I'm also wondering if you have any good tuning strategies for the rest of the PID terms for velocity mode drives, starting from a correctly set FF1 parameter.
Attachments:
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19529
- Thank you received: 6554
18 Jul 2019 12:04 #139789
by tommylight
Replied by tommylight on topic Odd velocity mode servo tuning issues
Search the forum for "servo tuning detailed howto", plenty of detailed info about tuning servo drives with Mesa 7i77.
Please Log in or Create an account to join the conversation.
- Juckix
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 0
18 Jul 2019 12:12 #139793
by Juckix
Haha well not exactly that.
And well I did look around the forum before asking and found some stuff, including a detailed guide by you I believe. But the issue is that many of them directly contradict each other, so I thought I would ask for a straight up recommendation.
Replied by Juckix on topic Odd velocity mode servo tuning issues
Search the forum for "servo tuning detailed howto", plenty of detailed info about tuning servo drives with Mesa 7i77.
Haha well not exactly that.
And well I did look around the forum before asking and found some stuff, including a detailed guide by you I believe. But the issue is that many of them directly contradict each other, so I thought I would ask for a straight up recommendation.
Attachments:
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19529
- Thank you received: 6554
18 Jul 2019 13:03 #139796
by tommylight
Replied by tommylight on topic Odd velocity mode servo tuning issues
forum.linuxcnc.org/10-advanced-configura...ning-detailed-how-to
I use that same procedure always, it always works. It is the only procedure to tune drives with no known parameters, and it will always result in a tight tolerance, fast moving, precise working machine.
There is another tutorial by JT that will get you going and it is easier to understand what is going on and what the parameters doo.
As with any tutorial, when people skip parts of it, it will result in all kinds of problems.
Follow it precisely and it will always result in a proper working machine. That also goes for the used parts as using that tutorial to tune drives with no tacho and feedback going to Linuxcnc will not work as is.
Recap, drives with tacho fedback, encoders to Mesa 7i77 OR to drive and then Mesa. This will always work, and after a bit of experience, the tuning is done in maximun 5 minutes per axis.
And please do use a phone or a tablet to check the vibrations during P tuning.
I use that same procedure always, it always works. It is the only procedure to tune drives with no known parameters, and it will always result in a tight tolerance, fast moving, precise working machine.
There is another tutorial by JT that will get you going and it is easier to understand what is going on and what the parameters doo.
As with any tutorial, when people skip parts of it, it will result in all kinds of problems.
Follow it precisely and it will always result in a proper working machine. That also goes for the used parts as using that tutorial to tune drives with no tacho and feedback going to Linuxcnc will not work as is.
Recap, drives with tacho fedback, encoders to Mesa 7i77 OR to drive and then Mesa. This will always work, and after a bit of experience, the tuning is done in maximun 5 minutes per axis.
And please do use a phone or a tablet to check the vibrations during P tuning.
Please Log in or Create an account to join the conversation.
- Juckix
- Offline
- Junior Member
Less
More
- Posts: 31
- Thank you received: 0
18 Jul 2019 13:18 #139800
by Juckix
Replied by Juckix on topic Odd velocity mode servo tuning issues
Alright, thanks. That's the one I remember seeing.
Please Log in or Create an account to join the conversation.
Time to create page: 0.175 seconds