From 6227a0dfb928e4cbe5c61736390328442e43f01f Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Wed, 31 Oct 2018 20:45:56 -0700 Subject: [PATCH 1/2] 1) Fixed documentation about speed unit and 2) extrusion speed is now limited to printer profile max value --- docs/api/printer.rst | 2 +- src/octoprint/printer/standard.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/api/printer.rst b/docs/api/printer.rst index c110a6de1..1c8483a55 100644 --- a/docs/api/printer.rst +++ b/docs/api/printer.rst @@ -219,7 +219,7 @@ Issue a print head command axes values are relative amounts) or to absolute position (provided axes values are coordinates) * ``speed``: Optional. Speed at which to move. If not provided, minimum speed for all selected axes from printer profile will be used. If provided but ``false``, no speed parameter will be appended to the command. Otherwise - interpreted as an integer signifying the speed in mm/s, to append to the command. + interpreted as an integer signifying the speed in mm/min, to append to the command. home Homes the print head in all of the given axes. Additional parameters are: diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index 044e32cbc..dcccba761 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -369,10 +369,14 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): # Use specified speed (if any) extrusion_speed = speed + max_e_speed = printer_profile["axes"]["e"]["speed"] if speed is None: # No speed was specified so default to value configured in printer profile - extrusion_speed = printer_profile["axes"]["e"]["speed"] + extrusion_speed = max_e_speed + else: + # Make sure that specified value is not greater than maximum as defined in printer profile + extrusion_speed = min([speed, max_e_speed]) self.commands(["G91", "G1 E%s F%d" % (amount, extrusion_speed), "G90"], tags=kwargs.get("tags", set()) | {"trigger:printer.extrude"}) From 32d5b250131aeaca2b9a34a3003edb414932360f Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Thu, 1 Nov 2018 21:44:42 -0700 Subject: [PATCH 2/2] Removed unnecessary variable initialization --- src/octoprint/printer/standard.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/octoprint/printer/standard.py b/src/octoprint/printer/standard.py index dcccba761..80cae7aa5 100644 --- a/src/octoprint/printer/standard.py +++ b/src/octoprint/printer/standard.py @@ -368,7 +368,6 @@ class Printer(PrinterInterface, comm.MachineComPrintCallback): printer_profile = self._printerProfileManager.get_current_or_default() # Use specified speed (if any) - extrusion_speed = speed max_e_speed = printer_profile["axes"]["e"]["speed"] if speed is None: