intelligent robotics assignment 1 · intelligent robotics assignment 1 team 4 helen hancox, kaziwa...

7
Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium range infrared (IR) sensor is 10cm to 80cm. In our experiments however we are going to test the medium IR sensor between the distances of 5cm and 85cm for the purposes of stress testing. Hypothesis: “The medium range IR sensor is accurate to within 1cm between a range of 5cm and 85cm, 95% of the time, when the distance is measured against a vertical wooden surface.” 2 Method The measurements of the IR sensor are taken at 5cm intervals, and 100 readings are taken at each interval with a half second delay between each reading. The sensor is mounted on a Lego block to ensure that the vertical angle between it and the target surface stays consistent throughout, as moving the sensor may change this. The Lego block can then easily be moved without affecting this angle. The front of the sensor is lined up with the front of the block to ensure that the sensor is always in a consistent place, the sensor is secured with Blu Tack so that it doesn't move. To ensure measurements are taken at the correct distances, plain white paper is used which is marked with horizontal lines at 5cm intervals. The paper is laid down in front of the wooden surface, and the Lego block is placed on the lines during the tests. To ensure that readings are output on the computer screen, the Intellibrain needs to be connected to the computer using a communications (COM) cable, so it should be ensured that the COM cable is connected to both the Intellibrain and the computer. The IR sensor also needs to be connected to the Intellibrain; this is done by plugging the sensor into one of the analogue ports on the Intellibrain. The specific port that the IR sensor is plugged into is referred to in the code. In this case it is plugged into analogue port 1. Before the tests can be conducted, the Java code to run the experiment should be compiled and loaded onto the Intellibrain, to ensure that the code is correct, it is run on the Intellibrain without recording the results. 1 of 7 Illustration 1: Set Up Of Sensor In Experiment Illustration 2: Set Up Of Sensor In Experiment

Upload: others

Post on 08-Jun-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

Intelligent Robotics Assignment 1

Team 4Helen Hancox, Kaziwa Hassan, Shaun Parsons

1 IntroductionThe published range of the Sharp GP2D12 medium range infrared (IR) sensor is 10cm to 80cm. In our experiments however we are going to test the medium IR sensor between the distances of 5cm and 85cm for the purposes of stress testing.

Hypothesis: “The medium range IR sensor is accurate to within 1cm between a range of 5cm and 85cm, 95% of the time, when the distance is measured against a vertical wooden surface.”

2 MethodThe measurements of the IR sensor are taken at 5cm intervals, and 100 readings are taken at each interval with a half second delay between each reading. The sensor is mounted on a Lego block to ensure that the vertical angle between it and the target surface stays consistent throughout, as moving the sensor may change this. The Lego block can then easily be moved without affecting this angle. The front of the sensor is lined up with the front of the block to ensure that the sensor is always in a consistent place, the sensor is secured with Blu Tack so that it doesn't move. To ensure measurements are taken at the correct distances, plain white paper is used which is marked with horizontal lines at 5cm intervals. The paper is laid down in front of the wooden surface, and the Lego block is placed on the lines during the tests. To ensure that readings are output on the computer screen, the Intellibrain needs to be connected to the computer using a communications (COM) cable, so it should be ensured that the COM cable is connected to both the Intellibrain and the computer. The IR sensor also needs to be connected to the Intellibrain; this is done by plugging the sensor into one of the analogue ports on the Intellibrain. The specific port that the IR sensor is plugged into is referred to in the code. In this case it is plugged into analogue port 1.

Before the tests can be conducted, the Java code to run the experiment should be compiled and loaded onto the Intellibrain, to ensure that the code is correct, it is run on the Intellibrain without recording the results.

1 of 7

Illustration 1: Set Up Of Sensor In Experiment Illustration 2: Set Up Of Sensor In Experiment

Page 2: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

To begin the experiment the Lego block is placed on the first horizontal line and the code is run. The measurements which the IR sensor takes, is output to the screen, these can be copied and pasted into the chosen tool for analysis. Once the measurements are taken, the IR sensor is moved to the next horizontal line, and the code is re-run, until all readings are taken and recorded for each distance that is intended in the test. Once readings are taken at all the distances, the test needs to be repeated 3 times to factor out noise; however more tests could be conducted following the same principles.

3 Analysis

Once we had completed our tests we analysed our data by plotting graphs for the results of each test. Graphs 1, 3 and 5 show the average distance recorded at each distance compared with the actual distance. Graphs 2, 4 and 6 show the standard deviation of our results at each distance.

2 of 7

Graph 1: Test 1 Data Summary

0 10 20 30 40 50 60 70 80 90

0

10

20

30

40

50

60

70

80

90

Test 1 Data

Average Distance Recorded

True Distance (cm)

Re

cord

ed

Dis

tanc

e (

cm)

Graph 2: Test 1 Standard Deviation

0 10 20 30 40 50 60 70 80 90

0.00

5.00

10.00

15.00

20.00

25.00

30.00

35.00

40.00

Test 1 Standard Deviation

Standard Deviation

True Distance (cm)

Sta

ndar

d D

evia

tion

Graph 3: Test 2 Data Summary Graph 4: Test 2 Standard Deviation

0 10 20 30 40 50 60 70 80 90

0.00

5.00

10.00

15.00

20.00

25.00

Test 2 Standard Deviation

Standard Deviation

True Distance (cm)

Sta

ndar

d D

evia

tion

0 10 20 30 40 50 60 70 80 90

0

10

20

30

40

50

60

70

80

90

Test 2 Data

Average Distance Recorded

True Distance (cm)

Re

cord

ed

Dis

tanc

e (

cm)

Page 3: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

As we can see from the graphs, the average distance recorded was generally greater than the actual distance, however this is not true from 70cm upwards because the IR sensor did not successfully take readings 100% of the time, null readings have been given a distance of 0cm, and thus the average of the 100 readings is considerably lower than the average of the actual readings that were successfully taken. This is again relayed in the standard deviation charts, at 70cm the standard deviation significantly increases and this again is due to the IR sensor not successfully taking 100 readings.

Graph 7 shows an overall average for all the data we recorded, this shows a similar pattern to the graphs for the individual tests. Graph 8 shows an overall average for all of the data between 10 and 65cm. Both of these graphs have also got Linear Regression for Average Distance Recorded plotted on them. From graph 7 it can be seen that Linear Regression is not a good model for our observed data because it has a low coefficient of determination (R2) of 0.04. However in graph 8, it can be seen that Linear Regression is a good model for our data, as the R2 is 1.

R2 is a way to see how well the model fits our observed data. R2 will be a value between 0 and 1, 0 means the model does not fit our data, and one would mean the model is a perfect match for our data.

In order to be able to prove or disprove our hypothesis, we need to look at how accurate the results we took are, in percentage terms. Table 9 shows this is tabular format. At each distance we took a count of the number of readings that were within 1cm of the actual distance (column 2). From this we then expressed this in percentage terms (column 3). To make this clearer we plotted the percentage of accurate readings on a graph. This can be seen in graph 9.

3 of 7

Graph 5: Test 3 Data Summary

0 10 20 30 40 50 60 70 80 90

0

10

20

30

40

50

60

70

80

90

Test 3 Data

Average Distance Recorded

True Distance (cm)

Re

cord

ed

Dis

tanc

e (

cm)

Graph 6: Test 3 Standard Deviation

0 10 20 30 40 50 60 70 80 90

0.00

5.00

10.00

15.00

20.00

25.00

Test 3 Standad Deviation

Standard Deviation

True Distance (cm)

Sta

ndar

d D

evia

tion

Page 4: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

4 of 7

Graph 7: Average Readings With Line Of Best Fit

0 10 20 30 40 50 60 70 80 90

0

10

20

30

40

50

60

70

80

90

f(x) = 0.19x + 25.9R² = 0.04

Average Readings With Line Of Best Fit

Average Distance RecordedLinear Regression for Av-erage Distance Recorded

True Distance (cm)

Re

cord

ed

Dis

tanc

e (

cm)

Graph 8: Average Readings With Line Of Best Fit (10-65cm)

0 10 20 30 40 50 60 70

0

10

20

30

40

50

60

70

80

f(x) = 1.13x - 1.47R² = 1

Average Readings With Line Of Best Fit (10-65cm)

Average Distance RecordedLinear Regression for Av-erage Distance Recorded

True Distance (cm)

Re

cord

ed

Dis

tanc

e (

cm)

Page 5: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

5 of 7

Table 1: All Data Accuracy Within 1cm

Dis tanc e (c m ) Re ading s Within 1 c m Pe rc e ntag e Re ading s Within 1 c m (% )5 0 0

1 0 3 00 1 001 5 3 00 1 0020 297 9925 21 7 72. 3 33 0 69 233 5 3 0 1 040 1 4 4.6745 1 4 4.6750 9 355 1 5 560 1 9 6. 3 365 1 0 3 . 3 370 2 0.6775 0 080 9 385 0 0

Ov e rall 1305 25 . 59

Graph 9: Percentage Of Accurate Readings Per Distance

0 10 20 30 40 50 60 70 80 90

0

20

40

60

80

100

120Percentage Of Accurate Readings Per Distance

Percentage Readings With-in 1cm (%)

True Distance (cm)

Per

cen

tage

(%

)

Page 6: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

4 ConclusionsWe were expecting to see that measurements would be consistent and accurate between the published distances, however this was not the case.

At a distance of 5cm the IR sensor was not accurate, but still took readings. It continually read measurements of 15cm. At distances of 10, 15 and 20cm, the sensor was accurate to within 1cm, more then 95% of the time, as stated in our hypothesis. At distances over 20cm the accuracy of the infrared sensor diminished. After 65cm the infrared sensor could not be relied upon as it did not always take readings.

From these observations we can conclude that the IR sensor is more then 95% accurate between distances of 10-20cm. Between distances of 20-65cm the sensor is between 72% accurate for a distance of 25cm and 3% accurate for a distance of 65cm.

These observations have led to us to be able to disprove our original hypothesis. However we have been able to suggest an alternative hypothesis. 'the IR sensor is accurate to within 10% of the actual distance between distances of 10 to 65 cm, 80% of the time', meaning for the distance of 10 cm the IR sensor will give a reading of 11cm or 9cm most of the time, for 20cm it will read either 18 or 22cm and so on.

Table 2 shows how accurate the readings are based on our alternative hypothesis. Here we have shown a count of the accurate readings that were taken within 10% of the actual distance, this has also been expressed in percentage terms. To make this clearer it can also be seen plotted on a graph (graph 10). From the table and the graph we can see that our alternative hypothesis is a lot more accurate then the first one, that was suggested. However there are still some slight issues around the distances of 55, 60 and 65cm.

6 of 7

Table 2: Data Accuracy Within 10% Between 10-65cm

Ac tual Dis tanc e Re ading s Within 1 0% Pe rc e ntag e Re ading s Within 1 0% (% )1 0 300 1 00. 001 5 300 1 00. 0020 300 1 00. 0025 300 1 00. 003 0 300 1 00. 003 5 286 95 . 3 340 290 96. 6745 259 86. 3 350 275 91 . 6755 76 25 . 3 360 56 1 8. 6765 1 50 50. 00

Ov e rall 2892 80. 3 3

Page 7: Intelligent Robotics Assignment 1 · Intelligent Robotics Assignment 1 Team 4 Helen Hancox, Kaziwa Hassan, Shaun Parsons 1 Introduction The published range of the Sharp GP2D12 medium

For this experiment the results were taken using the IR sensor and taking measurements off a wooden board, one of the materials which we could well need to measure against during our second assignment. As a group we expect the accuracy of the sensor to be different depending on the object we are measuring against and what material it is made off. We will also need to consider environmental conditions like a strong bright light as again this is likely to affect the accuracy of the sensor. All of these issues will need to be factored into any work we do later with the IR sensor.

7 of 7

Graph 10: Percentage Of Readings Within 10% Per Distance

0 10 20 30 40 50 60 70

0.00

20.00

40.00

60.00

80.00

100.00

120.00

Percentage Of Readings Within 10% Per Distance

Percentage Readings Within 10% (%)

True Distance (cm)

Per

cen

tage

(%

)