week-3

57
Week-3 3-7 Jan 2014

Upload: john-wiggins

Post on 15-Nov-2015

6 views

Category:

Documents


1 download

DESCRIPTION

industrial mechatronics

TRANSCRIPT

  • Week-3

    3-7 Jan 2014

  • Objectives Memory & File Organization and Addressing

    Examples of Boolean and Karnaugh Maps to Ladder Logic

    Operation of Latches

    Operation of Timers Rockwell Automation

    MODICON

    GE Fanuc

    Operation of Counters Rockwell Automation

    MODICON

    GE Fanuc

  • Rockwell Memory & File Organization

    Understanding File Organization and Addressing is very essential to program a PLC

    There exists two types of memories in Rockwell PLCs (RAM)

    Program Memory

    Data Memory

    Each contains 256 files (0-255)

    Program Memory:

    File 0 contains processor type, I/O Configurations etc

    File 1 is reserved

    File 2 contains the main ladder logic

    File 3-255 are user created according to subroutines in the main ladder

  • Data Memory:

    Data Memory also has 256 files

    Mainly contains the status of I/O and other instructions used in the main ladder and subroutine ladders

    There exists different files with different functions:

    File 0 (O) : Stores the status of outputs. If you want to change the status of the output you could put 0 or 1 in the correct bit

    File 1 (I) : Stores the status of the inputs. You can check the status of any input by looking in the file

    File 2 (S): Mainly stores status bits corresponding to the processors state.

    File 3 (B): Used to store bit information. You can store different information relating to contacts and coils.

    File 4 (T): Used to store Timer information.

    File 5 (C): Used to store data corresponding to Counters

    File 6 (R): Used for control, example when working with Sequencers & Shift registers

    Rockwell Memory & File Organization

  • File 7 (N): Used to store Integers or Bit information

    File 8 (F): Used to store floating point numbers. These numbers could be gains for PID blocks or outputs corresponding to them.

    File 9-255: These files are user defined. The user can define them according to his requirements. They can be used to store integers, floating points etc

    Rockwell Memory & File Organization

  • Memory Addressing

    Memory addressing is the processing of reading or writing data to the files

    The first letter in the input address is called the identifier

    The second letter is the file number (the default number is 1)

    The next item is the delimiter (colon)

    The next item after limiter is the slot number (in the chassis) and after that the Bit number

    I1:0/1 Input Register (File 1)

    Slot 0

    Channel 1

  • Memory Addressing

    File Type Identifier File Number

    Output O 0

    Input I 1

    Status S 2

    Bit B 3

    Timer T 4

    Counter C 5

    Control R 6

    Integer N 7

    Float F 8

  • Memory Addressing

    Power

    Supply

    CPU

    Input

    Output

    Input

    Output

    Output

    SLOT NO. 0 1 2 3 4 5

    How would you address different slots and channels within those

    slots??????

  • Similarly Timer and Counter Files can also be addressed however they contain additional parameters that can be addressed

    Timers & Counters and additional parameters that can be addressed in them will be discussed in upcoming lectures

    Memory Addressing

  • Boolean Representation - Example

  • Example

    Make Boolean Function & Simplify!!!

  • Example

  • Exercise

    Convert to Boolean Logic Simplify and then write the ladder logic

  • Karnaugh Maps

    Given a Truth table it can be used to get a (Simple) Boolean Function

  • Karnaugh Maps Example

    Asher JohnSticky Note. when we have to combine two blocks from columns and rows. rows first and then columns

  • Rslogix 500

    Mainly used for Micro Logix, Flex logix & SLCs

  • Timers & Counters - Motivation

    Complex systems cannot be controlled by Combinatorial Logic alone

    A system can be Event driven, Time driven or a combination of both

    Basic events which need to catered for are (Event + Time based):

    Delays

    Count of Events

    Latch Or Unlatch (to turn something On or Off)

    Common theme in all these events are:

    How long? (Time based)

    How many? (Count of events)

  • Response of a Device in Event Driven Systems

    The response of a device to an event can be classified into following two categories:

    Logical Response

    Event Response

    Consider the scenario when a push button is pressed, the device responds in the following manner:

  • Latches

    Latch & Unlatch:

    It can be considered as a sticky switch when it is turned on it remains ON

    It must be pulled (unlatched) to turn it off

    Different instructions are used to Latch & Unlatch the variables

  • Example

    These scan times are just an example to clarify things and dont depict the actual scan times of a PLC

  • An Actual Timing Diagram

    Real timing diagram for the Scenario mentioned before

  • Another Example

  • Draw the Timing Diagram

    Draw the Timing diagram of corresponding outputs to the Inputs

  • Latches in case of Other Vendors

    Latch & Unlatch blocks are not used universally by all PLC vendors

    Siemens uses SR Flip flops to perform latching & unlatching operations

    SR Flip Flop:

    S R Action

    0 0 No Change

    1 0 Q=1

    0 1 Q=0

    1 1 Not Specified

  • Siemens

  • Timers

    Mainly used for providing delays in between sequences & operations

    There are 4 different types of Timers:

    Off Delay Timers

    On Delay Timers

    Retentive On timers

    Retentive Off timers

    Examples of Usage:

    Consider a garage light which should remain ON for 2 minutes before turning off.

    Non Retentive

  • Off Delay Timers

    The timer turns ON as soon as the input turns high

    Starts incrementing when the input has turned false and turns OFF when a certain time has been achieved

    Examples:

    A garage light which should remain ON for 2 minutes before turning off.

    Consider a car whose ignition key has been turned off but the car engine remain ON for some time

    Cooling fans remain ON for some time after the oven has been turned off

  • ON Delay Timers

    Starts incrementing when the input has becomes true and turns ON when a certain time has been achieved

    It turns OFF immediately as the input turns OFF.

    Examples:

    Consider a car whose ignition key has been turned ON but the car engine turns ON after some delay

    An On delay timer would allow an oven to reach a specific temperature before starting production

  • Retentive Timers

    Retentive timers:

    They dont lose their accumulated values once the enable input lines go low

    They retain the accumulated value until the enable input lines goes high again

    They function like stop watches. They can start and stop and retain their current values until a reset button is pressed

    Non Retentive timers:

    The timer value goes to Zero once the enable input goes low

    Thus non retentive timers lose the accumulated value

  • Basic Similarities in Timers

    There are some basic common aspects in a Timer blocks made by different PLC vendors:

    Timers will have a number to identify them (for example T7 in case of Rockwell)

    Time Base:

    Timers can be programmed with different time basis, for example 1 second, 0.1 second and 0.01 second

    Example:

    If a timer has 0.1 second time base and the user entered 50 as the number of delay increments then delay would be 5 seconds

    Preset Value:

    The preset value is the number of increments the timer has to count before it changes it output. 50 is the preset value in the previous case

    Accumulated Value:

    It refers to the current increment the timer has reached during its operation

  • Rockwell Timers

    On Delay Timer: It starts accumulating when the rung

    becomes true and continues until the

    preset value becomes equal to the accumulated value or the rung goes false

    Basic Symbol used is T and the file number is 4 (T4).

    Status Bits Usage: Enable Bit (EN): It turns on immediately when the rung goes true and

    remains set until the rung goes false or timer is reset

    Timing Bit (TT): It remains true when the rung goes true or accumulated value is less then preset value

    Done Bit (DN): It is set when the accumulated value equals the preset value

  • Example of On Delay Timer

    The preset value is 4000ms, so delay of 4 seconds. The preset value is 4000ms, so delay of 4 seconds.

    Asher JohnSticky Noteas TT goes down DN bit gets ON.

  • Addressing Special Bits

    RsLogix 500 RsLogix 5000

  • Rockwell Timers

    Off Delay Timer: It starts accumulating when the rung

    becomes False and continues until the

    preset value becomes equal to the accumulated value or the rung goes True

    Status Bits Usage: Enable Bit (EN): It turns on immediately when the rung goes true and

    remains set until the rung goes false or timer is reset

    Timing Bit (TT): It remains true when the rung goes False and accumulated value is less then preset value

    Done Bit (DN): It is set when rung becomes true and reset when accumulated value is equal to preset value

  • Example of Off Delay Timer

    The preset value is 3500ms, so delay of 3.5 seconds.

  • Retentive ON timer

    Similar to ON timer except that it retains its value.

    The preset value is 4000ms, so delay of 4 seconds

    How can we use the timer after the cycle has completed?

  • Example

  • Example

    Consider the scenario in which a start button turns on the Heater

    and the Stop button (normally closed) turns it off. Initially there is a

    delay of 10 sec before the heater turns ON. After the heater is turned OFF the cooling fans remain ON for 5 minutes

  • Cascaded Timers

    The timers are connected to each other and thus are called

    cascaded timers

    Each timer drives the other timer

    Mainly used when a single timer cant provide the delay required

  • Timers of other PLC Vendors

    GE FANUC TIMERS & CONTACTS:

    There are of the following basic types:

    ONDTR (On delay timer) Retentive timer

    OFDT (Off delay timer) Retentive timer

    TMR (On delay timer) Non retentive timer

    Contact addressing in GE FANUC:

    %I represents inputs %I0005 represents real input 5

    %Q represents outputs %Q0003 represents real output 3

    %R represents system registers

    %AI Analog Inputs

    %AQ Analog Outputs

    ONDTR

    TB

    Time

    Base R

    PV

    %R0001

    Enable Input Output ONDTR

    TB

    R

    PV

    %R0001

    Enable Input Output

    Time

    Base

    ONDTR

    TB

    R

    PV

    %R0001

    Enable Input Output ONDTR

    TB

    R

    PV

    %R0001

    Enable Input ONDTR

    TB

    R

    PV

    %R0001

    Enable Input ONDTR

    TB

    R

    PV

    %R0001

    Enable Input Output

    Time

    Base

    ONDTR

    TB

    R

    PV

    %R0001

    Enable Input ONDTR

    TB

    R

    PV

    %R0001

    Enable Input ONDTR

    TB

    R

    PV

    %R0001

    Enable Input Output

  • Timers of other PLC Vendors Gould Modicon Timers & Contacts:

    The figure shows a Non retentive Gould

    Modicon Timer.

    The delay can be calculated by multiplying the

    preset value with the time base

    The Timer has two outputs, one which operates when the timer accumulated value equals the preset value and the other output is

    inverted

    Contact Addressing:

    0 at the start represents outputs 0005 represents the 5th real output

    1 at the start represents inputs 1002 represents the 2nd real input

    4 at the start represents Storage registers example 4004

    Reset

    Preset Value

    Time Base

    Storage Register

    Enable Output

    Output

  • Solve

  • Solve

  • Timing Diagram of a Retentive Timer (Assignment 3)

    Draw the timing diagram of the following retentive timer

  • Counters

    Counters are used in many important industrial applications

    Mainly used in Production lines where the items have to be counted

    When we are counting the number of products we might use a count up timer

    When we are counting the number of parts left we might use a count down timer

    The choice of counter to be used depends on the application

  • Operation of Counter

    There are different types of counters:

    Count up

    Count down

    They use a low to high transition for counting action

    Timers count time increments whereas counters count pulses on input lines

    Timer increments its value with each low to high transition and turns ON when the accumulated value equals the preset value

    Counters are edge triggered devices and dont accumulate when the level is remain high (level triggered)

  • Rockwell Automation Counters

    Rockwell Automation Counters Use the filer number 5 for counters and the symbol C

    So counter values would be stored in C5:0

    Counters are retentive and a reset bit must be used to return the accumulated value to zero

    Counters have the following essential elements: CU (Count Up bit)

    CD (Count Down bit)

    DN (Done bit)

    OV (Overflow bit)

    UN (Underflow bit)

    PRE (Preset value)

    ACC (Accumulated value)

  • Count Up Timers

    Count Up Timers (Retentive): The accumulator (ACC) value increases

    with every low to high transition

    The done bit (DN) is set when the accumulated value equals the preset value

    The over flow bit (OV) turns on when the counter value increases by 32,767. It then wraps around and starts counting from -32,768 (this is how 16 bit signed numbers are stored)

    The count up (CU) shows that the Counter has been enabled (it turns on when ever the rung condition goes true)

  • Example of Count Up Counter

    Contact B is used to Reset the counter

  • Example

    A count up (CU) Counter is used to remove the 6th Part of

    every 11 parts that are detected and then resets the

    counters

  • Count Down Counter

    Count Down Timers (Retentive): The accumulator (ACC) value decreases

    with every low to high transition

    The done bit (DN) is set when the accumulated value equals or greater then the preset value

    The over flow bit (OV) turns on when the counter value decreases by -32,768. It then wraps around and starts counting from 32,767

    The count down (CD) shows that the Counter has been enabled (it turns on when ever the rung condition goes true)

  • Example of Counters

    Count Up & Count Down Counters can have the same registers

  • Cascading Counters

    What is happening here?

    When will the last counter done bit (DN) be set?

  • What is the output?

  • Counters from Other Vendors

    GE FANUC TIMERS:

    There are of the following basic types:

    UPCTR (Up counter) Retentive Counter

    DNCTR (Down Counter) Retentive Counter

    UPCTR:

    Every time the input turns High it increments the Counter value by 1 and if it is equal to the preset value, the counter turn ON

    The R input is used to reset the counter

    DNCTR:

    Every time the input turns High it decrements the Counter value by 1 and if it is equal to the preset value, the counter turn ON

    The R input is used to reset the counter

    ONDTR

    TB

    R

    PV

    %R0001

    Enable Input ONDTR

    TB

    R

    PV

    %R0001

    Enable Input UPCTR

    R

    PV

    %R0001

    Enable Input Output

  • Gould MODICON Counters:

    When the input pin transitions from

    Low to high the counter increments the

    Counter value

    The reset pin must be high for the counter to

    Count

    The output value goes high when the input value equals the preset value

    The counter also provides an inverted output

    Counters from Other Vendors

    Reset

    Preset Value

    CTR

    Storage Register

    Enable Output

    Output

  • Solve