Challenge

Project - Position control of mass spring damper system

Q-1) Obtain the transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal.

Take m = 3.6; %kg k = 400; %N/m c = 100; %Ns/m

The reference signal is shown in the following figure.

AIM :-

To design the project of position control of mass spring damper system using matlab simulink model of transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal.

OBJECTIVE :-

Transfer function of a mass spring damper system and use it in the model. Add a PID controller to adjust the force on mass so that its position follows a reference signal. the matlab model of the pid control and transfer function pulse wavefrome generator.

This example shows a controlled mass-spring-damper. A controller adjusts the force on the mass to have its position track a command signal. The initial velocity for the mass is 10 meters per second. The controller adjusts the force applied by the Force Source to track the step changes to the input signal.

PID controller

In this project, PID controller has been designed by using Simulink in order to control a mass spring damper system which can move any direction. A transfer function for dc motor was added on the diagram. Response curve of the PID controller were fixed by tuning. The computer interface, different control algorithms can be performed on the system easily; control parameters can be set up online, filter algorithms in various structures can be tried and the reaction of these changeable values to the system can be observed. The effects of controller Proportional Integral Derivative (PID) for developing

TRANSFER FUNCTION :

The numerator coefficient can be a vector or matrix expression. The denominator coefficient must be a vector. The output width equals the number of rows in the numerator coefficient. You should specify the coefficients in descending order of powers of s.

'Parameter tunability' controls the runtime tunability level for numerator and denominator coefficients. 'Auto': Allow Simulink to choose the most appropriate tunability level. 'Optimized': Tunability is optimized for performance. 'Unconstrained': Tunability is unconstrained across the simulation targets.

With the following points of consideration, the modelling is done.

  • Point masses are present only
  • is resultant of all forces
  • is absolute acceleration
  • Linear force in direction is acting.

The following free body diagram (FBD) in a positive deflected state is presented.

The sum of all forces acting in a different direction is given as follows,

This is the equation of motion (EoM) and it is in the form of 2nd order ordinary differential equation (ODE), linear in nature, with constant coefficients and inhomogeneous.

The above equation was in the differential form we can convert it into the s domain or frequency domain which is represented as follows,

Finally, we can rearrange the equation to get the transfer function G(s) of this system. The definition of the transfer function of a control system is its outputs divided by its inputs. In this case, X(s) is the output, F(s) is the input, so we can get G(s) as follows:

The above-derived ODE can be converted to a single order equation by using a state-space representation of the mass-spring damper system. The Laplace transformation ignores the initial condition of the system.

PID controller

A proportional–integral–derivative controller (PID controller or three-term controller) is a control loop mechanism employing feedback that is widely used in industrial control systems and a variety of other applications requiring continuously modulated control. A PID controller continuously calculates an error value as the difference between a desired setpoint (SP) and a measured process variable (PV) and applies a correction based on proportional, integral, and derivative terms (denoted P, I, and D respectively), hence the name.

In practical terms, PID automatically applies an accurate and responsive correction to a control function. An everyday example is the cruise control on a car, where ascending a hill would lower speed if constant engine power were applied. The controller's PID algorithm restores the measured speed to the desired speed with minimal delay and overshoot by increasing the power output of the engine in a controlled manner.

The overall control function,

all non-negative, denote the coefficients for the proportional, integral, and derivative terms respectively (sometimes denoted P, I, and D).

Implementation of Spring mass system using PID controllers

The Simulink model of Spring mass damper system along with PID controller is shown below

Intial conditions are defined below

m=3.6; %Mass of the spring
k =400 ; %Spring constant
c=100 %Damping coefficient
fn=1.0 % Natural frequency in Hz
wn = sqrt(k/m) ; % Natural frequency in rad/sec
zeta=0.9; % Underdamped behaviour
p1= -zeta*wn+wn*sqrt(zeta^2-1);
p2=-zeta*wn-wn*sqrt(zeta^2-1);
P=[p1;p2];
A=[ 0 1 ; -k/m c/m];
B=[0 ; 1/m];
%Pole placement design
K=place(A,B,P);
Kp= K(1)
Kd=K(2)
Ki=0
Intially Ki was set to zero
Running the above conditions in matlab and updating the Kp , Ki and Kd gains in Simulink model and running the model
Workspace results:
Output results:
Explanation:
1 . The input refrence signal is inputed through the system by using Pulse generator having amplitude of 1 and period of 10 seconds as shown in figure below
2 The transfer function of Spring mass damper system is implemented in the system by using Transfer function
3 The input for the the Integral gain Ki is fed thorugh integrator block and refrence signal output . Intial reaponse of the Ki was set to zero to record the response with refrence signal
4 The PID gains such as Kp and Kd values are calculated by running matlab file and subsequently updated those values in the system
5 By running place command placement of pole is calculated
6 If we used the derivative block with the proportional gain to compare the output results . As we got steady state error which was overlapping overshoot response .
7 To compensate the above error we have introduced demux block to output separate signals coming from Kp and Ki gains.
Now Changing the Ki values and outputing results through scope block
Setting Ki as 50
As we can see from the above plot we can observe that rise time and settling time is decreasing
Increasing Ki value to 150
The output signal is not following refrence signal
Increasing the value of Ki to 600
The output signal is not following refrence signal
Increasing the value of Ki to 900
From the above plot we can clearly observe that the output follows refrence signal

Conclusion

With the help of PID controllers we have successfully positioned the spring mass damper system.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.