Goal is to: Control spindle RPM with cmmd := M03 Sxxxx, where S is RPM value
Firmware changes:
in Configuration_adv.h:
#define SPINDLE_FEATURE // Enabled
//#define LASER_FEATURE
than enabled PWM on pin which is defined in pins_RAMPS.h: (pin 8 )
`
#if EITHER(SPINDLE_FEATURE, LASER_FEATURE)
#define SPINDLE_LASER_ACTIVE_STATE LOW
#define SPINDLE_LASER_PWM true
#define SPINDLE_LASER_PWM_INVERT false
And now the part that gives me the headache:
/**
- Speed / Power can be set (‘M3 S’) and displayed in terms of:
- PWM255 (S0 - S255)
- PERCENT (S0 - S100)
- RPM (S0 - S50000) Best for use with a spindle
*/
#define CUTTER_POWER_UNIT RPM
if CUTTER_POWER_UNIT is seated as RPM and command M03 Sxxxxx
is send, it turns on PWM on pin but voltage is between 0v and 0.56v.
if CUTTER_POWER_UNIT is seated as PERCENT or PWM255 it works like charm.
In percent mode I can send for example
M03 S50
and voltage on the pin will be ~6v, with
M03 S100
voltage on the pin is 12v, also if it is in PWM255 mode with command M03 Sxxx it works without the problem.