From 854760feb6647b07b95b1639a772f5888f896d5d Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Thu, 20 Feb 2020 16:34:25 +0100 Subject: [PATCH] api/builtins/Control: add feed_forward gain This can be useful for motors with high internal static friction. --- pybricks/builtins.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pybricks/builtins.py b/pybricks/builtins.py index bdb9981..3873ccc 100644 --- a/pybricks/builtins.py +++ b/pybricks/builtins.py @@ -53,7 +53,7 @@ class Control(): """ pass - def pid(self, kp, ki, kd, integral_range, integral_rate): + def pid(self, kp, ki, kd, integral_range, integral_rate, feed_forward): """Get or set the PID values for position and speed control. If no arguments are given, this will return the current values. @@ -69,6 +69,10 @@ class Control(): are accumulated. integral_rate (:ref:`speed` or :ref:`linspeed`): Maximum rate at which the error integral is allowed to grow. + feed_forward (:ref:`percentage`): + This adds a feed forward signal to the PID feedback signal, in + the direction of the speed reference. This value is expressed + as a percentage of the absolute maximum duty cycle. """ pass