Changes
Page history
hov havde ikke gemt
authored
Mar 09, 2015
by
Steffan Lildholdt
Show whitespace changes
Inline
Side-by-side
Lesson-4.markdown
View page @
e7c2ce2b
...
...
@@ -51,6 +51,22 @@ So in order for this application to work properly, the car had to start of the l
### Exercise 4, Line Follower that stops in a goal zone
### Exercise 5, PID Line Follower
The program for this exercise implements a standard PID controller in the following way
`
``
java
// Calculate parameters
error = calculateError();
integral = integral + error;
derivative = (error - lastError) / dt;
// Apply the PID regulation
controlledValue = (kp
* error) + (ki *
integral) + (kd
*
derivative);
controlSignal(controlledValue);
lastError = error;
Delay.msDelay(dt);
### Exercise 6, Color Sensor
...
...
...
...