|
|
__Group 4__
|
|
|
__Lab Notebook 2__
|
|
|
__Date: 19/02 2015__
|
|
|
|
|
|
__Group members participating:__ Tine Hansen, Daniel Moltzen, Mads Eriksen, Lars Høeg
|
|
|
|
|
|
__Activity duration:__ 8 hours
|
|
|
|
|
|
|
|
|
__Results from class exercises__
|
|
|
|
|
|
__Exercise 1__
|
|
|
|
|
|
The goal is to compare the results from the ultrasonic sensor with measured distance to different objects/material.
|
|
|
|
|
|
Plan
|
|
|
|
|
|
![Screen Shot 2015-02-24 at 13.00.05](http://gitlab.au.dk/uploads/u4099/legolabtimadala/6b3f51652a/Screen_Shot_2015-02-24_at_13.00.05.png)
|
|
|
|
|
|
The plan is to compare the distance to different objects made of two different materials (wood and fabric). The sensor is placed 17 cm above ground.
|
|
|
|
|
|
setup: to measure the distance between the object and the car and how different materials affects the sensor, we started to measure 30 cm away from the object and then moved further away until we reach a value of 255. Below is our measurements.
|
|
|
|
|
|
Result
|
|
|
|
|
|
![Screen Shot 2015-02-24 at 13.01.36](http://gitlab.au.dk/uploads/u4099/legolabtimadala/477d5fd686/Screen_Shot_2015-02-24_at_13.01.36.png)
|
|
|
|
|
|
Conclusion
|
|
|
|
|
|
As the table shows the values from the sensor, when measuring the distance to a wooden wall, results in a very low variation from the actual value. When comparing the distance values to the fabric (soft pillow) you see that the max distance the sensor could measure was 131 cm. Our first thought it that it seems like the pillow absorbs the sound waves, causing them not to return to the sensor. However this might not be the case because you only see a little variation in regards to the actual value.
|
|
|
|
|
|
__Exercise 2__
|
|
|
|
|
|
In this exercise, we try to change the sample interval between readings to see how it affects readings from the sensor.
|
|
|
|
|
|
Plan
|
|
|
|
|
|
The plan is to measure the a steady distance in different sample intervals, respectively; 0 ms, 50 ms, 100 ms, 300 ms, 1000ms
|
|
|
|
|
|
Result
|
|
|
|
|
|
![Screen Shot 2015-02-24 at 13.03.18](http://gitlab.au.dk/uploads/u4099/legolabtimadala/20cc7ad20f/Screen_Shot_2015-02-24_at_13.03.18.png)
|
|
|
|
|
|
Conclusion
|
|
|
|
|
|
It looks like that the necessary minimum sample interval (300 ms) from the Alfa_03 is not a present requirement in the distance measured. We are not quite sure why this is, it could be a result of optimised code meaning it can read an echo quicker.
|
|
|
|
|
|
|
|
|
__Exercise 3__
|
|
|
|
|
|
In this exercise we test if the sensor can measure an object 254cm away and under what conditions it is possible. Furthermore we discuss if the time limit for measurement and if it limits the sensor in anyway.
|
|
|
|
|
|
Plan
|
|
|
|
|
|
We setup the sensor in front of the object, in this case a wooden wall, and moves it graduatly away until we reach the point where the interface displays 255. we use a sample interval of 1000 ms and 15 ms.
|
|
|
|
|
|
![Screen Shot 2015-02-24 at 13.15.04](http://gitlab.au.dk/uploads/u4099/legolabtimadala/2e9061d612/Screen_Shot_2015-02-24_at_13.15.04.png)
|
|
|
|
|
|
Result
|
|
|
|
|
|
Sound travels with the speed of 340.29 m / s = 34.02900 cm / ms. This means that it takes 34.02900 / 254 = 7,4642216933 ms for the sound to travel a distance of 254 cm. However, in our case, this needs to be multiplied by 2, hence the sound travels forth and back. We therefore get a minimum thread sleep of 7,4642216933 * 2 = 14,928443387 ms to measure a distance of 254 cm.
|
|
|
|
|
|
Context 1 - 1000ms : 248 cm
|
|
|
|
|
|
Context 2 - 15 ms : 254 cm
|
|
|
|
|
|
![Screen Shot 2015-02-24 at 13.15.40](http://gitlab.au.dk/uploads/u4099/legolabtimadala/8eb5467804/Screen_Shot_2015-02-24_at_13.15.40.png)
|
|
|
|
|
|
Conclusion
|
|
|
|
|
|
The max distance we got with a sample interval at 1000 ms was 248. Under other conditions, such as using a different object as reference or trying to direct the sensor echo using a screen to filter out noise from the surroundings that could impact the measured distance in a wrong way. When lowering the sample interval to 15 ms and choosing a different context, we got the sensor to measure the distance of 254 cm (see picture below). The ideal would be that we had tested using the same sample interval in the two different contexts.
|
|
|
|
|
|
__Exercise 4__
|
|
|
|
|
|
In this exercise we describe the behaviour of the car and what is the setpoint, process variable and manipiulated variable of the controller?
|
|
|
|
|
|
To find out what the controller does to the cars behaviour, we implement the tracker tester on our LEGO car.
|
|
|
|
|
|
The implemented tracker tester and the cars behaviour is shown in this video:
|
|
|
|
|
|
Result/Conclusion
|
|
|
|
|
|
What kind of controller has been implemented in this control loop ?
|
|
|
|
|
|
The controller implemented is a proportional-controller since it only adjusts the manipulated variable according to the proportional value- which is then send to the motor. Thereby not taking into accounts past and future errors.
|
|
|
What is the setpoint (SP), process variable (PV) and the manipulated variable (MV) of the controller?
|
|
|
|
|
|
By looking at the provided classes we see that the our desired distance acts as the SP, the distance itself is our PV, and the power to the wheels is our MV.
|
|
|
|
|
|
Video: https://drive.google.com/file/d/0B9cMMqmYdJxCOGJsZklmSVdiYjQ/view?usp=sharing
|
|
|
|
|
|
|
|
|
__Exercise 5__
|
|
|
|
|
|
In this exercise we experiment with different values of minPower and Pgain in the program RCparamTracker.java so the car will wildly oscillate around a distance from a given object.
|
|
|
|
|
|
Plan
|
|
|
|
|
|
The plan is to experiment with different values for minPower and the Pgain to make the robot oscillate wildly and furthermore to see how each of these two variables impacts the behaviour of the car.
|
|
|
|
|
|
Result
|
|
|
|
|
|
With a minPower of 50 and gain of 20 the robot oscillated as shown in the video, link:
|
|
|
|
|
|
https://drive.google.com/file/d/0B9cMMqmYdJxCandQbEt0RUtpajg/view?usp=sharing.
|
|
|
|
|
|
Conclusion
|
|
|
|
|
|
By increasing the minPower og Pgain it gets wilder. When increasing the gain too much, the robot tries to correct the errors, and this results in oscillation and overshoot.
|
|
|
|
|
|
__Exercise 6__
|
|
|
|
|
|
In this exercise we use the program of Philippe Houdain to create a similar program that makes the car follow a wall. Then we compare the NQC algorithms with other suggestions.
|
|
|
|
|
|
|
|
|
Not finished yet, will be done by tuesday evening and uploaded to course page and our Gitlab account.
|
|
|
|
|
|
|
|
|
__References__
|
|
|
http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson2.dir/Lesson.html |