... | @@ -143,16 +143,16 @@ |
... | @@ -143,16 +143,16 @@ |
|
// Variabler til PID
|
|
// Variabler til PID
|
|
|
|
|
|
// P led
|
|
// P led
|
|
int Kp = 300; // Proportional controller
|
|
int Kp = 300; //Proportional controller
|
|
int offset = sensor.getThreshold();
|
|
int offset = sensor.getThreshold();
|
|
int Tp = 50; // Target power. Den verdi der bruges nor error er 0
|
|
int Tp = 50; // Target power. Den verdi der bruges nor error er 0
|
|
|
|
|
|
// I led
|
|
// I led
|
|
int Ki = 0; // Integral constant
|
|
int Ki = 0; // Integral constant
|
|
int integral = 0;
|
|
int integral = 0;
|
|
|
|
|
|
// D led
|
|
// D led
|
|
int Kd = 0; // Derivative constant
|
|
int Kd = 0; // Derivative constant
|
|
int lastError = 0;
|
|
int lastError = 0;
|
|
int derivative = 0;
|
|
int derivative = 0;
|
|
|
|
|
... | @@ -188,7 +188,7 @@ |
... | @@ -188,7 +188,7 @@ |
|
LCD.drawString("Program stopped", 0, 0);
|
|
LCD.drawString("Program stopped", 0, 0);
|
|
LCD.refresh();
|
|
LCD.refresh();
|
|
}
|
|
}
|
|
|
|
>
|
|
>´´´
|
|
>´´´
|
|
>
|
|
>
|
|
>We started adjusting the numbers for the PID constants but we did not have time to find the desired values before it was time to hand in. Therefore we have not yet fully completed a satisfying PID controlled line follower robot.
|
|
>We started adjusting the numbers for the PID constants but we did not have time to find the desired values before it was time to hand in. Therefore we have not yet fully completed a satisfying PID controlled line follower robot.
|
... | | ... | |