grblHAL / Plugins_spindle

grblHAL plugins for spindle control
Other
9 stars 12 forks source link

Spindle load updates #13

Closed dresco closed 2 years ago

dresco commented 2 years ago

Support for spindle load reporting was added to the realtime report output in the last upstream commit.

This PR adds the necessary support code for the v1 Huanyang VFD, and a new function to retrieve the active VFD function pointers (for access from another plugin).

Load is reported as a percentage of the actual spindle amps vs maximum configured spindle amps.

// Example of access from another plugin
#if VFD_ENABLE
    const vfd_ptrs_t *vfd_spindle = vfd_get_active();
    if (vfd_spindle && vfd_spindle->get_load) {
        float load = vfd_spindle->get_load();
    }
#endif