... | ... | @@ -9,7 +9,7 @@ |
|
|
**Activity duration:** 3 hours
|
|
|
|
|
|
## Goal
|
|
|
The goal of this exercise is to expirement with the NXT ultrasonic sensor and program the LEGO car with a wall follower application.
|
|
|
The goal of this exercise is to experiment with the NXT ultrasonic sensor and program the LEGO car with a wall follower application.
|
|
|
|
|
|
## Plan
|
|
|
The plan is to follow the instructions given in the instructions for Lesson 2 (http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson2.dir/Lesson.html)
|
... | ... | @@ -18,7 +18,7 @@ The plan is to follow the instructions given in the instructions for Lesson 2 (h |
|
|
|
|
|
### Exercise 1
|
|
|
|
|
|
In this exercise we want to test the precision of the ultra sonic sensor. In order to do so we have the setup which is seen in the following image.
|
|
|
In this exercise we want to test the precision of the ultrasonic sensor. In order to do this we have a setup as shown in the following image.
|
|
|
|
|
|
![IMG_1348](http://gitlab.au.dk/uploads/rene2014/lego/d119fc1509/IMG_1348.JPG)
|
|
|
|
... | ... | @@ -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 ultra sonic 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 ultra sonic 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 set point 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.
|
|
|
|
|
|
The variables in the system is as follows
|
|
|
|
... | ... | |