Beruflich Dokumente
Kultur Dokumente
18.3
A t a Glan ce
O v erv iew
This section contains information for getting started with the PID control and AutoTuning functions available on Twido controllers. This section contains the following top ics:
Top ic Purp ose of Document S tep 1 - C onfiguration of Analog C hannels U sed for C ontrol S tep 2 - Prereq uisites for PID C onfiguration S tep 3 C onfiguring the PID S tep 4 - Initializ ation of C ontrol S et-U p S tep 5 - C ontrol S et-U p AT + PID S tep 6 - Debugging Adjustments Pag e 627 629 632 634 642 647 651
W h at's in th is Section ?
626
35011386 06/2008
Advanced Instructions
Purp os e of Docum en t
In troduction This q uick start guide aims to guide y ou, by p roviding ex amp les, through all the step s req uired to correctly configure and set up y our Twido controller's PID control functions. Note: Impl ementing the PID f unction on a Twido does not require an advanced l evel sy of stem understanding, does demand a certain degree of but rigor f good or resul ts.
35011386 06/2008
627
Advanced Instructions
C on cern in g th e ex am p le us ed in th is g uide
F or this ex amp le, we have chosen a Ty p e K ThermoC oup le (0-2 00 ). W e will use transistor control with the outp ut therefore being a base controller outp ut controlled directly by the PID controller using PW M (see p. 634). The diagram below shows the ex p erimental setup used in the ex amp le:
Re s is to r
IN 0+ IN 0-
G re e n Wh ite
To 0-200 Th e rm o C o u p le
+ 24 V
0V
23 0 V AC
628
35011386 06/2008
Advanced Instructions
35011386 06/2008
629
Advanced Instructions
The following table describes the p rocedure for configuring the analog channels of the ex p ansion module:
Step 1 2 A ction S elect Des crib e step from the TwidoS uite interface. S ee (Describing Ap p lications, TwidoS uite Programming S oftware, O nline H elp ). Disp lay the p roduct catalog and select a module to add to the sy stem descrip tion. F or ex amp le, TW DA L M 3L T for measuring temp erature using a PT1 00 or Thermocoup le. Add the module to the sy stem descrip tion (see (Positioning a M odule, TwidoS uite Programming S oftware, O nline H elp ).) U se the C onfiguration E ditor (C onfiguration E ditor, TwidoS uite Programming S oftware, O nline H elp ) to set p arameters of analog I/O modules that y ou added as ex p ansion modules when y ou described the sy stem. In the Ty p e column, select the inp ut ty p e corresp onding to the ty p e of sensor used (ThermoC oup le K , if the sensor is of this ty p e). In the R an g e column, select the measurement unit for the sensor. F or temp erature sensors it is easier to select C els ius , as this mak es the number of counts sent back by the analog card a direct factor of the real measurement. Provide an address for the inp ut sy mbol of the configured analog card. It will be used to comp lete the PID fields (% IW 1 .0, for this ex amp le). Do the same for an analog outp ut if an outp ut must be used to drive the control sy stem.
3 4
5 6
7 8
630
35011386 06/2008
Advanced Instructions
S everal ty p es of configuration are p ossible dep ending on the ty p e of measurement used, as indicated below: z F or the ap p lication in the ex amp le used in this document, we have chosen a Ty p e K Th erm oC oup le (0-2 00 ). The p rocess value read will be directly comp rehensible (2 000 counts = 2 00 as the unit factor is 0.1 ). z F or other ty p es of measurement, y ou choose 0-10V or 4 -2 0 m A in the Ty p e column, or C us tom in the R an g e column. Then adjust the value scale (enter 0 in the M in im um column and 10000 in the M ax im um column) to be able to read the p rocess value directly (1 0 V = 1 0000 counts). The ex amp le below shows a configuration for a ThermoC oup le K analog channel:
Descrpti ofthe m odul i on e Ref erence num Description TW DALM3LT Address 2
Ex ansion modul with 2 anal inp ( p e og uts RTD -Th and 1 outp ( -10V, -20mA) ) ut 0 4 , 12 b removabe screw terminalK, its, l . J C an cel
A p p ly
M in im um 0 0 0
M ax im um 1 09 5 4 09 5 4 09 5
35011386 06/2008
631
Advanced Instructions
The PID controller must be enabled in the p rogram by an instruction. This instruction can be p ermanent or be a condition of an inp ut or internal bit. In the following ex amp le, the PID is enabled by the instruction % M 0: z In L adder:
LD
SE C TIO N TITL E
Enter y comments here. Enter y our our comments here. Enter y comments here. Enter y our our comments here. Enter y comments here. Enter y our our comments here. Enter y comments here. Enter y comments here. our our
R ung 1
% M0
P ID 0
Note: Ensur that you use corect syntax: e r Checkthat there is a space between " PID"and the PID number ( e.g. PID<space>0) .
632
35011386 06/2008
Advanced Instructions
W hen using PID controllers, y ou are strongly advised to configure the scan mode of the PL C cy cle to p eriodic. The table below describes the p rocedure for configuring the scan mode. In this mode, the % s1 9 = 1 (scan p eriod overrun) shows that the PL C scan time is greater than the p eriod defined by the user.
Step 1 2 3 A ction U se the Prog ram o C on fig ure o C on fig ure th e B eh av ior task to configure the controller Scan M ode settings. C heck the Periodic box . S et the cy cle time as shown in the screen below:
C on fig ure th e B eh av ior N iv eaux fon ction Automatic ue Automatiq M anual A utom atic m an ag em en t The H ighest p ossible The L owest p ossible M an ual m an ag em en t
L evel 1 .0 L evel 2 .0 L evel 2 .5
Scan M ode
N ormal Periodic
Period (2 250
1 00 ms
ms
W atch dog Period (1 0-5 00 ms): Periodic E v en t N on used ot utilis Period (5 -2 5 0 ms): S ubp rogram number Startup
10 0
ms
A utos av e
N ote: The cy cle time should be adjusted to the siz e of the p rogram and desired p erformance. (A time of 5 0ms is a good comp romise).
35011386 06/2008
633
Advanced Instructions
634
35011386 06/2008
Advanced Instructions
The table below shows the PID dialog box and the p rocedure for accessing the different PID settings configuration tabs:
Step 1 A ction S elect the Prog ram o C on fig ure o C on fig ure th e Data task on the TwidoS uite interface. R es ult: The default software configuration window ap p ears. S elect A dv an ced O b jects from the O bject C ategory (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame and choose PID) from the O bjects Ty p e (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame. S elect the desired PID# from the PID table.
35011386 06/2008
635
Advanced Instructions
Step 4
A ction The PID dialog box ap p ears in the foreground and is used to enter the different controller settings as shown in the figure below. In offline mode, this disp lay s several tabs: Gen eral, In p ut, PID, A T, O utp ut:
Gen eral In p ut PID A T O utp ut A n im ation
A p p ly
C an cel
AT + PI D PI States D
W or addr d ess:
PI D PI contr l D oler
Output D/ I
Setpoi nt
I nput
Mes
AT PV Li i m t AT
Im p ortan t: The tabs must be entered in the order in which they ap p ear in the PID dialog box : first G eneral, Inp ut, PID, AT then O utp ut. N ote: In online mode, this screen disp lay s two more tabs, A n im ation and Trace, used resp ectively for the diagnostics and disp lay of the controller op eration.
F or the dy namic modification of the PID p arameters (in op eration and in online mode), it is advised to enter the memory addresses in the associated fields, thus avoiding switching to offline mode to mak e on-the-fly changes to values.
636
35011386 06/2008
Advanced Instructions
The following table shows how to set the Gen eral tab in the PID dialog box :
Step 1 2 A ction In the Gen eral tab, check the C on fig ured box to activate the PID and set the following tabs. In the O p eratin g m ode drop -down list, select the ty p e of op eration desired (see p. 634). In th e ex am p le: W e will select the M emory address mode and enter the word % M W 1 7 in the associated field. The PID op erating mode will then be link ed to the value in % M W 1 7 .
In p ut Tab Settin g
The following table shows how to set the In p ut tab in the PID dialog box :
Step 1 A ction In the In p ut tab, enter the analog channel used as a measurement in the associated field. In th e ex am p le: W e have chosen % IW 1.0 as this is used as a temp erature measurement. W here necessary , set alarms on the low and high measurement thresholds by check ing the box es and filling in the associated fields. N ote: The values entered may be fix ed values (entered in the associated fields) or modifiable values (by filling in the fields associated with the memory addresses: % M W x x ).
35011386 06/2008
637
Advanced Instructions
The following table shows how to set the PID tab in the PID dialog box :
Step 1 A ction In the PID tab, enter the value to be used to set the controller setp oint. In general, this value is a memory address or setp oint of an analog inp ut. In th e ex am p le: W e have entered % M W 0, which will be used as a setp oint word. The C orrector ty p e can be selected only if the PID op erating mode has been p reviously chosen in the G eneral tab. In th e ex am p le: the C orrector ty p e is set to automatic and disabled. N ote: If y ou have p reviously chosen PID as y our op erating mode, y ou can select the desired corrector ty p e (PID or PI) from the drop -down list. If PI is selected the Td p aram eter is forced to z ero and this field is disabled. S et the K p , Ti, Td p arameters. Im p ortan t: If the A T or A T+ PID mode is selected, it is essential that the K p , Ti and Td fields be comp leted with m em ory addres s es , to enable the AutoTuning function to automatically fill in the values found. In th e ex am p le: W e have entered % M W 1 0 for K p , % M W 1 1 for Ti and % M W 1 2 for Td. N ote: In p rincip le, it is rather difficult to determine the op timal adjustment values of K p , Ti and Td for an ap p lication that has not y et been created. C onseq uently , we strongly recommend y ou enter the memory words addresses in these fields, in order to enter these values in online mode thus avoiding switching to offline mode to mak e on-the-fly changes to values. E nter the PID Sam p lin g p eriod. This value is used by the controller to acq uire measurements and up date outp uts. In th e ex am p le: W e have set the PID samp ling p eriod to 1 00, or 1 s. G iven that the adjusted sy stem has a time constant of several minutes, this samp ling p eriod value seems correct. Im p ortan t: W e advise y ou set the samp ling p eriod to a multip le of the controller scan p eriod, and a value consistent with the adjusted sy stem.
638
35011386 06/2008
Advanced Instructions
The following table shows how to set the A T tab in the PID dialog box :
Step 1 2 3 Sp ecial N ote A dv ice A ction In the A T tab, check the A uth oriz e box if y ou want to use AT. E nter the M eas urem en t lim it value. This is the limit value that the measurement must not ex ceed during AT. E nter the O utp ut s etp oin t value which is the controller outp ut value sent to generate AT. F or furth er details ab out s ettin g th es e v alues refer to th e AT Tab of PID Function, p. 680 s ection . W e s tron g ly recom m en d y ou en ter th e m em ory words addres s es in th es e fields , in order to en ter th es e v alues in on lin e m ode th us av oidin g s witch in g to offlin e m ode to m ake on -th e-fly ch an g es to v alues .
35011386 06/2008
639
Advanced Instructions
The following table shows how to set the O utp ut tab in the PID dialog box :
W A R N IN G
RI OF SYSTEM OVERLOAD SK You are reminded that manual mode has a direct efect on the control output. f l er Consequentl, y sending a manual setpoint ( Output f d)acts directl on the open iel y control sy l ed stem. You shoul theref proceed with care in this operating mode. d ore Faiur to f l these i ucti l e olow nstr ons can r esul i death,serous i ur or t n i nj y, equi ent dam age. pm
W A R N IN G
UNEXPECTED EQUI PMENT OPERATI ON Do not use rel output with PID as this mayresulin the number ofpermitted ay t operations f rel s being ex or ay ceeded and the rel destroy Depending on the ay ed. process being control this can have haz l ed, ardous consequences. Faiur to f l these i ucti l e olow nstr ons can r esul i death,serous i ur or t n i nj y, equi ent dam age. pm
Step 1 A ction In the O utp ut tab, enter the selection from the A ction drop -down list. This selection dep ends on the configured sy stem: z Direct action: the controller outp ut decreases as the variation value (setp oint - measurement) increases (cold controller). z Inverse action: Direct action: the controller outp ut decreases as the variation value (setp oint - measurement) increases (hot controller). Im p ortan t: W hen using the AT function, this list automatically selects B it addres s . The op erating mode is determined by the AT function, and in this case entered in the bit associated with this field. 2 W here necessary , enter the threshold values of the controller outp ut in the A larm s field. This function may be necessary in certain ap p lications for managing p rocess alarms where thresholds are ex ceeded.
640
35011386 06/2008
Advanced Instructions
Step 3
A ction S et the M an ual m ode op erating mode. The drop -down list offers several choices: z In h ib it = no manual mode. z A uth oriz e = the controller op erates in manual mode only . z B it addres s = the value of the bit is used to change the op eration of manual mode (bit set to 0 = automatic mode, bit set to 1 = manual mode). In th e ex am p le: H ere we select % M 2 to activate the choice, and % M W 1 8 to adjust the value of the manual setp oint. U se the manual mode to mak e trials to determine the m in /m ax outp ut lim itation , or most accurate A T outp ut s etp oin t. 4 Adjust the Dis crete outp ut word. This word is used by the controller to send the control setp oint. It can be sent directly to an analog outp ut channel (% Q W ..) or to a memory word (% M W x x ) for additional p rocessing. Im p ortan t: W hen using the PW M function, enter a memory address (% M W x x ) in this field. S et the PW M outp ut if req uired by the sy stem: 1. C heck the A uth oriz e box if y ou intend to control the sy stem via a PW M actuator. 2 . E nter the PW M control Period in the associated field. 3. E nter the O utp ut used to control the PW M actuator. W e recommend y ou use the base controller transistor outp uts for this function (for ex amp le, % Q 0.0 or % Q 0.1 for the TW DL M DA2 0DR T base controller). C onfirm the controller configuration by click ing O K in the bottom left of the screen. To configure several PID controllers, click N ex t to increment the number of the PID to be set.
6 7
35011386 06/2008
641
Advanced Instructions
Note: Bef switching the control to RUN mode,checkthat the machine ore l er s operating conditions al this f the rest ofthe appl l ow or ication.
642
35011386 06/2008
Advanced Instructions
Procedure
35011386 06/2008
643
Advanced Instructions
Step 3
A ction To p ower up the loop controller, start by controlling the PID controller in M an ual mode in order to increase the limit values needed by the AT function. To set the controller to M anual mode: 1. S witch the controller to R U N mode. 2 . E nter the memory addresses with the following values in the animation table: z % M 2 : M anual mode selection = 1 , (M 2 = 1 = > M anual M ode, M 2 = 0 = > Automatic M ode), z % M W 1 6 : PW M p eriod setting = 1 0, z % M W 1 7 : O p erating mode selection for the PID controller = 1 (PID only ), z % M W 1 8 : M anual setp oint associated with the % M 2 bit selection = 1 000. This setp oint value can be selected several times, on condition that the sy stem be left to return to its initial state. In th e ex am p le: W e have selected the value 1 000, which corresp onds to an average temp erature increase value (for information, 2 000 counts = 2 00 ). W hen cold, the sy stem starts at a value of 2 5 0 counts. C heck that the controller is R U N mode. (% M 0: controller validation = 1 , to be entered in the animation table.) S elect A dv an ced O b jects from the O bject C ategory (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame and choose PID) from the O bjects Ty p e (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame. S elect the desired PID# from the PID table.
4 5
644
35011386 06/2008
Advanced Instructions
Step 6
A ction Activate the A n im ation tab for the req uired PID number and check that the animation matches the screen below:
Gen eral In p ut PID A T O utp ut A n im ation
A p p ly
C an cel
PI D
Ts PI contr l D oler Kp Ti Td 0 0 0
Output
Perod i 20
Setpoi nt 0
Rev 0 0 Output
I nput
Mes 0
N ote: The screens of the PID controller are only refreshed if the controller is enabled (and API set to R U N ). 7 Activate the Trace tab for the req uired PID number, then: 1. S et the time elap se drop -down list to 15 m in to see a trace of the measurement signals p rogress. 2 . C heck that the measurement value remains within the accep table values for the sy stem. The increase in the measurement can be check ed in the Trace tab. W hen this has stabiliz ed, read the value corresp onding to the stabiliz ation of the measurement grap h (for ex amp le, 3 5 0 counts corresp onding to 3 5 , or an increase of 1 0 comp ared with the initial state).
35011386 06/2008
645
Advanced Instructions
Step 8
A ction S et the time elap se scroll list to 1 5 min to see a trace of the measurement signals p rogress. C heck that the measurement value remains within the accep table values for the sy stem. W e can view the increase in the measurement from the Trace tab. W hen this has stabiliz ed, read the value corresp onding to the stabiliz ation of the measurement grap h (for ex amp le, 3 5 0 counts corresp onding to 3 5 , or an increase of 1 0 comp ared with the initial state). If we see that the actuator is not controlled, check the outp ut circuit: z F or an analog outp ut, check the outp ut voltage or current from the analog card. z F or a PW M outp ut, check : z the L E D of the outp ut concerned is lit (% Q 0.1 , in this ex amp le), z the wiring of the sup p lies and 0V circuit for the TW DL M DA2 0DR T base outp uts, z the actuator p ower sup p ly . C lose the PID disp lay screen and stop the manual mode by entering the following values in the animation table: z % M 0: E nable loop controller = 0 (stop the loop controller) z % M 2 : S election of Automatic or M anual mode = 0 (stop manual mode) z % M W 1 7 : O p erating mode selection for the PID controller = 0 z % M W 1 8 : M anual setp oint associated with % M 2 bit selection = 0.
10
646
35011386 06/2008
Advanced Instructions
R em in der of K p , Ti an d Td Settin g s
F or op eration in AT+ PID mode to be p ossible, the following two conditions must be met: z The K p , Ti, Td coefficients must be configured as m em ory addres s es (% M W x x ). z The A ction ty p e in the O utp ut tab must be set to a m em ory b it addres s (% M x x ).
35011386 06/2008
647
Advanced Instructions
2 3
4 5 6
648
35011386 06/2008
Advanced Instructions
Step 7
A ction Activate the A n im ation tab for the req uired PID number and check that the animation matches the screen below:
Gen eral In p ut PID A T O utp ut A n im ation
A p p ly
C an cel
PI D
Ts 0 PI contr l D oler Kp Ti 0 0
Output
Perod i 2 0
Setpoi nt 0
Td 0
Rev 0 0 Output
I nput
Mes 0
AT PV Li i m t 0
N ote: The screens of the PID controller are only refreshed if the controller is enabled (and API set to R U N ). 8 C lick on Trace button and wait for the sy stem to startAT. Trace N ote: The waiting time may last for 1 0-2 0 minutes before the AT p rocedure changes.
35011386 06/2008
649
Advanced Instructions
O nce the Auto-Tuning seq uence is comp lete, the memory words assigned to the K p , Ti and Td coefficients are comp leted with the calculated values. These values are written to the R AM memory and saved in the controller as long as the ap p lication is valid (p ower-down of less than 3 0 day s) and no cold-start is p erformed (% S 0). Note: Ifthe sy stem is not inf l uenced byoutside f l uctuations,th val maybe e ues har written in the settings of PID control and the control switched to PID d the l er l er mode onl. y
R ep etition of A T
The Auto-Tuning seq uence is rep eated on every switch to R U N or cold start (% S 0). Y ou should therefore test the diagnostics words using the p rogram what to do in the event of a restart.
650
35011386 06/2008
Advanced Instructions
O rder
M easure
E x p ort
S creen data can be ex p orted into E x cel format by click ing on the E x p ort button. This op ens a dialog box in which y ou can sp ecify the name and location of an .c v s file. In this dialog box click Sav e to ex p ort the data or C an cel to abandon ex p ort.
35011386 06/2008
651
Advanced Instructions
To return to the PID controller screens without losing the grap h trace history , p roceed as follows:
Step 1 A ction S elect A dv an ced O b jects from the O bject C ategory (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame and choose PID) from the O bjects Ty p e (O bject C ategory F rame, TwidoS uite Programming S oftware, O nline H elp ) frame. S elect the desired PID# from the PID table. C lick the A n im ation tab.
In the A n im ation tab for the PID controllers, y ou can access the last 1 5 states of the current controller by mak ing y our selection from the drop -down list as shown below:
Gen eral In p ut PID A T O utp ut A n im ation
A p p ly
C an cel
Li ofPI states st D 1 2 /04 /2 004 1 7 :3 5 The PID setp oint is reached 12/ 2004 17:29 The PI contr i i pr ess 04/ D ol s n ogr 1 2 /04 /2 004 1 7 :2 9 Autotuning p rocess finished 1 2 /04 /2 004 1 7 :2 0 Phase 4 autotuning in p rogress 1 2 /04 /2 004 1 7 :1 5 Phase 3 autotuning in p rogress 1 2 /04 /2 004 1 7 :1 0 Phase 2 autotuning in p rogress 1 2 /04 /2 004 1 7 :02 Phase 1 autotuning in p rogress
Note: The PID states are stored when the PC and TwidoSuite are in onl mode. ine
652
35011386 06/2008