Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Jack H.Automating manufacturing systems with PLCs.2005.pdf
Скачиваний:
261
Добавлен:
23.08.2013
Размер:
5.34 Mб
Скачать

plc pid - 25.20

 

BT9:0/DN BT9:1/DN

 

 

 

 

 

SUB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SourceA N7:80

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SourceB N7:42

 

 

 

 

 

 

 

 

 

Dest N7:81

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

DIV

 

 

 

 

 

 

 

 

 

SourceA N7:81

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

SourceB 2

 

 

 

 

 

 

 

 

 

Dest N7: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.21 A Water Tank Level Control Program

25.5SUMMARY

Negative feedback controllers make a continuous system stable.

When controlling a continuous system with a logical actuator set points can be used.

Block diagrams can be used to describe controlled systems.

Block diagrams can be converted to equations for analysis.

Continuous actuator systems can use P, PI, PD, PID controllers.

25.6PRACTICE PROBLEMS

1.What is the advantage of feedback in a control system?

2.Can PID control solve problems of inaccuracy in a machine?

3.If a control system should respond to long term errors, but not respond to sudden changes, what type of control equation should be used?

plc pid - 25.21

4.Develop a ladder logic program that implements a PID controller using the discrete equation.

5.Why is logical control so popular when continuous control allows more precision?

6.Design the complete ladder logic for a control system that implements the control equation below for motor speed control. Assume that the motor speed is read from a tachometer, into an analog input card in rack 0, slot 0, input 1. The tachometer voltage will be between 0 and 8Vdc, for speeds between 0 and 1000rpm. The voltage output to drive the motor controller is output from an analog output card in rack 0, slot 1, output 1. Assume the desired RPM is stored in N7:0.

Vm otor = ( rpmmoter rpmdesired) 0.02154

where,

Vmotor = The voltage output to the motor rpmmoter = The RPM of the motor

rpmdesired = The desired RPM of the motor

7.Write a ladder logic control program to keep a water tank at a given height. The control system will be active after the Start button is pushed, but it can be stopped by a Stop button. The water height in the tank is measured with an ultrasonic sensor that will output 10V at 1m depth, and 1V at 10cm depth. A solenoid controlled valve will open and close to allow water to enter. The water height setpoint is put in N7:0, in centimeters, and the actual height should be +/-5cm.

8.Implement a program that will input (from I:000) an analog voltage Vi and output (to O:001) half that voltage, Vi/2. If the input voltage is between 3V and 5V the output O:002/0 will be turned on. Include start and stop buttons that will force the output voltage to zero when not running. Do not show the bits that would be set in memory, but list the settings that should be made for the cards (e.g. voltage range).

25.7 PRACTICE PROBLEM SOLUTIONS

1.Feedback control, more specifically negative feedback, can improve the stability and accuracy of a control system.

2.A PID controller will compare a setpoint and output variable. If there is a persistent error, the integral part of the controller will adjust the output to reduce long term errors.

3.A PI controller

4.

Assume the values:

update

plc pid - 25.22

N7:0 = Analog input value

N7:1 = Analog output value

N7:2 = Setpoint

MOV

Source F8:4

Dest F8:5

MOV

Source F8:3

Dest F8:4

SUB

Source A N7:2

Source B N7:0

Dest F8:3

F8:0 = Kp

F8:1 = Kd

F8:2 = Ki F8:3 = ei F8:4 = ei-1 F8:5 = ei-2

F8:6 = T (Scan Time)

CPT

 

Dest F8:10

 

Expression

"F8:0 + F8:2 * F8:6 + F8:1 | F8:6"

 

 

 

 

CPT

 

Dest F8:11

 

Expression

"-F8:0 - 2 * F8:1 | F8:6"

 

 

 

 

CPT

 

Dest F8:12

 

Expression

"F8:1 | F8:6"

 

 

CPT

Dest N7:1

Expression

"N7:1+F8:3*F8:10+F8:4*F8:11+F8:5*F8:12"

5.Logical control is more popular because the system is more controllable. This means either happen, or they don’t happen. If a system requires a continuous control system then it will tend to be unstable, and even when controlled a precise values can be hard to obtain. The need for control also implies that the system requires some accuracy, thus the process will tend to vary, and be a source of quality control problems.

plc pid - 25.23

6.

FS

BT9:1/EN BT9:0/EN

BT9:2/EN

BT9:1/DN

BTW

Rack 0

Group 0

Module 0

Control Block BT9:0

Data N7:0

Length 37

Continuous No

BTR

Rack 0

Group 0

Module 0

Control Block BT9:1

Data N7:37

Length 20

Continuous No

BTW

Rack 0

Group 1

Module 0

Control Block BT9:2

Data N7:57

Length 13

Continuous No

CPT

Dest N7:57

Expression

"0.02154*(N7:41-F8:0)"

plc pid - 25.24

7.

S2:1/15 - first scan

 

BTW

 

 

 

 

 

 

Rack: 0

 

 

 

 

 

 

Group: 0

 

 

 

Module: 0

 

 

 

BT Array: BT9:0

 

 

 

Data File: N7:1

 

 

 

Length: 37

 

 

 

Continuous: no

 

 

 

 

BT9:0/EN

BT9:1/EN

BTR

Rack: 0

 

 

 

 

 

 

 

 

 

 

 

 

Group: 0

 

 

 

 

 

 

 

 

 

 

 

 

Module: 0

 

 

 

 

 

 

 

 

 

 

 

 

BT Array: BT9:1

 

 

 

 

 

 

Data File: N7:38

 

 

 

 

 

 

Length: 20

 

 

 

 

 

 

Continuous: no

 

 

 

 

 

 

 

START

ESTOP

B3/0 - ON

Note: Assume that a 12 bit analog input card is set for 0 to 10V input. Thus giving a range of 0V(0)

BT9:0/DN BT9:1/DN

GRT

SourceA F8:2

SourceB F8:1

LES

SourceA F8:2

SourceB F8:0

B3/0 - ON

ADD

Source A N7:0

Source B 5

Dest F8:0

SUB

Source A N7:0

Source B 5

Dest F8:1

DIV

Source A N7:43

Source B 409.5

Dest F8:2

U B3/1 - VALVE

L B3/1 - VALVE

B3/0 - ON

B3/1 - VALVE

O:002/0

 

 

 

 

 

 

 

 

 

 

 

 

VALVE

 

 

 

 

 

 

plc pid - 25.25

8.

BTW

FS Rack 0

Group 0

Module 0

Control Block BT9:0

Data N7:0

Length 37

Continuous No

 

 

 

 

 

 

start

 

 

 

 

 

 

stop

active

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

active

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BT9:1/EN

BT9:0/EN

BTR

 

Rack 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Group 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Module 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Control Block BT9:1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data N7:37

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Length 20

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Continuous No

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

BT9:1/EN

BT9:1/DN

active

active

LIM

upper 2048

 

 

 

 

 

 

lower 1229

 

 

 

 

 

 

test N7:41

 

 

 

 

BTW

Rack 0

Group 1

Module 0

Control Block BT9:2

Data N7:57

Length 13

Continuous No

DIV

sourceA N7:41 sourceB 2

dest N7:57

MOV source 0 dest N7:57

O:002/0

assume:

12 bit input and output

2s complement values -10V to 10V range constant update

no filtering

scale from -4095 to 4095

3V

3

 

 

-----

4095

= 1229

10

5V

5

 

 

-----

4095

= 2048

10