grblHAL / Plugins_spindle

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

VFD as default spindle ($395) does not expose VFD settings #21

Closed andrewmarles closed 1 year ago

andrewmarles commented 1 year ago

The dynamic spindle selection seems to work well for VFD spindles when they are selected as spindle > 0. The is_vfd_spindle and _is_modvfd_selected functions expose the appropriate settings and they appear to work as expected.

But if I set the default spindle to be one of the VFD spindles, it never enumerates correctly. $476 is never exposed, nor do the MODVFD settings if that spindle is selected. It does appear that the MODVFD spindle is in fact being activated by the core as I can see traffic on the RS485 interface and it generates error14 when it can't communicate. I have spent a fair amount of time trying to figure out where it is going wrong but no success yet.

terjeio commented 1 year ago

But if I set the default spindle to be one of the VFD spindles, it never enumerates correctly. $476 is never exposed

$460 is for setting the modbus address if a single VFD spindle is selected (for backwards compatibility). Here is what I get in ioSender when I compile locally (STM32F4xx) with #define VFD_ENABLE 5:

image

Are you compiling with the Web Builder?

andrewmarles commented 1 year ago

I am compiling from source (plugins plus UF2 bootloader packaging). I am using VFD_ENABLE of -1 and N_SPINDLE of 8 so that support for all the different VFDs is compiled in and the user can change at runtime.

terjeio commented 1 year ago

Oops, I am messing up a bit, too much going on... Try with this spindle/select.c:

select.zip

I'll be away for a few days so do not have time for much testing.

andrewmarles commented 1 year ago

This seems to have resolved the issue. Thanks for the quick fix, I figured it was something simple and I just wasn't seeing it.

terjeio commented 1 year ago

Fix commited.