Home

ESE 499 Senior Design Project

 

Exploration of a Two-Mass Rectilinear System


 

Text Box: Advisor: Dr. Hiro Mukai
Email: mukai@ese.wustl.edu
Text Box: Aliza Skolnik
Email: askolnik@wustl.edu
Phone: 216-780-3662

 

 

 

 

 

 

OBJECTIVE.

INITIAL EXPERIMENTATION

MODELING AN IDEALIZED TWO-MASS/SPRING SYSTEM

DIFFERENTIAL EQUATIONS/INPUT-OUTPUT EQUATIONS

EIGENVALUES

TRANSFER FUNCTION

FREQUENCY RESPONSE

SIMULATED RESPONSE TO VARIOUS INPUT FREQUENCIES

SYSTEM WITH DAMPERS

PARAMETER IDENTIFICATION OF A SINGLE-MASS/SPRING/DAMPER SYSTEM

PARAMETER IDENTIFICATION OF A TWO-MASS/SPRING/DAMPER SYSTEM

CONCLUSIONS

REFERENCES

APPENDIX A

APPENDIX B

 

 


OBJECTIVE

 

For this project, I modeled a two-mass system in the 251 Laboratory, which utilizes a rectilinear system.  Previously, the system was modeled with one mass employed and used for laboratory experiments for students enrolled in ESE 251.  The system (detailed in the following section titled “System Description”) represents the dynamics found in many mechanical systems.  Each mass can have two modes, sine or cosine.  I will conclude what kind of sinusoidal inputs will be needed to induce the two modes. First, I conduct experiments with the system.  Then, I model an ideal version of the two-mass system.  I then formulate the space-state representation and the differential equations from this model that represent the system.  I use the A matrix and various Matlab techniques to obtain the eigenvalues, modes, and frequency response.  The outcomes of this project will be as follows: (1) the models and equations describing the system, (2) the inputs which invoke certain modes, and (3) a new laboratory experiment with solution guide for ESE 251.

 

It is known that an n-degree of freedom system will have n natural frequencies and n natural modes of vibration.  In this case n=2 because there are two masses, and hence I expect that there will appear to be two natural frequencies.  I set out to answer the following questions:  How do we find these natural frequencies? What do they mean? Why are they important?  I expect the system to exhibit a combination of two kinds of behavior (modes) depending on the input.  One behavior occurs when Mass1 moves in the positive or negative direction the same time that Mass2 is moves in the same direction.  The second type of behavior occurs when Mass1 moves in the opposite direction that Mass2 moves.  We will call these behaviors “in-phase” and “out-of-phase” modes, respectively.

 

 

INITIAL EXPERIMENTATION:

 

To better understand the system response behavior and obtain a general conception of frequency response, I conducted several experiments while the system was in the configuration shown in Figure 3.   The damper is not connected to anything while the stiff spring is connected in between the first and second masses. The first two masses are free to move along the guiding rail but the third one is screwed in place.

 

Figure 3. Overhead of the Two-Mass/Spring System used for initial experimentation

 

First, I tested several sinusoidal inputs with varying amplitudes at frequency ω=1 and ω=10 to make sure the mass would not hit the end of the guiding rail, because this would ruin the output data.  The largest amplitude that accomplished this was 0.02 volts.  I varied the frequency for the sinusoidal input from ω=1 Hz to ω=10 Hz, incrementing by 1 Hz for each experiment.  I set the repetitions as a function of the frequency (repetitions=10*frequency) so that the higher frequencies could reach steady-state.  After executing each trial, I exported and saved the data and created a plot in order to make sure it captured the behavior (see Appendix A for graphs).  I also recorded my observations.  Table 2 describes each trial and the observed output response.

 

Sinusoidal Input

Amplitude=0.02 Volts

Trial

Frequency in Hz

Repetitions

Observations

1

1

10

Mass1 and Mass2 move together, displace about the same

2

2

20

Mass1 and Mass2 move together, displace about the same

3

3

30

Mass1 and Mass2 move together, Mass2 displaces a little more than Mass1

4

4

40

Mass1 and Mass2 do not move together, but aren’t moving completely opposite from each other;  Mass2 displaces more that Mass1

5

5

50

Displacement explodes (move more as time passes); Masses move in towards each other, Mass2 displaces slightly more than Mass1

6

6

60

Masses move inwards towards each other and outwards away from each other

7

7

70

Masses move inwards towards each other and outwards away from each other; very little displacement but Mass1 displaces more than Mass2

8

8

80

Similar to above except Mass2 displaces even less

9

9

90

Similar to above except Mass2 displaces even less

10

10

100

Similar to above and Mass2 barely moves (looks like vibrates back and forth rapidly)

Table 1. Two-Mass/Spring Actual System Response to Varying Frequency Sinusoidal

 

The frequencies of ω=4,5, and 6 Hz seem to be a turning point in system behavior, and this provides an incentive to further explore the system.

 

As seen in the descriptions of movement in Table 1, at lower frequencies the modes exhibited are in-phase, and as the frequency increases, its switches to a combination of modes and then to a more out-of-phase mode. If we idealize this model by saying the damping is negligible and the masses are equal, we can more easily explore the mode functions and frequency response of the system.  We can use this information to build up to a more accurate model of the system. 

 

 

MODELING AN IDEALIZED TWO-MASS/SPRING SYSTEM

 

In order to better understand the two-mass system with the dampers (and in order to more simply analyze the real system), I first modeled an ideal version of the system seen in Figure 4 below.  This system assumes no attached dampers and therefore no friction or other such damping phenomena. 

 

 

 

 

 

 

 

 


Figure 4.  Two-Mass/Spring Ideal System Schematic

 

*Note:  Details of space-state derivation and other mathematical procedures are presented in the Laboratory Manual in the Appendix.

 

I created a free body diagram to model the forces acting on each mass, and determined the space state representation of this system, which looks like the following:

 

 

DIFFERENTIAL EQUATIONS/INPUT-OUTPUT EQUATIONS

 

We can then derive the differential equations to ensure that this is a fourth degree differential equation. 

 

For z1: 

For z2: 

To even further idealize this model, we can assume, and substitute =.  Then the matrix becomes A =.  This A matrix is very helpful in exploring the eigenvalues, modes, and responses. 

 

 

EIGENVALUES:

 

            By hand, and verifying by Matlab, I calculated the eigenvalues for this ideal system.  In order to do this, I solved for the characteristic polynomial.

 

By setting this characteristic polynomial equal to zero, we can solve for the eigenvalues. 

 

 

The eigenvalues are therefore λ = 0, 0, -, and +.  These eigenvalues indicate mode function candidates.  In this system there is one real eigenvalue with a multiplicity of two, and a pair of complex conjugate eigenvalues (which indicate sinusoidal modes).  This means that the mode function candidates are .   The system has no attached damper and because it is ideal, it has no natural damping (such as friction) either.  This means that there is nothing to slow down the masses and there will be no transient response, represented by an exponential mode function.  The zero real eigenvalue and zero scalar portion of the imaginary eigenvalue indicates no exponential mode functions and hence nothing to make the system slow or cease movement.  We would expect a marginally stable response because all eigenvalues lay directly on the imaginary axis or at the origin.  I explore the response after analyzing the transfer function below. 

 

 

TRANSFER FUNCTION

 

Since Matlab cannot create a symbolic transfer function, I hand-modeled the transfer function and verified it by substituting in numbers to Matlab.  With the given input-output equations for Mass1 and Mass2, we can easily determine by taking the Laplace transform of the input-output equation and rearranging the terms. 

For z1:  

For z2:

 

The characteristic equation is the same for both masses, which are the poles of the system.  The characteristic equation is the denominator of the transfer function: .  Setting this equal to zero and solving for s, we obtain s=0, s=0, and s= (our poles, which we can also obtain via eigenvalues shown above.)  Setting the numerator equal to 0 and solving for s in order to obtain our zeroes, we get s=.  By assuming =50, =200, Matlab produces the following transfer functions using the tf(sys) command:

 

Transfer function from input to output...

                     200 s^2 + 1e004

 #1:  ---------------------------------------------

      s^4 + 3.901e-016 s^3 + 100 s^2 + 3.901e-014 s

 

                          10000

 #2:  ---------------------------------------------

      s^4 + 3.901e-016 s^3 + 100 s^2 + 3.901e-014 s

 

The s3 and s terms are basically zero; the poles are 0, 0, -10i, and +10i; and the zeroes are +7.07i and -7.07i for Mass1 and none for Mass2.  The hand-obtained poles of  equals  and the hand-obtained zero pf  equals .  Hence, these values show that the general termed transfers functions obtained by hand are correct.

 

FREQUENCY RESPONSE

 

I decided to further explore the frequency response of the system to identify the natural frequencies and explore the response to various magnitudes of frequencies.  From the Second Order Canonical System, we know that .  Through Matlab, I was able to plot a frequency response graph of the space state representation of the ideal system by substituting in numbers for  and .  The following is a graph of the frequency response of ideal system assuming =50, =200 (Figure 5). 

 

Figure 5. Bode Plot (Frequency Magnitude Response) of Ideal Two-Mass/Spring System

 

As you can tell the output from Mass1 peaks at =10 radians/second, and also in the negative direction at =7.07 radians/second.  This negative peak is due to the zeroes in the first mass transfer function.  If the second mass has no zeroes, then there should only be one peak; and this is what we observe in the frequency response of the second mass.  There is a one large spike at = 10 radians/second.  If the frequency response is graphed on a linear scale (not a logarithmic one) in order to include 0 rad/second, the effect of the pole at the origin is shown by the peak at that frequency.   

 

Figure 6. Bode Plot (Frequency Magnitude Response) of Ideal Two-Mass/Spring System including ω=0

 

 

SIMULATED RESPONSE TO VARIOUS INPUT FREQUENCIES

 

            Using Matlab, we can model the system response to input frequencies varying in range, smaller, equal to, and larger than the natural frequencies (see Appendix A2, idealBode.m).  In the following set of graphs, the ideal system was modeled using the space state representation modeled earlier.  It is still assumed that =50, =200.  The natural frequencies found are 10 and 7.07 radians/second.  I made sure to test inputs with frequency equal to, smaller than, and greater than those frequencies. 

 

 

Figure 7.  Ideal Two-Mass/Spring System Response to Sinusoidal Inputs with frequencies 3, , 10, and 14 Hz.

 (Solid Lines: Mass displacement.  Dotted Lines: Input)

 

At small frequencies the masses displace in-phase with each other, meaning they basically travel together.  This is shown in the upper right panel when the input frequency is equal to 3 Hz.  As the input frequency is increased, the masses travel less and less in phase with each other.  They are clearly not in-phase at the first natural frequency of 7.0711.  Of greatest importance in Figure 7 is the response to the input with ω=10 Hz, which is equal to .  The graph shows that the masses react violently and are very unstable when the input frequency is close to the natural frequency.  By graphing the state vector and testing numerous input frequencies, I also noticed that after the input frequency ω=7.07 Hz, the velocity vectors started acting in oscillatory patterns (see Figure 8). 

 

Figure 8.  Ideal Two-Mass/Spring System Response to Sinusoidal Inputs with frequencies 6.2, , 7.5, and 8 Hz.

 (Solid Red and Blue Lines: Mass displacement.  Green and Light Blue Lines: Input)

 

This patter continues until the input frequency reaches ω=10 Hz, when the periodic nature of the pattern becomes infinite and hence unstable.  After ω=10, the periodic nature continues, shrinking with time.  Also, after ω=10, the velocity of Mass1 is larger relative to Mass2, whereas before Mass2 had a larger amplitude velocity vector (see Figure 9).   At an input frequency of ω=14 Hz, the masses are clearly traveling out-of-phase with each other.

 

Figure 9.  Ideal Two-Mass/Spring System Response to Sinusoidal Inputs with frequencies 7.5, 9, 11, and 12.5 Hz.

 (Solid Red and Blue Lines: Mass displacement.  Green and Light Blue Lines: Input)

 

 

SYSTEM WITH DAMPERS:

 

To more accurately model the real system, dampers can be included to create a model as in Figure 10, below.  The dampers simulate factors such as friction between the mass carriage sliding bed and the guiding rail.

 

  

 

 

 

 

 

 


Figure 10.  Model of Two-Mass/Spring/Damper System

 

We can ideally assume that M1=M2=M.  This is a fair assumption because the mass carriages, sliding bed, and brass weights should weigh the same for the first and second cart (as long as there are an equal number of brass weights on each cart.)  Also we can ideally and fairly assume that both damping constants are equal.  The equations describing the system are represented here in a space-state form.

 

Substituting , we can solve for the eigenvalues and transfer functions in general terms.  The eigenvalues obtained through the A matrix are

 

Assuming  then = [0  -1  -0.5+9.9875i  -0.5-9.9875i].

 

In this case, the transfer functions are:

 

For z1:  

For z2:

 

 

If the value under the square root is less than zero (i.e. ), than the term will evaluate to an imaginary number and therefore the mode functions will be oscillatory.  This means, when  the modes are sine or cosine.  This makes sense because the damping (described by the constant B) is expected to be small, making the term small.  Hence most of the time (i.e. when the damping is small enough), the ratios will produce oscillatory movement.  In this case, when , the mode function candidates are 

There are transient elements present in the modes, which makes sense because a damper will slow the movement of the masses.  

 

The bode frequency response is represented in Figure 11.  The differences between the bode response seen in the ideal model and the response of the current model are the lower magnitude of the peaks, and the larger slope at lower frequencies.  These effects are cause by the damper.

 

Figure 11.  Bode Frequency Response for Two-Mass/Spring/Damper System

 

The natural frequencies are at 7.04Hz (obtained by solving for the zeros of the first mass’s transfer function) and  9.97 Hz (obtained by solving the characteristic equation).  If the same principle holds true as last time, the behavior of the system will become unstable and increasingly oscillate violently when the input frequency reaches the main natural frequency (9.97 Hz) and the states will start to behave in a periodic fashion once the input frequency is 7.04 Hz.  This is proven by graphing the responses to various input frequencies, many of which are shown in Figure 12.

Once again, at low frequencies, the masses move in-phase with each other.  Once the input frequency reaches the first natural frequency due to the zero of the first mass, the masses are not in-phase anymore.  When the input frequency is equal to the second natural frequency due to the poles of both masses, the masses demonstrate a high magnitude oscillatory effect.  At higher frequencies, the first mass moves more and is out-of-phase with the second mass.

Figure 12.  Two-Mass/Spring/Damper System Response to Sinusoidal Inputs with frequencies 2, 7.04, 9.79, and 12 Hz.

(Solid Blue and Green Lines: Mass displacement.  Dotted Red Lines: Input)

 

This past idealization of the plant model is close to the actual system because the natural dampers should be quite small and approximately equal; the masses should also be approximately equal but represent a significantly large ratio.  Instead of using fake numbers for  and in order to identify the actual parameters in the two-mass system, I must first identify the parameters in the single-mass system first.

 

 

PARAMETER IDENTIFICATION OF A SINGLE-MASS/SPRING/DAMPER SYSTEM

 

In order to obtain the ratios of K, M, and B, the system can be set up with a single mass, damper, and spring.  Then a step input can be applied and the output measured.  We can use this data to minimize the error from our model and plant data to iterate and optimize our x vector, which will contain the values for the ratios.  First, I set up the system with the first cart’s sliding bed free to move along the guiding rail; the second two masses were fastened to the ground.  I attached a damper to the first cart, and a thick spring attached to a fixated point and the first cart.  The setup should look like this:

 

Figure 13.  Setup for Single-Mass/Spring System used for Parameter Identification

 

Then, I set up the ECP program by following the subsequent procedure:

  1. Start the ECP program.  Power up the Controller Box.
  2. Re-phase Motor. 
  3. Select Counts as User Units.
  4. Select a Continuous Time PID Control Algorithm with a Ts value of  0.00442 seconds, a kp value of 0.07, and a ki and kd values of zero. 
  5. Set the Sample Period  (servo cycles) equal to 1 and select Control Effort and Encoder 1 Position since I want to measure the input and the displacement of Mass1. 
  6. Set the Trajectory as Open Loop and then the specifications as stated in Table 2.
  7. Zero Position.
  8. Execute with Normal Data Sampling. 

 

Number of Weights on Cart

Type of Input

Step Size (volts)

Dwell Time (msec)

Number of Reps

4

Step

0.5

1450

1

4

Step

0.2

1450

1

2

Step

0.3

1450

1

2

Step

0.1

1450

1

Table 2.  Trajectory for Single Mass/Spring/Damper Parameter Identification

 

After I ran the experiment I exported the raw data file and saved it as a text file.  I modified the raw data table in the text file in two ways:  (1) making it Matlab-friendly by deleting the first line of text and removing the first and last brackets; and (2) removing the data after the system reached steady-state.  This latter part of the data (after steady-state is reached) is removed because the output displacement after the step input is done executing is useless in identifying the parameters.  I recorded the displacement in counts at the highest point, y(peak); the displacement in counts at steady-state, y(∞); the peak time, Tp; and the total samples taken, m.  I then created a Matlab script to calculate an estimation for the parameters by inputting the recorded data variables for a specific run, comparing the system to the canonical second-order system, and then outputting estimations (see Appendix B).  By comparison to the Canonical Second-Order System, . The DC Gain  can be estimated using y(∞) and u(∞), whereas the Percent Overshoot can be estimated using y(∞), y(peak), ζ, and an ωn value.  Multiple trials were conducted to ensure consistency in the plant behavior.  Since I was planning on using 2 weights to identify the two-mass system, I used the data from the last trial run in Table 2. 

 

I then modeled the system by hand.  The configuration is modeled in Figure 3.

 

 

 

 

 

 

 

 


Figure 14. Single-Mass/Spring/Damper System Schematic

 

By determining the forces acting on the mass and manipulating the derived equations, I determined the space state equations. 

 

By substituting, I created an x-vector containing the three parameters, i.e. .

 

Then I created three m-files:  identify.m, simout.m, and fun.m in order to minimize the error between the model and plant data (see Appendix B).  The “simout” function computes the simulated output of the physical system.  The “fun” function finds a vector x that minimizes the error function, based on an iterative method.  The identify file graphs the experimental data, the data from the model before iterating, and the data from the model after a certain number of iterations.  I inputed the estimated parameters as the x0 vector for an initial guess.  After running identify.m, which calls the other two files, the x vector (called “xbetter”) containing and is terminated at:  xbetter = [9.3964    511    8.322e+005]. The graph output from identify.m is shown in Figure 13.

 

Figure 15.  Minimizing error in model to Identify Parameters of Single-Mass/Spring/Damper System

 

As you can see, after iterating the model becomes closer to the actual data.  The xbetter vector makes sense because the B/M ratio is small while the last ratio is very large.  This is because it takes the DC gain in account. 

 

 

PARAMETER IDENTIFICATION OF A TWO-MASS/SPRING/DAMPER SYSTEM

 

            The parameter identification for the two-mass system is outlined in the laboratory and the solution guide (see Laboratory and Laboratory Solution Manual in Appendix).  The eigenvalues and mode functions of this real system are very complicated.  In order to find the eigenvalues to try and get the solution for the natural frequency, I ran the following simple code:

 

A = sym ('[0, 1, 0, 0; -alpha1, -alpha3, alpha1, 0; 0, 0, 0, 1; alpha2, 0, -alpha2, -alpha4]');

eig(A)

 

Just this produced a considerably large answer.  But luckily, we are able to safely approximate some parameters in order to gain a general understanding of the natural frequency of our actual system.

            If we assume the parameters that we obtained in the single-mass experiment, but lower the damping ratio to something smaller, we can calculate the natural frequency.  I  estimated .  The first parameter is the exact amount for  .  However, the second parameter is a smaller estimation for  because the damper in this case is not a external physical resistance, rather it is the natural friction which is very small.  The natural frequency  is approximated as it was in the previously model with dampers (which is safe to assume because the masses are about equal and the dampers are about equal).  Also this is safe to assume because the dampers do not strongly effect the actual natural frequency; instead they affect the magnitude of the oscillations at the natural frequency.  As an example, assume the parameters for the last ideal model we explored.  The bode plot is shown in Figure 16.  Compare this to Figure 15, where  (an entire magnitude larger), and you can see there is hardly any difference in where the natural frequencies are located.  When the damping is larger (i.e. the ratio  is larger), the smaller the magnitude on the bode plot. 

Figure 16.  Bode Plot for Ideal Model with Damper when

Therefore, .  This explains why the system was violently reacting near an input frequency of 5 Hz ; the input frequency was too close to its natural frequency. 

 

 


CONCLUSIONS

 

The natural frequency is a crucial aspect of a system.  When an oscillatory external force is applied, the system is forced to vibrate at that excitation frequency.  If the applied frequency is equal to or close to the natural frequency of the system, large or unstable oscillations can occur, known as resonance.  This concept is important when building any major structure, such as bridges, buildings, or airplane wings.  The most famous example is the Tacoma Narrows Bridge.  Due to forced oscillations from the wind, the bridge began exhibiting a torsional vibration mode by twisting, and it soon thereafter collapsed. 

            In the two-mass setup of the ECP Model 210, I was able to excite the modes so that the  masses traveled in-phase by applying a sinusoidal input with a frequency lower than the natural frequency of the system.  Once I reached close to 5Hz, the system oscillations were very large and growing and hence exhibiting resonance. At higher input frequencies I was able to excite the modes so that the masses traveled out-of-phase with each other. 

            I was able to accurately model an ideal version of the actual system with and without dampers incorporated.  An analysis of the A matrix and the transfer functions helped determine the modes, as well as the natural frequency.  The damper does not greatly effect the location of the natural frequencies of the system but does reduce the magnitude of oscillations possible when the input frequency matches the natural frequency. 

            Through the labs that I created, I guide students through understanding numerous techniques to help model and understand systems, such as eigenvalues, poles, mode functions, and frequency response.  I explored all of these in my research as well.  Hopefully the laboratory exercises will develop their skills in modeling systems, understanding the importance of frequency response by using bode diagrams and system response graphs, and analyzing equations to obtain and utilize eigenvalues and modes.  They will also gain a better understanding of parameter identification and natural frequencies.

 


REFERENCES

 

Educational Control Products.  <http://www.ecpsystems.com/>

 

Mukai, Hiro.  Introduction to Mechanical and Electrical Systems. Chapters 1-9. ESE 351 (Signals and Systems) Class Notes "Linear Systems and Signals," Dept of Electrical and Systems Engineering. Washington University, St. Louis, MO.  Spring 2004.

Mukai, Hiro.  Laboratory for ESE 251 (Introduction to Systems Science and Engineering). Laboratories 1-12, Dept of Electrical and Systems Engineering.  Washington University, St. Louis, MO. Spring 2004.