How to solve a simple control system problem with Laplace Transform?
- Why we need Laplace Transform?
Laplace transform is used to transfer differential equations to algebraic equations, which can then be solved by the formal rules of the algebra. Let’s see a simple example first.
As we know, the dynamic equation of the mass-spring-damper system is
𝑚𝑥′′+𝑏𝑥′+𝑘𝑥=𝐹, given initial state 𝑥(0) = 0
But now, we cannot solve this equation as it is a differential equation in the time domain. The problem is whether we can solve this differential equation like solving an algebraic problem. The answer is yes! Laplace transform can transform this from the time domain to the frequency domain and arrive at an algebraic equation. This sounds hard to imagine. Let’s see how it transforms!
2. How to do Laplace Transform?
There are a lot of great tutorials online which teach us how to do Laplace transform. (For your reference, these series give very detailed examples.) In brief, if we have f(t), which is the function of time. We can use Laplace integral :
to transfer the time domain t to the frequency domain s.s is a complex number. It should be clear that what we use is the one-sided Laplace transform which corresponds to t≥0(all non-negative time). This is confusing to me at first. But let’s put it aside first, we will discuss it later and now just focus on how to do Laplace transform.
Given some examples, if f(t) = 1, which is a constant function of time. Then what is its Laplace transform?
Let’s see more examples to get some ideas about Laplace transform. If f(t)=t, what is its Laplace transform?
Before calculating this integral, according to Integration Rules:
We know f(t) = t, so we can let
And we know
According to the definition of Laplace transform and Integration rules, we can arrive:
Now, let’s see some more general properties of the Laplace transform. For example, what is the Laplace transform of f′(t) which is the derivative of f(t)?
As we did before, we can also use Integration rules, this time we let:
We can get L{f′(t)} as follows:
Furthermore, we can get the Laplace transform of the second derivative of f(t), which is f′′(t):
If you are interested in the integral computation of Laplace transform, you can try yourself. There are also great tutorials online which go through steps of Laplace transform. You can also check the Table Of Laplace Transforms online.
3. Solve the Mass-Spring-Damper System with Laplace transform
Back to our example above, we want to know the open-loop step response of the mass-spring-damper system:
𝑚𝑥′′+𝑏𝑥′+𝑘𝑥=𝐹
which we cannot solve it before. But now if we transfer it to s domain, we can get the result.
According to the results of part2, we know the first and second derivatives of f(t) is as follows:
So we can arrive at x′ = s*X(s)- X(0), we denoted X(s) as the Laplace transform of function x(t). Given X(0)=0, so
L{x′} = s*X(s)
L{x′′} = s² *X(s)
Now we transfer the dynamic model as following:
Finally, we get the transfer function G(s) of this control system. The definition of the transfer function of a control system is its outputs divided its inputs. In this case, X(s) is the output, F(s) is the input, so we can get G(s) as follows:
Suppose the input F =1, m=1, b=9, k=20, we can get the output X(s) as follows:
The last step is taking the inverse transform then gives,
Now we solved the above mass-spring-damper system.
4. Adding PID control to the mass-spring-damper system
If we want to control this system, one method is to use the PID control which can convert this problem to be a closed-loop system.
The notation is this: G(s) is the plant transfer function, which we have solved before. Gc(s) is the controller transfer function, R(s) is a reference (or command)input, and Y(s) is the output.
For the unity feedback, i.e., H(s)=1, the closed-loop system is given by,
According to the above example, we know the plant transfer function is,
Meanwhile, we know that the block diagram of PID control as below,
According to the definition of PID control, we know its transfer function in the time domain is,
where Kp, Ki, Kd, all non-negative, denote the coefficients for the proportional, integral, and derivative terms respectively. e(t) is the error.
In the control system, we must transfer all functions into the Laplace domain. According to part2, we know how to transfer a function from the time domain(t) to the frequency domain(s). In this case, let L{e(t)}=1,
According to part2, we know that
Suppose e(0)=0, so L{e’(t)}=s*1-e(0)=s, equivalently,
The transfer function in the Laplace domain of the PID controller is,
Our controller transfer function can be written as,
Above all, the transfer function of the closed-loop system with PID control gives,
5. Intuitional understanding of Laplace transform
As we mentioned before, the Laplace transform is used to transfer function from the time domain to the frequency domain. In this article, I just give you an example of f(t)=1(t≥0), and its Laplace transform is,
If visualized intuitively, L{1} is drawn like shown below:
There is a great video that can help you imagine how it transfers.
5. Summary
This article illustrates a simple example of the second-order control system and goes through how to solve it with Laplace transform. Furthermore, we add the PID control to it and make it become a closed-loop system and get the transfer function step by step. In the last part, this article gives an intuitional understanding of the Laplace transform. I hope it can help you understand Laplace transform more easily and get a rough idea of the application of Laplace transform on control systems.