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
The goal is to compare the results from the ultrasonic sensor with measured distance to different objects/material.
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.
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.
In this exercise, we try to change the sample interval between readings to see how it affects readings from the sensor.
The plan is to measure the a steady distance in different sample intervals, respectively; 0 ms, 50 ms, 100 ms, 300 ms, 1000ms
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.
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.
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.
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
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.
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:
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.
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.
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.
With a minPower of 50 and gain of 20 the robot oscillated as shown in the video, link:
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.
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.
Write the NQC (“not quite c”) program to a similar java program and the compare the algorith with ones suggested in the exercises from the book.
Result/Conclusion Writing a program in Java that had similarities to the NQC program resulted in some issue. We had a hard time writing the java, and only achieved a three-state solution. This wasn’t efficient enough for the robot to turn corners properly and follow the wall again. Furthermore, this was caused because of the constant turns, if we could have done the algorithm correctly we would achieve different and sensitive turns according to the distance to the wall.
Comparison of the NQC to the different algorithms from the book:
1.Using this suggestion results in the issues as mentioned above
2.The second suggestion uses hard and gentle turns, to make cornering easier, furthermore it helps the robot to stay closer to the wall, however it lacks the state of going straight
3.This suggestion uses the former two suggestions and looks very familiar to NQC algorithm in theory, however we can’t compare them with a graph.