Servo tuning issues (Velocity mode driven from 7i77)
14 Apr 2019 17:36 #130859
by fungus
Servo tuning issues (Velocity mode driven from 7i77) was created by fungus
Good afternoon folks,
Please forgive me for starting another tuning thread.
Background: these are DYN4 drives and DMM servos, set up as velocity mode; they are receiving +/-10V analog signal from a Mesa 7i77. The PID velocity loop in the DYN4 is satisfactorily tuned, and now I am attempting to close a positioning loop through LinuxCNC.
I have read several tuning threads here, but I just can't seem to get things working (or at least make them behave the way other people report).
In the Gnipsel tutorial, it is mentioned that "commanded velocity" is the parameter you should trigger on during tuning. In my case, I cannot get anything on any commanded velocity channels; I can get velocity feedback, but no commands. NOW, for me that makes perfect sense... I am closing a position loop, which means I should only have position commands.
To heighten my confusion, FF1 seems to have no affect. According to the tuning sticky ,
I'm a bit thrown off by this. I got things pretty close with PID, but I have some following error I just can't shake. It seems like I can't get far with the Gnipsel page above, as P alone causes some pretty bad oscillation before it even brings any stiffness to the axis.
Thanks for any help. PID & FFn have frustrated me enough that I'm going to take a calculus class. I want to know how to do this!
Please forgive me for starting another tuning thread.
Background: these are DYN4 drives and DMM servos, set up as velocity mode; they are receiving +/-10V analog signal from a Mesa 7i77. The PID velocity loop in the DYN4 is satisfactorily tuned, and now I am attempting to close a positioning loop through LinuxCNC.
I have read several tuning threads here, but I just can't seem to get things working (or at least make them behave the way other people report).
In the Gnipsel tutorial, it is mentioned that "commanded velocity" is the parameter you should trigger on during tuning. In my case, I cannot get anything on any commanded velocity channels; I can get velocity feedback, but no commands. NOW, for me that makes perfect sense... I am closing a position loop, which means I should only have position commands.
To heighten my confusion, FF1 seems to have no affect. According to the tuning sticky ,
Since I apparently don't have a velocity command, does this mean that FF1 is null and void?FF1 is the first derivative of position, so that is proportional
to velocity.
I'm a bit thrown off by this. I got things pretty close with PID, but I have some following error I just can't shake. It seems like I can't get far with the Gnipsel page above, as P alone causes some pretty bad oscillation before it even brings any stiffness to the axis.
Thanks for any help. PID & FFn have frustrated me enough that I'm going to take a calculus class. I want to know how to do this!
Please Log in or Create an account to join the conversation.
14 Apr 2019 17:40 #130861
by PCW
Replied by PCW on topic Servo tuning issues (Velocity mode driven from 7i77)
If you leave the PID components command-deriv pin unconnected, the PID component uses a locally calculated derivative (I would suggest using this mode)
FF1 is the _primary_ tuning parameter for velocity mode drives. It needs to be correct
for any hope of final tuning to work
FF1 is the _primary_ tuning parameter for velocity mode drives. It needs to be correct
for any hope of final tuning to work
Please Log in or Create an account to join the conversation.
14 Apr 2019 18:05 #130863
by fungus
Replied by fungus on topic Servo tuning issues (Velocity mode driven from 7i77)
Hi Peter,
Right now, I have:
net x-vel-cmd does not occur anywhere else in the HAL file. I can comment this out, but it looks like it is already disconnected (unless the net is referenced in another file)
Would you recommend I start with FF1 = 1 (or some other beginning value) and tune PID to match it?
Thanks for your help.
Right now, I have:
net x-pos-cmd => pid.x.command
net x-vel-cmd => pid.x.command-deriv
...
net x-pos-cmd axis.0.motor-pos-cmd
net x-vel-cmd does not occur anywhere else in the HAL file. I can comment this out, but it looks like it is already disconnected (unless the net is referenced in another file)
Would you recommend I start with FF1 = 1 (or some other beginning value) and tune PID to match it?
Thanks for your help.
Please Log in or Create an account to join the conversation.
14 Apr 2019 18:14 #130864
by PCW
Replied by PCW on topic Servo tuning issues (Velocity mode driven from 7i77)
1.
Comment out the
net x-vel-cmd => pid.x.command-deriv
statement
2. FF1 == 1 only if the analog out is scaled in machine units per second
For example with the default output scaling (in volts), if 10V = 10 inches/sec (or 10 mm/second) FF1 =1
So if you want FF1 to be one you need to know the approximate machine
axis velocity (in machine units per second) at 10V and set the output scale
(and limits) to that number
Also if you use an older version of pncconf to create the initial hal file, make sure you comment out or delete all the pid.N.maxerror statements
Comment out the
net x-vel-cmd => pid.x.command-deriv
statement
2. FF1 == 1 only if the analog out is scaled in machine units per second
For example with the default output scaling (in volts), if 10V = 10 inches/sec (or 10 mm/second) FF1 =1
So if you want FF1 to be one you need to know the approximate machine
axis velocity (in machine units per second) at 10V and set the output scale
(and limits) to that number
Also if you use an older version of pncconf to create the initial hal file, make sure you comment out or delete all the pid.N.maxerror statements
Please Log in or Create an account to join the conversation.
20 Apr 2019 15:40 #131314
by fungus
Replied by fungus on topic Servo tuning issues (Velocity mode driven from 7i77)
Wow, I head a serious misunderstanding regarding OUTPUT_SCALE, OUTPUT_MIN_LIMIT & OUTPUT_MAX_LIMIT.
In my case, the DMM servos output 3000RPM at 10V; there's a 2:1 belt reduction, & I have 5mm pitch ballscrews (but I'm using inches), so 1 rev = ~0.197".
So at 10V, I should get 4.921 IPS.
For axis X (in the .INI):
OUTPUT_SCALE = -4.921
OUTPUT_MIN_LIMIT = -4.921
OUTPUT_MAX_LIMIT = 4.921
Does this sound reasonable? If so, the tuning order should be that I set FF1 to this calculated value, then tune the PID loop after?
My usual procedure for high inertia systems is to turn up kP to instability, back off 30%, add kD until instability, back off 30%, cycle back and forth between the two until I can't turn them up any higher and then add any kI I need.
Thanks again for the help.
In my case, the DMM servos output 3000RPM at 10V; there's a 2:1 belt reduction, & I have 5mm pitch ballscrews (but I'm using inches), so 1 rev = ~0.197".
So at 10V, I should get 4.921 IPS.
For axis X (in the .INI):
OUTPUT_SCALE = -4.921
OUTPUT_MIN_LIMIT = -4.921
OUTPUT_MAX_LIMIT = 4.921
Does this sound reasonable? If so, the tuning order should be that I set FF1 to this calculated value, then tune the PID loop after?
My usual procedure for high inertia systems is to turn up kP to instability, back off 30%, add kD until instability, back off 30%, cycle back and forth between the two until I can't turn them up any higher and then add any kI I need.
Thanks again for the help.
Please Log in or Create an account to join the conversation.
20 Apr 2019 15:52 #131317
by PCW
Replied by PCW on topic Servo tuning issues (Velocity mode driven from 7i77)
Yes, if you have the output scaled in machine units/second as it look like you have done,
FF1==1
Normally D is not needed for velocity mode drives (D is velocity feedback and that's
handled by the drives themselves)
FF1==1
Normally D is not needed for velocity mode drives (D is velocity feedback and that's
handled by the drives themselves)
Please Log in or Create an account to join the conversation.
21 Apr 2019 00:11 #131347
by fungus
Replied by fungus on topic Servo tuning issues (Velocity mode driven from 7i77)
Hmm. I still have nothing under commanded velocity in halscope. I'm using the <axis>-output signal to trigger off of currently.
I have significant oscillation if I set kP high enough to tightly control the axis, the same way I would usually expect to see before I increase kD. Is this an indication that I should revisit the velocity controller's tuning?
After scaling as mentioned above, I ended up with the following as a rough tune:
kP: 32
kI: 0
kD: 4
FF0: 0
FF1: 0.27
FF2: 0.065
A FF1=1 was WAY too high and caused massive overshoot.
I'll probably start from scratch and re-tune just to see if I can make it better, but this is huge progress. Thank you Peter for your help!
I have significant oscillation if I set kP high enough to tightly control the axis, the same way I would usually expect to see before I increase kD. Is this an indication that I should revisit the velocity controller's tuning?
After scaling as mentioned above, I ended up with the following as a rough tune:
kP: 32
kI: 0
kD: 4
FF0: 0
FF1: 0.27
FF2: 0.065
A FF1=1 was WAY too high and caused massive overshoot.
I'll probably start from scratch and re-tune just to see if I can make it better, but this is huge progress. Thank you Peter for your help!
Please Log in or Create an account to join the conversation.
21 Apr 2019 00:45 #131349
by PCW
Replied by PCW on topic Servo tuning issues (Velocity mode driven from 7i77)
Sounds like your drives are not really running in velocity mode
(D should never really be needed for velocity mode drives)
Do the drives resist any attempt to turn them when the analog velocity command is 0?
They should be very stiff if truly in velocity mode (though may drift slowly)
(D should never really be needed for velocity mode drives)
Do the drives resist any attempt to turn them when the analog velocity command is 0?
They should be very stiff if truly in velocity mode (though may drift slowly)
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19206
- Thank you received: 6437
21 Apr 2019 01:25 #131356
by tommylight
Replied by tommylight on topic Servo tuning issues (Velocity mode driven from 7i77)
That sure looks like your encoder_scale is set 4 times lower, FF1=0.27 ! Try 0.25.
Please Log in or Create an account to join the conversation.
22 Apr 2019 00:49 #131437
by fungus
Replied by fungus on topic Servo tuning issues (Velocity mode driven from 7i77)
PCW,
these DYN4
drives have 3 modes: Position, Speed and Torque. I currently have "speed" selected. They "assert the shaft" when tuned, keeping a solid grip. I actually notice no drift as well. They bury many of the parameters, so it is entirely likely that they are not true "Velocity" drives, but rather some kind of hybrid. One thing I noticed while in the manual this time is that they list the "Speed Control Range" as 0:5000, so at 10V I'll get 5000RPM rather than 3000RPM. I'll need to revisit the output scaling due to this. It is likely part of the reason why the FF1 is so low.
Tommylight, if my encoder_scale was set incorrectly, wouldn't I get the wrong output for a commanded distance? For example, right now if I command 1", I get 1". If it was set 4x too low, for a 1" command, wouldn't I expect to get 0.25" of axis motion?
Tommylight, if my encoder_scale was set incorrectly, wouldn't I get the wrong output for a commanded distance? For example, right now if I command 1", I get 1". If it was set 4x too low, for a 1" command, wouldn't I expect to get 0.25" of axis motion?
Please Log in or Create an account to join the conversation.
Time to create page: 0.098 seconds