a programming method for programmable controller … · a programming method for programmable...

13
A Programming ��攀昀��呪 Programmable C��爀��攀爀�愀���椀攀 Takahiro MIYAT��呪 Miyata Techno-��愀伀昀昀椀��呪 Yashio, Saitam�愀�愀�愀温呪 ABSTRACT In order to ma��攀 �攀�攀�椀愀�爀�爀�最爀愀愀� 昀椀爀�Time-chart of ��攀 爀攀�愀�攀爀攀�愀�昀 �攀 �爀�最爀愀��愀戀�攀 �爀 checks will be� �攀 �攀 �椀�攀�愀爀愀��攀�攀��愀爀爀攀�愀Mnemonic progr�愀�愀戀攀 �愀�攀 攀愀�椀�椀�最 �攀 �爀爀攀�攀relays. Becaus�攀戀��攀愀�爀攀�攀昀�爀 �攀 爀攀�愀愀爀攀 �愀programmers. 1. INTRODUCTIO�Most of sequen��椀愀�爀�攀�攀爀攀 攀瘀攀爀 �攀�昀 are widely use�昀�爀 �攀�攀�椀愀�爀�攀�爀�最爀愀�� magnetic relay��爀 �爀愀�椀��爀�爀 �爀椀愀�爀�最爀愀�� And relays to ��攀 �最椀�椀爀��椀愀爀攀 爀攀��愀�攀�椀�昀 logic, complic�愀�攀�椀爀椀�最 椀� �攀�攀��愀爀愀��攀�椀爀攀In systems app��椀�最 倀爀�最爀愀��愀戀�攀 �爀��攀爀 �攀爀攀椀�愀昀�攀爀 to clarify wha��椀�昀 �攀爀愀�椀愀爀攀 爀攀��椀爀攀昀�爀 愀��愀 Flowchart, Blo��椀愀最爀愀愀�昀�爀�愀瘀攀 戀攀攀� �攀programmers to� �愀瘀攀 最攀�攀爀愀瘀椀攀� �昀 �攀�愀�椀�愀�椀愀� the operations� �昀 �攀 �攀 �攀�愀�攀 愀��椀�攀 戀愀� In my programm�椀�最�愀�攀 椀� 爀��攀 椀��椀�愀�攀 �攀爀愀�椀"Operation-cha�爀�∀愀��攀爀愀�椀�昀 �攀 爀攀��攀�椀瘀攀 爀攀�愀Among others, ��攀攀�爀攀�愀愀� �攀��爀攀�攀�攀�愀戀攀 �攀椀� the other hand��攀 匀攀�昀�椀爀��椀�愀戀攀攀� �爀攀 �攀needs to be ma�椀�愀椀�攀攀瘀攀� 椀温呪 power-supply s���愀最攀�呪 In recent year��攀 倀� �愀戀攀攀� �攀�爀攀 椀��攀愀�昀 攀�攀has been taken� �攀��爀攀�攀�攀伀� �攀 匀攀�昀�椀爀��椀 logic respecti�瘀攀�攀爀攀昀�爀攀�呪 use of the PC �椀�攀椀� 爀愀��攀爀 �愀爀戀攀 �攀爀�� In the use of ��攀攀�爀攀�愀戀��昀 �攀愀�爀攀�攀愀爀攀 �愀�攀 devise their l��最椀�爀攀 攀愀�椀�呪 That's why I m�愀�攀 椀� 爀��攀 �攀 �攀 �攀攀�爀攀�愀�攀�reason or othe�爀愀��椀�攀 �瘀攀�椀攀��攀戀� �椀If you make yo��爀 �椀�攀�愀爀�爀�最椀� 愀���爀�愀�攀 �椀because you ca�攀愀�椀�愀�昀 �攀 �愀�最椀�最 ��爀�椀PLC_programmin��呪 file:///E¦/web��椀�攀一�攀�匀�一一�爀攀�攀�愀�椀�一倀�爀攀�攀�愀�椀�一�㌀

Upload: trankien

Post on 26-Jun-2018

241 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

A Programming Method for

Programmable Controller-applied SystemsTakahiro MIYATA

Miyata Techno-Consultancy Office

Yashio, Saitama, Japan

ABSTRACT

In order to make a sequential control program, at first the Operation-chart of the target system will be drawn. Then theTime-chart of the related relays of the programmable controller is drawn to satisfy the Operation-chart. After this, logicalchecks will be done on the Time-chart and necessary relay operations will be added.

Mnemonic programs can be made easily, using the corrected Time-chart. The Keep-relay function will be used as outputrelays. Because, both set and reset for the relays are made by positive logic, which is easily understandable by theprogrammers.

 1. INTRODUCTION

Most of sequential control systems were ever composed of magnetic relay circuits. But recently programmable controllersare widely used for sequential control systems. A programmable controller is composed of a microcomputer, ICs andmagnetic relays, or transistors, or triacs. In a programmable controller, Magnetic relays are only used for the output circuits.And relays to compose logic circuits are replaced with software relays or virtual relays. So in order to compose sequencelogic, complicated wiring is not necessary, and desired logic can be programmed with mnemonic codes.

In systems applying Programmable Controller (hereinafter referred to as PC), it is necessary, in preparing the PC program,to clarify what kind of operations are required for any target systems. For this purpose, such materials as Time-chart,Flowchart, Block-diagram and so forth have been used. Among those materials, use of the Time-chart can benefit theprogrammers to have a general view of mechanical units and their functions. That is, we have the advantage of watching allthe operations of the whole system on a space and time basis.

In my programming, I make it a rule to indicate operations of the respective components of the system in the"Operation-chart", and operations of the respective relays of the PC in the "Time-chart".

Among others, Keep-relay as memory element may be used in the case of sequential control by electromagnetic relays. Onthe other hand, the Self-hold-circuit has been more used than others allowing for costs, except when the original stateneeds to be maintained even in

power-supply stoppage.

In recent years, the PC has been used more instead of electromagnetic relays, and the same idea with the Self-hold-circuithas been taken on memory element. On the Self-hold-circuit, however, set and reset are made by the positive and negativelogic respectively. Therefore,

use of the PC in such steps is rather hard to be understood especially by the beginners.

In the use of Keep-relay, both of set and reset are made by the positive logic, so the beginners as well as veterans candevise their logic much more easily.

That's why I make it a rule to use the Keep-relay on memory element. If I have to use the Self-hold-circuit for somereason or other, I adopt a simple convenient step by which the Keep-relay can be converted to the Self-hold type.

If you make your Time-chart through CAD in accordance with my approach, you can automate your PC programmingbecause you can easily catch hold of the changing coordinates of every PC element when it operates.

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (1/13) [2001/07/02 10:51:24]

Page 2: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig. 1 Example of Operation-chart (Operations of Injection molding machine)

2. OPERATION-CHART AND TIME-CHART

It seems that the words "Operation-chart" and "Time-chart" are used frequently in the same meaning. I use both of themmyself in their meanings quite distinct from each other.

In my way, the chart which indicates operations of system components is called the "Operation-chart", and the chartindicating operations of each PC relay is called the "Time-chart".

When the Operation-chart is made, slope and height of actuators and others are drawn as their operational speed or movingdistance changes. In other words, these factors should be described so that we can grasp how the whole system operates.However, it is not required to describe them exactly in their speed, moving distance, operating time and so on. It is onlyneeded that changing points of the control factors are shown clearly. Namely, when does the actuator proceed and/orrecede? And, when does its speed change? Fig. 1 represents an example of the Operation-chart in which operations ofInjection-cylinder of the injection molding machine and also opening and closing of the mold are shown.

First, names of components (i.e. Injection-cylinder) under control will be entered on the left-side of the column. Next,motions of components (i.e. proceed, recede and the like) will be entered on the right-side upper and lower spaces.Situations of component operations are represented on the vertical axis, while time and process factors are entered on thehorizontal axis. In Fig. 1, pictures of injection molding machine(s) are shown in my effort to help enhance readers' image. Itis not necessary, in the actual Operation-chart, to add these pictures.

In the case of Time-chart, presentation of the PC-relay operations is perfectly satisfactory, and there exist only two valuesof ON and OFF. As the result, slope and height of lines need no change. Presentation of lines in certain slope and/or heightwill be enough. In short, only timing relative to the respective relays should be described clearly. For the Timer, it is notnecessary for the setup time to be matched with its time-axis so long as the time matches the Operation-chart. It isappropriate for the setup time to be shown in numeric characters for coding purpose.

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (2/13) [2001/07/02 10:51:24]

Page 3: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig.2 Input Time-chart

Fig.3 Output Time-chart BR

Fig.4 Output-relay Motion in Operation-chart

Fig.5 Input-Output Relationship

Fig.6 Timer's Time-chart

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (3/13) [2001/07/02 10:51:24]

Page 4: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig.7 Counter's Time-chart

Fig.8 Pulse function (Differential)

   In the Time-chart, the points of rising and falling respectively are shown in slope lines which point out the timeconversion of the relays. The actual conversion time is fixed in milliseconds, therefore, these points can be ignored in viewof the operation speeds of the machine.

For this reason, if you want to relate the Operation-chart of the machine with the PC Output-relays, you should only makethe chart so that the Output-relays can operate ON/OFF at the same time the operation of the system starts. In Fig. 4, suchpresentation as in (a) may be naturally reasonable.

However, the description in Fig. 4(b) matches more with the actual situations because the relays' operation time can beignored as against that of the actuator.

3. PROMISE OF MAKING TIME -CHART

   Many of the conventional Time-charts made are of the nature that they only tell you the relays being either ON orOFF. You can see the main principles of my Time-chart making as shown in Fig. 2 and Fig. 3. In these Figures, it ispromised that "ON" means the relay coil being electrified, that is, the contact a of relay being made or closed (contact bbeing broken or opened). On the other hand, "OFF" means the relay coil being not electrified, that is, the contact a of relaybeing broken or opened (contact b being made or closed).

The relation between the Input-relay and Output-relay is as shown in Fig. 5. The input line is marked ● (input), and theoutput line is marked ○ (output). The input and output points will be connected with a solid line. This line will be calledthe "Relational-line". In this approach, relays' situations can be understood at once by the users. In addition, if some relaysare ON or OFF situations at the same time, you can easily identify the relays which are interrelated.

The function of the PC timer is generally of ON Delay-timer (the timer's Output-contact will be ON when a certain periodof time has passed after the timer coil be electrified). The relation between the contact X which drives the timer and theTimer TIM is represented as shown in Fig. 6. Counter's Time-chart will be made as shown in Fig. 7. Fig. 7 (a) describesthe situation where the Counter CNT counts up by the Count-input X1, and immediately after that, reset is made by theReset-input X2. Fig. 7 (b) is the case in which the Counter CNT counts up by X2, one of the Count-inputs.

Pulse function (differential function) will be represented as in Fig. 8. Each numeric character 1 shown on the left side of theInput mark and also on the right side of the Output mark indicates that the Pulse-output (differential) is made by the rising(or falling) of the Input X. This numeric character is called the reference number. Such reference numbers are used, whenplural Outputs and Inputs are related, to clarify which Input relates with which Output.

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (4/13) [2001/07/02 10:51:24]

Page 5: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig.9 Self-hold-circuit

Fig.10 Time-chart of Keep-relay

Fig. 11 Ladder diagram of Keep-relay

Fig. 12 ON/OFF of Output by the same Contact

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (5/13) [2001/07/02 10:51:24]

Page 6: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

4. TIME-CHART AND LADDER-DIAGRAM

In drawing the Ladder-diagram (s) from the Time-chart, it is a principle that Output-relay (s) will be Keep-relay (s). Thus,set and reset for the relay(s) are made by the positive logic, which is easily understandable by the programmers. TheKeep-relay in Fig. 10 will be converted to the Ladder-diagram as shown in Fig. 11. Fig. 11(a) and 11(b) are the caseswhere the Keep- relay instruction has a single network (products of Omron Corporation, etc.); 11(c) is the case where theKeep-relay has plural instructions (products of Mitsubishi Electric Corporation, etc.). If a set is made on the contact a andreset made on the contact b (See Fig .12 ), the ladder-diagram will be changed as shown in Fig. 13(b).

The Timer in Fig. 6 will be changed as shown in Fig. 14. The Counter in Fig. 7 (a) will be changed as shown in Fig. 15. Fig.15(a) shows the case where the Counter has a single instruction (products of Omron Corporation, etc.); Fig. 15(b) is the casewhere the Counter has plural instructions (products of Mitsubishi Electric Corporation, etc.).

As a general rule, memory elements may be aided by the Keep-relay. If any Keep-relay needs to be converted to theSelf-hold-circuit for some reason or other, you should take the following procedures. Here is a step by which theKeep-relay circuit in Fig. 16 is converted to the Self-hold-circuit.

a. Setting conditions will be used as they are. And the Self-contact Y will be connected with the setting conditions inparallel.

b. Conditions of reset are as follows: The Contact a(make contact) will be converted to the Contact b(break contact), and theContact b will be converted to the Contact a. Then, contacts being connected in parallel will be connected in series, andcontacts being connected in series will be connected in parallel. (See Fig. 17)

c. The Self-hold-circuit shown in Fig. 18 will be achieved by connecting the set conditions and reset conditions in series.

Fig.13 Ladder-diagram of Fig.12

Fig.14 Ladder-diagram of Fig.6

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (6/13) [2001/07/02 10:51:24]

Page 7: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig. 15 Ladder-diagram of Counter

Fig. 16 Keep-relay circuit

Fig.17 Conversion of Reset condition

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (7/13) [2001/07/02 10:51:24]

Page 8: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig. 18 Conversion to Self-hold-circuit

5. DRAWING OF TIME-CHART FROMOPERATION-CHART

Here is an explanation of how to draw the Time-chart based upon the Operation-chart already made. Two actuators aretaken for example. In the beginning, motions of the two cylinders (horizontal one and vertical one) will be drawn. Slopelines for the cylinder movement will be drawn adequately provided that certain actual feeling be realized.

On the left-side column, names of candidate units, i.e. "Horizontal-cylinder", "Vertical-cylinder", etc. will be listed. Onthe right-side upper and lower parts of the unit names, operations of the respective units, i.e. "Proceeding","Receding", etc.will be entered. In the chart(s), the column represents operating situations of the units; the row indicates lapse of time andchanges in process.

In the Operation-chart shown in Fig. 19, the Horizontal-cylinder begins a horizontal proceeding by the Starter. First, as itcomes to the end of proceeding, the Vertical-cylinder begins to ascend. Then, as 5 seconds pass after the ascending end, theVertical-cylinder begins to descend, and comes to the descending end. At this time, the Horizontal-cylinder starts receding,and comes to the receding end. All the operations finish so far. Fig.19 Drawing of Operation-chart.

Next comes drawing of the Time-charts for the PC Output-relay (10011) to excite the Horizontal-cylinder's solenoid(Horizontal-SOL) and, the PC-Output relay (10012) to excite the Vertical-cylinder's solenoid (Vertical-SOL). Timing ofthe rising and falling of the respective relays will be shown so as to coincide with the starting of motions of the respectivecylinders. Numbers attached to the unit names, i.e. (10011) and (10012), indicate the Output-relay Nos. in the OmronSYSMAC series.

Fig. 21 represents the operation of the limit-switches for detecting the cylinder positions. Here are, the Confirmation-LS(11004) for the Horizontal-cylinder proceeding, Confirmation-LS (11005) for the Horizontal- cylinder receding,Confirmation-LS (11006) for the Vertical-cylinder ascending, and Confirmation-LS (11007) for the Vertical-cylinderdescending. These numbers indicate the Input-relay Nos. in the Omron SYSMAC series.

Operations of the respective LS will be drawn so that each cylinder starts its motion as it reaches the fixed place.

Fig. 22 represents addition of the starting-switch operation. Here, by operating the starting-switch the Vertical-cylinder'ssolenoid is excited, and the Horizontal-cylinder starts operating. To indicate this, a relational line will be drawn betweenthe Input-relay for Starting-switch (11008) and the Output-relay for the Horizontal-SOL(10011). It is conditioned that theHorizontal-SOL is on its end of receding.

Fig. 23 represents the addition of the Timer's operation which starts descending when five minutes pass after theVertical-solenoid has reached its end of ascending.

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (8/13) [2001/07/02 10:51:24]

Page 9: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig. 19 Drawing of Operation-chart

Fig. 20 Drawing of Time-chart for Output-relay to excite Solenoid

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (9/13) [2001/07/02 10:51:25]

Page 10: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig. 21 Drawing of Position-detecting LS movement

Fig.22 Addition of Starting-switch Movements

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (10/13) [2001/07/02 10:51:25]

Page 11: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig.23 Timer's operation added and Relational-line between Input-relay and Output-relay

Fig. 24 Addition of Logical checks and Necessary conditions

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (11/13) [2001/07/02 10:51:25]

Page 12: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

Fig.25 Completed Ladder-diagram

00000 LD 1001200001 AND 1100600002 TIM 004 #005000003 LD 1100700004 DIFU 0700100005 LD 1100400006 DIFU 0700000007 LD 1100800008 AND 1100500009 LD 0700100010 AND NOT 1001200011 KEEP 1001100012 LD 0700000013 AND 1001100014 LD TIM00400015 KEEP 10012 00016 END

Table 1 Mnemonic-program

The value of five seconds will be indicated in numeric character as 5.0s. The drawing will be so made that the Timeroperates when the Vertical -SOL(10012) is ON and also the Confirmation-LS (11006) for the Vertical-cylinderascending is ON .In addition, returning of the Horizontal-SOL (10011)will be made by the Confirmation-LS forthe Vertical-cylinder descending.

The programmers, however, cannot necessarily achieve the drawing well-done. You should later do logical checks

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (12/13) [2001/07/02 10:51:25]

Page 13: A Programming Method for Programmable Controller … · A Programming Method for Programmable Controller-applied Systems ... A programmable controller is composed of a microcomputer,

and add auxiliary relays needed. Fig. 24 shows the results in which necessary conditions have been added. Thoseresults having been converted into the Mnemonic-program are shown in Table 1. Fig. 25 is the Ladder-diagram ofthe results.

6. AN AFTER-WORD

When the Time-chart has been satisfactorily drawn, the conversion work from it to the Mnemonic-program is easyand mechanical. Therefore, if the Time-chart is worked by CAD or the like, the next process of converting thenecessary coordinates read from CAD into the Mnemonic can be automated. The PC makers' software products areavailable for drawing the Ladder-diagram from the Mnemonic-program.

Advice for future study: Such functions as calculations, data transfer, JUMP, comparison, etc. should be consideredin their style in relation with the Time-chart.

For each of these functions, a flowchart will be prepared in separate at first, then reviewed through the Time-chart.Finally, functions will be added to the Mnemonic-program and/or the Ladder-diagram.

REFERENCES

[1] Takahiro Miyata, "How to use the Programmable Controller", Issued by Kogyo Chosa-kai Co., Ltd. (l993-7)

AUTHOR'S BIOGRAPHY

Takahiro MIYATA: Takahiro MIYATA was born in Okayamam, Japan on May 1, 1935. He graduated from MusashiInstitute of Technology in 1960 with a B.Eng. He entered Kyosan Electric Mfg. Co., Ltd. as a railway signalingsystem engineer in 1960.He entered NCR Co., Japan Ltd., as a system engineer in 1970.

Now he is the head of Miyata Techno-Consultancy Office since 1977.He is a fellow member of the Institute ofElectronics, Information and Communication Engineers, and a fellow member of Japan Consulting EngineersAssociation.He passed the qualification examinations of PE.Jp (Electricity and Electronics Division) and PE.Jp(Information Engineering Division) in 1969 and 1978 respectively.

He was awarded an honor of skilled technician from the Minister of Labor in 1997.

End

PLC_programming

file:///E¦/web_site/Flet's_ISDN/presentation/PLC_presentation.html (13/13) [2001/07/02 10:51:25]