grblHAL / ESP32

grblHAL driver for ESP32
Other
73 stars 43 forks source link

Multiple Spindle with VFD code correction #48

Closed JoachimF closed 1 year ago

JoachimF commented 1 year ago

In driver.c line 1899

PWM is not initialized when VFD is enable

#if (!VFD_SPINDLE || N_SPINDLE > 1) && defined(SPINDLE_ENABLE_PIN)
//#if VFD_SPINDLE != 1 && defined(SPINDLEPWMPIN)

If VFD is set by default, PWM is set to 100%, I don't know where to change that. Is there a way to have PMW on I2S Pin?

Regards,

Joachim

terjeio commented 1 year ago

PWM is not initialized when VFD is enable

Good catch, will fix in next commit.

If VFD is set by default, PWM is set to 100%, I don't know where to change that.

Set PWM as default and add M104 as a startup command ($Nx) to switch to the VFD?

Is there a way to have PMW on I2S Pin?

It may be possible with code changes - but I will not be able to look into that for a while. You can give it a try?

terjeio commented 1 year ago

PWM is not initialized when VFD is enable

Set N_SPINDLE to 2 to have the PWM spindle enabled together with the VFD. In the Web Builder this can be done by checking Add PWM spindle in the General tab.

In an upcoming build I have added code to ensure the PWM spindle pins will be initialized to the off state on startup (if enabled).

terjeio commented 1 year ago

The latest commit has code added for initializing the PWM output even if the PWM spindle is not the default. Handling of multiple spindles has been changed somewhat - see the readme.