# Spring Mass Damper Transfer Function Example

Okay welcome to back to eme 32:14 mechatronics Lawrence Tech here for passage and current I'm going to go through a create a whole series of these hopefully short I try to keep them sharp but sometimes you get into the subject and just have to get into it you know a series of short videos will recover specific topics the first one is be transfer functions we'll look at time response we'll look at the frequency response and some fourier stuff and system identification i've got some videos on the plas transforms and bode plots I'll probably leave those I might come back to those but what I'm going to do is I'm going to resin give you a big lecture and you know all the theory I want to keep these practical I want to keep these basically I'm going to do some examples I'll work through an example and I would encourage you to get the pencil and paper out and work along with it you know if if I make a giant leap in algebra or a giant leap for in a transformation from from the difference equation to Laplace domain equation you know stop the video work out the intermediate steps make sure that you get to the same answer I got to and if you don't one of us made a mistake and if I made a mistake pointed out and we'll fix it but you know make sure you can do what I'm doing.

That you get this on an exam and we'll we'll just chunk into this and I'll create the extra videos as we go there's nothing polished here there's no big PowerPoint I've got exactly one page of notes on this whole thing or.

It won't it won't take us that long I hope and it's oh I will also I'll use MATLAB towards the end to some simulations and show how this works you can you know build the models in MATLAB if you want some of the other videos I would encourage you to have MATLAB open as well because we'll be going back and forth more than on this particular one.

There is our spring mass damper this this box here is our math sits on some wheels it has a mass of five kilograms believe it or not. This is supposed to be a spring. Okay, I think I've already given you my. This is why I'm an engineer not an artist joke Cavan die. Okay, but the spring has a constant of K of three.

The spring force will be basically the force will be three times the Delta X the difference from in position from wherever the unsprung position is or on natural position. This is a damper with a damping coefficient of two the force on a damper is of course B times X dot and I'm leaving this open to having some initial conditions like having a initial position point five meters away from where you would normally come to rest and we're also going to be applying an external force of some form or another step function sine functions whatever we'll be applying those as we go and just illustrate how they work and we'll talk about the course response the free response and we'll play with some of these constants in MATLAB to show you how the equations change and how you know how how the actual response happens in well it's not real life but a simulation of real life. Okay.

Let's start out with what we call Newton's law right F equals MA that's always a good place to start or actually I should say the sum of the forces because that's that's a bad summer I drew the sum of the forces equals mass times acceleration we know the mass we are going to calculate or input the forces because there's going to be the external force force the spring force the damper and then we can calculate acceleration and from acceleration we can calculate things like velocity and position just by integrating.

Let's write out our equation here we can say that M X double dot that's our ma equals of some of our forces we have some applied force as a function of time we have a user - inside we have our force due to the damping which is the X dot and we have our force from the spring which is just K X ok.

There is an ordinary differential equation on trying to solve it as a differential equation is difficult but we can slide this into the Laplace domain quite nicely let me just there can be some more room to work and I can do this pretty much by inspection I'm going to rearrange the equation put the force on the right by itself put all these terms which have a which are function of X on the left side of the equation and I'm going to transform the whole thing into a plasterer main all in one big step because saves time and I have it written down and if you need to do those steps if you're not comfortable take the time pencil and paper work it out this whole pretty much this whole exercise can be done on pencil and paper.

Starting with the force on the right side equation I don't know what that force is a function of time is at the moment.

I'm just going to write it as f of F and that's equal to we have to transform the force K here.

It just since it's just X is just K X of F let me write that better. Okay, X of s and our convention normally would be these these would be uppercase and these would have been lowercase in in the time domain but with it's just too hard to write it that way.

Use your imagination I'll transform this term next oops we went crazy with the eraser oh boy. Okay.

My B of X dot is B times s times X of s and you know multiplying by ass is the same as the derivative and I also have an initial condition that I need to account for and that's just X at time equals zero that's the time based value of x at time equals zero their initial condition the race is too fat the next term is the that's a plus is the mass times acceleration term and that one I'm going to need a little bit of room.

That's m/s squared because the second derivative X of s minus the initial condition here for X dot since I'm making a new derivative from X dot X dot 0 minus and I'm taking the derivative of the initial condition of X.

It will be F X 0 and there's a plus sign there.

There is our transformation and rearrangement from Laplace domain to from time domain from a time domain differential equation to our last Laplace domain equation. Okay, and I'm going to rearrange it yet again and what I'm going to do is factor out X of s all by itself and I will come up with or I'm going to solve for X of a slash today not factored out X of s equals 1 over M s squared plus B let's be consistent here make that lowercase B S Plus K plot times F of F plus X dot of 0 plus 1 plus F X of 0 all over M s squared plus B s plus K ok again if you need to stop this to go through the algebra feel free but basically I solved for X of s algebraically which is a lot easier than solving a differential equation I have this bit of equation which represents how this system is going to behave as a function of our external applied force this. This is our this part of the equation goes to the particular solution and here we have the response of the system due to these initial conditions X 0 and X 0 and so. This is the homogeneous homogeneous portion of it and I can divide these up into two actual separate equations and and solve them independently and simulate them independently and then because. This is a linear system I can then come back and put them both back together to get the response to a forcing function and to the initial conditions all in one big thing.

This this particular solution tells us the forced respond and this tells us the free. Okay, and then what I would do like.

I can now I'll rewrite them.

I'll say X of s forced equals 1 over M s squared plus D s plus K times F of s X of F 3 equals x 0 plus 1 plus F x0 dot and sorry x0 all over the same denominator we have the same denominator in both cases in this denominator is called the characteristic equation M s squared plus B s plus K and those are good things to remember for an exam you know the particular solution or the forest response comes from from this part the free homogeneous free response comes from that part and the numerator is receiving the denominator is called the particular solution and we look at the roots of that denominator they will tell us a lot about how the system. Okay.

Those are my two things at this point I'm going to jump into MATLAB Dutta done it under nerd or the dirt order to matlab and i have a model here and let me get all of the pieces I need. Okay.

This model I didn't put the transfer functions in this model I took the differential equations. This is my sum of courses right there I divide by the mass that gives me the acceleration.

I just taking the differential equation rearranged a little bit integrate that I get velocity I multiply velocity by the damping force that gives me one of the forces I needed back here I take the velocity integrate that to get position I can multiply two position by the spring force that gives me the third force here that I needed back back in here and then I have an external force. Okay, and I have a scope here that tells me the acceleration the velocity and position and another scope that gives me the forces.

I've got inputs outputs the internal thing if I run this dink. Okay.

If I run this I can hit my square here to get these pop-up now hit my square here it needs to pop up nicely. Okay.

We have the response here paste it into my journal.

We can draw on it unfortunately those lines are kind of skinny but let's talk about the external force here remain zero the whole time the spring force has an initial value here of 1.5 because we have this initial displacement the position here is close to point is at point five.

There is an initial force here since the initial velocity is zero my initial damping force is zero. Okay, velocity starts out zero.

I have a force I have that results in an acceleration and as it accelerates and and moved my spring force decreases and eventually it does a little oscillation and eventually in my position here we get to we will get to zero the equilibrium position spring forces go to zero and everything else goes to 0 as it grinds its way to a stop.

That is the free response the response due to the initial conditions now if I go back to MATLAB and I set my initial condition here to zero. Okay, and I have my external force I'm going to I'm going to make it go to three to get a little nicer response is there just one. Okay, I can I can run that simulation and.

Now I have the response due to that step function that happened at one second it went from zero to three up to that point you can see there was no stamping force there was no spring force the position was at zero the velocity was at zero an acceleration was at zero but the instant I applied this force my acceleration happens. Okay, and the velocity starts to pick up that is the velocity picks up I get start to get a damping force and I also get to stuff as it starts to move I get a spring force those forces reduce the acceleration as soon as it starts moving and as soon as it moved some position.

It basically I pushed it it kind of bounced I pushed it. This is look look at position we start at zero went over one and a half overshot a bit came back and isolated and eventually with this force applied where our steady state's position is going to be it's going to settle out here of one with a force of three which if we go back to our our spring constant here we said that our spring constant was three times Delta X.

Our steady state is for a unit input by put one in a set of three we've gotten a final resting position of one third and that's again our our steady state gain here that we could calculate from that case.

That all makes sense and that that was the.

Here we have the homogeneous response or free response due to the initial conditions here we had zero initial conditions and we apply to force and if I go back into MATLAB I can make that back to point five. Okay, and then I run my simulation and here we have click there click there the combined response to the initial conditions and to the applied force at one.

That that's how we play with these systems now let's let's take one little bit of go back to our pencil and paper now it's just seeing how the system behaves. Okay.

I have X of s and I'm going to make X of s over F of s make it a transfer function form equals 1 over M s squared plus B s plus K ok that's our our response to a force and we could play with either equation of the homogeneous order particular we typically for system ID and for a lot of things we'll want to express our equation in this form Omega squared all over s squared plus 2 Zeta Omega n plus Omega N squared ok is a standard form and in particular if we can we do system ID we can identify things like Omega N and Zeta or if we want to just understand how the system behaves by putting it in this form Omega n gives us our frequency our natural frequency not not the damped natural frequency but we calculate that gives us our natural frequency and it gives us our damping and we can tell a lot about how the system is going to behave just from those numbers.

If I look at these two equations I find that Omega n is equal to the YF 2 k over m v / m r ACM there. Okay, Omega n is equal to the square root of K over m right Zeta equal that's a bad data someday I gotta learn how to draw those equals B over m times 1 over 2 Omega n. Okay.

Now I have all the numbers that I need to do that and.

That's just equal now here I had a 1 in the numerator in here I have Omega N squared.

To make that work out yeah you know Omega N squared is K over m.

I in when I divided oh i divided through by M sorry I missed the step here 1 over K M when I divide through by M.

I need to put a K up there to get Omega N squared because Omega Omega N squared equals K over m I already got 1 over m.

To make to make this equal to 1 over m I need to have a multiplied by K I'll just do it this way.

I'll put K over m and I'll put a 1 over K out here for my static gain and then of course K over m is Omega N squared so. This is my equation in the standard form like that I can see that my steady state gain is going to be 1 over K that's essentially what we gave it here and and I think I'll knock this one off right here because we'll talk about frequency response separately.

I can take the same model apply a sine wave in see how it behaves as a function of different frequencies I can see how it's changing their damping and things will affect that I think at this point we're going to stop this lecture to keep them reasonably short.

YT Stats Views: 20 932 Likes: 44 Dislikes: 2
96% Likes
4% Dislikes