@@ -37,20 +37,20 @@ In theory the actual and the measured distance should be identical. However many
### Exercise 2
The setup and process in this exercise is identical to the one in exercise 1. The result however do not change no matter what the sample interval is set to. This is due to the blocking functionality of the sensor which means that whenever a reading is requested, the program locks until the particular reading is done. Therefore the sample interval do not affect the readings from the sensor.
The setup and process in this exercise is identical to the one in exercise 1. The result however does not change no matter what the sample interval is set to. This is due to the blocking functionality of the sensor which means that whenever a reading is requested, the program locks until the particular reading is done. Therefore the sample interval does not affect the readings from the sensor.
### Exercise 3
The process in this exercise was to place the LEGO car with the ultrasonic sesnor mounted close to a wall and then pulling it backwards while reading the distance from the LCD. Unfortunatly it was not possible to measure a distance above ~150cm. This can be caused by multiple factors.
The process in this exercise was to place the LEGO car with the ultrasonic sensor mounted close to a wall and then pulling it backwards while reading the distance from the LCD. Unfortunately it was not possible to measure a distance above ~150cm. This can be caused by multiple factors.
The delay from sending a ultrasonic sound, until the echo is received is 2*distance/speed of sound.
For the maximum distance of 2.54m the delay will be 2*2.54m /343.21m/s = 14.8ms assuming the air temperature is 20 degrees of celcius. This puts a physical time limitation on the usage of the sensor. Therefore if the temperature in the room is not exactly 20 degrees celcius this will affect the sensor reading.
For the maximum distance of 2.54m the delay will be 2*2.54m /343.21m/s = 14.8ms assuming the air temperature is 20 degrees Celcius. This puts a physical time limitation on the usage of the sensor. Therefore if the temperature in the room is not exactly 20 degrees Celsius this will affect the sensor reading.
Another important factor is battery level. When the test were carried out the battery level of the LEGO car was minimal which affects the ultrasonic transmission power and thereby also the sensor reading.
Another important factor is battery level. When the test was carried out the battery level of the LEGO car was minimal which affected the ultrasonic transmission power and thereby also the sensor output.
### Exercise 4
The program described in exercise 4 is able keep a fixed distance to an object in front of the regulated device. In order to do so it implements a linear feeback system in terms of a proportional only controller where the feedback is the measured distance to the object. By subtracting the measured distance from the setpoint and multipliyng this by a Pgain factor the program will make the car drive fast when it is far away from the object and decrease the speed as it gets closer to the object.
The program described in exercise 4 is able keep a fixed distance to an object in front of the regulated device. In order to accomplish this, it implements a linear feedback system in terms of a proportional only controller where the feedback is the measured distance to the object. By subtracting the measured distance from the setpoint and multiplying this by a Pgain factor the program will make the car drive fast when it is far away from the object and decrease the speed as it gets closer to the object.