Background:

advertisement
ME414/514
Homework 7
Due 5-20-2009
Midterm #2 Review
Background:
This homework is to be done individually and will help review the material covered in
midterm #2.
Matlab / Serial Commands:
1. What are the two commands needed to initialize Matlab use of a serial com port?
2. The following code is copied from cdc_task.c.
a) What command would have to be entered in Matlab to call sensorSetup()
on the microcontroller?
b) What command in Matlab would read the voltage on Port F0?
c) How many bytes would be transmitted from the microcontroller to a
laptop in part a?
d) How many bytes would be transmitted from the microcontroller to a
laptop in part b?
e) Assume that the commented debugging lines 178-180 and 187-189 are no
longer commented. Fill out the table below for part B.
Microcontroller Buffer
Buffer[0] =
Buffer[1] =
Buffer[2] =
Buffer[3] =
Buffer[4] =
Buffer[5] =
Buffer[6] =
Buffer[7] =
Laptop Serial Buffer
Buffer[0] =
Buffer[1] =
Buffer[2] =
Buffer[3] =
Buffer[4] =
Buffer[5] =
Buffer[6] =
Buffer[7] =
ME414/514
Homework 7
Due 5-20-2009
Midterm #2 Review
Roborealm:
Download CheckerDetector.robo and checker2.jpg from below the Homework #7 link.
1. What is the purpose of the affine command?
2. What is the purpose of rotating and doing the perspective command?
3. Which function defines the BLOBS array that contains the X and Y coordinates for
the checker blobs?
4. What is the purpose of the VBScript Program?
5. What option in Roborealm needs to be enabled to communicate checker coordinates
to Matlab?
Labview:
Below is the output of a 4-30 cm Sharp IR distance detector. The red region of the graph
is highlighted in red, to show that a mechanical stop disables the sensor from being closer
than 4 cm to an object.
1. Sketch a VI on Labview that would read the voltage on PortF1, where the sensor
is plugged in, and convert the read value to a distance using the linear
approximation below. What is the maximum error of this approximation (in cm).
2. Sketch a VI on Labview that would read the voltage on PortF1 and convert the
read value to a distance using the two piece linear approximation below.
Download