Control Engineering Online Update for March 10, 2006

03/10/2006


Control Engineering Online Update - Technology
March 10, 2006
Highlights
Sponsored by Phoenix Contact

PLC programming tools have evolved greatly over the last 20 years. However, a great majority of PLC implementations have not. The reason: management is constantly faced with the dilemma that only certain technicians know how the program was written and are therefore the only individuals qualified to troubleshoot and/or modify it. Grafcet, also known as sequential function chart programming (SCF), offers an IEC 61131-1-compliant approach.




CLIPLINE Complete from Phoenix Contact
Four connection technologies work together via our patented dual bridge system, which accepts the same push-in jumpers and accessories. Screw clamp, spring-cage, auto-spring and insulation displacement connectors provide the right connection technology for any application. Visit phoenixcon.com/cliplinecomplete for more information on this innovative technology. www.phoenixcon.com/cliplinecomplete

Structured PLC Programming using Grafcet

Structured programming methodologies for PLCs have been present for decades and can even be implemented on legacy controllers. Most of these methodologies incorporate a graphical flowchart of the control sequence, which translates directly into controller logic. These flowcharts can be read, written and modified by non-programmers with the assurance that what has been conveyed graphically will be implemented verbatim in logic. Direct benefits to controller owners include:

• Shorter logic development cycle
• Accelerated testing and commissioning tasks
• Reduction of downtime due to enhanced diagnostics
• Easier offline simulation and factory acceptance testing

One of these programming methodologies is known as Grafcet—a graphical programming methodology founded in 1977 and further defined in IEC 60848 and IEC 61131-3 as sequential function chart programming (SFC). The term is a French acronym: Graphe Fonctionnel de Commande Etape-Transition, which means Functional Graph of a Step-Transition Command. Figure 1 below shows the base elements of a simple Grafcet.


The sequence begins at Step 0 where Action #1 is performed. The sequence then waits until Condition #1 is met before advancing to Step 1 where Action #2 is performed. The sequence stays on Step 1 until Condition #2 is met at which point it advances to Step 2. Once on Step 2, Action #3 is performed for one program scan and then the sequence returns to Step 0 where the cycle repeats.

There are two popular implementations of this structure in PLCs. Bit-based, or latch/unlatch style, and file-based or memory-table style.
Also sponsored by Moxa


Visit www.moxa.com to learn about Moxa’s 2-8 port Plug-N-Play Embedded Computers for Manufacturing Automation, Power/Utility, Transportation, POS/ATM, Environmental Monitoring, and more. Features: Linux and Windows support, Robust Fanless Design, LCM Display and keypad for HMI, Dual 10/100 Mbps Ethernet, and Intel Xscale processor. Call to learn more 888-MOXA-USA.

 


Bit-based Grafcet

The simplest implementation of the Grafcet flowchart can be done with basic latch-unlatch ladder logic. In this implementation, a subroutine is assigned to each Grafcet. Step transition logic is resolved at the top of the subroutine and step output or action logic is resolved immediately following.

To ensure that at least one program scan occurs between each step, both a transition word and a step word are employed for each Grafcet. Bits in the step word initiate actions whereas bits in the transition word initiate step transition. In this way, a step with no conditions will still insure that actions have a chance to execute. Figure 2 illustrates the required logic.
Figure 2

Resolving the transitional logic is a direct translation from the Grafcet. For our example from Figure 1, the transitional logic in Figure 3 could be used:
Figure 3

Typical step action logic to resolve the Grafcet from Figure 1 might appear as shown in Figure 4.
Figure 4

Advantages of this style of programming are:
• Easy to understand by electricians
• Can be implemented on virtually any PLC
• Rung/network number can directly relate to step number
• Forcing a step simply requires setting the step bit
• Conditions to pass step can be easily seen on one rung/network of logic
• Parallel branch execution is possible within same Grafcet
• Relatively low programming overhead required

Disadvantages include:
• Sequencing modifications require ladder-logic changes
• The larger the Grafcet, the more logic that is required
• Automatic step manipulation and recovery can be challenging

File-based Grafcet

Similar to the canned drum sequencer instructions found in many PLC controllers, file-based Grafcet attempts to implement this with standard logic while permitting flexibility not available in these instructions. Input and output conditions are stored in preset files. A step counter is used as an index into these files.

As a minimum, the following data words will be required:

STEP_COUNTER - holds the step number
INPUT_WORD - mapped to all required inputs
OUTPUT_WORD - activates required outputs
INPUT_XOR_RESULT - holds result of the input XOR

The following data files will also be required:

#INPUT_MASKS - holds required inputs for each step
#INPUT_STATES - holds required states for each input
#OUTPUT_PRESETS - holds required outputs for each step

Once the format is in place, step presets for virtually any aspect of an automatic sequence can be defined. Logic is minimal to incorporate other features. To implement our example from Figure 1, the mapping shown in Figure 5 could be used. The Grafcet could then be modified to match Figure 6.
Figure 5

 

Figure 6

Mapping inputs

Sequence input mapping would appear as shown in Figure 7:
Figure 7

Grafcet presets

The status of the real inputs is compared against the conditions, which are expected to pass step (presets). For this article, both an input file (mask bits) and a state file (is the input ON or OFF) are used. By turning on a bit in the Mask file, the sequence is being told that the user expects to look at that input on that step in order to pass step. By setting the associated state bit in the State file, it is indicated that the user expects to see that input turn ON in order to pass step. Similarly, by setting a bit in the Output file, it is indicated that the associated output condition should be activated on that step. Absence of a set bit for an output on a step will force the output off on that step.

Table 1 shows the presets required to implement the Grafcet defined in Figure 6:
#INPUT_MASKS
Bit #: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Word 0000000000000000 1
Word 100000000000000 1 0
Word 200000000000000 1 1
Word 300000000000000 1 1
#INPUT_STATES
Word 0000000000000000 1
Word 100000000000000 1 0
Word 200000000000000 1 1
Word 30000000000000000
#OUTPUT_PRESETS
Word 0000000000000000 1
Word 100000000000000 1 1
Word 20000000000000 1 00
Word 30 1 00000000000000
Table 1

Step evaluation

The logic required to evaluate real inputs against the preset files and to advance a step if they are met is key to the File-based Grafcet architecture. Figure 8 demonstrates how this is implemented on a PLC:
Figure 8

Passing step

Once the XOR result evaluates to zero, the Grafcet can then pass step by incrementing the step counter as shown in Figure 9.
Figure 9

Setting outputs

Setting the output word from the preset stored for the current step is shown in Figure 10.
Figure 10

Real outputs are then set by the images of the output word as shown in Figure 11.
Figure 11

Advantages of File-based Grafcet are:

• One set of logic executes all steps
• Preset files can be used for any aspect of a sequence including:



• Step changes can be made directly in the data table
• Steps can be advanced and repeated with ease
• Once the stepping logic is proven, it will work for any number of steps
• Can be implemented on any PLC that supports indirect addressing, AND, OR and XOR functions
• Real I/O changes are easily accommodated in the mapping logic
• Diagnostic and preset conditions are easily visualized

Disadvantages include:
• Requires more overhead than Bit-based Grafcet
• Electricians may require additional training to understand the indirect addressing model

Why Grafcet?

Through utilization of IEC 61131-1 compliant software and techniques such as Grafcet, programs can be written which will be easier to troubleshoot, maintain and re-deploy for different applications. The Grafcet techniques demonstrated in this article have been implemented on a wide assortment of PLCs including those from Rockwell Automation, Siemens, Omron, Modicon, Idec, Mitsubishi and Westinghouse. The Grafcet chart is easy to understand and can be interpreted and even revised by non-programmers ensuring that the machine cycle will function as anticipated by all stakeholders the first time.

Online resources

Grafcet home page: www.lurpa.ens-cachan.fr/grafcet.html

IEC 60848 Standard: tc3.iec.ch/txt/147.htm

Petri Nets: lamspeople.epfl.ch/decotignie/G7RdPgb.pdf

SFC defined in IEC 1131-1: www.61131.com/sfc.htm


By Mike Voll, controls manager, Manufacturing/Industrial, Stantec Consulting Ltd.





The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers. Vote now (if qualified)!
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
HMI effectiveness; Distributed I/O; Engineers' Choice Award finalists; System Integrator advice; Inside Machines
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. As we know, PLCs aren’t the only option for making decisions in a control loop, but they are likely why you’re here.
This digital report explains how motion control advances and solutions can help with machine control, automated control on assembly lines, integration of robotics and automation, and machine safety.
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Control room technology innovation; Practical approaches to corrosion protection; Pipeline regulator revises quality programs
Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers. Vote now (if qualified)!
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
HMI effectiveness; Distributed I/O; Engineers' Choice Award finalists; System Integrator advice; Inside Machines
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. As we know, PLCs aren’t the only option for making decisions in a control loop, but they are likely why you’re here.
This digital report explains how motion control advances and solutions can help with machine control, automated control on assembly lines, integration of robotics and automation, and machine safety.
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Control room technology innovation; Practical approaches to corrosion protection; Pipeline regulator revises quality programs
Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers. Vote now (if qualified)!
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
HMI effectiveness; Distributed I/O; Engineers' Choice Award finalists; System Integrator advice; Inside Machines
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. As we know, PLCs aren’t the only option for making decisions in a control loop, but they are likely why you’re here.
This digital report explains how motion control advances and solutions can help with machine control, automated control on assembly lines, integration of robotics and automation, and machine safety.
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Control room technology innovation; Practical approaches to corrosion protection; Pipeline regulator revises quality programs
Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
click me