plc automation slides

26
Styrteknik: Tidskretsar, räknare PLC3B:1 Olika exempel med Timers och Counters En Enkel Timer med MELSEC IL Om BTN_DGVG trycks ned och hålls nedtryckt: => LEDKG_red = 1 efter 5.0 sek (50*100 ms) OBS här anges timer T1 explicit i koden. Normalt används funktionsblock som väljer timer internt. Funktion : LD BTN_DGVG OUT T1 K50 LD T1 OUT LEDKG_RED

Upload: haseeb-riaz

Post on 05-Jan-2016

259 views

Category:

Documents


4 download

DESCRIPTION

Industrial Automation, Assignment 1. PLC design and Ledder Logic and boolean Algebra Practice Timers and Counters

TRANSCRIPT

Page 1: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:1

Olika exempel med Timers och Counters

En Enkel Timer med MELSEC IL

• Om BTN_DGVG trycks ned och hålls nedtryckt: => LEDKG_red = 1 efter 5.0 sek (50*100 ms)

• OBS här anges timer T1 explicit i koden. Normalt används funktionsblock som väljer timer internt.

Funktion:

LD BTN_DGVGOUT T1 K50LD T1OUT LEDKG_RED

Page 2: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:2

Ex test3: Ladder Diagram

Vilken timer som används kan erhållas med ”Upload project” som visar MELSEC-koden

Page 3: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:3

Ex test3: MELSEC IL from Ladder Diagram using IEC timer TON

• Med Upload Project erhålls koden!• X005 = BTN_DGVG• M8000 = RUN-indikering• Värdet 5000 sparas i D128• Y000 = LEDKG_RED

• Subrutinen P_30• 5000/100 = 50 => D132 (dvs 5 sek)• Timer T17 används• Utvärdet sparas i M257• T17*100=>aktuellt tidsvärde=>D130

ger värdet till utgången ET

Page 4: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:4

Ex test4: IEC Function Block Diagram

Page 5: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:5

Ex test5: MELSEC Function Block Diagram

Page 6: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:6

Ex test5: MELSEC Function Block Diagram

Upload Project ger koden!

OBS ingen subrutin

Page 7: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:7

Ex test6: IEC Function Block Diagram, Pulse Timer

Page 8: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:8

In GX IEC Developer timers and counters are programmed using a group of special functions provided in the Manufacturer Library.

Function: TIMER_M / COUNTER_MOperands Normal timers/counters Extended timers/counters

Action Passes the setpoint value and calls (starts) the timer/counter

Med en Function måste man specifiera vilken Timer (T1-T32) man ska använda.

Page 9: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:9

MELSEC Output Instructions: OUT T

10 seconds after setting X0, the following program sets the outputs Y10 and Y14. A low speed timer (100 ms) is used.

• Function TIMER_M

• TC1 = T1, Coil på T1, adress

• TS1 = Status T1, avläst värde

• Övrigt enligt tidigare ex

• OBS Man väljer själv vilken Timer (T1) som ska användas.

Page 10: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:10

Input of a binary value from digital inputs Binary Conversion BINP

The program reads the time setting via the inputs X10 through X1F in BCD data format. Note 16 inputs are needed.

With leading edge from X0 BCD data is converted into BIN data first and stored in D10.

After setting X2 the time setting is read. After the set time has passed Y15 is set.

A low speed timer (100 ms) is used.

Page 11: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:11

LEDKG_GREEN tänds 5 sek efter att BTN_DGVG har tryckts ned

Användning av MELSEC Function: TIMER_M

Page 12: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:12

Ex test_C1: MELSEC IL Counter

OBS Här anges Counter C0 explicit i koden*)

Page 13: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:13

Ex test_C2: IEC Function Block Diagram

Page 14: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:14

Ex test_C3: MELSEC Function Block Diagram

Page 15: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:15

Ex test_C4: MELSEC Function Block Diagram

Page 16: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:16

FX1 har 2000 programsteg, För de olika testerna med räknaren gäller:

•Test_C1: MELSEC kod =>12 programsteg•Test_C2: IEC Function Block => 44 programsteg•Test_C3: MELSEC Function Block => 22 programsteg•Test_C4: MELSEC Function =>12 programsteg

MELSEC-Blocken är anpassade för PLC:en och kräver färre programsteg. Konstruktionen kan inte flyttas till andra styrsystem lika lätt.

Page 17: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:17

Räknarens värde kan visas på utgångarna.Vid lab 2 ska antaletbilar i ett garage visas.

Page 18: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:18

Page 19: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:19

Page 20: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:20

On-off cycle timer

Page 21: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:21

Page 22: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:22

Varianter av ”One shot”

Page 23: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:23

Exempel med timer från AMS kapitel 9.

Consider the short ladder logic program in Figure 9.13 for control of a heatingoven. The system is started with a Start button that seals in the Auto mode. This can bestopped if the Stop button is pushed. (Remember: Stop buttons are normally closed.)When the Auto goes on initially the TON timer is used to sound the horn for the first 10seconds to warn that the oven will start, and after that the horn stops and the heating coilsstart. When the oven is turned off the fan continues to blow for 300s or 5 minutes after.

Tips: Stop button kan vara t.ex. SW_KGS på labkortet. Sluten kontakt innebär att processen kan starta. Start kan vara BTN_KGSG.Använd Function Block Diagram eller Ladder Diagram.I lösningen I AMS är heat.dn, “done bit”, den normala utgången på en timer. Signalen heat.tt är 1 sä länge timern räknar, signalen finns inte I IEC:s tidskretsar.Börja med att rita ett tidsdiagram för exemplet.

Page 24: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:23

Exempel med Counter från AMS kapitel 9.

The program in Figure 9.17 is used to remove 5 out of every 10 parts from a conveyorwith a pneumatic cylinder. When the part is detected both counters will increasetheir values by 1. When the sixth part arrives the first counter will then be done, therebyallowing the pneumatic cylinder to actuate for any part after the fifth. The second counterwill continue until the eleventh part is detected and then both of the counters will be reset.

Rita tidsdiagram för lösningen. Skriv program.

Page 25: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:23

Exempel från AMS kapitel 9.

Shear Press

1. A toggle start switch (TS1) and a limit switch on a safety gate (LS1) must bothbe on before a solenoid (SOL1) can be energized to extend a stamping cylinderto the top of a part.2. While the stamping solenoid is energized, it must remain energized until a limitswitch (LS2) is activated. This second limit switch indicates the end of a stroke.At this point the solenoid should be de-energized, thus retracting the cylinder.3. When the cylinder is fully retracted a limit switch (LS3) is activated. The cyclemay not begin again until this limit switch is active.4. A cycle counter should also be included to allow counts of parts produced.When this value exceeds 5000 the machine should shut down and a light lit up.5. A safety check should be included. If the cylinder solenoid has been on for morethan 5 seconds, it suggests that the cylinder is jammed or the machine has afault. If this is the case, the machine should be shut down and a maintenancelight turned on.

Skriv program!

Page 26: PLC Automation Slides

Styrteknik: Tidskretsar, räknare PLC3B:23

16. In dangerous processes it is common to use two palm buttons that require a operator to use both hands to start a process (this keeps hands out of presses, etc.). To develop this there aretwo inputs that must be turned on within 0.25s of each other before a machine cycle may begin.

18. Write a ladder logic program that does what is described below. - When button A is pushed, a light will flash for 5 seconds. - The flashing light will be on for 0.25 sec and off for 0.75 sec. - If button A has been pushed 5 times the light will not flash until the system is reset. - The system can be reset by pressing button B

20. A buffer can hold up to 10 parts. Parts enter the buffer on a conveyor controller by output con-veyor. As parts arrive they trigger an input sensor enter. When a part is removed from the

buffer they trigger the exit sensor. Write a program to stop the conveyor when the buffer is full,and restart it when there are fewer than 10 parts in the buffer. As normal the system should alsoinclude a start and stop button.

22. We are using a pneumatic cylinder in a process. The cylinder can become stuck, and we needto detect this. Proximity sensors are added to both endpoints of the cylinder’s travel to indicatewhen it has reached the end of motion. If the cylinder takes more than 2 seconds to complete amotion this will indicate a problem. When this occurs the machine should be shut down and alight turned on. Develop ladder logic that will cycle the cylinder in and out repeatedly, andwatch for failure.

Flera exempel från AMS kapitel 9