1 Introduction to Calculating PID Gains Symbollically
Peter Nachtway provided the meat of this article to me. (You can see the original file here.)
Peter had answered a problem on the sci.engr.control usenet group (the question that was asked can be found here). Here's the original question
The task: I will simulate a numerical PID under scicos. I use a Scifunc-Block. This block is triggered each ms. There I have following question:
1. The integral part of the PID has the form Yi = Yi + Ki * u1; The Problem: It seems, as Yi keeps not the value of the run before. Thus no integration is done. How can I reach, that Yi keeps this value?
2. Variable init: The variables are initialized in Diagram/context. Is this the correct place? is This init at "context" only done at the start of simulation and not every Scifunc-calling?
3. What else must be considered that the PID works propper?
There were some private conversations between Peter and Wolfgang. The result is the pdf I linked to above.
2 PID Control Problem Formulation
|Type 0 System with 2 poles|
The PID controller is
|Standard PID Controller|
The closed loop transfer function for a controller and second order velocity is
Let's start by evaluating
Substituting Eqn. 2 into Eqn. 1
} Multiply top and bottom by and get
The closed loop transfer function with characteristic equation in powers of s. Explicitly, the characteristic equations is
Based on design requirements we can construct a desired closed loop transfer function.
In this example the desired characteristic equation is
2.1 Symbollic Solution
Using Eqn. 5 and Eqn. 6 it is easily determined that
The values of K, A1, A0 are part of the plant model and therefore known at the time of the PID controller design. As a result there are 3 equations and 3 unknowns. Here are the values of Ki, Kp, adn Kd.
This example comes from http://www.engin.umich.edu/group/ctm/PID/PID.html.
For this example
- M = 1 kg
- c = 10 Ns/m
- k = 20 N/m
- F = 1 N
- K = 1
- A1 = 10
- A0 = 20
So if we choose rad/sec then we get