Sol10 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

EECS 16B Designing Information Devices and Systems II

Fall 2017 Miki Lustig and Michel Maharbiz Homework 10


This homework is due November 16, 2017, at noon.
1. Interpolation
Samples from the sinusoid f (x) = sin(0.2πx) are shown in Figure 1. Draw the results of interpolation using
each of the following three methods:

Figure 1: Samples of f (x).


.

(a) Zero order hold interpolation.


Solution: Figure 2.

Figure 2: Zero order hold.


.

(b) Linear interpolation.


Solution: Figure 3.

EECS 16B, Fall 2017, Homework 10 1


Figure 3: Linear interpolation.
.
(c) Sinc interpolation assuming the Nyquist limit has been satisfied.
Solution: Figure 4.

Figure 4: Sinc interpolation.


.

2. Polynomial interpolation and regression


Variometers indicate the rate of climb or descent (vertical velocity) in an aerial vehicle. I have a small
variometer sensor that I would like to use on a quadrotor for altitude control. In order to evaluate the
sensor’s performance, I launch it on a small model rocket and record its measurements. The recorded values
are:
Time (s) Velocity (m/s)
0 3.75
0.5 -1.5
1.5 -8.5

(a) Perform polynomial inerpolation on these points. Show your work (you can use a computer to do a
matrix inverse).

EECS 16B, Fall 2017, Homework 10 2


Solution: Since there are three points, we can find a unique second-order polynomial that will pass
through all of the points:     
1 x1 x12 a0 y1

1 x x 2  a  = y 
 2 2  1  2
1 x3 x32 a2 y3
Plugging in the values from the table, we have:
    
1 0 0 a0 3.75
1 0.5 0.25 a1  = −1.5
    
1 1.5 2.25 a2 −8.5

We can solve for the coefficients ai by inverting the Vandermonde matrix:


    
15
a0 1 0 0
   8  4 
a1  = − 3 3 − 13   − 32 
4
a2 3 −2 23 − 17
2
   
15
a0
   435 
a1  = − 3 
a2 7
3

The final polynomial is


7 35 15
v(t) = t 2 − t +
3 3 4

(b) (Optional) The rocket is in freefall, so I expect that it will approximately follow a parabolic trajectory
(its flight will not be exactly parabolic due to wind resistance). The velocity profile of a parabolic
trajectory is linear. Perform polynomial regression using a first-order polynomial.
Solution: The final polynomial is v(t) = −8t + 15 4.

3. Turning via reference tracking


We would like the car to turn with a specified radius r and speed v∗ . The controller’s unit for distance is
encoder ticks, but each tick is approximately 1 cm of wheel circumference. To turn, we want δ to change at
a particular rate. Without loss of generality, we’ll analyze a right turn, corresponding to increasing δ . For a
left turn, we simply negate δ . Our goal is to generate a reference from the desired r and v∗ for the controller
to follow. This reference will be a function of the controller’s time-step. Inspect the following diagram:

• r - turn radius in cm where 1 cm 1 encoder tick


• ω - angular velocity
• θ - angle traveled
• d - distance traveled by the center of the car in ticks
• l - distance between the centers of the wheels in cm

From this geometry, can you write δ [k] in the following form?

δ [k] = f (r, v∗ , l, k)

EECS 16B, Fall 2017, Homework 10 3


Solution: Answer:
d[k] = v∗ k = ωrk = rθ [k]
v∗ k
θ [k] =
r
l
dL [k] = (r + )θ [k]
2
l
dR [k] = (r − )θ [k]
2
l l
δ [k] = dL [k] − dR [k] = (r + − r + )θ [k]
2 2
All of which results in:
v∗ l
δ [k] = k
r
This is the desired δ [k] = f (r, v∗ , l, k) for turning the car.

4. Redo problem 1 on the midterm

5. Redo problem 2 on the midterm

6. Redo problem 3 on the midterm

7. Redo problem 4 on the midterm

8. Redo problem 5 on the midterm

Contributors:

• John Maidens.

• Justin Yim.

• Andrew Blatner.

EECS 16B, Fall 2017, Homework 10 4

You might also like