AME 3623: Project 3
- All components of the project are due by Tuesday, March
9th at 5pm
- Groups are the same as for project 1.
- Discussion within groups is fine.
- Discussion across groups may not be about the specifics of the
solution (general programming/circuit issues are fine to
discuss).
For this project, you will be calibrating your Sharp distance sensor.
Specifically, you will be writing a function that returns a calibrated
distance.
At the end of this project, you should be able to:
- design mathematical models for transforming raw sensor data
into calibrated information,
- implement these models in code, and
- test the models.
Component 1: Micro-controller Circuit
There are no hardware changes for this project.
Component 2: Sensor Model
Given the data that you already collected, derive a
mathematical equation for distance as a function of sensor value.
Keep in mind:
- The output of the function must be a float in cm
- Using a simple mathematical function, you will be able
estimate
the distance quite well over a reasonable range. For the
purposes of navigation with these distance sensors (and nearby
obstacles), distance estimates need to be most accurate at
8 cm.
Performing a least-mean-squared fit of your function to your
data (i.e., using regression) will treat
all points equally in the fitting process. Instead, you must
favor 8cm. To do this, use a representative point
to define one point that your
function must capture well and then select any other parameters
to best capture the rest of your data (think carefully about
which point should this be)
Component 3: Analog Interface Software
Implement the following function:
- float read_distance() will read
the analog port attached to the distance sensor and return the calibrated distance in cm.
Component 4: Testing
Write a new version of the sensor_display_step() function that:
- Prints the calibrated distance in cm.
Then:
Hints
- You should not have any more calls to delay() in your code,
except in setup(). PeriodicAction does what we need here.
- As the distance to an object decreases from 8cm, the distance
sensor will start to yield smaller values, making
interpretation ambiguous. We will not test distances shorter
than 8cm.
- Your model will likely not extrapolate well beyond 80cm (in
fact, it can yield infinite or even negative distances, neither
of which make much sense). In these cases, it is appropriate in
your read_distance() function to detect this case and simply
return 80cm.
What to Hand In
Submit to a set of files to the project3 area on Gradescope by the
deadline (not a zip file). These files include:
- Documented code. Include your "ino" file. The
documentation requirements are the same as in project 1.
- Figure: a copy of graph of sensed distance vs true distance.
Other components:
- Demonstration/Code Review: All group
members must be present. This review must be completed within
five days of the deadline. However, it is better to complete these reviews
as early as possible.
Grading
For this project, we expect:
- A properly configured circuit
- Microprocessor installed
- Sharp sensor installed correctly
- Properly written software
- Function that reads from the analog port and returns a
well-calibrated distance
- step function that prints out the calibrated distance
- Properly documented code
- Project-level documentation at the top of the ino file:
name and group number, date and project number
- Function-level documentation above the function
definition. Include an abstract description of what the
function does; a list of the names, types and units
associated with each parameter and return value; and the
effects that the function has on the processor or
connected components.
- In-line documentation inside of functions: individual
lines or small groups of lines have an English
description that describes logically what the code is doing
- Labeled figures of:
- Sensed vs true distance. The sensed distance should
match the true distance over a majority of the range
(especially capturing the smaller distances)
andrewhfagg -- gmail.com
Last modified: Wed Mar 10 23:34:48 2021