chiark / gitweb /
Corrected e-length calculation in planner
authorErik van der Zalm <erik@vdzalm.eu>
Sat, 11 Feb 2012 17:36:42 +0000 (01:36 +0800)
committerdaid <daid303@gmail.com>
Sun, 12 Feb 2012 10:02:12 +0000 (18:02 +0800)
Marlin/planner.cpp

index 2eb0733330556073f250c5376319d2800dc0a1ca..b895b95e52101c129428f7fd8d9030a7c97079ef 100644 (file)
@@ -518,7 +518,7 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
   delta_mm[Z_AXIS] = (target[Z_AXIS]-position[Z_AXIS])/axis_steps_per_unit[Z_AXIS];
   delta_mm[E_AXIS] = (target[E_AXIS]-position[E_AXIS])/axis_steps_per_unit[E_AXIS];
   if ( block->steps_x == 0 && block->steps_y == 0 && block->steps_z == 0 ) {
-    block->millimeters = delta_mm[E_AXIS];
+    block->millimeters = abs(delta_mm[E_AXIS]);
   } else {
     block->millimeters = sqrt(square(delta_mm[X_AXIS]) + square(delta_mm[Y_AXIS]) + square(delta_mm[Z_AXIS]));
   }