Posted on Leave a comment

Understanding Programmable Logic Controllers (PLCs): How They Work and Why They Matter

Programmable Logic Controllers (PLCs) are integral to modern industrial automation and control systems. They provide a robust, flexible, and reliable means of managing various processes in manufacturing, production, and infrastructure sectors. To appreciate the value of PLCs, it’s crucial to understand their fundamental operation, components, programming, and applications. This article delves into how PLCs work, exploring their internal structure, programming logic, and practical applications in real-world scenarios.

Introduction to PLCs

A Programmable Logic Controller (PLC) is a digital computer used for automation of electromechanical processes, such as control of machinery on factory assembly lines, amusement rides, or light fixtures. Designed to withstand harsh industrial environments, PLCs are characterized by their ability to be reprogrammed to accommodate changes in process requirements, making them highly adaptable and versatile.

The Evolution of PLCs

The concept of PLCs was first introduced in the late 1960s as a solution to replace hard-wired relay control systems, which were cumbersome and inflexible. The initial PLCs were simple and could only handle basic tasks. However, technological advancements have transformed PLCs into sophisticated devices capable of performing complex control functions and integrating with various digital communication systems.

Key Components of a PLC

To understand how a PLC works, it’s essential to examine its main components:

1. Central Processing Unit (CPU)

The CPU is the brain of the PLC. It processes the input data based on the control program stored in memory and sends commands to the output devices. The CPU performs three primary tasks:

  • Processing Inputs: It reads the status of input devices.
  • Executing the Control Program: It processes the input data according to the logic programmed into the PLC.
  • Controlling Outputs: It sends commands to the output devices based on the processed data.

2. Input/Output (I/O) Modules

PLCs use I/O modules to interface with external devices. These modules are categorized into:

  • Input Modules: Receive signals from input devices such as sensors, switches, and other control elements. These signals can be digital (on/off) or analog (varying levels of voltage or current).
  • Output Modules: Send control signals to actuators, such as motors, solenoids, or relays, based on the CPU’s commands.

3. Power Supply

The power supply provides the necessary electrical power for the PLC and its components to operate. It converts the input voltage from an external source into a regulated voltage suitable for the PLC’s internal circuits.

4. Programming Device

The programming device is used to input and modify the control programs that the PLC will execute. This can be a dedicated programming terminal, a personal computer with PLC programming software, or a handheld programmer.

5. Communication Interfaces

Modern PLCs often feature communication interfaces that allow them to connect with other PLCs, computers, or network systems. These interfaces support various communication protocols, such as Ethernet, Profibus, and Modbus, enabling data exchange and integration with broader automation systems.

The Operation of a PLC

The PLC operates through a cycle known as the Scan Cycle, which consists of three main phases: Input Scan, Program Execution, and Output Scan. Here’s a detailed look at each phase:

1. Input Scan

During the Input Scan phase, the PLC reads the status of all input devices. This involves sampling the digital or analog signals from sensors and switches and converting them into a format that the CPU can process. The PLC updates its internal representation of the input status, ensuring that it has the most current data.

2. Program Execution

In the Program Execution phase, the PLC processes the input data according to the control program stored in its memory. The control program consists of a series of logical instructions or algorithms that define how the PLC should respond to various input conditions. These instructions are typically written in one of several programming languages, including:

  • Ladder Logic: A graphical programming language that resembles electrical relay diagrams. It is widely used due to its simplicity and ease of understanding.
  • Function Block Diagram (FBD): A graphical language that uses blocks to represent functions and their connections, making it suitable for complex control systems.
  • Structured Text (ST): A high-level textual programming language similar to Pascal or C, used for more complex algorithms and data processing.
  • Sequential Function Charts (SFC): A graphical language used for designing sequential control processes.

The CPU executes the control program in a step-by-step manner, processing the input data and making decisions based on the programmed logic. This can involve performing calculations, making comparisons, or executing complex algorithms.

3. Output Scan

During the Output Scan phase, the PLC updates the output devices based on the results of the program execution. The CPU sends commands to the output modules, which then activate or deactivate actuators, motors, or other controlled devices. This phase ensures that the PLC’s decisions are translated into physical actions in the controlled process.

PLC Programming

Programming a PLC involves creating a control program that specifies how the PLC should respond to various input conditions. This program is written using one of the standard PLC programming languages. The choice of language often depends on the complexity of the control system and the preferences of the programmer.

Programming Languages

  • Ladder Logic (LD): Ladder Logic is the most common PLC programming language, resembling electrical relay circuits. It consists of rungs and rails, with each rung representing a control logic operation. Ladder Logic is easy to understand and is particularly useful for beginners and those with a background in electrical engineering.
  • Function Block Diagram (FBD): This graphical language uses blocks to represent functions and their interconnections. It is well-suited for designing complex systems where functions need to be visually organized and connected.
  • Structured Text (ST): Structured Text is a high-level textual language similar to Pascal or C. It is used for complex algorithms and data handling. Its syntax allows for detailed and precise control logic.
  • Sequential Function Charts (SFC): SFC is used for designing sequential control processes. It breaks down processes into steps and transitions, making it ideal for systems with multiple stages or sequences.

Programming Software

PLC programming is typically done using specialized software provided by the PLC manufacturer. This software allows programmers to create, test, and debug control programs. Some widely used PLC programming software includes:

  • Siemens TIA Portal: Used for Siemens PLCs, providing a comprehensive environment for programming and configuring automation systems.
  • Rockwell Automation Studio 5000: Used for Allen-Bradley PLCs, offering a suite of tools for designing and managing control systems.
  • Schneider Electric Unity Pro: Used for Schneider Electric PLCs, providing advanced programming and simulation capabilities.

PLC Applications

PLCs are used in a wide range of applications across various industries. Here are some examples of how PLCs are applied in real-world scenarios:

1. Manufacturing Automation

In manufacturing, PLCs control assembly lines, coordinate robotic arms, and manage conveyor belts. They ensure precise timing and synchronization of machinery, improving production efficiency and product quality.

2. Process Control

PLCs are used in process control industries such as oil and gas, chemicals, and water treatment. They regulate parameters such as flow rates, pressure, temperature, and chemical concentrations, ensuring safe and efficient operation of industrial processes.

3. Building Management Systems

In building management, PLCs control HVAC systems, lighting, and security systems. They enable automation of climate control, lighting schedules, and access control, enhancing energy efficiency and occupant comfort.

4. Transportation Systems

PLCs are used in transportation systems, including traffic light control, railway signaling, and airport baggage handling. They manage the operation of traffic signals, monitor train movements, and coordinate the flow of luggage through airport conveyors.

5. Amusement and Entertainment

PLCs control amusement park rides and attractions, ensuring safety and synchronization of ride elements. They manage ride operations, monitor safety sensors, and control visual and audio effects.

Benefits of Using PLCs

PLCs offer several advantages that make them a preferred choice for industrial automation:

  • Flexibility: PLCs can be reprogrammed to accommodate changes in process requirements or system configurations, providing adaptability in dynamic environments.
  • Reliability: Designed to withstand harsh industrial conditions, PLCs are robust and reliable, with features such as fault detection and redundancy.
  • Ease of Use: Programming languages like Ladder Logic are intuitive and easy to learn, allowing for efficient development and troubleshooting of control systems.
  • Integration: PLCs can communicate with other systems and devices, enabling integration with broader automation networks and data management systems.

As technology advances, PLCs are evolving to meet new challenges and opportunities. Some emerging trends include:

  • IoT Integration: The integration of PLCs with the Internet of Things (IoT) enables enhanced data collection, remote monitoring, and real-time analytics.
  • Cloud Computing: Cloud-based PLC solutions offer scalable and flexible control options, allowing for remote access and data management.
  • Artificial Intelligence (AI): AI and machine learning are being integrated into PLC systems to improve predictive maintenance, process optimization, and anomaly detection.

Conclusion

Programmable Logic Controllers (PLCs) are vital components of modern industrial automation, providing flexible, reliable, and efficient control of various processes and systems. By understanding the internal workings of PLCs, their programming, and their applications, we can appreciate their role in enhancing productivity, safety, and innovation across industries. As technology continues to advance, PLCs will remain at the forefront of automation, driving progress and shaping the future of industrial control systems.

Posted on Leave a comment

PLC Sensor Calibration/Scaling with example

PLC Sensor Calibration/Scaling with example

Have you ever purchased a simple 4..20 mA or 0..10 VDC analog sensor and wondered how to get them more accurate as read by the PLC? It is not uncommon for someone to assume a thermocouple, RTD, pH or other analog sensor comes “out of the box” set up and ready for exact measurement. In fact, sometimes they are advertised that way. But let us not be fooled, we have all at some point looked at the readings and said “this can be much more accurate”.

This is a quick how-to guide to help you quickly and efficiently calibrate and scale those analog sensors for the accuracy you desire. We will skip the theory as much as possible and only brush on the necessary technical topics. This guide is intended for anybody with access to a PLC, an analog sensor, and a desire to get a more accurate sensor reading.

What you need:

1. A general understanding on what you are trying to measure with your analog sensor (Temperature, pressure, level, etc.)
2. Access and general knowledge of basic Ladder logic or similar style programming
3. A “high” and “low” test sample or way to define two end points of what you are trying to measure. For example, a cup of ice water for a low temperature reading and a cup of boiling water for a high reading
4. Something to measure your test samples (thermometer, ruler, etc.)
5. Knowledge of Calculus 1 or 2 (Just kidding, but we will be using the equation of a line, “y = mx + b”)
Figure 1: What you need

Assumptions:

1. You know your way around the PLC you are utilizing
2. The sensor is hooked up to an analog input and confirmed working. For example, holding the thermocouple in your hand nets an increasing register value as seen by the PLC. Removing your hand you can observe the raw analog value decrease back to a steady state.
Figure 2: Assumptions

Step by Step Guide:

Time needed: 20 minutes

How to calibrate and scale a analog sensor

  1. Create two samples of “high” and “low” points for a control

    In this example we will be calibrating and scaling a thermocouple. We have chosen a cup of ice water for our “low” point, and a cup of hot water for our “high” point.

  2. Locate the sensor input in the PLC and prepare to record values

    Make sure you have located the correct register in the PLC that contains the sensor information. We are going to be taking a few measurements to assist in our scaling and calibration.

  3. Place the sensor in the “low” state/condition

    For example, we will place the thermocouple in our cold water with a actual thermometer so we can measure the exact temperature we should be reading.

  4. Record the sensor register value and actual value

    Look at the register in the PLC and record the number as X1. Record the actual temperature as seen on the thermometer as Y1. We measured a water temperature of 35 degrees F with a PLC register value of 3000.

  5. Repeat this process for the “high” state/condition

    In this example, we will repeat the above step replacing the cold water with our cup of hot water and record those values as X2 and Y2 respectively. We measured a water temperature of 200 degrees F with a PLC register value of 23000.

  6. Prepare for Simple Calculus

    We are now going to create our equation of a line with the numbers we just measured.

  7. Calculate the Slope or m

    From the equation we are going to calculate m from “y = mx + b”; to do this, simply calculate the following equation ((Y2-Y1)/(X2-X1)); no this is not a Facebook math trick problem.

    From our above example with X1 = 3000, Y1 = 35 (degrees F) and X2 = 23000 and Y2 = 200 (degrees F)

    m = (Y2-Y1) / (X2-X1) = (200 – 35) / (23000 – 3000) = 0.00825
    m = 0.00825

  8. Calculate the offset of b

    This is generally the trickiest part of the problem. When calculating the offset, or b, you will need to pick one of the two above measurements (high or low) and plug them back into the equation of a line and calculate for b. We will choose to use the low point for this example.

    From the above example, choosing the “low” point as our test:

    y = m x + b
    35 = 0.00825 * 3000 + b
    b = 35 – 24.75
    b = 10.25

  9. Combine the slope and offset to create the equation of the line

    Combine all of the above information and you will form the equation:

    y = 0.00825 * x + 10.25

    This is the new scaled and calibrated equation based off the real world samples you took. Now, for every PLC register value X, you will have a corresponding temperature in Fahrenheit Y. This is typically entered in the PLC as a CMP (compute) block where y would be called your “Temperature_Scaled” and the value would calculate from the equation 0.00825 * raw_analog_input + 10.25

That is it guys. Easy as cake. In the above examples you an try substituting pH samples in for a pH sensor or any other measurable combination of analog values and desired outputs (like a level transmitter and a actual product level). As long as you can physically measure it in real life you can scale the PLC accordingly.

BONUS TIP: Assuming scaling is linear (and generally this is true for most sensors) the equation you created can expand far above and below your high and low measurements. For example, say the temperature sensor you scaled really operates in the ranges of 400-600 degrees F; assuming the sensor you calibrated is meant for the total range we have observed ( in our example 35 F to now 600 F) our simple bench top equation should expand into the 400 – 600 degrees F range without any work required on your part*. The beauty about the linear equation is that it is defined for all points in space. You are only limited by the PLC register that is sending you data.

*In our above example we had a high value of 2300; in general, most analog inputs (raw) will range up to 32000 or 64000 depending on the register type (we are not intending on this to be a technical discussion) so take our example with a grain of salt knowing that you would have much different values if the sensor was in fact rated for 35 F to 600 F. Please contact us if you want more personalized help on this topic!

Posted on Leave a comment

How do I become an automation or controls engineer?

Automation Engineer Expectations

Automation and controls engineering is one of many fields of specialty in the industrial manufacturing industry. You are most likely here because you are interested in this job title and are looking for more information about what it is and how you can work towards this job title. To get started, let us define what an automation or controls engineer is and does so we can focus on the specifics on what is needed to pursue such an interesting and challenging career.

Automation Engineer
Automation Engineer

What is a Automation or controls engineer?

We define an automation or controls engineer as an engineer who is tasked with designing, programming, implementing and improving a manufacturing plant or machine process with the aid of programmable logic controllers, relays or any other form of “control” circuity. An automation or controls engineer has a desire to learn electrical and computer engineering practices and shows natural strength in problem solving skills. On top of the necessary math and science educational background, there is a huge industry demand for engineers with soft skills to aid in interfacing with customers and other employees. Long gone are the days of quiet guys and pocket protectors (sorry nerds!)

What kind of education do I need?

Most companies are looking for a Bachelors of Science (B.S.) in an accredited 4-year program in one of the engineering colleges (Electrical, Computer) with a cumulative GPA of a 3.0 or above. Additionally, companies have been branching out more into Computer Science and Data Science degrees to attempt to capitalize on the new Industry 4.0 trends of Internet of Things (IOT), machine learning (ML) and artificial intelligence (AI). I write a post on this interesting topic specifically in the future.

Electrical engineering still caries a heavy weight as the core engineering background for new engineers as they are the most prepared to jump right into plant day to day operations as they are exposed the most to electricity and circuity. However, it is worth noting that Computer engineering is becoming much more attractive as PLC processors get more complicated and powerful, opening the doors to newer applications an use cases. It would not be uncommon for a systems control integrator to look for a computer engineer to help implement and execute more complicated control systems while working along somebody like a electrical engineer to do the full electrical design or backbone of the computer system.

Automation Engineer Expectations
Automation Engineer Expectations

Supplemental Education

On top of your standard 4-year degree mentioned above I would also recommend a fundamental understanding in the following:

  • Python and/or C# Programming Language
  • Knowledge of basic automation terminology (PLC, HMI, VFD, Sensor, 4..20mA, etc.)
  • Microsoft Word
  • Microsoft Excel
  • Linux or Unix Experience (for core low-level understandings of systems)
  • Network and networking infrastructure (I.P. Address, Network Switch, Router, Network Mask, MAC Address, etc.)
  • SQL, Stored Procedures and Reporting (not a must but a strong bonus companies like to look for)

What kind of job experience do I need?

This probably one of the hardest questions to quantify as it is 100% dependent on you and your hiring institution. There are two methods of approach to this question in my eyes, and that is if you a new graduate out of college or you have been in the industry previously in ANY capacity as a maintenance personnel, technician, operator or any other industry specific position. In either case, you want to make sure any job experience you do have aligns with the manufacturing work environment and structure as long as allowing you to practice typical skills seen on the plant floor like troubleshooting, evaluation, monitoring and operating.

New graduates out of college

I almost need to start this entire post off with the following sentence, ensure that you are actively participating in a paid or unpaid internship in a related field no later than the start of your junior year in college! This bears repeating because I cannot tell you the countless individuals I have worked with and tried to help get jobs in this field that simply did not put in the time while in college and simply struggled finding jobs after graduation even while carrying a good GPA and skill-set. Please make sure you are actively pursuing an internship in any automation related areas by no later than your junior year. Two years experience out of college will virtually guarantee you a hire directly out of college (usually with the company you are doing your internship with).

Previous industry experience

This is a very gray area in the industrial world. Those with “previous industry experience” can sometimes go unnoticed in the engineering wold and work among engineers and other technical peers sometimes without the necessary degrees or certifications. There is nothing wrong with this at all and is a great way to re-tool as an existing industrial employee but just know there can come a time when your credentials are needed and ultimately are required for the job position. For example, I worked at my first job as a engineer for seven years and never once had to produce any evidence my of degree. When I changed jobs the first thing the new company did was ask for proof of my degree and went as far as having me scan a copy for them to keep on file!

However, back on topic, as somebody with “previous experience” companies are looking for you to know and understand the basic concepts that any engineer would need to understand (electrical theory, programming, problem solving, etc) as well as a familiarity with the typical plant level hardware and software needed to work a typical day as a automation engineer (this could be CAD Experience, programmable logic controller (PLC) Programming experience, etc.) all covered in detail later. Your value you bring to an employer is your familiarity to the plant process and the knowledge you would of learned on the job by necessity.

Automation Engineer Reality
Automation Engineer Reality

Where do I apply for automation and controls engineering jobs?

If you are lucky enough to live in a major US city, you likely have a few local “integrators” that have established an engineering headquarters in your immediate area. “Integrators” are companies that generally work independent of a specific manufacturing plant and service a wide range of customers across the country or even globe. Integrators generally serve two groups of offerings: to quote, engineer, design, program, install and commission new or existing processes or to focus on industry service generally with a 24 hour support structure where engineers are for-hire on an as-needed basis. These engineers are well traveled and go to where the work is which can be local, regional or global. This specific service is in HUGE demand due to the flexibility and travel requirements.

A second (or third) avenue for automation and controls engineering is the manufacturing plant approach where you will work on an engineering team at a local manufacturing facility. These engineers are tasked to become “machine owners” and will be in charge of suggesting maintenance, evaluating performance, tweaking performance and the general upkeep and conditioning of the machine or process from a technical perspective. The term “continuous improvement” comes to mind to explain the day-to-day activities of these specific engineers. Although this is a solid path to automation or controls engineering, you can sometimes limit your vertical ability as companies can be difficult to move around in depending on job title, qualification, ability, etc.

What kind of salary should I expect as an Automation or Controls Engineer?

Salary is largely dependent on your location and ability. As a senior automation or controls engineer, you can expect your salary to max out anywhere from $100,000 to $120,000 a year. The average salary according to glassdoor is $79,609 a year (Source) . If you are looking to be on the higher end of salary, you are going to need to strategically move around to get to those next levels of pay. From my experience, you will have a very hard time starting at one salary and ending up where you want to be. From personal experience, to make those pay bumps you will sometimes need to move to a different department or company who is willing to take that next investment. This is especially true for new graduates out of college!

Conclusion

In conclusion these would be the basics to understand when looking to become an automation or controls engineer. Whether you plan to pursue an internship with an integrator or to go work for an industrial manufacturer, you will still need to make sure you have completed the right schooling (or in some cases, have the right experience) to apply for the job you want. The industry itself is always changing and you will have the opportunity to learn daily, so if you are somebody who enjoys electronics, computers and how stuff is made, this is the job for you! Thanks for reading! Please reach out with any specific questions or please comment below!

Got this far? Browse our shop to see what the heck automation controls hardware even is.

Posted on Leave a comment

Create a SD card Image for CompactLogix series processors for backup and restore purposes

This is a introduction video on how to create a SD card image with a 1784-SD1 and any of the CompactLogix series processors. This is a must-know in your repository of knowledge on how to easily and quickly create a backup of your PLC processor to either load when a process fails or when you purchase a new processor out of the box. This can save you hours of unnecessary work by allow you to commission a new processor directly out of the box with a IP Address, PLC Program and Firmware version. No more need to get on RSLogix/Studio and do each step manually.

Create a SD card Image for CompactLogix series processors for backup and restore purposes

  1. Obtain either a Allen Bradley 1784-SD1 (1GB) or 1784-SD2 (2GB) and insert into processor

    Depending on the application size, you will need to purchase either a 1784-SD1 or 1784-SD2 SD memory card from Allen Bradley. Unless you are storing additional items on the memory card I have not seen a actual need for the 2GB 1785-SD2. Once you have the card, insert it into the processor SD card slot (can be done under power)

  2. Open Allen Bradley RSLogix/Studio 5000

    You can do this with either RSLogix or Studio 5000; there is no real difference in respect to this tutorial. I will be using Studio 5000 because of the specific version of firmware I am using; Version 28.

  3. Go online with your CompactLogix processor

    The next few steps can only be done while online with the processor. This makes sense because the processor itself is the piece of hardware that is making the SD card image.

  4. Place controller in program mode

    You can do this via the online interface (if your key switch is in remote) or by moving the processor key switch to “PROG” or program mode

  5. Go to controller properties

    Right click on your projects controller and go to “properties”

  6. Go to Nonvolatile Memory tab

    On the properties menu, click the Nonvolatile Memory tab

  7. Click “Load/Store”

    *TIP* If “Load/Store” is grayed out (cannot click) make sure that you have an official Allen Bradley SD memory card installed in the processor, you are online with the project/processor and the processor is in program mode; see step 4 above.

  8. Configure SD Card image settings

    This will be the meat of your configuration. There are many options for you specific to what you are trying to do with the SD card image. Under the controller section, you will see your project name, processor type, current revision number and some user configurable input fields, Load Image, Load Mode, and Image Note.

    Load Image:

    On Power Up – Load image at next power up event
    On Uninitialized Memory – Load image when no program is present (new processor, failure, etc)
    User Initiated – Load via Nonvolatile dialog box

    Load Mode:

    Run (Remote Only) – Processor will boot into run mode (only if processor key is in the REM position)
    Program (Remote Only) – Processor will boot into program mode (only if processor key is in the REM position)

    Image Note:


    A Description of the image you are creating.

  9. Enable/Disable Automatic Firmware Update

    If you enable this feature, the SD card will store the processor firmware version to be loaded upon next event. This is a great way to commission a new “out of the box” processor from firmware version 1 up to whatever version you are using in your application/program.

  10. After you have set up desired configuration, select “<– Store”

    Select the “<– Store” button indicating you are ready to create the SD card image

  11. Yes to accept risk

    You must accept the risk of placing the processor in STOP mode (although I think this is mildly redundant due to the processor already needing to be in program mode to get this far)

  12. Yes to not including modules in firmware update

    This screen appears mainly to let you know the processor specific features of the built-in IO will not be included in the SD firmware image. I believe this is to account for small differences in versioning between processor types. You can essentially ignore this and select “Yes”

  13. The processor will now create image your configured image

    Your project will now go offline and the processor will reboot into a memory store procedure. The “OK” and “SD” LED’s on the processor will blink together as the SD image is created. Once the image has been successfully created, the processor will reboot back into the mode selected by the key switch. Once the processor has returned to Run or Program the SD card image is complete.

  14. Remove SD Card from Processor

    At any point you can remove the SD card form the processor. You have have created a SD card image.

    *WARNING* You are now holding a potential major disruption to a processor. If you selected to load image on boot with firmware, you will completely erase any processor specific data upon power up of any processor this SD card is placed in.