Lab 1 Oral presentations - Electrical and Computer Engineering at

advertisement
UNIVERSITY OF UTAH
ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT
ECE 1000
LAB 1 Oral Presentation Contents
Each student must make one oral presentation in lab during the semester. Contents for oral
presentations are listed below for Lab 1. Talks start the second week of Lab 1.
Presentations will last five minutes and will be given at the beginning of the lab session. The
presentations will typically describe work performed the previous or current week in lab by way
of review. Practice your talk and be succinct. Stick to the five-minute time frame.
Presentation 1.1: Thermistor measurements
a) Explain that your presentation will discuss how you measured the resistance of the
thermistor versus temperature
b) Describe the procedure you followed to measure your thermistor. Address the
following issues as you proceed:
i) Settings (such as °C rather than °F) used for the calibrated temperature probe and
its multimeter.
ii) Settings used for the multimeter measuring the thermistor resistance.
iii) Draw a plot on the board showing the data points you obtained for thermistor
resistance versus temperature. This plot will be RT in ohms versus temperature in
°C, (linear scales as opposed to logarithmic scales used for least squares later on).
iv) Note the highest and lowest temperature you were able to achieve.
v) Ask students in the lab for the lowest and highest values anyone saw for RT, and
write them on the board.
c) Conclude your presentation by commenting on whether your data appears to follow an
exponential curve and whether it has some data points that appear spurious. Note: the
thermistor equation doesn't say the plot you draw (RT versus T) will be an exponential.
It says instead that the plot of RT versus 1/T will be an exponential. Nevertheless, you
should get a smooth curve that is similar to an exponential, if all goes well.
Presentation 1.2: Thermistor characteristics
a) Explain that your presentation will discuss the mathematics for modeling the thermistor
and how to linearize the model so a straight line will model the thermistor response.
b)
c)
d)
€
€
€
e)
€
€


β 1 − 1 
T T0 

Write the equation on the board for the thermistor: RT = R0e
Step through the derivation of the equation that linearizes the model:
ln(RT ) = ln(R0 ) + β T1 − β T1
0
Equate the linearized model to the equation
€ y = ax + b by identifying x, y, a, and b:
1
x=T
i)
ii) y = ln(RT )
iii) a = β
iv) b = ln(R0 ) − β T1
0
€
Conclude your talk by sketching (by eye) where your line fit would be.
Presentation 1.3: Least-squares fit of thermistor data
a) Explain that your presentation will describe the mathematics behind a least-squares fit
for a straight line.
b) Draw a plot on the board showing the data points you obtained for ln(RT) versus 1/T.
This plot should be approximately linear.
i) Label the data points as (x1, y1), (x2, y2), (x3, y3), ... (xN, yN) where N is the number
of data points you have.
ii) Draw a straight line fit of your data by hand. Label the straight line y = ax + b.
c) Discuss how you would measure the error at each data point for a straight line fit:
i) Use a measure like absolute value of error, or error squared, that is always positive
so positive and negative errors don't cancel out for a bad fit.
ii) Sum the measured errors at all the data points to get the total error.
iii) Point out that we use squared error because it is easier to work with
mathematically.
N
2
iv) Write down the equation for total squared error: E = ∑ [ yi − (axi + b)] where the
i=1
d)
data points are (xi, yi).
Point out that, from calculus, the minimum value of any function such as E as a function
of parameters a and b must occur where the derivatives of E with respect to a and b
€
equal zero.
i) Write down the two derivative equations:
N
dE
= 2∑ [ yi − (axi + b)] xi = 0
da
i=1
N
dE
= 2∑ [ yi − (axi + b)] = 0
db
€
e)
i=1
Finish your talk by noting that the polyfit function in Matlab™ solves the equations for
the derivatives to find a and b.
N
€
a∑
i=1
N
N
xi2 + b
N
∑ xi = ∑ yi xi
i=1
N
i=1
N
a∑ xi + b∑1 = ∑ yi
€
i=1
i=1
i=1
€
2
ECE 1000
LAB 1 Oral Presentation Contents (cont.)
Presentation 1.4: Derivation of vo: Kirchhoff's Laws.
a) Explain that your presentation will discuss the voltage loops and current sums at nodes
used to derive the equation for vo.
b) Draw the Lab 1 circuit on the board.
c) Erase the op-amp and replace it with a source labeled vo.
d) Combine R2 and RT and call that Req.
d) Point out the voltage loops and current sums you used to derive vo, and write (but do not
solve) the equations for each loop.
e) Conclude your talk by noting how many voltage loops and how many current sums at
nodes you used.
Presentation 1.5: Derivation of vo: Algebraic solution.
a) Explain that your presentation will discuss the solution of the equation for vo.
b) Draw the Lab 1 circuit and final equations for the previous presentation on the board.
c) Note which equations you used to isolate variables to substitute into other equations.
Write the equation for each isolated variable you obtained as you solved for vo, but do
not try do all the algebra on the board.
d) Write down the final equation for vo.
e) Conclude your talk by noting how each component affects the final equation. In
particular, vo is directly proportional to the 12 V source voltage.
Presentation 1.6: Derivation of vo: Consistency check.
a) Explain that your presentation will discuss a consistency check for the thermistor
circuit.
b) Draw the Lab 1 circuit and the equation for vo on the board.
c) Set R2 and R4 to 0 Ω for your consistency check. Note that one has to be careful with
op-amps and not short the inputs together or connect the minus input directly to a
voltage source.
d) Note that with R2 and R4 set to 0 Ω, the voltage loop through R4, across the + and inputs, through R2, and through vo is 0 V + 0 V + 0 V + vo = 0 V. Thus, vo = 0 V.
e) Show that the formula for vo gives a value of zero, too, when R2 and R4 are set to 0 Ω.
f) Conclude your talk by noting that other consistency checks are possible (but they are
somewhat limited in number for the Lab 1 circuit because of the op-amp).
3
Presentation 1.7: Optimal linear response for vo.
a) Explain that your presentation will discuss the linearization of the Lab 1 circuit output.
b) Sketch Fig. 2(a) on the board and note that the resistance, RT, of the thermistor has an
exponential response that accounts for the curvature of vo versus T in Fig. 2(a).
c) Sketch Fig. 2(b) on the board and note that the linear response for vo may be partially
understood by considering the value of RT||R2.
d) Using your values of Ro and β, and using R2 = 5Ro, draw a plot of RT||R2 versus T for T
between 0 and 100 °C. (Use a spreadsheet to calculate values every 10 °C.) Note the
curvature of the plot.
e) Repeat (d) but use R2 = Ro/5. Note that the plot is more linear than in (d).
f) Conclude your talk by noting that R2 is only part of the explanation for the linearized
response of vo, but it gives an indication of how linearization is possible.
Presentation 1.8: Squared error calculation for vo versus straight line response.
a) Explain that your presentation will discuss the Matlab™ code that calculates the squared
error for vo versus a straight line temperature response.
b) Sketch Fig. 2(b) on the board and draw a dot on each curve at 50 °C.
c) Note that the squared error between the two curves at 50 °C is the square of the distance
between the two dots. Comment that we measure the total error between the two curves
by adding up the squared error at 100 points separated by 1 °C.
d) Write the lines of Matlab™ code that calculate the squared error for the two curves.
You need not write all of the code for calculating vo; just write vo = ...
e) Explain each line of the Matlab™ code that calculates the squared error.
f) Conclude your talk by noting that the fmins function calls the squared-error function
many times as it tries to find resistor values that minimize the error between vo and a
straight-line response.
Presentation 1.9: Use of fmins to find optimal circuit component values.
a) Explain that your presentation will discuss the Matlab™ code that calls the fmins
function to find optimal resistor values for the circuit.
b) Write the lines of Matlab™ code that initialize the resistor values and call the fmins
function.
c) Identify which value is R1, which value is R2, and so forth in the initial vector x0 used as
an argument for fmins.
d) Note that the name of the function that calculates squared error is an argument of the
fmins function.
e) Write the first line of code in the Matlab™ function that calculates squared error. Note
that initial vector x0 will appear as an argument passed into the squared-error function.
Also, note that the squared-error function must extract R1, R2, and so forth from the x0
vector in the same order they are stored in x0.
f) Conclude your talk by noting that the fmins function calls the squared-error function
many times before it returns a final x vector containing the optimal R1, R2, and so forth.
4
Download