-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spindle refactoring, issue with original Huanyang logic #18
Comments
Should it be limited to the min value of |
No, it's a bit odd the way it does it.. These are typical settings for a 24k Chinese CNC spindle;
As I understand it, this VFD uses Hz instead of RPM when requesting a speed, and the Fwiw, it still seems to work fine (min/max capped as expected) if I revert to this. I haven't checked whether it's the VFD doing the limiting, or the $30/$31 settings - I could check the modbus messages to be sure.
|
|
Did a bit more checking here.. With the older code (just setting rpm_max50);
Can I ask what the use case for the new code is, vs just setting $30/$31? Am guessing multi spindle support, where you may have different values at run time? I think if you wanted to get the actual allowable RPM from the v1 Huanyang, then would need to query PD005, PD011, and PD144 during init. Having all three, could then calculate the configured min/max RPM .. |
This is handled in the VFD - by ignoring the speed command. grblHAL (and Grbl) clips the PWM spindle speed at max allowed speed and IMO VFDs should do the same to be consistent.
$30/$31 is for the PWM spindle, and I see no reason for using the settings when the limits can be read from the VFD. And especially so in a multi spindle setup that includes a PWM spindle. And if both $30/$31 and the VFD settings are used for limits they have to be kept in sync to be meaningful?
Agree. The PD144 value read is not the max RPM but rather a scaling factor? From the manuals I have: |
Agreed, I think intuitively I was just expecting the VFD to change speed, but to clip it at the PD005 value - rather than do nothing..
Yes, it's supposed to be the physical motor speed (dependent on # poles etc) for a 50hz input. For the typical Chinese spindles, this is 3000rpm, with a safe rpm range of 7,200 min to 24,000 max. The Huanyang v1 code calculates the frequency to send like this edit: oops - 100x the actual Hz, two extra zeros.. |
Something like this then? |
Cool I'll give that a test, thanks! Was also just wondering whether it's worth renaming |
That seems to work well for me. Can confirm it picks up the correct RPM limits from the VFD, and falls back to the $30/$31 values if spindle is offline during init. Noticed a small typo on lines 87 & 91, the values are right but the comments are the wrong way round.. |
Thanks, I'll commit the changes soon. I have fixed the typos already, and renamed the enum and variable as well. |
Looks like the refactoring has impacted speed control for original Huanyang VFDs..
Here it's setting
spindle_hal->rpm_max
to the configured RPM @ 50Hz, which is then enforced inspindle_set_rpm()
Plugins_spindle/vfd/huanyang.c
Lines 214 to 219 in 881ed9d
The text was updated successfully, but these errors were encountered: