Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective We will be analyzing the error associated with our ultrasonic ranger today. It will not be used to track motion yet, since we need

Objective
We will be analyzing the error associated with our ultrasonic ranger today. It will not be used to track motion yet, since we need to have a sense first of how much error we should expect in its measurements that we take in the future. Data is only as good as the sensor that takes it. In this lab you will plot real time data from the sensor, and analyze it for its standard deviation and standard error.
Please provide answers in your lab submission for all the questions in the procedure below. They are indicated by Q1, Q2, etc. What you are to submit to Canvas is a pdf file that is produced as an output from a MATLAB live script. This is not an m-file, nor is it an output of the command window. In the live script you need to have all the code you used, all the outputted values for the statistics, and the plots of the acquired data. That way you are submitting a complete record of what you did. You are also to include nicely formatted, written responses in complete sentences to any questions in the lab. Naturally, put a title and your name at the top as you would on any submission you'd turn in by hand in person.
Please note that code blocks in MATLAB live scripts are not meant for English writing. There are text blocks for that purpose. Writing English sentences in code blocks tends to look like a mess - with random purple text and sentences that run right off the page. Please don't do that.
If you write code that returns an error in the live script and don't clean it up, but instead leave the error message(s), it will result in point deductions for formatting. The goal you should have in mind with your submission is that it has the same clean formatting you'd expect of a lab report turned in by hand.
Please note that MATLAB will output the live script as pdf directly, so you don't need any external software.
Make sure to include answers to the 15 background questions on statistics along with your lab submission (in the same live script).
Procedure
1. At the bottom of this document is computer code that you can use in MATLAB to allow real-time data acquisition from the ultrasonic sensor. It will plot the data and save it in an array in MATLAB for analysis.
Simply cut and paste all the code into a new code block in a live script. To create a life script in MATLAB, go to the top bar and choose New/Live script. Here is a link to MATLAB naming conventions: Naming conventions for when you assign a name to your live script.
2. Set up your sensor such that it faces a stationary object. It is best if they both are stable and on the same surface so that, for instance, error doesn't arise due to a table shaking on which the sensor sits, while the stationary object is on another unshaken surface. Whatever your stationary object is, it should be stable and have a side that faces the sensor. This is necessary since sound waves need to reflect back to the sensor, and they will reflect just like balls or light rays bounce (reflect) off surfaces.
3. Use the icon that looks like a play button to start data acquisition. You should see a plot of data and it will acquire data for around 10 seconds. Exactly how long it runs depends on your computer processor and graphics capabilities. Ultimately it will run until 300 data points are gathered.
4. Notice that in the area of MATLAB called 'Workspace' there are now two arrays of data that we will use. They are called t and x. x contains the distance measurements taken by the sensor and t contains the time stamps from when they were taken.
5. Use the length() command and find out how many distance measurements were taken. Type length(x) to get this value. Q1: What is the length of the array?
6. If nothing was moving, there was only one distance between the sensor, yet the x values are not all the same. This is the nature of doing science. Error is inherent in measurements. In this case we measured one quantity (the distance to that object) many (the length of the array) times. Because of this, even though our sensor has error (and therefore we couldn't expect a single measurement to be "right"), we can take advantage of making multiple measurements and get a more precise value.
7. Find the mean value of the values in x. This is done by typing mean(x). Q2: What is your mean value in meters?
8. The standard deviation of the array values can be found using std(x). Q3. What is your standard deviation. Note that the 'e' is scientific notation. So 4.8929e-04 means
This 'e' notation is both how you input scientific notation into computers, and how they output it to us. It is, however, NEVER appropriate to write it this way by hand! Note that some computer languages use a capital 'E'. MATLAB will accept either as input.
9. The standard error mentioned in the reading will need to be calculated next. Please find it for your x array. Note that the square root is found in MATLAB by using the sqrt() command, an

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

9th Edition

B01JXPZ7AK, 9780805360479

More Books

Students also viewed these Databases questions

Question

What is a verb?

Answered: 1 week ago

Question

LO2.2 List the main characteristics of the market system.

Answered: 1 week ago

Question

LO2.5 Describe the mechanics of the circular flow model.

Answered: 1 week ago