12
control of salinity Thanks to David Hall, from LWTL

control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

control of salinity

Thanks to David Hall, from LWTL

Page 2: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

General Idea

โ€ข The objective is to keep the salinity close to a setpoint which will be provided by your instructor

โ€ข The salinity sensor measures the analog voltage output of the salinity circuit

โ€ข Opening DI solenoid valve decreases salinity

โ€ข Opening salty solenoid valve increases salinity

DI water(0.0% NaCl)

salt water(1.0% NaCl)

2

0.05 wt % NaCl โ‰ค setpoint for salinity โ‰ค 0.15 wt% NaCl(your instructor will provide a setpoint, such as 0.09 wt% NaCl)

Page 3: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

Control of Salinity

time

salin

ity

(%w

t N

aCl)

0.00

0.05

0.10

0.15

setpoint = 0.09upper control limit (UCL)

lower control limit (LCL)

system upset byexternally adding salty water

system upset byexternally adding DI water

valve = closed

valve = open

valve = closed

valve = open

t1

t2

t1 > t2 since valve is left open an amountof time proportional to the error

deadband

system lag hysteresis

deadtimecompensation

3

random variationof conductivity

error

error

DI water valve status

error

salty water valve status

Page 4: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

key pointsโ€ข The valve is left open an amount of time that is proportional to the error.

โ€ข small error = valve is open a short amount of timeโ€ข large error = valve is open a long amount of time

โ€ข The DI valve is left open longer than the salty valve when correcting for the same magnitude of error (DI=0%, setpoint = 0.09%, salty = 1%).

โ€ข The system has memory . . . it takes time for the salinity of the water to become uniform (mixing, water in pump and tubing). The lag time is called hysteresis.

โ€ข Control is more stable if we wait for the system to stabilize after opening a valve. The deadtime compensation is set to allow the system to come to equilibrium before responding to error.

โ€ข The upper and lower control limits are set so that random error will not cause the valves to open unnecessarily; these limits are often set three standard deviations of the error away from the setpoint. The difference between UCL and LCL is called the deadband.

4

Page 5: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

control strategyโ€ข The setpoint concentration will be assigned by your instructor. Assume 0.09% NaCl

here.

โ€ข Compute the setpoint, UCL and LCL values for control of salinity (in analog reading units โ€“ between 0 and 1023): โ€ข Convert setpoint value from salinity concentration to analogS output value using

reverse curve fit equationโ€ข To compute UCL and LCL values, use the greatest standard deviation (s)

computed from calibration data.โ€ข UCL = sepoint + 3sโ€ข LCL = sepoint - 3s

โ€ข Using this approach, 99.7% of random error will fall between the LCL and UCL, which means that your solenoid valve will be triggered due to a false alarm only 0.3% of the time.

โ€ข UCL and LCL will therefore have the same units as analog output. (between 0 and 1023).

5

Page 6: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

setting UCL and LCL by examining random errorEx

amp

le R

ead

ings

to

Illu

stra

te P

roce

du

re

494

496

498

500

502

504

506

508

510

512

0 5 10 15 20

anal

og

ou

tpu

t

reading

analog output

๐‘ˆ๐ถ๐ฟ = ๐‘ ๐‘’๐‘ก๐‘๐‘œ๐‘–๐‘›๐‘ก + 3ฯƒ = 503 + 8 = 511

๐ฟ๐ถ๐ฟ = ๐‘ ๐‘’๐‘ก๐‘๐‘œ๐‘–๐‘›๐‘ก โˆ’ 3ฯƒ = 503 โˆ’ 8 = 495

6

reading done at 0.09% salt concentration.This was the reading with maximum standard deviation for that particular fishtank

Page 7: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

โ€ข It takes time for your system to settle out after the salinity changes. โ€ข Assume the system whose response is depicted in the graph below is โ€œupsetโ€ at 18

seconds due to a sudden addition of salty water.โ€ข At about 30 seconds, the salinity values stabilize (with continued random error at the

new salinity level).โ€ข For this example, the deadtime compensation would be set to 12 seconds (30s - 18s).โ€ข This means that you would want to allow 12 seconds between salinity corrections.

setting deadtime compensation

490

495

500

505

510

515

520

525

0 5 10 15 20 25 30 35 40

anal

og

ou

tpu

t

time (s)

analog output

UCL

LCL

mean

time when salty water was added

deadtime = 12 s

7

Page 8: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

strength of response to errorโ€ข We will compute the amount of salty water that should be added to the current

mixture to correct the salinity

โ€ข Over correcting repeatedly causes the system to oscillate about the setpoint

time

salin

ity

(%w

t N

aCl)

0.00

0.05

0.10

0.15

setpoint = 0.09

upper control limit (UCL)

lower control limit (LCL)

error

a correction that is too strong was applied

overshoot (undesirable)a second correction is applied โ€“ this one is also too strong

8

Page 9: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

apply a response proportional to error

time

salin

ity

(%w

t N

aCl)

0.00

0.05

0.10

0.15

setpoint = 0.09

upper control limit (UCL)

lower control limit (LCL)

error 80% of error

โ€ข We will compute the amount of salty water that should be added to the current mixture to completely correct the salinity

โ€ข We will open the solenoid valve long enough to remove a percentage of the errorโ€ข For example, if the salinity is 0.152% and the setpoint is 0.09%, then applying an 80%

correction will lower the salinity to 0.102%, which is computed as target = (.00152-(.00152-.0009)*.8) = 0.102 %

โ€ข We call the proportionality constant the gain, G; gain is a common term used when working with industrial controllers. Here G = 0.8

9

Page 10: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

Compute target concentration

time

salin

ity

(%w

t N

aCl)

0.00

0.05

0.10

0.15

error 80% of error

More generally:

target = setpoint + (1-G)(salinityinitial โ€“ setpoint)

10

error

80% of error

salinityinitial

salinityinitial

target

target

setpoint = 0.09

UCL

LCL

Page 11: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

11

Assume that your fishtank system has a setpoint of 0.09% NaCl. Your instructor comes by your table and upsets your system by adding a good dose of DI water. The conductivity circuit returns an analog output that corresponds to a salinity of 0.04% NaCl (which is below LCL).

a) What is the target concentration if you have a gain of 0.80 (80%)?b) Using this gain, how much salty water (1% NaCl) should be added?c) How long should you leave the valve open if the flow rate is 0.2L/min?

Recommended assumptions:The water that leaving at the overflow is a mixture of water from the salty tank and the fishtank.The most salty the overflow water can be is 1% NaCl, and the least salty it can be is 0.04% NaCl. Assume that F=15% of the overflow water is 1% NaCl and that the rest is 0.04% NaCl. Neglect density differences between incoming and outgoing water; that is, the mass of water that comes in from the salty tank is equal to the mass of water that leaves through the overflow.

teams of 2

Class Problem

Page 12: control of salinity 502 504 506 508 510 512 0 5 10 15 20 put reading analog output ๐‘ˆ๐ถ๐ฟ= ๐‘’ ๐‘– +3ฯƒ=503+8=511 ๐ฟ๐ถ๐ฟ= ๐‘’ ๐‘– โˆ’3ฯƒ=503โˆ’8=495 6 ... 0 5 10 15

sketch control structure

โ€ข Compute setpoint, using reverse curve fit equation

โ€ข Compute UCL and LCL

โ€ข Measure salinity to get analogS (the analog output of the conductivity circuit)

โ€ข If analogS > UCL or < LCL & if time since last correction > deadtime then . . .

โ€ข Compute the %wt NaCl (using normal curve fit) to update LCD panel

โ€ข Compute the target salinity based on your gain

โ€ข Compute the time that your salty or DI solenoid valves needs to be left open

โ€ข Open the DI or salty valve for the computed time

12

๐‘ˆ๐ถ๐ฟ = ๐‘ ๐‘’๐‘ก๐‘๐‘œ๐‘–๐‘›๐‘ก + 3ฯƒ

๐ฟ๐ถ๐ฟ = ๐‘ ๐‘’๐‘ก๐‘๐‘œ๐‘–๐‘›๐‘ก โˆ’ 3ฯƒ

target = setpoint + (1-G)(salinityinitial โ€“ setpoint)