... | ... | @@ -87,4 +87,68 @@ We further tried to scale all the values to Kp=800, Ki=200, Kd=1600, but this re |
|
|
Different types of surfaces was used as floor for the experiment, including a grey linoleum floor, a wooden table and white sheets of plain paper. We saw that the white surface resulted in the best results, and were therefore chosen as the general surface. The reason for this was that the detected values from the light sensor differed way more on the same place on the grey and wooden surface, as compared to to the white.
|
|
|
|
|
|
![Surface ](http://gitlab.au.dk/uploads/u4099/legolabtimadala/c2a15100a1/Surface_.png)
|
|
|
##### Picture 2: different types of surfaces, to the left grey linoleum, in the middle wood and to the right white A3 paper |
|
|
\ No newline at end of file |
|
|
##### Picture 2: different types of surfaces, to the left grey linoleum, in the middle wood and to the right white A3 paper
|
|
|
|
|
|
#### Surface angle:
|
|
|
We did not find this test worth trying, because of the difficulties on the planar surface that we experienced.
|
|
|
|
|
|
#### Light Condition:
|
|
|
In regards to how the light level in the room affected the robot, we experimented with a light setting where the lights in the room was turned on and a semi-dark room. We found that there were too much shadows in the setting with light turned on, and that this conflicted with light sensor and its detected values. Hence, the best context was in the semi-dark room with drapes closed and lights turned off. The problems that arise in the case where lights were turned on could also be caused by the lightsource not being a fluorescent lamp. A fluorescent lamp emits almost no infrared light, meaning that the sensor to some extent is insensitive to their light, as mentioned in [1].
|
|
|
|
|
|
#### Note:
|
|
|
We further tried to use the light sensor mounted on another robot design (The Segway with Rider) [3], where the light sensor was placed higher above the surface and the center of gravity is different. Here we experienced very little changes, and the results was as poorly as with the other design.
|
|
|
|
|
|
![segwayRobotHøjde](http://gitlab.au.dk/uploads/u4099/legolabtimadala/4ce5e1ebfc/segwayRobotH%C3%B8jde.png)
|
|
|
##### Picture 3: Robot setup and height from sensor to surface, inspired by “The Segway with Rider” [3].
|
|
|
|
|
|
### Conclusion
|
|
|
In the process of making the robot self- balance, we performed different experiments. By choosing the PID values with a trial and error method we found that the values Kp=400, Ki=0, Kd=600, all scaled by 100, worked best. Even though this resulted in not more than a few seconds of balance. We further tried to change the wheels on the robot to see if that changed the behaviour. The results from this were more or less the same. As we have seen in the experiments in the earlier lessons, the reflection of the surface makes an impact on the sensor, which is why we also tried different surfaces with different colors and textures,. One of the most important factors in the surrounding is still the shadows that interfere with the surface. Darkening the room also helped our robot to balance better.
|
|
|
|
|
|
Further experimentation led to mounting the light sensor on another robot design as seen in Picture 3, but the results here were just as poorly as with the first design.
|
|
|
|
|
|
## Self-balancing robots with color sensor
|
|
|
|
|
|
![SegwayRobotSmåHjulHøjde](http://gitlab.au.dk/uploads/u4099/legolabtimadala/9eea4dd24d/SegwayRobotSm%C3%A5HjulH%C3%B8jde.png)
|
|
|
##### Picture 4: Robot setup and height from sensor to surface, inspired by “The Segway with Rider”[3].
|
|
|
|
|
|
### Results
|
|
|
Below is shown a video[4] of our end result when experimenting with the self-balancing robot that uses a color sensor.
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/UTHTnAUIhdY/0.jpg)](http://www.youtube.com/watch?v=UTHTnAUIhdY)
|
|
|
##### Video 4: Self-balancing robot with color sensor
|
|
|
|
|
|
Video 4[11] shows that the robot can balance when the room is dark. It is balancing on white paper by using the white light from the sensor. We had to find the perfect balancing point when setting the offset and starting the program. The robot uses the offset to compare the live sensor data and tries to reach the offsets value. As seen in the video, the wheels are moving all the time trying to find the right angle. In the end when it begins to oscillate it is not possible for the robot to get back to the perfect offset.
|
|
|
|
|
|
We further tried using only the red light from the color sensor, but did not see any remarkable changes and therefore did not document that experiment. Together with the red light we went to try the robot in a complete dark room, but again we did not get better results.
|
|
|
|
|
|
In the latter we will talk about how we have tuned the parameters and reflect more upon the context for the robot.
|
|
|
|
|
|
#### Implemented code:
|
|
|
The code implemented [12,13] in achieving the results for this type of robot is almost similar to the previous one[8,9]. Both the GUI and the NXT software is the same except that we have added the color sensor instead of the light sensor, which also gives us the opportunity to change the color projected from the sensor, as seen in Code Snippet 4.
|
|
|
|
|
|
```
|
|
|
cs = new ColorSensor(SensorPort.S2);
|
|
|
cs.setFloodLight(Color.WHITE); //Could also be RED, etc.
|
|
|
```
|
|
|
##### Code Snippet 4[12,13]
|
|
|
|
|
|
#### Parameters:
|
|
|
We have found the PID values the same as in the first experiment, i.e by trial and error inspired by table 1[4].
|
|
|
|
|
|
The best values we found were Kp=300, Ki=20, Kd=1000 with an overall scale of 100. If we increase Kp the robot starts to overshoot and becomes unstable. If we use a smaller value the robot starts to have problems with the rise time and starts drifting one way or the other. This time Ki was most effective with a value of 20. We tried once more with a Ki value on 0, but this time it had another effect. Without a Ki value the robot could not find any steady state and continued to overshoot a bit every time. We ended up with a Kd value on 1000, this helped us handle the overshooting, however there were a larger margin. The effect of values between 800 and 1200 was almost the same, but for some reason 1000 had a bit more positive effect on the result.
|
|
|
|
|
|
#### Surface angle:
|
|
|
In the main experiments we used a horizontal surface. This worked fine, but we wanted to see how well the robot would stay in balance on an angled surface. As seen in Video 5 the robot balances in about 10 seconds on a 8° surface. A steeper angle does not work. it seems like the motors become unsurfasient and the values from the sensor is too diverse for the robot to stay in balance.
|
|
|
|
|
|
[![image alt text](http://img.youtube.com/vi/m8RDj60D8wI/0.jpg)](http://www.youtube.com/watch?v=m8RDj60D8wI)
|
|
|
##### Video 5: Self-balancing robot with color sensor on non-planar surface
|
|
|
|
|
|
#### Surface color:
|
|
|
The color of the surface in which we had the best results was white. When trying on a grey textured floor there was too much disturbance to have a self-balancing robot. We tried on a wooden table in the surface angle experiment, this seemed to work better than when the wooden table was horizontal. We do not know if this is a coincident or if the tables reflection of the light from the sensor is better when the angle of the reflection is away from the sensor.
|
|
|
#### Light Condition:
|
|
|
We have tried almost the same as in the first experiment the only exception was that we wanted to try the robot in an all dark room , so we did not have any light source at all. This did not seem to affect the robot particular in any particular way. The results from a darkroom and a semi dark room was too very similar to say which one was better.
|
|
|
We used light for the angel experiment. Here the light source came from the phone recording the video. The light source here did not seem to inflict the robots sensor. this can be due to the angle of the light source which most of the time did not make any shadows that could make interference or it indicates that the color sensors is not as sensitive to shadows as the light sensor. If this could be due to a stronger light on the color sensor that can obliterate the shadows, we do not know.
|
|
|
|
|
|
### Conclusion
|
|
|
Our obtained results indicates that the color sensor worked better than the light sensor. The robot did not work at all when using the light sensor but worked very well with the color sensor. We cannot say exactly why, but discussed several options such as, there might be better technology in the color sensor, and could be faster when updating to the NXT. Another more plausible possibility is that the color sensor is less disturbed by light and shadows. We further saw that the robot could balance for about 10 second on a non-planar surface, and it wasn’t so sensitive to surface color and texture when it was non-planar. The best PID values we found for the color sensor was Kp=300, Ki=20, Kd=1000 with an overall scale of 100. which resulted in the robot staying in balance for at least 15 seconds.
|
|
|
|