Spindle speed close to minimum fix.
- When spindle speed is close to the minimum rpm, the PWM value would be zero or lower than allowed. The computation error was caused by setting the minimum PWM value to zero, when it should have been 1. - Added a compiler check for minimum PWM to be greater than zero. - Moved some of the spindle PWM macros to a more appropriate place in the cpu_map.h.
This commit is contained in:
@ -360,7 +360,8 @@
|
||||
// setting, like rpm max to max PWM. So the variable spindle pin will not output the voltage range between
|
||||
// 0V for disabled and the voltage set by the minimum PWM for minimum rpm.
|
||||
// NOTE: Compute duty cycle at the minimum PWM by this equation: (% duty cycle)=(SPINDLE_MINIMUM_PWM/256)*100
|
||||
// #define SPINDLE_MINIMUM_PWM 5 // Default disabled. Uncomment to enable. Integer (0-255)
|
||||
// Value must be greater than zero.
|
||||
// #define SPINDLE_MINIMUM_PWM 5 // Default disabled. Uncomment to enable. Integer (1-255)
|
||||
|
||||
// By default on a 328p(Uno), Grbl combines the variable spindle PWM and the enable into one pin to help
|
||||
// preserve I/O pins. For certain setups, these may need to be separate pins. This configure option uses
|
||||
@ -580,6 +581,12 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SPINDLE_MINIMUM_PWM)
|
||||
#if !(SPINDLE_MINIMUM_PWM > 0)
|
||||
#error "SPINDLE_MINIMUM_PWM must be greater than zero."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------
|
||||
OEM Single File Configuration Option
|
||||
|
||||
|
Reference in New Issue
Block a user