Icon

Input follow + Offset + PID + Auto/Manual hot keys

This application is a backup PID controller and operates in two modes of operation.

Auto Mode

  1. The ACCESS module displays pressure measured byCH1 in auto mode.
  2. The mA signal going to valve 1 is measured (CH2) and retransmitted to value 2 with an offset value added.
  3. The second input measures a pressure; if the pressure goes above a set point a backup PID function will further reduce the output valve angle to control output.

Manual Mode

  1. The ACCESS module displays 'Valve2' angle as a percentage in manual mode.
  2. 'Valve2' angle can be adjusted using AM702 hot keys.

Operation

  1. To enter manual mode press "BACK" + "NEXT" simultaneously buttons. The mA output will be displayed as a percentage of "Valve 2" and relay 1 will also switch on to indicate manual mode.
  2. Press "UP" the output will increase by 4% per second until the "BACK" button is pressed.
  3. Press "UP" + "BACK" the output will increase by 20% per second until the "BACK" button is pressed.
  4. Press "DOWN" the output will decrease by 4% per second until the "BACK" button is pressed.
  5. Press "DOWN" + "BACK" the output will decrease by 20% per second until the "BACK" button is pressed.
  6. To enter auto mode press "UP" + "NEXT". The pressure measured by CH1 will be displayed and relay 1 will switch off to indicate auto mode.

The Standard Program Details

Declarations

Variable
Label
Description
Value
CH1
kPa PT
kPa measurement input
0 to 5000
CH2
Valve 1
Valve 1 setting from PID 1
0 to 100%
Con_a
PB %
Proportional band setting
(40)
Con_b
I time S
Integration setting
??
Con_c
D time S
Differential setting
??
Con_d
EquTime
Set to same value as the equation evaluation timer.
(0.1)
Con_e
PID SP
PiD controller setpoint
2900
Con_f
IntReset
Integration reset value
(1200)
Con_f
Offset %
Value added to reading on input 2
2
Con_g
Val 50
equation constant
50

Con_i

Val 2

equation constant

2

Con_j
Val 100
equation constant
100
Mem4
Valve 2
Valve output
0 to 100 %
Mem6
i
Integral error signal
0-5000
Mem7
PiD
Controller output error signal
0-5000
Mem8
delta
Difference between set point and process feedback (error)
Mem9
old delta
value of delta in previous sample.
Timer enable:
Y
Timer sec:
0.1
Update on input:
N
The command Gosub PID referred to in the program list is documented in UAP0025.
Please refer to UAP0025 for instructions on set-up and equation sampling time.

Program List

Program List Comment
If HK0011-Manual Goto Manual if hot keys for manual mode are pressed
If HK1001-Auto Goto Auto if hot keys for auto mode are pressed
Read Var00 Read flag to determine if in auto or manual mode
If<0 Goto Manual If Var00 is less than 0 manual mode is running goto Manual.
Del S Program will only get to this point if in auto mode.
Clear stack.
Gosub PID Calculate PID correction signal using standard PID algorithm please refer to UAP0025 for more details.
Read Mem7 Load PID correction signal into stack.
Con_h Read 50
Divide Convert PID correction from 5000 error signal to a 100 error signal
Read Ch2 Get reading from input 2 (Valve 1 setting)
Con_g Read offset value
Add Add offset to valve 1 setting
min Get the smallest value out of (Valve 1 + offset) and (PID error)
Save Mem4 Save result to go to output.
Send M4  
Exit ----------------------------------------------
LAB: Auto Initialize flag for auto mode switch off relay and clear last pressed hot key code.
Display Ch1  
RY1 off  
Con_i  
Save Var00  
HotK off  
Exit -----------------------------------------------------------
LAB: Manual Initialize flag for Manual mode and switch on relay
Display Mem4  
RY1 on  
Con_i  
CngSgn  
Save Var00  
Del S  
Read Mem4 Read current setting of output.
If HK0001-StopRamp If next button is pressed then go to Stop ramp
If HK1000-RmpUpS If up button is pressed then go to ramp up slow
If HK1010-RmpUpF If up + back pressed then go to ramp up fast
If HK0100-RmpDowS If down pressed then go to ramp down slow
If HK0110-RmpDowF If down + back pressed then go to ramp down fast
Exit --------------------------------------------------------------
LAB: StopRamp To stop ramping clear the last pressed key code.
HotK off  
Exit -------------------------------------------------------------
LAB: RmpUpS Ramp up slowly by adding 0.2 to memory 4 every 100ms.
Con_d Read 0.1
Con_i Read 2
Multiply 2 x 0.1 = 0.2
Add Add 0.2 to value in stack (memory 4)
Goto ChkLimit Go to Check limits then save
Exit -----------------------------------------------------------
LAB: RmpUpF Ramp up fast by adding 2 to memory 4 every 100ms.
Con_i Read 2
Add Add 2 to value in stack (memory 4)
Goto ChkLimit Go to Check limits then save
Exit -----------------------------------------------------------
LAB: RmpDowS Ramp down slowly by subtracting 0.2 from memory 4 every 100ms.
Con_i  
Con_d  
Multiply  
Subtract  
Goto ChkLimit  
Exit -----------------------------------------------------------
LAB: RmpDowF Ramp down fast by subtracting 2 from memory 4 every 100ms.
Con_i  
Subtract  
Goto ChkLimit  
Exit -----------------------------------------------------------
LAB: ChkLimit Check that the value in stack is between 0 and 100
Save Mem4 Save value in stack
If<0 Goto SetTo 0  
Con_j  
Subtract  
If>0 Goto SetTo100  
Exit -----------------------------------------------------------
LAB: SetTo 0  
Read Var21  
Save Mem4  
Exit  
LAB: SetTo100 -----------------------------------------------------------
Con_j  
Save Mem4  
Exit  
<End>  

USC Programs

File Comment
Help If unexpected results occur when loading the .usc file press back and click on help for instructions.
UAP00261.usc Initial release works with USC Config 104 and older usc modules but contains no auto manual operating mode and a older PID algerithim
UAP00262.usc

Will only work with USC Config 106 and USC modules containing S/W 1.06.02 or higher

It has auto and manual operating modes using hotkeys and a newer PID algarithim.

UAP0026r.usc

Contains the same auto manual feature as issue 2
however the PID function was written by Rick Joubert of Epic Energy for a specific application.
Will only work with USC Config 106 and USC modules containing S/W 1.06.02 or higher