From b1edd667e51f3f3f95d530f4094b6edee2618ab0 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Wed, 23 Jan 2019 21:11:51 +0100 Subject: [PATCH] modmotor: respect previously specified stall limits --- pybricks/ev3devices.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pybricks/ev3devices.py b/pybricks/ev3devices.py index c723789..c12992e 100644 --- a/pybricks/ev3devices.py +++ b/pybricks/ev3devices.py @@ -171,14 +171,14 @@ class Motor(): """ pass - def run_until_stalled(self, speed, stop_type=Stop.coast, duty_limit=100, stall_speed=5, stall_time=200): - """run_until_stalled(self, speed, stop_type=Stop.coast, duty_limit=100, stall_speed=5, stall_time=200) + def run_until_stalled(self, speed, stop_type=Stop.coast, duty_limit=None, stall_speed=None, stall_time=None): + """run_until_stalled(self, speed, stop_type=Stop.coast, duty_limit=default, stall_speed=default, stall_time=default) Run the motor at a constant speed (angular velocity) until it stalls. The motor is considered stalled when it cannot move even with the maximum torque. Specifically, the motor is stalled when the duty cycle computed by the PID controllers has reached the maximum (so ``duty`` = ``duty_limit``) and still the motor cannot reach a minimal speed (so ``speed`` < ``stall_speed``) for a period of at least ``stall_time``. These settings lets you adjust how soon the motor should be considered to be stalled. - These settings are exactly the same as :func:`.set_stall_settings`, but in this function they are only applied temporarily. For example, you can choose ``duty_limit=50`` to limit the motor torque during this maneuver, but it returns to its original value aftwards. + These optional settings are exactly the same as :func:`.set_stall_settings`, but in this method they are only applied temporarily. For example, you can choose ``duty_limit=50`` to limit the motor torque during this maneuver, but it returns to its previous value aftwards. Arguments: speed (:ref:`speed`): Speed of the motor.