1
0

Update CruiseControlMX5.pde

This commit is contained in:
2025-01-02 23:33:46 +01:00
parent 7cb389d4a3
commit cc4614e463

View File

@@ -10,9 +10,9 @@ import java.util.regex.Pattern;
static final Pattern FLOAT_REGEX = Pattern.compile("^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$"); static final Pattern FLOAT_REGEX = Pattern.compile("^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$");
static final String COM_PORT = "COM5"; static final String COM_PORT = "COM4";
static final int speedStart = 0, speedEnd = 240; static final int speedStart = 0, speedEnd = 240;
static final int minSampleSize = 50, maxSampleSize = 600; static final int minSampleSize = 50, maxSampleSize = 1000;
static final float minTimeSpan = 5F, maxTimeSpan = 60F; static final float minTimeSpan = 5F, maxTimeSpan = 60F;
static final float[] graphPos = new float[2]; static final float[] graphPos = new float[2];
@@ -44,15 +44,14 @@ float timeSpan;
boolean showError = true, showIntegral = true, showDerivative = true, showSpeed, showAcceleration, showServo; boolean showError = true, showIntegral = true, showDerivative = true, showSpeed, showAcceleration, showServo;
boolean autoScaleError, autoScaleIntegral = true, autoScaleDerivative = true, autoScaleSpeed, autoScaleAcceleration = true, autoScaleServo = true; boolean autoScaleError, autoScaleIntegral = true, autoScaleDerivative = true, autoScaleSpeed, autoScaleAcceleration = true, autoScaleServo = true;
float errorRangeMin = -3F, errorRangeMax = 3F, integralRangeMin = Float.NaN, integralRangeMax = Float.NaN, derivativeRangeMin = Float.NaN, derivativeRangeMax = Float.NaN, speedRangeMin = 0F, speedRangeMax = 150F, accelerationRangeMin = Float.NaN, accelerationRangeMax = Float.NaN; float errorRangeMin = -5F, errorRangeMax = 5F, integralRangeMin = -200, integralRangeMax = 200, derivativeRangeMin = Float.NaN, derivativeRangeMax = Float.NaN, speedRangeMin = 0F, speedRangeMax = 150F, accelerationRangeMin = Float.NaN, accelerationRangeMax = Float.NaN;
int servoRangeMin = 1170, servoRangeMax = 1970; int servoRangeMin = Integer.MIN_VALUE, servoRangeMax = Integer.MIN_VALUE;
boolean sampleOrTimeGraph = false; boolean sampleOrTimeGraph = false;
boolean drawSmoothCurves; boolean drawSmoothCurves;
void setup() { void setup() {
size(1600, 512); size(1600, 512);
pixelDensity(displayDensity());
windowTitle("Cruise Controller MX5"); windowTitle("Cruise Controller MX5");