EML 4312: Project 01 (updated October 1, 2020)

Due on Canvas on October 13 by 11:00am

100 points

1. Use the mass-spring-damper system shown to the right where

M = 7 kg, B = 3 N-s/m, and K = 4 N/m.

F is a force applied to the mass (M), and X is the position (m).

M

K

B

F X

(a) Derive the system’s 1 degree-of-freedom (i.e., X direction) equation of motion. (5 pts.)

(b) Calculate the transfer function for the system (XF ). (5 pts.)

(c) Create a Matlab script (“Lastname-OneMassStep”) that numerically calculates and plots

the motion of the mass over time (you can start from the example posted on Canvas

that we went over in lecture 12). Include a graph of the mass position (X) from t = 0

to t = 25 given a step force input equal to 7 N (note, there is no feedback in this case;

the 7 N is a step force). Compare the numerical solution to a solution using Matlab’s tf

and step commands. Label axes and lines in all graphs. (10 pts.)

(d) Add PID feedback to the numerical model and tune the feedback gains so X reaches and

stays within 2% of 3 m in less than 5 seconds with no more than 0.2 m overshoot. Turn

in this Matlab code (named “Lastname-OneMassFeedback”). Include two plots: (1) the

position over time and (2) the force applied over time. (15 pts.)

• Turn in the following: equation of motion with derivation, transfer function with deriva-

tion, “Lastname-OneMassStep.pdf” (using Matlab publish with plot), and “Lastname-

OneMassFeedback.pdf” (using Matlab publish with two plots). Label all plots clearly.

2. Use the double mass-spring-damper system where

M1 = 2 kg, M2 = 1 kg,

B1 = 0.3 N-s/m, B2 = 0.7 N-s/m,

K1 = 10 N/m, and K2 = 5 N/m.

M1 M2

K1 K2

B2B1

Ffeedback

X1 X2

(a) Derive the system’s 1 degree-of-freedom (i.e., X direction) equations of motion. (20 pts.)

(b) With initial conditions of X2(0) = 1 and Ẋ2(0) = Ẍ2(0) = X1(0) = Ẋ1(0) = Ẍ1(0) = 0,

plot the motion of both masses on a single graph and label the lines and axes. Turn in

this Matlab code (named “Lastname-TwoMassesInitial”). (20 pts.)

(c) Program PID feedback and tune the gains such that X2 moves into its resting position

in half the time and with fewer oscillations than without feedback. Include two plots:

one showing the positions over time and the other showing the force applied over time.

Turn in this Matlab (named “Lastname-TwoMassesFeedback”). (25 pts.)

• Turn in equations of motion (with derivation), “Lastname-TwoMassesInitial.pdf” (us-

ing Matlab publish with plots for both masses) and “Lastname-TwoMassesFeedback.pdf”

(using Matlab publish with two plots: one showing both masses and one showing the

applied force). Label all plots clearly.

1

To be clear, you should submit on Canvas the following five PDF files:

(a) One PDF file named “Lastname.pdf” including:

i. Derivations for part 1(a,b)

ii. Plots for part 1(c,d). Note, only plots (no code) should be turned in here.

iii. Derivations for part 2(a)

iv. Plots for 2(b,c). Note, only plots (no code) should be tur