Skip to content

Commit

Permalink
Fixed a very rare but critical bug when reducing override rates.
Browse files Browse the repository at this point in the history
- See main branch commit log for details.
  • Loading branch information
chamnit committed Aug 2, 2017
1 parent e321c82 commit 40fd602
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
10 changes: 10 additions & 0 deletions doc/log/commit_log_v1.0d.txt
@@ -1,3 +1,13 @@
----------------
Date: 2017-08-01
Author: Sonny Jeon
Subject: Fixed RAMPS control pin conflict

[fix] RAMPS soft-reset control pin interfered with Z-enable. Shifted
all control pins by plus one on the analog pins. RAMPS defines these
pins as belonging to the AUX 2 port, which is assumed to be unused.


----------------
Date: 2017-07-17
Author: Sonny Jeon
Expand Down
2 changes: 1 addition & 1 deletion grbl/grbl.h
Expand Up @@ -23,7 +23,7 @@

// Grbl versioning system
#define GRBL_VERSION "1.1f"
#define GRBL_VERSION_BUILD "20170801"
#define GRBL_VERSION_BUILD "20170802"

// Define standard libraries used by Grbl.
#include <avr/io.h>
Expand Down
7 changes: 3 additions & 4 deletions grbl/stepper.c
Expand Up @@ -973,15 +973,14 @@ void st_prep_buffer()
switch (prep.ramp_type) {
case RAMP_DECEL_OVERRIDE:
speed_var = pl_block->acceleration*time_var;
mm_var = time_var*(prep.current_speed - 0.5*speed_var);
mm_remaining -= mm_var;
if ((mm_remaining < prep.accelerate_until) || (mm_var <= 0)) {
if (prep.current_speed-prep.maximum_speed <= speed_var) {
// Cruise or cruise-deceleration types only for deceleration override.
mm_remaining = prep.accelerate_until; // NOTE: 0.0 at EOB
mm_remaining = prep.accelerate_until;
time_var = 2.0*(pl_block->millimeters-mm_remaining)/(prep.current_speed+prep.maximum_speed);
prep.ramp_type = RAMP_CRUISE;
prep.current_speed = prep.maximum_speed;
} else { // Mid-deceleration override ramp.
mm_remaining -= time_var*(prep.current_speed - 0.5*speed_var);
prep.current_speed -= speed_var;
}
break;
Expand Down

0 comments on commit 40fd602

Please sign in to comment.