Sunteți pe pagina 1din 30

University of Tehran

Faculty of Engineering

School of Mechanical Engineering

Course :

Automatic control

Project:

Design a PID Controller For Crank Slider

Instructor:

Dr. Yousefi-Koma

By:

Morteza shafiee

Hassan Ghiamatyoun

Summer 2010

Tehran

0 | Design a PID Controller For Crank Slider


Contents
Chapter-1......................................................................................................................................... 2
Introduction: ................................................................................................................................ 3
PID controllers: ........................................................................................................................... 4
Chapter-2......................................................................................................................................... 5
2.1.General effect on system by applying P.I.D controllers: ..................................................... 6
2.1.1.Proportional term: ........................................................................................................... 6
2.1.2.Integral term: .................................................................................................................. 6
2.1.3.Derivative term : ............................................................................................................. 6
2.2.Effects of increasing a parameter independently : ................................................................ 7
2.3.Crank Slider: ......................................................................................................................... 7
2.4.Block diagram of system:...................................................................................................... 8
Chapter-3....................................................................................................................................... 10
3.1.The best controller:.............................................................................................................. 11
3.1.1.Proportional controller(P): ............................................................................................ 11
3.1.2.Proportional - Derivative controller(PD):..................................................................... 13
3.1.3.Proportional – Integral controller(PI): .......................................................................... 15
3.1.4.Proportional – Integral - Derivative controller(PID): ................................................... 17
3.2.comparing controllers:......................................................................................................... 19
Chapter-4....................................................................................................................................... 20
4.1.Controller testing : ............................................................................................................... 21
4.1.1.Proportional controller(P): ............................................................................................ 21
4.1.2.Proportional - Derivative controller(PD):..................................................................... 23
4.1.3.Proportional – Integral controller(PI): .......................................................................... 24
4.1.4.Proportional – Integral - Derivative controller(PID): ................................................... 25
Results: ...................................................................................................................................... 27
Chapter-5....................................................................................................................................... 28
References : ............................................................................................................................... 29

1 | Design a PID Controller For Crank Slider


Chapter-1

Introduction
 PID controllers

2 | Design a PID Controller For Crank Slider


Introduction:
proportional-integral-derivative (PID) control is certainly the most widely used control
strategy today. It is estimated that over 90% of control loops employ PID control, quite often
with the derivative gain set to zero (PI control). Over the last half-century, a great deal of
academic and industrial effort has focused on improving PID control, primarily in the areas of
tuning rules, identification schemes, and adaptation techniques. It is appropriate at this time to
consider the state of the art in PID control as well as new developments in this control approach.

The three terms of a PID controller fulfill three common requirements of most control problems.
The integral term yields zero steady-state error in tracking a constant set point, a result
commonly explained in terms of the internal model principle and demonstrated using the final
value theorem .In this projects , the goal is to find a PID controller (if one exists) that allows the
loop transfer function to achieve gain and phase specifications over finite frequency intervals.
The PID framework solves many control problems and is sufficiently flexible to incorporate
additional capabilities. We can thus expect that this technique will continue to play an important
role in control practice.

3 | Design a PID Controller For Crank Slider


PID controllers:
A proportional–integral–derivative controller (PID controller) is a generic control loop
feedback mechanism (controller) widely used in industrial control systems – a PID is the most
commonly used feedback controller. A PID controller calculates an "error" value as the
difference between a measured process variable and a desired set point. The controller attempts
to minimize the error by adjusting the process control inputs. In the absence of knowledge of the
underlying process, PID controllers are the best controllers. However, for best performance, the
PID parameters used in the calculation must be tuned according to the nature of the system-
while the design is generic, the parameters depend on the specific system.

The PID controller calculation (algorithm) involves three separate parameters, and is accordingly
sometimes called three-term control: the proportional, the integral and derivative values, denoted
P, I, and D. The proportional value determines the reaction to the current error, the integral value
determines the reaction based on the sum of recent errors, and the derivative value determines
the reaction based on the rate at which the error has been changing. The weighted sum of these
three actions is used to adjust the process via a control element such as the position of a control
valve or the power supply of a heating element. Heuristically, these values can be interpreted in
terms of time: P depends on the present error, I on the accumulation of past errors, and D is a
prediction of future errors, based on current rate of change. By tuning the three constants in the
PID controller algorithm, the controller can provide control action designed for specific process
requirements. As you see in figure-1 we show a sample diagram of PID controller .The response
of the controller can be described in terms of the responsiveness of the controller to an error, the
degree to which the controller overshoots the set point and the degree of system oscillation. Note
that the use of the PID algorithm for control does not guarantee optimal control of the system or
system stability .Some applications may require using only one or two modes to provide the
appropriate system control. This is achieved by setting the gain of undesired control outputs to
zero. A PID controller will be called a PI, PD, P or I controller in the absence of the respective
control actions. PI controllers are fairly common, since derivative action is sensitive to
measurement noise, whereas the absence of an integral value may prevent the system from
reaching its target value due to the control action.

Figure-1: the block diagram of sample PID controller.

4 | Design a PID Controller For Crank Slider


Chapter-2

 General effect on system by applying P.I.D controllers


 Effects of increasing a parameter independently
 Crank Slider
 Block diagram of system

5 | Design a PID Controller For Crank Slider


2.1.General effect on system by applying P.I.D controllers:
Now we describe the effect of Proportional, Integral and Derivative terms on controller .

2.1.1.Proportional term:

The proportional term (sometimes called gain) makes a change to the output that is proportional
to the current error value. The proportional response can be adjusted by multiplying the error by
a constant Kp , called the proportional gain. A high proportional gain results in a large change in
the output for a given change in the error. If the proportional gain is too high, the system can
become unstable (see the section on loop tuning). In contrast, a small gain results in a small
output response to a large input error, and a less responsive (or sensitive) controller. If the
proportional gain is too low, the control action may be too small when responding to system
disturbances.

2.1.2.Integral term:

The contribution from the integral term (sometimes called reset) is proportional to both the
magnitude of the error and the duration of the error. Summing the instantaneous error over time
(integrating the error) gives the accumulated offset that should have been corrected previously.
The accumulated error is then multiplied by the integral gain and added to the controller output.
The magnitude of the contribution of the integral term to the overall control action is determined
by the integral gain, Ki.

The integral term (when added to the proportional term) accelerates the movement of the process
towards set point and eliminates the residual steady-state error that occurs with a proportional
only controller. However, since the integral term is responding to accumulated errors from the
past, it can cause the present value to overshoot the set point value (cross over the set point and
then create a deviation in the other direction).

2.1.3.Derivative term :

The rate of change of the process error is calculated by determining the slope of the error over
time (i.e., its first derivative with respect to time) and multiplying this rate of change by the
derivative gain Kd. The magnitude of the contribution of the derivative term (sometimes called
rate) to the overall control action is termed the derivative gain, K d .

The derivative term slows the rate of change of the controller output and this effect is most
noticeable close to the controller set point. Hence, derivative control is used to reduce the
magnitude of the overshoot produced by the integral component and improve the combined
controller-process stability. However, differentiation of a signal amplifies noise and thus this

6 | Design a PID Controller For Crank Slider


term in the controller
oller is highly sensitive to noise in the error term, and can cause a process to
become unstable if the noise and the derivative gain are sufficiently large

2.2.Effects
Effects of increasing a parameter independently :
There is a table that show the effects of in
increasing
creasing a parameter independently. In next section we
examine these effect and discuss on theme.

Parameter Rise time Overshoot Settling time Steady-state


state Stability
error

Kp Decrease Increase Small change Decrease Degrade

Decrease
Ki Decrease Increase Increase significantly Degrade

Kd Minor Minor Minor No effect in Improve if Kd


decrease decrease decrease theory small

Table-2: Effects of increasing a parameter independently


independently.

2.3.Crank Slider:

As you see in figure-2 and figure-4 we simulate a slider lag in Matlab Simulink

Origin position vector: B


A= [0 0 0]
CG2
B= [10 10 0]

C= [15 5 0] CG1 C

CG1= [5 5 0]

CG2= [12.5 7.5 0]


A
Dimensions are in cm

Each link has 1 kg mass

Figure-2:
Figure Crank Slider

7 | Design a PID Controller For Crank Slider


2.4.Block
Block diagram of system:
By using Matlab Simulink , we design a block diagram for system. As you se
seee in figure-2
figure we
use five scopes to monitoring our data:

Figure
Figure-3: Block diagram of system.

8 | Design a PID Controller For Crank Slider


Figure-4: Block diagram of subsystem.

9 | Design a PID Controller For Crank Slider


Chapter-3



The best controller
comparing controllers

10 | Design a PID Controller For Crank Slider


3.1.The best controller:
In this chapter we try to choose the best controller and optimized controller .by using matlab

signal constraint block , we determine a best controller.

3.1.1.Proportional
Proportional controller(P):

First we apply proportional controller to control the system .as you see in figure 3.1 controller is
optimized to desired responses and the optimized gain is:

p = 1525.2

Figure
Figure-3.1:iteration for optimized responses .

11 | Design a PID Controller For Crank Slider


Figure-3.2:system response.

We have a steady state error about 0.0006 cm because the gain of integral is zero

Figure-3.3:torque signal.

12 | Design a PID Controller For Crank Slider


3.1.2.Proportional - Derivative controller
controller(PD):

as you see in figure 3.4 controller is optimized to desired responses and the optimized gain is:

p = 1545.3

d = 10.43

Figure
Figure-3.4:iteration for optimized responses .

13 | Design a PID Controller For Crank Slider


Figure-3.5:system response

Again we have a steady state error about 0.0006 cm because the gain of integral is zero and there is very
small effect on system in variety of d(derivative gain).

Figure-3.6:torque signal.
14 | Design a PID Controller For Crank Slider
3.1.3.Proportional – Integral controller
controller(PI):

as you see in figure 3.7 controller is optimized to desired responses and the optimized gain is:

i = 52.5881

p = 919.2763

Figure
Figure-3.7:iteration for optimized responses .

15 | Design a PID Controller For Crank Slider


Figure-3.8:system response

If you see carefully Figure-3.8 you understand that we don’t have steady state error because we apply
integral term in our controller.

Figure-3.9:torque signal.

16 | Design a PID Controller For Crank Slider


3.1.4.Proportional – Integral - Derivative controller
controller(PID):

as you see in figure 3.10 controller is optimized to desired re


responses
sponses and the optimized gain is:

d = 1.0000e-005

i = 52.6060

p = 918.9681

Figure
Figure-3.10:iteration for optimized responses .

17 | Design a PID Controller For Crank Slider


Figure-3.11:system response

Again we don’t have steady state error because we apply integral term in our controller.

Figure-3.12:torque signal.

18 | Design a PID Controller For Crank Slider


3.2.comparing controllers:
We can apply all of controller for controlling system ,but its depend on what we do with
controller and what are our goals .if we want exact output (exact position for slider) we must
apply integral term in controller and if we need small overshoot we must apply derivative term in
our controller there are many condition as you see in Table 3.1 we summarized the effect of
controller on system .

Term Math Function Effect on Control System

P Typically the main drive in a control loop, KP reduces a large part


Proportional KP × e(t) of the overall error.

I Reduces the final error in a system. Summing even a small error


Integral KI × ∫ e(t) dt over time produces a drive signal large enough to move the system
toward a smaller error.

D Counteracts the KP and KI terms when the output changes quickly.


Derivative KD × d e(t) / dt This helps reduce overshoot and ringing. It has no effect on final
error.

Table-3.1: summery of PID characteristics.

The best an certain controller in our view point is PID because it is very adaptive with condition
in comparison with other controller although there is not difference between PID and PI
controller because effect of D is not very visible .

19 | Design a PID Controller For Crank Slider


Chapter-4


Controller testing
Results

20 | Design a PID Controller For Crank Slider


4.1.Controller testing :
We test controllers in two ways:

1)change input value and check controller work correctly or not.

2)change mass of links and check controller work correctly or not.

change input value:

for each controller we determine range of input .you can see below results and diagrams

4.1.1.Proportional controller(P):

Range of acceptable input: 0.0737-0.2

Figure-4.1: response for minimum input value (P controller).

21 | Design a PID Controller For Crank Slider


Figure-4.2: response for maximum input value (P controller).

22 | Design a PID Controller For Crank Slider


4.1.2.Proportional - Derivative controller(PD):

Range of acceptable input: 0.0737-0.2

Figure-4.3: response for minimum input value (PD controller).

Figure-4.4: response for maximum input value (PD controller).

23 | Design a PID Controller For Crank Slider


4.1.3.Proportional – Integral controller(PI):

Range of acceptable input: 0.0737-0.2001

Figure-4.5: response for minimum input value (PD controller).

Figure-4.6: response for maximum input value (PI controller).

24 | Design a PID Controller For Crank Slider


4.1.4.Proportional – Integral - Derivative controller(PID):

Range of acceptable input: 0.0737-0.2002

Figure-4.7: response for minimum input value (PID controller).

Figure-4.8: response for maximum input value (PID controller).

25 | Design a PID Controller For Crank Slider


Now we only test PID controller with change in link 3 s mass:

Range of mass can vary in : 0-9.1 Kg

Figure-4.9: response for maximum mass (PID controller).

Figure-4.10:maximum torque for maximum mass.

26 | Design a PID Controller For Crank Slider


Results:

All of controller work correctly in determined region. If the PID controller parameters (the
gains of the proportional, integral and derivative terms) are chosen incorrectly, the controlled
process input can be unstable, i.e. its output diverges, with or without oscillation, and is limited
only by saturation or mechanical breakage. In this project we see that the best controller is PID
controller.

27 | Design a PID Controller For Crank Slider


Chapter-4
Chapter-5

Appendix
References

28 | Design a PID Controller For Crank Slider


References :

[ 1] KATSUHIKO OGATA, “Modern Control Engineering”, Fourth Edition

[2] http://lorien.ncl.ac.uk

[3] http://www.wikipedia.org

29 | Design a PID Controller For Crank Slider

S-ar putea să vă placă și