diff --git a/config/printer.mendel.h b/config/printer.mendel.h index e027027..ce39707 100644 --- a/config/printer.mendel.h +++ b/config/printer.mendel.h @@ -176,6 +176,13 @@ */ //#define USE_INTERNAL_PULLUPS +/** \def Z_LATE_ENABLE + Some printers have a heavy z-axis, some a not self locking spindle. In that case + you should not activate this. This will deactivate the stepper after a finished move, + and will only activate it, when z will move. +*/ +//#define Z_LATE_ENABLE + /** \def TEMP_HYSTERESIS Actual temperature must be target +/- this hysteresis before target temperature is considered to be achieved. Also, BANG_BANG tries to stay diff --git a/config/printer.wolfstrap.h b/config/printer.wolfstrap.h index ac37efc..24bf035 100644 --- a/config/printer.wolfstrap.h +++ b/config/printer.wolfstrap.h @@ -176,6 +176,13 @@ */ //#define USE_INTERNAL_PULLUPS +/** \def Z_LATE_ENABLE + Some printers have a heavy z-axis, some a not self locking spindle. In that case + you should not activate this. This will deactivate the stepper after a finished move, + and will only activate it, when z will move. +*/ +//#define Z_LATE_ENABLE + /** \def TEMP_HYSTERESIS Actual temperature must be target +/- this hysteresis before target temperature is considered to be achieved. Also, BANG_BANG tries to stay diff --git a/configtool/miscellaneouspage.py b/configtool/miscellaneouspage.py index 1ce3b48..758407d 100644 --- a/configtool/miscellaneouspage.py +++ b/configtool/miscellaneouspage.py @@ -13,6 +13,7 @@ class MiscellaneousPage(wx.Panel, Page): self.font = font self.labels = {'USE_INTERNAL_PULLUPS': "Use Internal Pullups", + 'Z_LATE_ENABLE': "Z Late Enable", 'EECONFIG': "Enable EEPROM Storage", 'BANG_BANG': "Enable", 'BANG_BANG_ON': "On PWM Level:", @@ -74,6 +75,10 @@ class MiscellaneousPage(wx.Panel, Page): cb = self.addCheckBox(k, self.onCheckBox) sz.Add(cb, pos = (6, 1)) + k = 'Z_LATE_ENABLE' + cb = self.addCheckBox(k, self.onCheckBox) + sz.Add(cb, pos = (7, 1)) + b = wx.StaticBox(self, wx.ID_ANY, "BANG BANG Bed Control") b.SetFont(font) sbox = wx.StaticBoxSizer(b, wx.VERTICAL) diff --git a/configtool/printer.generic.h b/configtool/printer.generic.h index c5a2944..38d5abc 100644 --- a/configtool/printer.generic.h +++ b/configtool/printer.generic.h @@ -176,6 +176,13 @@ */ #define USE_INTERNAL_PULLUPS +/** \def Z_LATE_ENABLE + Some printers have a heavy z-axis, some a not self locking spindle. In that case + you should not activate this. This will deactivate the stepper after a finished move, + and will only activate it, when z will move. +*/ +#define Z_LATE_ENABLE + /** \def TEMP_HYSTERESIS Actual temperature must be target +/- this hysteresis before target temperature is considered to be achieved. Also, BANG_BANG tries to stay diff --git a/dda.c b/dda.c index 8fdc780..f2bc945 100644 --- a/dda.c +++ b/dda.c @@ -279,7 +279,10 @@ void dda_create(DDA *dda, TARGET *target) { stepper_enable(); x_enable(); y_enable(); - // Z is enabled in dda_start() + #ifndef Z_LATE_ENABLE + z_enable(); + // #else Z is enabled in dda_start(). + #endif e_enable(); // since it's unusual to combine X, Y and Z changes in a single move on reprap, check if we can use simpler approximations before trying the full 3d approximation. @@ -492,8 +495,10 @@ void dda_start(DDA *dda) { if ( ! dda->nullmove) { // get ready to go psu_timeout = 0; - if (dda->delta[Z]) - z_enable(); + #ifdef Z_LATE_ENABLE + if (dda->delta[Z]) + z_enable(); + #endif if (dda->endstop_check) endstops_on(); @@ -715,8 +720,10 @@ void dda_step(DDA *dda) { #ifdef DC_EXTRUDER heater_set(DC_EXTRUDER, 0); #endif - // z stepper is only enabled while moving - z_disable(); + #ifdef Z_LATE_ENABLE + // Z stepper is only enabled while moving. + z_disable(); + #endif // No need to restart timer here. // After having finished, dda_start() will do it.