From b5d0d91e7493ee587aa50d40b3dd770ee7dd6edb Mon Sep 17 00:00:00 2001 From: Robin Krens Date: Wed, 24 Jan 2024 11:28:24 +0100 Subject: [PATCH] minor cleanup --- src/pid-controller.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/pid-controller.js b/src/pid-controller.js index f225098..b284e64 100644 --- a/src/pid-controller.js +++ b/src/pid-controller.js @@ -1,8 +1,4 @@ class PIDController { - //public enum DerivativeMeasurement { - // Velocity, - // ErrorRateOfChange - //} constructor() { this.PIDParams = {proportionalGain: 2, integralGain: 0.0, derivativeGain: 2, iMin: -1, iMax: 1, integralSaturation: false, derivativeInitialized: false, outputMax: 1, outputMin: -1, magnitude: 10, force: 0, derivativeMeasurement: "Velocity"}; this.valueLast; @@ -35,7 +31,7 @@ class PIDController { if (this.derivativeInitialized) { if (this.PIDParams.derivativeMeasurement == "Velocity") { - deriveMeasure = -valueRateOfChange; + deriveMeasure = -valueRateOfChange; } else { deriveMeasure = errorRateOfChange; } @@ -47,7 +43,6 @@ class PIDController { result *= this.PIDParams.magnitude; this.PIDParams.force = result * 60; /* this routine is called ~60seconds */ - //console.log(result*60 + " N"); return result; //return Math.min(Math.max((result, this.PIDParams.outputMin), this.PIDParams.outputMax)); } -- 2.7.4