Spindle PID troubleshooting -- solved
05 May 2020 18:09 #166784
by PCW
Replied by PCW on topic Spindle PID troubleshooting
Can you post your hal and in files?
Please Log in or Create an account to join the conversation.
05 May 2020 18:36 #166786
by paulctan
Replied by paulctan on topic Spindle PID troubleshooting
Attachments:
Please Log in or Create an account to join the conversation.
06 May 2020 00:25 #166823
by paulctan
Replied by paulctan on topic Spindle PID troubleshooting -- solved
Found the problem. Posting so that other people can find it as well (like me, a year from now!).
Basically, changed
(which is now commented out)
to
Hope this is helpful for someone else.
Paul Tan.
#*******************
# SPINDLE
#*******************
setp pid.s.Pgain [SPINDLE_9]P
setp pid.s.Igain [SPINDLE_9]I
setp pid.s.Dgain [SPINDLE_9]D
setp pid.s.bias [SPINDLE_9]BIAS
setp pid.s.FF0 [SPINDLE_9]FF0
setp pid.s.FF1 [SPINDLE_9]FF1
setp pid.s.FF2 [SPINDLE_9]FF2
setp pid.s.deadband [SPINDLE_9]DEADBAND
setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
setp pid.s.error-previous-target true
net spindle-index-enable <=> pid.s.index-enable
net spindle-enable => pid.s.enable
net spindle-vel-cmd-rpm-abs => pid.s.command
#net spindle-vel-fb-rpm-abs => pid.s.feedback
net spindle-fb-rpm-abs-filtered => pid.s.feedback
net spindle-output <= pid.s.output
Basically, changed
net spindle-vel-fb-rpm-abs => pid.s.feedback
to
net spindle-fb-rpm-abs-filtered => pid.s.feedback
Hope this is helpful for someone else.
Paul Tan.
Please Log in or Create an account to join the conversation.
06 May 2020 05:38 #166839
by cmorley
Replied by cmorley on topic Spindle PID troubleshooting -- solved
filtered rpm is usually for a more steady display of RPM.
I still wonder about your scaling - IIRC you VFD is 0-5 Volt and your RPM is 0-5000
but your scaling doesn't reflect this:
OUTPUT_SCALE = 4700
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 4700
This defines the scaling as 0-10 volts 0-4700 RPM
That could definitely throw off the proper spindle speed.
Chris
I still wonder about your scaling - IIRC you VFD is 0-5 Volt and your RPM is 0-5000
but your scaling doesn't reflect this:
OUTPUT_SCALE = 4700
OUTPUT_MIN_LIMIT = 0
OUTPUT_MAX_LIMIT = 4700
This defines the scaling as 0-10 volts 0-4700 RPM
That could definitely throw off the proper spindle speed.
Chris
Please Log in or Create an account to join the conversation.
06 May 2020 06:29 - 06 May 2020 06:30 #166843
by Hakan
Replied by Hakan on topic Spindle PID troubleshooting -- solved
I think there are two things.
First - the actual speed is lagging, You command 16.667 rps and only get 13.947 rps. This error can be reduced by the pid controller. Bring up halscope and look at pid.s.command, pid.s.feedback and pid.s.error. Make sure the nominal scaling is right (4700 vs 5000 rpm as indicated above), you can also compensate for scaling errors with FF0. It is always best to have the scaling set as good as it reasonably gets, the smaller the error the pid controller need to adjust for the better. Then it is basically a servo tuning exercise for which there are many guides out there. But the easy way is to work with P parameter. In the first screenshot you use halshow to view signals. Instead view the pins for the pid.s component in halshow.
Second - The rpm value in gmoccapy does not show the real speed value (pid.s.feedback). Isn't that what you got better by using the filtered data.
First - the actual speed is lagging, You command 16.667 rps and only get 13.947 rps. This error can be reduced by the pid controller. Bring up halscope and look at pid.s.command, pid.s.feedback and pid.s.error. Make sure the nominal scaling is right (4700 vs 5000 rpm as indicated above), you can also compensate for scaling errors with FF0. It is always best to have the scaling set as good as it reasonably gets, the smaller the error the pid controller need to adjust for the better. Then it is basically a servo tuning exercise for which there are many guides out there. But the easy way is to work with P parameter. In the first screenshot you use halshow to view signals. Instead view the pins for the pid.s component in halshow.
Second - The rpm value in gmoccapy does not show the real speed value (pid.s.feedback). Isn't that what you got better by using the filtered data.
Last edit: 06 May 2020 06:30 by Hakan.
Please Log in or Create an account to join the conversation.
Time to create page: 0.094 seconds