Homing and feed hold bug fixes.
WARNING: Bugs may still exist. This branch is a work in progress and will be pushed to the edge branch when at beta stability. Use at your own risk. - Homing freezing issue fixed. Had to do with the cycle stop flag being set incorrectly after the homing cycles and before the pull-off maneuver. Now resets the stepper motors before this can happen. - Fixed an issue with a rare feed hold failure. Had to do with feed hold ending exactly at the end of a block. The runtime protocol now sets the QUEUED and IDLE states appropriately when this occurs. Still need to clean this code up however, as it’s patched rather than written well. - Updated version build via $I command. - Forgot to comment on a new feature for the last commit. Since steps are integers and millimeters traveled are floats, the old step segment generator ignored the step fraction differences in generating the segment velocities. Didn’t see like it would be much of a big deal, but there were instances that this would be a problem, especially for very slow feed rates. The stepper algorithm now micro-adjusts the segment velocities based on the step fractions not executed from the previous segment. This ensures that Grbl generates the velocity profiles EXACTLY and noticeably improves overall acceleration performance.
This commit is contained in:
@ -61,11 +61,11 @@ void spindle_run(uint8_t direction, float rpm)
|
||||
|
||||
// Halt or set spindle direction and rpm.
|
||||
if (direction == SPINDLE_DISABLE) {
|
||||
|
||||
|
||||
spindle_stop();
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if (direction == SPINDLE_ENABLE_CW) {
|
||||
SPINDLE_DIRECTION_PORT &= ~(1<<SPINDLE_DIRECTION_BIT);
|
||||
} else {
|
||||
@ -80,7 +80,7 @@ void spindle_run(uint8_t direction, float rpm)
|
||||
if ( rpm > SPINDLE_RPM_RANGE ) { rpm = SPINDLE_RPM_RANGE; } // Prevent uint8 overflow
|
||||
uint8_t current_pwm = floor( rpm*(255.0/SPINDLE_RPM_RANGE) + 0.5);
|
||||
OCR_REGISTER = current_pwm;
|
||||
|
||||
|
||||
#ifndef CPU_MAP_ATMEGA328P // On the Uno, spindle enable and PWM are shared.
|
||||
SPINDLE_ENABLE_PORT |= (1<<SPINDLE_ENABLE_BIT);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user