Challenge

Position control of mass spring damper system

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

ANSWER:

Steps:

The transfer function of a mass spring damper system can be derived using Newton's second law of motion, which states that the sum of the forces acting on an object is equal to its mass multiplied by its acceleration.

For a mass-spring-damper system, the equation of motion can be written as:

m * d^2x/dt^2 + c * dx/dt + k * x = f

Where:

m is the mass of the object in kg

c is the damping coefficient in Ns/m

k is the spring constant in N/m

x is the displacement of the mass from its equilibrium position in m

f is the external force applied to the mass in N

Taking the Laplace transform of both sides of the equation and assuming zero initial conditions,

we can derive the transfer function:

X(s) / F(s) = 1 / (ms^2 + cs + k) where X(s) is the Laplace transform of x(t) and F(s) is the Laplace transform of f(t).

To add a PID controller to the system to adjust the force on the mass so that its position follows a reference signal, we can use the following control law:

f(t) = Kp * e(t) + Ki * Integral[e(t) dt] + Kd * de(t) / dt

where: Kp is the proportional gain

Ki is the integral gain

Kd is the derivative gain

e(t) is the error between the desired reference signal and the actual position of the mass, given by

e(t) = x_ref(t) - x(t) Integral[e(t) dt]

is the integral of the error over time de(t) / dt is the derivative of the error with respect to time

Substituting the control law into the transfer function equation,

we can obtain the closed-loop transfer function:

X(s) / X_ref(s) = Kp + Ki/s + Kds / (ms^3 + c*s^2 + (k+Kp)s + Ki + Kdc)

where X_ref(s) is the Laplace transform of x_ref(t).

By choosing appropriate values for the PID gains Kp, Ki, and Kd, we can adjust the system response to meet the desired performance specifications.

PID CONTROLLER:

Choosing the appropriate values for the proportional, integral, and derivative gains (Kp, Ki, and Kd) in a PID controller is essential for achieving stable and responsive control of a system. There is no universal method for selecting the optimal PID gains, as the selection process depends on the system's dynamics, input/output characteristics, and performance requirements. However, here are some general guidelines that can help you choose PID gains more accurately:

  1. Start with small values of Kp, Ki, and Kd, and then increase them gradually until you achieve the desired response. This is known as the "trial and error" method.

  2. Use mathematical models or simulations to estimate the system's dynamics and behavior, and then use these models to determine the PID gains that will produce the best performance.

  3. Use tuning methods such as the Ziegler-Nichols method or the Cohen-Coon method to find the optimal PID gains. These methods involve injecting a step input into the system and observing its response to determine the appropriate gains.

  4. Use heuristic rules of thumb to estimate the optimal gains based on the system's properties. For example, a fast and stable system may require a high Kp, while a slow and sluggish system may require a high Ki.

In conclusion, selecting accurate values for Kp, Ki, and Kd in a PID controller is crucial for achieving stable and responsive control. Different methods, such as trial and error, mathematical modeling, tuning methods, and heuristic rules, can be used to select the optimal gains. It's important to note that the selection process depends on the system's dynamics and performance requirements, and there is no universal method for selecting the optimal PID gains.

Input signal design:

Simulink Model:

Conclusion:

PID controller is essential for achieving stable and responsive control of a system. There is no universal method for selecting the optimal PID gains, as the selection process depends on the system's dynamics, input/output characteristics, and performance requirements.

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.