-
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 load feedback with multiple spindles #11
Comments
Hook your code into the grbl.on_spindle_select event? |
Ah yes thanks, so I assume I should just be able to filter on (for instance) the v1_active flag in the realtime report? But on checking, something looks off... v1_active is set false when the spindle is Huanyang and true when PWM? Building with VFD_ENABLE = -1, and N_SPINDLE = 2
|
Oops - a bug in the registration code, change to:
The idea behind having a wrapper for VFD registration was to have a place to add common VFD extension code, e.g. by adding VFD specific function pointers by wrapping the "standard" registration struct in a super struct together with a VFD specific struct. The registration function above would then pass on the "standard" struct to the core and save the VFD specific one to the spindles array. By subscribing to the |
Thanks, this is what I've got so far.. If you're generally in agreement with the approach, I can open a PR for discussion?
|
Here is how I am thinking: This way it will be easy to add new (and optional) functionality by letting the VFD drivers telling vfd/spindle.c what they are capable of. As a bonus adding functions to |
Cool thanks, will have a look... |
This is working for me, just a couple of small updates; Added the power related modbus bits back for the Huanyang v1 VFD |
I have commited my changes, can you add yours in a PR?
I have changed the final code a bit, should be ok now.
Perhaps a function to retrieve the active VFD function pointers (as a pointer to vfd_spindle) is more flexible? Then the plugin code can determine what is available and any new functions will be instantly available. A bit like how it is done in the core but with a single call? |
Am going to have another look at spindle load reporting for VFD spindles, this time just as a percentage (following discussion in previous PR, and in line with how it's done on other machines).
Am planning to query the maximum amps during spindle configuration, and then the actual amps periodically along with the rpm. Can then use a calculated load percentage for feedback in the realtime report etc. So far so good..
I have a question though, I only want to add this additional report data if the spindle is selected. For instance if I switch away from the Huanyang spindle to the PWM spindle with M104, then I'd want to stop adding the data in the Huanyang plugin realtime report. Is there a way within the spindle plugin to determine whether the spindle is currently active?
The text was updated successfully, but these errors were encountered: