From 3ce7f6aa5e13e99776d3e40d443fc9e226e359ec Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Mon, 19 Oct 2020 22:59:16 +0200 Subject: [PATCH] stepper: fix pump bug where it doesn't stop --- scripts/planktoscope/stepper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/planktoscope/stepper.py b/scripts/planktoscope/stepper.py index 555774e..7297741 100644 --- a/scripts/planktoscope/stepper.py +++ b/scripts/planktoscope/stepper.py @@ -381,7 +381,7 @@ class StepperProcess(multiprocessing.Process): return # We are going to use microsteps, so we need to multiply by 16 the steps number - nb_steps = self.focus_steps_per_mm * distance * 16 + nb_steps = round(self.focus_steps_per_mm * distance * 16, 0) logger.debug(f"The number of steps that will be applied is {nb_steps}") steps_per_second = speed * self.focus_steps_per_mm * 16 logger.debug(f"There will be a speed of {steps_per_second} steps per second") @@ -436,7 +436,7 @@ class StepperProcess(multiprocessing.Process): logger.error("It should be either FORWARD or BACKWARD") return - nb_steps = self.pump_steps_per_ml * volume + nb_steps = round(self.pump_steps_per_ml * volume, 0) logger.debug(f"The number of steps that will be applied is {nb_steps}") steps_per_second = speed * self.pump_steps_per_ml / 60 logger.debug(f"There will be a speed of {steps_per_second} steps per second")