... | ... | @@ -57,7 +57,7 @@ |
|
|
>Try the LineFollowrCal.java. The program uses the simple class Car.java to move the car.
|
|
|
>
|
|
|
>#### Plan
|
|
|
>
|
|
|
> Upload the code to the robot and observe what happens.
|
|
|
>
|
|
|
>#### Results
|
|
|
>After running the LineFollowerCal.java we observed that it runs fine along a black line but as soon it encounters a different color eg. green or grey it starts spinning uncontrollably. This is partly due to the program only distinguishing between black and non-black colors. This means that whenever the robot encounters a color different from black it will diverse from its course. From this point it might not detect black colors even though it drives over a black line due to its sample interval of 10ms. This interval makes the robot detect colors once every 10ms and all other time it is blind to it's surrounding meaning that we cannot be sure that i makes a reading as it drives over black.
|
... | ... | @@ -134,6 +134,7 @@ |
|
|
>After the implementation the code with our PID controller looked like this:
|
|
|
>
|
|
|
> ´´´
|
|
|
>
|
|
|
> BlackWhiteSensor sensor = new BlackWhiteSensor(SensorPort.S3);
|
|
|
>
|
|
|
> sensor.calibrate();
|
... | ... | @@ -189,6 +190,7 @@ |
|
|
> LCD.drawString("Program stopped", 0, 0);
|
|
|
> 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.
|
... | ... | |