Project - Position control of mass spring damper system
To obtain the transfer function of the mass-spring-damper system, we'll start by writing down the equations of motion:
��¨+��˙+��=�mx¨+cx˙+kx=F
Where:
- �m is the mass (3.6 kg)
- �c is the damping coefficient (100 Ns/m)
- �k is the spring constant (400 N/m)
- �x is the displacement of the mass from its equilibrium position
- �F is the force applied to the mass
Taking the Laplace transform, assuming zero initial conditions, we get:
��2�(�)+���(�)+��(�)=�(�)ms2X(s)+csX(s)+kX(s)=F(s)
Rearranging and solving for �(�)/�(�)X(s)/F(s), we obtain the transfer function:
�(�)�(�)=1��2+��+�F(s)X(s)=ms2+cs+k1
Substituting the given values �=3.6m=3.6, �=100c=100, and �=400k=400, we get:
�(�)�(�)=13.6�2+100�+400F(s)X(s)=3.6s2+100s+4001
Next, let's design a PID controller to adjust the force on the mass. The general form of a PID controller is:
�(�)=��+���+���C(s)=KP+sKI+KDs
Where:
- ��KP is the proportional gain
- ��KI is the integral gain
- ��KD is the derivative gain
The overall transfer function with the PID controller becomes:
�(�)�(�)=�(�)1+�(�)�(�)R(s)X(s)=1+C(s)G(s)C(s)
Substituting �(�)=13.6�2+100�+400G(s)=3.6s2+100s+4001 and �(�)=��+���+���C(s)=KP+sKI+KDs, we get:
�(�)�(�)=���2+���+��3.6�3+(100+��)�2+(400+��)�+��R(s)X(s)=3.6s3+(100+KD)s2+(400+KP)s+KIKPs2+KIs+KD
This is the transfer function of the closed-loop system with the PID controller.
Matlab program