From: Joseph Coffland Date: Mon, 19 Sep 2016 04:22:01 +0000 (-0700) Subject: Fixed jog reverse direction X-Git-Url: https://git.buildbotics.com/?a=commitdiff_plain;h=8f558224683f924a336dbd9a9d3fe52dbfd1988f;p=bbctrl-firmware Fixed jog reverse direction --- diff --git a/src/plan/jog.c b/src/plan/jog.c index f700c46..ed17675 100644 --- a/src/plan/jog.c +++ b/src/plan/jog.c @@ -64,14 +64,17 @@ static jog_runtime_t jr; static stat_t _exec_jog(mp_buffer_t *bf) { // Load next velocity bool changed = false; + bool done = true; if (!jr.writing) for (int axis = 0; axis < AXES; axis++) { float Vn = jr.next_velocity[axis] * axes[axis].velocity_max; float Vi = jr.velocity[axis]; float Vt = jr.target_velocity[axis]; + if (JOG_MIN_VELOCITY < fabs(Vn)) done = false; + if (!fp_ZERO(Vi) && (Vn < 0) != (Vi < 0)) - Vn = 0; // Go zero on sign change + Vn = 0; // Plan to zero on sign change if (fabs(Vn) < JOG_MIN_VELOCITY) Vn = 0; @@ -82,7 +85,6 @@ static stat_t _exec_jog(mp_buffer_t *bf) { } } - bool done = true; float velocity_sqr = 0; for (int axis = 0; axis < AXES; axis++) {