6
Modeling a One and Two-Degree of Freedom Spring-Cart System Joseph D. Legris, Benjamin D. McPheron School of Engineering, Computing & Construction Management Roger Williams University One of the most commonly explored dynamic systems in undergraduate mechanical engineering courses is the spring mass damper system. While this system is widely studied, there is sparse documentation in regards to appropriate identification and modeling of a two-degree of freedom spring mass damper system that is applicable to undergraduate engineering students. A group at Roger Williams University recently constructed a low-cost, two-degree of freedom spring mass damper system, which required appropriate characterization. The system was constructed using a Vernier cart and track system that utilizes linear encoding to perform position tracking of the carts. The dynamics of this system were successfully identified, resulting in a second order transfer function for the one-degree of freedom system, and a fourth order transfer function for the two-degree of freedom system. This work details the system characterization, including a SolidWorks model for motion study and system identification for the one and two-degree of freedom system models. The motion study operates under conditions identical to that of the real-time study; demonstrating a 1:1 ratio of the dimensions, a precise coefficient of friction between the cart and track contact, and accurate equipment mass measurements. The system parameters are found by applying several identification algorithms in MATLAB, including techniques from courses in vibrations and control systems. These parameters were replicated within the motion study with good agreement between the observed system response and the theoretical response. The result of this work is that the developed system can be effectively characterized, and the identified system parameters can be used for simulating the system response. Corresponding Author: Benjamin D. McPheron, [email protected] Introduction Students taking courses on mechanical vibrations, dynamic modeling, or control systems are often tasked with developing the system model for systems represented as the interconnection of a spring, a mass, and a damper [1]. Commonly, faculty members will develop systems of this nature and ask students to perform system modeling [2,3]. Recently, a team of students and faculty members at Roger Williams University developed a low- cost spring mass damper system by modifying a Vernier Dynamics Cart and Track Encoder System and employing the Logger Pro software. This system can be configured as either a one-degree of freedom system with a single mass or a two-degree of freedom system with two interconnected masses. This system is shown in Figure 1 [4]. Figure 1: A low cost two cart spring system. As a part of the development of course materials for this system, several system identification methods should be tested and ground truth values should be established for system parameters. This work outlines the system identification methods employed, the results of system identification, and the development of a SolidWorks model and motion study representing the physical system. Theory The one degree of freedom, second order system is shown in Figure 2. The relationship between an input position " () and the output position & () can be found by considering first the relationship between an input force () applied on the mass and & (). For a simple one degree of freedom spring mass damper system, this relationship is found to be ( = 1/ - + (/) + (2/) , (Eq. 1) where M is the mass, B is the friction or viscous damping, and k is the spring constant. The related input position of the block can be mapped to an input force by understanding that a positional step is governed both be the spring constant and the friction using the relationship that = ( " + 2) " (), where " is an initial friction term that includes static friction.

Modeling a One and Two-Degree of Freedom Spring-Cart Systemegr.uri.edu/wp-uploads/asee2016/97-500-1-RV.pdf · Modeling a One and Two-Degree of Freedom Spring-Cart System ... two-degree

Embed Size (px)

Citation preview

Modeling a One and Two-Degree of Freedom Spring-Cart System

Joseph D. Legris, Benjamin D. McPheron School of Engineering, Computing & Construction Management

Roger Williams University

One of the most commonly explored dynamic systems in undergraduate mechanical engineering courses is the spring mass damper system. While this system is widely studied, there is sparse documentation in regards to appropriate identification and modeling of a two-degree of freedom spring mass damper system that is applicable to undergraduate engineering students. A group at Roger Williams University recently constructed a low-cost, two-degree of freedom spring mass damper system, which required appropriate characterization. The system was constructed using a Vernier cart and track system that utilizes linear encoding to perform position tracking of the carts. The dynamics of this system were successfully identified, resulting in a second order transfer function for the one-degree of freedom system, and a fourth order transfer function for the two-degree of freedom system. This work details the system characterization, including a SolidWorks model for motion study and system identification for the one and two-degree of freedom system models. The motion study operates under conditions identical to that of the real-time study; demonstrating a 1:1 ratio of the dimensions, a precise coefficient of friction between the cart and track contact, and accurate equipment mass measurements. The system parameters are found by applying several identification algorithms in MATLAB, including techniques from courses in vibrations and control systems. These parameters were replicated within the motion study with good agreement between the observed system response and the theoretical response. The result of this work is that the developed system can be effectively characterized, and the identified system parameters can be used for simulating the system response.

Corresponding Author: Benjamin D. McPheron, [email protected]

Introduction

Students taking courses on mechanical vibrations, dynamic modeling, or control systems are often tasked with developing the system model for systems represented as the interconnection of a spring, a mass, and a damper [1]. Commonly, faculty members will develop systems of this nature and ask students to perform system modeling [2,3]. Recently, a team of students and faculty members at Roger Williams University developed a low-cost spring mass damper system by modifying a Vernier Dynamics Cart and Track Encoder System and employing the Logger Pro software. This system can be configured as either a one-degree of freedom system with a single mass or a two-degree of freedom system with two interconnected masses. This system is shown in Figure 1 [4].

Figure 1: A low cost two cart spring system.

As a part of the development of course materials for this system, several system identification methods should be tested and ground truth values should be established for system parameters. This work outlines the system identification methods employed, the results of system identification, and the development of a SolidWorks model and motion study representing the physical system.

Theory

The one degree of freedom, second order system is shown in Figure 2. The relationship between an input position 𝑋"(𝑠) and the output position 𝑋&(𝑠) can be found by considering first the relationship between an input force 𝐹(𝑠) applied on the mass and 𝑋&(𝑠). For a simple one degree of freedom spring mass damper system, this relationship is found to be

𝑋( 𝑠𝐹 𝑠

=1/𝑀

𝑠- + (𝐵/𝑀)𝑠 + (2𝑘/𝑀),(Eq. 1)

where M is the mass, B is the friction or viscous damping, and k is the spring constant. The related input position of the block can be mapped to an input force by understanding that a positional step is governed both be the spring constant and the friction using the relationship that 𝐹 𝑠 = (𝐵"𝑠 + 2𝑘)𝑋"(𝑠), where 𝐵" is an initial friction term that includes static friction.

Figure 2: System model for one cart.

In this case, we arrive at the first principle model

𝑋( 𝑠𝑋" 𝑠

=(𝐵"/𝑀)𝑠 + (2𝑘/𝑀)

𝑠- + (𝐵/𝑀)𝑠 + (2𝑘/𝑀)(Eq. 2)

for the second order system. In this case, the values for the mass and spring constant are known, with 𝑀 =0.57kg and 𝑘 = 15N/m. The two-degree of freedom, fourth order system is more complicated to model from first principles. The relationship between an input position 𝑋"(𝑠) and the output position 𝑋&(𝑠), the result can be obtained as:

𝑋( 𝑠𝑋" 𝑠

=𝑏?𝑠? + 𝑏-𝑠- + 𝑏@𝑠 + 𝑏(

𝑠A + 𝑎?𝑠? + 𝑎-𝑠- + 𝑎@𝑠 + 𝑎(,(Eq. 3)

where the expression for each coefficient is defined in Table 1. The variables used in these expressions correspond to values shown in the two cart system in Figure 3. These variables are the initial damping 𝐵", the mass of the carts 𝑀@ and 𝑀-, the friction of each cart 𝐵@ and 𝐵-, and the spring constant 𝑘. Table 1: Coefficients for fourth order first principle

model. Coefficient Expression

𝑏? 𝐵"𝑀-/𝑀@𝑀- 𝑏- (2𝑘𝑀- + 𝐵-𝐵")/𝑀@𝑀- 𝑏@ (2𝑘𝐵- + 2𝑘𝐵")/𝑀@𝑀- 𝑏( 4𝑘-/𝑀@𝑀- 𝑎? (𝑀@𝐵- + 𝑀-𝐵@)/𝑀@𝑀- 𝑎- (2𝑘𝑀@ + 2𝑘𝑀- + 𝐵@𝐵-)/𝑀@𝑀- 𝑎@ (2𝑘𝐵@ + 2𝑘𝐵-)/𝑀@𝑀- 𝑎( (4𝑘- − 𝑘-)/𝑀@𝑀-

In this case, the values for the mass and spring constant are known, with 𝑀@ = 0.57kg, 𝑀- = 0.56kg and 𝑘 =15N/m. It is difficult to measure some of these system parameters. In particular, it is difficult to measure the damping and friction coefficients. As a result, identification algorithms may be used to find the system dynamic model. In order to identify the system model, several identification methods were employed. These methods fall into two categories: numerical solutions to differential equations and system transfer function identification. The methods for numerical solutions to

Figure 3: System model for two carts.

difference equation are commonly taught as a part of an undergraduate vibrations course, while transfer function identification methods are typically found in courses on control systems.

Runge-Kutta Method

The Runge-Kutta method is an iterative process of numerically approximating solutions to ordinary differential equations. The weighted average of a set of steps is computed around each point and used to advance the particle.

This method can accurately approximate a solution to an exponentially decaying sine wave, as is the case for the one-degree of freedom system, which is second order. The definitive second order equation that is being analyzed is

𝑦HH = −2𝜉𝜔K𝑦H − 𝜔K-𝑦 +𝐹(/𝑀, (Eq. 4) Where: 𝜉 = 𝐵/2 𝑘/𝑀, 𝜔K = 𝑘/𝑀, k is the spring constant, M is the mass, B is the damping constant, and 𝐹( is the initial step force. For this particular approximation, the initial force is modeled as a scaled step input [5].

Euler Method The Euler method is an iterative numerical analysis technique to solve ordinary differential equations. It is essentially a simplified version of the Runge-Kutta ODE solution method. The basic form of the equation is

𝑦KL@ = 𝑦K + ℎ𝑓(𝑡K, 𝑦K), (Eq. 5) and the equations to be analyzed are

𝜔KL@ = 𝜔K −PQ𝜔Kℎ −

RQ𝑋K + 𝜔Kℎ (Eq. 6)

and 𝑋KL@ = 𝑋K + 𝜔Kℎ, (Eq. 7)

where ℎ is the step size, 𝜔 is frequency, 𝐵 is friction, k is the spring constant, and X is position. The step size determines the accuracy of the approximation. The smaller the step size, the more accurate the approximation will be [6]. In order to perform identification, the user must iteratively change parameters until the estimate approached the actual system.

Prediction-Error Method The task of finding a transfer function that maps the input step 𝑅(𝑡) to the output 𝑋(𝑡) can be posed as a system identification problem. To perform this task, the step input 𝑅(𝑡) is applied to the unknown system composed of the mass-spring system with the position encoder sensor, and the resulting output 𝑋(𝑡) is recorded. The system identification algorithm is provided both the input 𝑅(𝑡) and the output 𝑋 𝑡 to identify a transfer function that provides a predicted output 𝑋(𝑡). The error between 𝑋(𝑡) and 𝑋 𝑡 is used as a part of an identification algorithm to update the prediction function so that the next step will have a smaller error. This update process is repeated until the error either reaches some convergence criterion or the maximum number of iterations is reached. The performance metric for this identification algorithm the mean square error cost function (MSE), which is defined as

𝐽QUV 𝛩 = 𝐸[𝑒-(𝑛; 𝛩)] ≈ @_

𝑒-(𝑛; 𝛩)_K`@ (Eq. 8)

where 𝛩 describes the identified filter and the error signal is 𝑒 𝑛; 𝛩 = 𝑋 𝑛 − 𝑋 𝑛, 𝛩 [7]. In this particular system, the system output can be represented as

𝑋 𝑛 = P ab a

𝑅 𝑛 , (Eq. 9) where 𝐴 𝑞 and 𝐵 𝑞 are polynomials whose ratio is the true transfer function of the unknown system, with the argument q representing the forward shift, defined such that 𝑞e"𝑋 𝑛 = 𝑋(𝑛 − 𝑖). Then output of the prediction filter, denoted as 𝑋(𝑛), is

𝑋 𝑛 = P ab a

𝑅 𝑛 , (Eq. 10)

where 𝐵(𝑞) and 𝐴(𝑞) are estimates of the polynomials 𝐴 𝑞 and 𝐵 𝑞 . In order to identify the prediction filter 𝑋 𝑛 , the polynomials 𝐵 𝑛 , 𝐴 𝑛 and their degrees (or orders) 𝑛P and 𝑛b are optimized as a part of the parameter vector Θ, used as the argument in the MSE cost function defined in Equation 8, to provide a minimal MSE. The transfer function identification method used in this project is the prediction-error method (PEM). PEM uses numerical optimization to minimize the prediction error. The prediction error 𝑒 𝑛 is the error between the predicted output of the system and the measured output. Using the SISO model described as

𝑋 𝑛 = P ab a

𝑅 𝑛 + 𝐻 𝑞 𝜒(𝑛), (Eq. 11)

the prediction error between the measured output and

predicted output is 𝑒 𝑛 = 𝐻e@ 𝑞 𝑋 𝑛 − P a

b a𝑅 𝑛 . (Eq. 12)

The goal of PEM is to minimize the MSE cost function using the particular error defined in Equation 12. Thus, the task of PEM is to minimize the MSE cost function by adjusting the parameters located in the vector 𝛩 =(𝐴, 𝐵, 𝑛b, 𝑛P, 𝐻). The values of these parameters at convergence of the cost function to a minimal point resulting model is the system estimate [8,9].

System Identification Results

The Runge-Kutta method can be used to approximate the system response in MATLAB by applying an ordinary differential equation solver. However, this method expects a perfect second order system, and does not account for any non-linearities or changes in natural frequencies as seen in the actual response of the system. Figure 4 shows the result of applying the Runge-Kutta approximation method to the one-degree of freedom cart system. The one-degree of freedom cart system is second order, and the system response displays the expected exponential decay. It is possible to see that the estimated cart position does not completely match the measured cart position. This fact is useful in motivating the use of identification algorithms from the MATLAB System Identification Toolbox.

Figure 4: Experimental and estimated system

response using the Runge-Kutta method for the one-degree of freedom system.

Figure 5 shows the result of applying the Euler approximation method to the one-degree of freedom cart system. Similar to the Runge-Kutta method, it is possible to observe that the estimated cart position does not entirely match the measured cart position. This fact, coupled with the slow iterative parameter changes, makes this method inappropriate for modeling higher order systems, such as the two-degree of freedom cart system.

One of the benefits of PEM is that it provides accurate results for systems of second order systems and systems with a much higher order. This makes this method suitable for modeling the two-degree of freedom cart system, which is fourth order. To this point, Figure 6 displays the estimated response of the one cart system using PEM, and Figure 7 shows the estimated response for the two-cart system. In both of these figures, it is possible to see a close agreement between the measured cart position and the estimated cart position. The compare function in MATLAB indicates that the signals have an 87% match for both the one cart and two cart systems, using the normalized root mean square measure of the goodness of fit.

Figure 5: Experimental and estimated system

response using the Euler method for the one-degree of freedom system.

Figure 6: Experimental and estimated system

response using the Prediction Error Method for the one-degree of freedom system.

Figure 7: Experimental and estimated system

response using the Prediction Error Method for the two-degree of freedom system.

The identified transfer function for the one cart system is

𝐺@ej&k =e-.(lmnLm?.(l

noL(.@-(pnLm?.@@ (Eq. 11)

which is second order. Comparing this result to Equation 2, the identified coefficients agree with the expected form. The identified parameters correspond to a value of 𝐵 ≈ 0.0688Ns/m, using the known values of 𝑀 =0.57kg and 𝑘 = 15N/m. The identified transfer function for the two-cart system is

𝐺-ej&k =e(.??(-nsLm@.(lnoe@?.mmnL-@-mntL(.@ummnsL@(unoLl.vAlnL-@?@

(Eq. 12) which is fourth order, and appears similar to the expected form. The consistency of these results with the first principle models demonstrate the usefulness of these identification methods. The PEM result can be used to define the ground truth values for the two cart system.

SolidWorks Motion Study

In order to apply the motion study, it was necessary to create a model that was as identical to the experimental apparatus as possible. This was done using the SolidWorks modeling software to create precise dimensions and mass measurements comparative of the actual device. The result was a representation of the second and fourth order system responses. For the Motion Study, there were three components that are important to have identical specifications to attain an accurate model. The track and two carts needed to be identical to ones supplied with the Vernier Dynamics Cart and Track Encoder System. Also, the distance between where the carts were pinned needed to be recorded appropriately. Also, the mass of each cart was important to match. This was done by setting each cart in SolidWorks to a ‘custom plastic’ that allowed the density to be set. Since the measured mass of cart 1 and cart 2 was 𝑀@ = 0.57kg and𝑀- = 0.56kg, this mass was

converted to density by measuring the volume of each cart. This was done using SolidWorks measuring tools, and determined each cart had a volume of𝑉 =0.004803m?. This was used to determine that the density of cart one and cart two was 𝜌@ =1186.98 kg m? and𝜌- = 1160.77kg/m? . Figure 8 shows the complete SolidWorks model. The springs are not present within the figure because they are only available as modeling components within the motion analysis package of SolidWorks, and appear invisible within the system.

Figure 8: SolidWorks rendering of the two-cart

system that was analyzed using the motion analysis tools available through the Software.

Once the apparatus was constructed, the motion study was constructed. This was done using the Motion analysis tools available through SolidWorks. There were three motion analysis components that were added to the study and altered to match the experimental conditions. Firstly, three springs were added between the nodes and the carts. They were assigned a free length of 6 cm and a stiffness of𝑘 = 15N/m. The springs were at a resting position of 22 cm, so they were all initially under a load of tension within the system. Secondly, friction was added to the system using a solid body contact function available through the motion study tools. There are settings for static and dynamic friction coefficients, and for this application they were each set to 0.01 to give a low friction for to the response. This yields a decay to occur once the transient portion of the response dies. Gravity was also implemented into the stud in order to get an appropriate response from the solid body contact feature. Lastly, a step force of 5 N was added to cart one to imitate the force of pulling and releasing the cart, which is what was done in the experimental testing. The step force acted as somewhat of an impulse, because the 5 N step turns on when𝑡" = 0𝑠, and turns off (becomes set to 0) when𝑡k = 0.1𝑠.

There were two different motion studies created within SolidWorks. The first study pertains to the second order system response. This was done by making cart two pinned, which was imitated by fixing the SolidWorks rendering of the cart. The motion that was recorded by the ‘results’ feature on SolidWorks is shown below in figure 9.

Figure 9: One-degree of freedom simulated data of the displacement by mass 1 within the SolidWorks

motion analysis. The response is slightly more linear than the experimental data due to the fact that there is no damping added to the SolidWorks study. The experimental study has a low amount of damping occurring from an unknown source to the experimenters, therefore it could not be accurately modeled within SolidWorks. The second study pertains to the fourth order system that was tested. For this test, we simply changed the second cart from ‘fixed’ to ‘floating’ on SolidWorks. This allows the model to be freely moving within the system, and only reliant on the solid body contact. Figure 10 and 11 show the fourth order response of cart 1 and cart 2 respectively when a 5 N step force is applied to the motion study.

Figure 10: Two-degree of freedom simulated data of the displacement by mass 1 within the SolidWorks

motion analysis.

Figure 11: Two-degree of freedom simulated data of the displacement by mass 2 within the SolidWorks

motion analysis. It is worth noting that the distance traveled which was recorded by SolidWorks is different than the distance traveled that was created in our MATLAB model. This is due to the inability to edit the resting point within the SolidWorks model. So, the starting value might be different, but the range that the cart within the SolidWorks motion study travels is approximately the same; 0.3 m. Otherwise, the simulation gives a good representation of the second order and fourth order systems that were modeled within MATLAB.

Conclusions

This work develops system modeling methods for a low-cost two-degree of freedom spring-cart system. The methods used included methods traditional to Vibrations instruction, an advanced system identification algorithm, and SolidWorks motion studies. These methods can be used to provide ground truth model parameters that can be used to develop control algorithms and as an answer key for student activities using this system. A main take away from the SolidWorks simulation is that it is somewhat similar to the Euler and Runge-Kutta methods of approximation. There seems to be a level of uncertainty when working with some of the features within SolidWorks, and the result is usually a product of some guess-and-check work. While this method can yield a similar result, it better suited to be a learning tool to accompany the model rather than a method of approximation. It is easy to conclude from this work that the Prediction Error Method provided the most accurate approach for identifying system parameters. Unfortunately, this method is also the most difficult for students to understand. As a result, further work needs to be developed to aid in instructing students on this approach.

References

1. B.T. Burchett, “Parametric time domain system identification of a mass-spring-damper system”, Proceedings of the 2005 American Society for Engineering Education Annual Conference & Exposition, 2005.

2. A. Mazzei, R. Chandran, R. Lundstrom, “Integration of hands-on experience into dynamics systems teaching”, Proceedings of the 2003 American Society for Engineering Education Annual Conference & Exposition, 2003.

3. R.J. Ruhala, “Five forced-vibration laboratory experiments using two lumped mass apparatuses with research caliber accelerometers and analyzer”, Proceedings of the 2011 American Society for Engineering Education Annual Conference & Exposition, 2011.

4. B.D. McPheron, J.D. Legris, C.P. Flynn, A.J. Bradley, E.T. Daniels, “Development of a low-cost two-degree of freedom spring-cart system and system identification exercises for dynamic modeling”, 2016 American Society for Engineering Education Annual Conference & Exposition, In Press.

5. "Galaxy Simulator Parameters Defined." Galaxy Simulator Parameters. University of Illinois, n.d. Web. 03 Dec. 2015. <http://rainman.astro.illinois.edu/ddr/ddr-galaxy/parameters.html>.

6. D.J. Inman, "Chapter 2: Basics of Vibration Dynamics." Engineering Vibration. Upper Saddle River: Pearson Education, 2008. N. pag. Print.

7. G. Panda, P.M. Pradhan, and P.M. Majhi, “IIR system identification using cat swarm optimization”, Expert Systems with Applications, Volume 38 (2011) 12671-12683.

8. B.D. McPheron, “Flux Regulation in Powered Magnets: Enabling Magnetic Resonance Experiments with Pulsed Field Gradients”, A Dissertation in Electrical Engineering. The Pennsylvania State University, The Graduate School (2014).

9. L. Ljung, System Identification Theory for the User. 2nd ed. Prentice Hall (1999).