Problem Based Learning – Mastering PLC programming for Beginners

Mastering PLC programming is no easy task. You have to learn the proper terminology, determine the language(s) you want to focus on, learn those languages, choose a suitable PLC to begin programming on, and so much more. Although we do not have solutions to all these questions or the rest that you may come up with, we are here to offer you a simple tip on what we believe will make learning PLC programming easier. That is, Problem Based Learning.

Moving onto problem based learning early enough in your journey is crucial if you want to develop a career in industrial controls. This is because problem based learning teaches problem formulation, a skill that is just as useful as PLC programming itself. Do not start with trying to solve complex industrial problems. There is no point in getting lost in the complexity of the controls problem when your main objective is to learn PLC programming. We suggest that you begin your programming journey by solving closed-ended programming problems.

Once you are comfortable with solving close-ended problems, you will be ready to move on to the open-ended problems. PLC programming problems in the industry are never clearly defined. The problems will always be open-ended. So, you will need to take the skills you gained while learning closed-ended problems and combine them with the skills you will learn solving open-ended problems.

When solving open-ended problems, you will find that the process of developing the solution will typically help to clarify the problem. It is not a common occurrence for one to fully understand all the requirements of open-ended problems before attempting to find the solution. Solving such problems is usually iterative and requires you to break the problem into smaller, more understandable steps.

Below are examples of both closed-ended and open-ended problems that you can easily start with.

A Closed-Ended Problem: PLC Programming of a Basic Motor Control

An example of a very common PLC programming problem is the development of a PLC logic that controls a motor.

To program the functionality of starting and stopping a motor, there are three simple rules you should follow. These are:

  1. Break the problem down into small steps;
  2. Illustrate these steps in a diagram;
  3. Create the logic diagram in your PLC software.

For the AC motor control problem, this would be done as follows.

(1) Break the problem down into small steps

Below are the steps:

  • Turn on a motor when a momentary start pushbutton is pressed;
  • The motor should stay on when the start pushbutton is released;
  • The motor should turn off when a momentary stop pushbutton is pressed;
  • The motor should stay off when the stop pushbutton is released.
(2) Illustrate these steps in a diagram

These steps could then be described diagrammatically as shown in the Figure 1 below.

Basic_Relay_Control_of_a_Three_Phase_AC_Motor

(3) Create the logic diagram in your PLC Software

Assuming that the motor control application is accomplished by wiring a normally open Start pushbutton to input I:0/0, a normally closed Stop pushbutton to input I:0/1, and a contactor relay M to output O:4/0, you will end up with into control logic similar to the CPU program in Figure 2.

PLC_programming_for_Basic_Motor_Control

An Open-Ended Problem: PLC Programming of a Garage Door Opener System

For an open-ended problem, you could write a PLC program that uses a set of inputs, outputs, and internal bits to control a device. The device you choose could be anything depending on your background or experiences. Chances are, it may not be a motor, because simply turning a motor on and off has little to no usefulness in real life. Instead, problems could include programming a garage door opener system, a sprinkler system, or elevator. Our advice to you is to start with more familiar devices as you would have a better understanding of how they function. For our example, we shall use a garage door opener scenario.

To solve an open-ended problem, you must first simplify it. For example, for the garage door opener problem, we may start off with a simple garage door opener system that consists of two buttons; one wired to a PLC input that controls the door opening output, and another wired to a PLC input that controls the door closing output. This would result in the very simple logic shown below.

Simple_PLC_Door_Control

After developing the solution to the simple problem, you must add in the complexities that make the functionality of the system more realistic. Our current solution to the garage door opener problem is simple, but also unrealistic. To close the door, one does not only have to press and hold the switch until the door is fully closed, they also have to release the button immediately after the door is closed. Otherwise, the motor will continue forcing the door to move which may break a component in the mechanism. So, we can incorporate into the problem limit switches or sensors that go on when the door is fully closed, and off when it is open. This reasoning would help you to implement the following conditions:

  • The door should stop once it is fully closed or open.
  • The system should respond to the button that opens the door only if the door is closed.
  • The system should respond to the button that closes the door only if the door is open.

You can also add in a condition that the control system should not respond to the button that opens the door when the door is being closed.

These additions would result in the logic shown below.

improved_door_control_with_sensors

From here you can add in momentary button press operations, single open/close button operations, safety conditions for stopping the door in case there is someone or something in the door way etc. The options are endless and depend on what type of functionality you want to achieve.

Conclusion

Overall, open-ended problems teach you how to define the key requirements in real life problems, and how to develop programming solutions to those unique problems. In order to master this, you must first master the basic skills learned through solving closed-ended problems. Then, you should quickly transition into the open-ended problems. Note that every open-ended problem is different, and there is never a single defined solution to the problem. In fact, you may find yourself with multiple solutions! However, understanding the problem and the ways to break it down into small steps, then implementing the basics skills learned when solving close-ended problems, is a sure-fire way of mastering PLC programming.

That concludes our segment on mastering PLC programming. If you would like us to go into a more detailed tutorial of how to program a basic motor control with a PLC, or even a simple garage door opening system, or any other example, let us know in the comments section of this page.