diff --git a/config/CreatBot_D1000/base.cfg b/config/CreatBot_D1000/base.cfg index 946ba385a..b02424fe0 100644 --- a/config/CreatBot_D1000/base.cfg +++ b/config/CreatBot_D1000/base.cfg @@ -419,6 +419,7 @@ gcode: [gcode_macro PROBE_SERVO_CLOSE] gcode: SET_SERVO SERVO=probe_servo angle=130 + G4 P2000 [gcode_macro _START_PRINT_BASE] description: Call when starting to print diff --git a/config/CreatBot_D1000_V0/base.cfg b/config/CreatBot_D1000_V0/base.cfg index 0e245940f..925cadd87 100644 --- a/config/CreatBot_D1000_V0/base.cfg +++ b/config/CreatBot_D1000_V0/base.cfg @@ -355,6 +355,7 @@ gcode: [gcode_macro PROBE_SERVO_CLOSE] gcode: SET_SERVO SERVO=probe_servo angle=130 + G4 P2000 [gcode_macro _START_PRINT_BASE] description: Call when starting to print diff --git a/config/CreatBot_D600Pro2/base.cfg b/config/CreatBot_D600Pro2/base.cfg index c87325575..d594d5f67 100644 --- a/config/CreatBot_D600Pro2/base.cfg +++ b/config/CreatBot_D600Pro2/base.cfg @@ -419,6 +419,7 @@ gcode: [gcode_macro PROBE_SERVO_CLOSE] gcode: SET_SERVO SERVO=probe_servo angle=130 + G4 P2000 [gcode_macro _START_PRINT_BASE] description: Call when starting to print diff --git a/config/CreatBot_D600Pro2_V0/base.cfg b/config/CreatBot_D600Pro2_V0/base.cfg index 536808ca6..b32caee74 100644 --- a/config/CreatBot_D600Pro2_V0/base.cfg +++ b/config/CreatBot_D600Pro2_V0/base.cfg @@ -356,6 +356,7 @@ gcode: [gcode_macro PROBE_SERVO_CLOSE] gcode: SET_SERVO SERVO=probe_servo angle=130 + G4 P2000 [gcode_macro _START_PRINT_BASE] description: Call when starting to print diff --git a/config/CreatBot_F430NX/base.cfg b/config/CreatBot_F430NX/base.cfg index 1169e773a..531d0b9bb 100644 --- a/config/CreatBot_F430NX/base.cfg +++ b/config/CreatBot_F430NX/base.cfg @@ -570,8 +570,8 @@ gcode: [gcode_macro PROBE_SERVO_CLOSE] gcode: - G4 P500 SET_SERVO SERVO=probe_servo angle=165 + G4 P2000 [gcode_macro _START_PRINT_BASE] description: Call when starting to print @@ -625,6 +625,8 @@ gcode: [gcode_macro END_PRINT] gcode: + {% set svv = printer.save_variables.variables %} + {% set y_offset = svv.nozzle_y_offset_val|default(0)|float %} M400 G92 E0 G1 E-10.0 F3600 @@ -633,6 +635,7 @@ gcode: {% set dual_mode = printer['gcode_macro _SET_DUAL_MODE'].dual_mode|default("primary") %} {% if dual_mode == "copy" or dual_mode == "mirror" %} G0 Z1.00 F6000 + _ACTIVATE_PRIMARY_MODE G90 _PARK_extruder _PARK_extruder1 @@ -645,7 +648,7 @@ gcode: M107 G1 Z2 F3000 G90 - G0 Y300 F3600 + G0 Y{300-(y_offset if printer.toolhead.extruder == 'extruder1' else 0)} F3600 # BED_MESH_CLEAR [gcode_macro PRINT_END] diff --git a/klippy/extras/servo.py b/klippy/extras/servo.py index 99b5cb6e4..b0163956a 100644 --- a/klippy/extras/servo.py +++ b/klippy/extras/servo.py @@ -74,11 +74,12 @@ class PrinterServo: if self.signal_duration: if abs(self.signal_duration / 0.02 - round(self.signal_duration / 0.02)) < 1e-9: self.signal_duration -= 0.001 - print_time = max(print_time, print_time + self.signal_duration) + print_time = max(print_time + SERVO_SIGNAL_PERIOD, print_time + self.signal_duration) self.mcu_servo.set_pwm(print_time, 0) + self.last_value_time = print_time def _handle_ready(self): print_time = self.printer.lookup_object('toolhead').get_last_move_time() - self._handle_signal_duration(print_time) + self._set_pwm(print_time, self.initial_pwm) def _get_pwm_from_angle(self, angle): angle = max(0., min(self.max_angle, angle)) width = self.min_width + angle * self.angle_to_width @@ -90,6 +91,7 @@ class PrinterServo: cmd_SET_SERVO_help = "Set servo angle" def cmd_SET_SERVO(self, gcmd): print_time = self.printer.lookup_object('toolhead').get_last_move_time() + print_time = max(print_time, self.last_value_time) width = gcmd.get_float('WIDTH', None) if width is not None: if self.steps_decomposed: