Spindle PID troubleshooting -- solved

More
6 years 5 months ago #166632 by paulctan
Linuxcnc 2.8pre on mint.

Everything has been working fine for a while now. I started trying to fix my spindle speed (it's been running a little bit slower than programmed). Spindle is controlled from Mesa card via Analog 0-5V output.

I set the P=0.4, FF0=1.0, everything else 0.

See attached photo for halshow.

spindle-vel-fb-rps is 13.94723, and spindle-vel-cmd-rps is 16.66667
but, (see photo circled items), spindle actual rpm is 1293 when I commanded 1000.

What am I missing? Am I looking at the correct hal variables? Is there a hal variable to show the PID error?

Thanks.

Paul Tan.


Code:
[SPINDLE_9] P = 0.4 I = 0.0 D = 0.0 FF0 = 1.0 FF1 = 0.0 FF2 = 0.0 BIAS = 0.0 DEADBAND = 0.0 MAX_OUTPUT = 4700 ENCODER_SCALE = 8192.0 OUTPUT_SCALE = 4700 OUTPUT_MIN_LIMIT = 0 OUTPUT_MAX_LIMIT = 4700

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #166637 by tommylight
Can your spindle do 4700 RPM at 5V input ?
Check the scaling so it corresponds to what it actually can do at 5V.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #166647 by paulctan
Yes, the spindle can do 5000 RPM. Scaling is not the issue. The spindle RPM is not linear to the output voltage (or, the output voltage might not be linear). I wanted to use the PID loop to adjust the output voltage accordingly. I.e., at low RPM, e.g. 500 RPM, I get actual RPM of about 420, at 1000 RPM, I get 950, at 2000 RPM I get 1950. At 4500 RPM, I get 4400 RPM. Not perfectly linear. I wanted to close that feedback loop.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #166656 by tommylight
What encoder is on the spindle and how is that scaled in hal ?

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #166664 by paulctan
Encoder is built into the DMM DYN4 servo motor. I am scaling it based upon the pulley ratio. But, that's not the issue. My issue is why the PID error is wrong based upon what the system is seeing.

Please Log in or Create an account to join the conversation.

More
6 years 5 months ago #166672 by paulctan
Hmmm... should I be asking this in the configuring linuxcnc section instead? or maybe in the HAL section? Asking the moderators here if it should be moved or not.

Please Log in or Create an account to join the conversation.

Time to create page: 0.308 seconds
Powered by Kunena Forum