Скачиваний:
8
Добавлен:
10.07.2023
Размер:
867.4 Кб
Скачать

plc pid - 25.5

(degrees presumably). The temperature will be read and stored in N7:0, and the output to turn the heater on is connected to O:000/0.

 

GRT

 

U

O:000/0

 

SourceA N7:0

 

 

 

 

 

 

SourceB 74

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LES

 

L

O:000/0

 

SourceA N7:0

 

 

 

 

 

 

SourceB 72

 

 

 

 

 

 

 

 

 

 

 

 

Figure 25.4 A Ladder Logic Controller for a Logical Actuator

25.3 CONTROL OF CONTINUOUS ACTUATOR SYSTEMS

25.3.1 Block Diagrams

Figure 25.5 shows a simple block diagram for controlling arm position. The system setpoint, or input, is the desired position for the arm. The arm position is expressed with the joint angles. The input enters a summation block, shown as a circle, where the actual joint angles are subtracted from the desired joint angles. The resulting difference is called the error. The error is transformed to joint torques by the first block labeled neural system and muscles. The next block, arm structure and dynamics, converts the torques to new arm positions. The new arm positions are converted back to joint angles by the eyes.

plc pid - 25.6

 

 

 

 

 

 

 

 

real world

θ

desired

+

θ

error

neural

τ applied

arm structure

arm position

 

 

 

 

 

system and

 

and dynamics

 

 

 

 

 

 

muscles

 

 

 

 

 

 

 

 

 

 

 

 

-

 

 

 

 

 

 

 

θ

actual

 

 

 

eyes

 

 

** This block diagram shows a system that has dynamics, actuators,

feedback sensors, error determination, and objectives

Figure 25.5 A Block Diagram

The blocks in block diagrams represent real systems that have inputs and outputs. The inputs and outputs can be real quantities, such as fluid flow rates, voltages, or pressures. The inputs and outputs can also be calculated as values in computer programs. In continuous systems the blocks can be described using differential equations. Laplace transforms and transfer functions are often used for linear systems.

25.3.2 Feedback Control Systems

As introduced in the previous section, feedback control systems compare the desired and actual outputs to find a system error. A controller can use the error to drive an actuator to minimize the error. When a system uses the output value for control, it is called a feedback control system. When the feedback is subtracted from the input, the system has negative feedback. A negative feedback system is desirable because it is generally more stable, and will reduce system errors. Systems without feedback are less accurate and may become unstable.

A car is shown in Figure 25.6, without and with a velocity control system. First, consider the car by itself, the control variable is the gas pedal angle. The output is the velocity of the car. The negative feedback controller is shown inside the dashed line. Normally the driver will act as the control system, adjusting the speed to get a desired velocity. But, most automobile manufacturers offer cruise control systems that will automatically control the speed of the system. The driver will activate the system and set

plc pid - 25.7

the desired velocity for the cruise controller with buttons. When running, the cruise control system will observe the velocity, determine the speed error, and then adjust the gas pedal angle to increase or decrease the velocity.

 

 

Control

 

 

INPUT

variable

OUTPUT

 

 

 

(e.g. θ gas)

 

 

SYSTEM

(e.g. velocity)

 

 

 

 

(e.g. a car)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

vdesired

 

verror

Driver or

θ gas

 

car

vactual

 

 

 

 

 

 

 

 

 

+

_

 

cruise control

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 25.6 Addition of a Control System to a Car

The control system must perform some type of calculation with Verror, to select a new θ gas. This can be implemented with mechanical mechanisms, electronics, or software. Figure 25.7 lists a number of rules that a person would use when acting as the controller. The driver will have some target velocity (that will occasionally be based on speed limits). The driver will then compare the target velocity to the actual velocity, and determine the difference between the target and actual. This difference is then used to adjust the gas pedal angle.

1.If verror is a little positive/negative, increase/decrease θ gas a little.

2.If verror is very big/small, increase/decrease θ gas a lot.

3.If verror is near zero, keep θ gas the same.

4.If verror suddenly becomes bigger/smaller, then increase/decrease θ gas quickly.

Figure 25.7 Human Control Rules for Car Speed

Mathematical rules are required when developing an automatic controller. The

plc pid - 25.8

next two sections describe different approaches to controller design.

25.3.3 Proportional Controllers

Figure 25.8 shows a block diagram for a common servo motor controlled positioning system. The input is a numerical position for the motor, designated as C. (Note: The relationship between the motor shaft angle and C is determined by the encoder.) The difference between the desired and actual C values is the system error. The controller then converts the error to a control voltage V. The current amplifier keeps the voltage V the same, but increases the current (and power) to drive the servomotor. The servomotor will turn in response to a voltage, and drive an encoder and a ball screw. The encoder is part of the negative feedback loop. The ball screw converts the rotation into a linear displacement x. In this system, the position x is not measured directly, but it is estimated using the motor shaft angle.

Cdesired +

 

e

 

 

V

 

 

V

 

 

 

ω ,θ

actual

 

 

x

 

Controller

 

 

Current

 

 

 

DC

Ball

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-

 

 

 

 

 

 

Amplifier

 

 

 

Servomotor

 

 

 

Screw

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Cactual

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Encoder

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 25.8 A Servomotor Feedback Controller

The blocks for the system in Figure 25.8 could be described with the equations in Figure 25.9. The summation block becomes a simple subtraction. The control equation is the simplest type, called a proportional controller. It will simply multiply the error by a constant Kp. A larger value for Kp will give a faster response. The current amplifier keeps the voltage the same. The motor is assumed to be a permanent magnet DC servo motor, and the ideal equation for such a motor is given. In the equation J is the polar mass moment of inertia, R is the resistance of the motor coils, and Km is a constant for the motor. The velocity of the motor shaft must be integrated to get position. The ball screw will convert the rotation into a linear position if the angle is divided by the Threads Per Inch (TPI) on the screw. The encoder will count a fixed number of Pulses Per Revolution (PPR).

plc pid - 25.9

Summation Block:

e = Cdesired Cactual

 

(1)

Controller:

Vc

=

Kpe

 

 

 

 

(2)

Current Amplifier:

Vm

=

Vc

 

 

 

 

(3)

 

d

ω

Km2

ω

=

Km

(4)

Servomotor:

----

+

 

------

Vm

 

 

---------

 

 

 

 

dt

 

JR

 

 

JR

 

 

ω

 

 

d

 

 

 

 

 

 

=

----

 

 

 

 

(5)

 

dtθ actual

 

 

 

Ball Screw:

x =

θ

actual

 

 

 

 

(6)

-------------

 

 

 

 

 

 

 

TPI

 

 

 

 

 

Encoder:

Cactual

= PPR( θ

actual)

(7)

 

Figure 25.9 A Servomotor Feedback Controller

The system equations can be combined algebraically to give a single equation for the entire system as shown in Figure 25.10. The resulting equation (12) is a second order non-homogeneous differential equation that can be solved to model the performance of the system.

(21.4), (21.5)

(21.2), (21.3)

(21.1), (21.9)

(21.8), (21.10)

(21.7), (21.11)

 

 

d

2

 

 

Km2

d

 

 

 

Km

 

 

 

 

 

 

 

 

----

 

 

θ actual

+

---------

 

 

----

θ actual =

 

------

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

JR

Vm

 

 

 

 

 

 

 

dt

 

 

 

 

JR

 

dt

 

 

 

 

 

 

 

 

 

 

 

 

Vm = Kpe

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Vm = Kp( Cdesired Cactual)

 

 

 

 

 

 

 

 

 

 

 

 

d

2

 

 

 

Km2

d

 

 

 

Km

 

 

 

 

 

 

 

 

----

 

 

θ

actual +

 

---------

 

----

θ

actual

=

 

------

 

( Cdesired

Cactual)

 

 

 

 

 

 

 

dt

JR

Kp

 

 

dt

 

 

 

 

 

 

JR

 

 

 

 

 

 

 

 

 

 

 

 

 

d

2

 

 

 

Km2

d

 

 

 

Km

 

 

 

 

 

 

 

 

----

 

 

θ

actual +

 

---------

 

----

θ

actual

=

 

------

 

( Cdesired

PPRθ actual)

 

 

 

 

 

 

 

dt

JR

Kp

 

 

dt

 

 

 

 

 

 

JR

 

 

 

 

 

 

 

 

 

 

 

 

d

2

 

 

 

 

Km2 + Km

( PPR) Kp

d

 

 

 

 

KpKm

 

----

 

θ

 

actual +

----------------------------------------------

 

----

θ actual =

 

-------------

 

 

 

 

 

 

 

 

 

JR

 

 

 

 

 

JR

Cdesired

 

dt

 

 

 

 

 

 

 

 

 

 

 

 

 

 

dt

 

 

 

 

 

 

(21.8)

(21.9)

(21.10)

(21.11)

(21.12)

plc pid - 25.10

Figure 25.10 A Combined System Model

A proportional control system can be implemented with the ladder logic shown in Figure 25.11 and Figure 25.12. The first ladder logic sections setup and read the analog input value, this is the feedback value.

S2:1/15 - first scan

BT9:0/EN BT9:1/EN

MOV

Source 0000 0000 0000 0001

Dest N7:0

MOV

Source 0000 0101 0000 0000

Dest N7:2

BTW

Rack: 0

Group: 0

Module: 0

BT Array: BT9:0

Data File: N7:0

Length: 37

Continuous: no

BTR

Rack: 0

Group: 0

Module: 0

BT Array: BT9:1

Data File: N7:37

Length: 20

Continuous: no

Figure 25.11 Implementing a Proportional Controller with Ladder Logic

The control system has a start/stop button. When the system is active B3/0 will be on, and the proportional controller calculation will be performed with the SUB and MUL functions. When the system is inactive the MOV function will set the output to zero. The last BTW function will continually output the calculated controller voltage.

plc pid - 25.11

I:001/1 - START

 

I:001/0 - ESTOP

 

B3/0 - ON

 

 

 

 

 

 

 

 

 

B3/0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B3/0 - ON

 

 

 

 

 

MOV

 

 

 

 

 

 

Source 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Dest N9:60

 

B3/0 - ON

BT9:1/DN

 

 

 

 

 

 

SUB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SourceA N7:80

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SourceB N7:42

 

 

 

 

 

 

 

 

 

Dest N7:81

 

MUL

SourceA N7:81

SourceB 2

Dest N9:60

BT9:2/EN

Block Transfer Write

Module Type Generic Block Transfer

 

 

 

 

 

 

Rack 000

 

 

 

 

 

 

Group 1

 

 

 

Module 0

 

 

 

Control Block BT9:2

 

 

 

Data File N9:60

 

 

 

Length 13

 

 

 

Continuous No

 

 

 

 

Figure 25.12 Implementing a Proportional Controller with Ladder Logic

This controller may be able to update a few times per second. This is an important design consideration - recall that the Nyquist Criterion requires that the actual system response be much slower than the controller. This controller will only be suitable for systems that don’t change faster than once per second. (Note: The speed limitation is a practical limitation for a PLC-5 processor based upon the update times for analog inputs and outputs.) This must also be considered if you choose to do a numerical analysis of the control system.

Соседние файлы в папке PLC