Hi guys, I need your support because today I’m getting mad.
I’m trying to enable the spindle ON/OFF trough M3-M5 GCodes on my SKR 1.3 Board and a iot relay board.
I have configured marlin 2.0.3 in order to enable the function:
#define SPINDLE_FEATURE
and disabling the other features:
#define SPINDLE_LASER_PWM false -> to send target speed reference
#define SPINDLE_INVERT_DIR false -> to send speed inversion
then I have mapped the output pin:
#ifndef SPINDLE_LASER_ENA_PIN
#define SPINDLE_LASER_ENA_PIN P2_00 -> SKR 1.3 servo output
#endif
with this modification the servo pin is 0 V or 3.3 V following coherently M3 and M5 commands.
the next step was connecting the relay:
wired:
Vcc to 5V (servo connector SKR 1.3)
Gnd to Gnd (servo connector SKR 1.3)
In1 to P2_00 (servo connector SKR 1.3)
swiched ON -> relay always active, no effect from M3-M5 commands
Then I connected the same relay board to an Arduino UNO, tested it with the Blink.ino sketch and I verified the correct behavior of the relay board that switches ON when In1 is connected to GND and OFF on other levels.
At this point I imagined that the SKR1.3 pin is not able to drive to Gnd the servo output and I found this resource:
https://electronics.stackexchange.com/questions/245976/control-5v-relay-through-3-3v-gpio-using-npn-transistor
found in my lab some components and I built this circuit:
This circuit inverts the command logic so I inverted command logic in the fw by #define SPINDLE_LASER_ACTIVE_HIGH true.
Tested again and everything seems to work:
M3 Command
M5 Command
But… when switch on the board supply for about 10 second the relay is switched ON
Start after SKR1.3 supply
I have verified that during this “BOOT” time the servo output is driven at 1.22 V causing the spurious relay activation.
That’s all, now I’m really stuck with my mechanical engineer background I don’t know how to proceed to remove this spurious relay activation at startup… maybe I have only bought the wrong relay board…
Thank you for your support
Gabriele