ELE239 - Programmable Controllers

Introduction

ELE239 - Programmable Controllers
Examines installation, programming, interfacing, and concepts of troubleshooting programmable controllers.

Required Materials:
Programmable Logic Controllers: A Practical Approach to IEC 61131-3 using CoDeSys - Dag Hanssen
Velocio Ace 11 PLC
5V 2A Wall Plug
USB to Mini USB Cable w Data
Software:
Codesys
Resources:
Textbook
Class Video Playlist

Week 1

Welcome to ELE 239! I will be posting content and labs each Friday and following with solutions and updates the following week. This post serves as an introduction to the course, syllabus, and the structure. Feel free to reach out if you need anything. Make sure to have all the class materials by the end of next week!

Getting Started:
Watch the intro video and read the syllabus. Contact me with any questions! Please introduce yourself on Canvas in the dicussion forum. We will be using Canvas as a discussion and announcement tool. Make sure you can log into Canvas!

Supplemental Materials
ELE239 Syllabus
Week 1 Introduction Video
Discussion Post 1
Codesys x64 3.5.15 Download

For next class...
Watch the introduction video for the class.
Respond to the Canvas Discussion post introducing yourself and read others' posts to get to know people in the class!
Read Part I, Chapter 1 & 2 of Programmable Logic Controllers - Hanssen
Download and install Codesys 3.5 for Windows using the above links. Codesys is also available on the lab laptop computers for your use on campus.

Week 2

Thank you for introducing yourself and getting started on our class! Hopefully you can access Canvas properly and participate on the discussion. This week we will install Codesys and test its functionality. We will also review the readings and provide some additional support.

Getting Started:
Please utilize the Codesys Development Help as needed. It is also available in Codesys. Watch the intro video and begin your first program. We will be creating a simple program to just test our development environment and see if everything is working properly. This excercise will provide context as we progress.

Supplemental Materials
Codesys Help Dev Environment
Introduction to Codesys Tutorial
Discussion Post 2

Lab 1: Development Environment
We will be utilizing Codesys and the IEC standard to write our programs. This week will be a short introduction to Codesys to help familiarize yourself with the program and its features. Refer to help documentation when needed. Follow below:
Follow along with the tutorial to create a simple program in a virtual PLC.
Create a new 'Standard Project' in Codesys. Name your project 01ELE239IntroLastname.
Setup your device to be the 'CODESYS Control Win V3' using Ladder Logic.
Open your PLC_PRG (PRG) by double-clicking on the left in the devices tree.
Notice the Program Tools, Program Construction and Program Variable docking windows. In the Program Tools list, find the 'Contact' and drag it over to the 'Start Here' icon in the Pogram Construction window.
Rename the ??? variable to Button1 and make sure it is BOOL.
Find the 'Coil' element and drag it onto the contact labeled Button1. Name the Coil Light as a BOOL.
Find the Online dropdown and select Simulation mode. Then Login to the controller.
From here you can test all your possible scenarios for the I/O. Start your simulation and play with the values in the table.
The Debug dropdown will allow you to Start the controller and Write Values that you selected.
Add 2 more rungs with different variable names. Can you make one of the coils activate the other two contacts, in turn activating three coils at the same time? How would you accomplish this?

For next class...
Read Part I, Chapter 3 of Programmable Logic Controllers - Hanssen
Answer the questions in the discussion and provide 2 responses to other posts. Make sure to comment and question other students' responses!
Make sure you work through Lab 1 to have a working single rung proram and simulation. Then build the other two rungs as you think they should be. Reach out if you need nay help with this!

Week 3

You should have successfully developed your first ladder logic diagram program in Codesys. Make sure it does exactly what you want by simulating and testing values. Don't forget to post on the discussion from last week.

Getting Started:
Create a mental model of a simple automated system you use regularly or are familiar with. I won't constrain you to anything in particular, but a good example would be the basic heating/cooling system, a carnival ferris wheel, a pinball machine, a home security system, or something that senses/detects and changes based on that reading! Get creative.
Model your simple system as a flow chart. To quickly do this, try draw.io and use different geometries to determine different things. Your goal is to make sure you build a process loop. You learned about a variety of sensors from the readings.
Make sure that your system includes a sensor/reading, control/set point, controller, predetermined values, and a way to modify the system.
Feel free to use this as an example: Simple Heating Process Loop.
Post your system on the appropriate discussion board for feedback.

Supplemental Materials
Week 2 Lab Solution
Data Types - Codesys
Industrial Start/Stop
Week 3 Discssion - Control Process Loop
Week 3 Discussion - Start/Stop & Variables

Lab 2: Beginning our Program
In Codesys we will develop a unique program for our control process loops. We will simulate and make sure that everything is working and meets the needs of the system.
Start by listing the variables you need for your system.
Use the top section to develop your variables before you begin your program.
In the above example I would create a setpoint (INT), start (BOOL), stop (BOOL), indicatorLight (BOOL), temperature (INT) to create a simple system.
This system would have a user-defined setpoint, start the heating at a certain temperature reading, turn on an indicator light when heating, and shutdown when temperature is reached.
We will begin the process by creating a simple start/stop function and if you would like you can include a reset here. We want the system to turn on with the user, but stay on until asked to do so.
Create a rung that starts the system and continues to stay on regardless of the user.
Make sure to use the defined variables from earlier. If you can begin laying out your whole system. What are you missing in your logic? What would make it easier?
Ensure all variables are labeled and your start/stop rung is complete. Test it in simulation and have it activate another rung with a simple coil.

For next class...
Read Part III, Chapter 5 - Chapter 6.6.5 of Programmable Logic Controllers - Hanssen
Answer the questions in both discussions. Comment on 2 other posts for each and try to help out or ask questions if you are not sure!
Start/Stop Program Submission

Week 4

You should have successfully built a simple start/stop function in Codesys. Make sure it does exactly what you want by simulating and testing values. Don't forget to post on the discussion from last week.

Getting Started:
Check out the provided examples and video to help with solving your process control loop using what you have built on. You should be able to use simple logic elements and math operators.

Supplemental Materials
Week 3 Lab Solution
Week 4 Examples
Example 1 - .zip
Example 2 - .zip
Week 4 Discussion - Ladder Logic Process

Lab 3: Full Process Loop
Begin your project with a start/stop rung. You may reuse your previous example.
Your goal is to recreate your process loop that you drew last lab. Look at each of the stages and break that down into related rungs.
Start with your human input and make a setpoint or similar as an INT variable.
Once that setpoint is hit, make sure the system turns on the main function. In my example case this is the heater.
Allow the system to add to its value manually. Make an input control the input (temperature) variable.
As you enact that input from the system, increase the input variable. Have the system turn on or stop when a certain number is reached.
This will change the operation of the control loop and the process should start over. You can manually change the setpoint/temperature with the variable.
Simplify the system with inputs and outputs that are connected and give a good example of your process control loop.

For next class...
Read Part II, Chapter 4 of Programmable Logic Controllers - Hanssen
Answer the questions in both discussions. Comment on 2 other posts for each and try to help out or ask questions if you are not sure!
Process Loop Program Submission

Week 5

At this point you should have a basic model of your process control loop. Make sure it does exactly what you want by simulating and testing values. Don't forget to post on the discussion from last week. This week we will dive into some counter and timer examples to expand our logic!

Getting Started:
In Codesys pull up the information and details for each of the timers and counters. Make sure to look at the block diagram connections.
Check out this video on Counters for a brief background that should align with your understanding from the readings.
Check out this video on Off Delay Timers (TOF) and this video on On Delay Timers (TON)

Supplemental Materials
Codesys - CTU
Codesys - TON
Codesys - TOF
Week 5 Discussion - Counters
Week 5 Discussion - Timers

Lab 4: Timers & Counters
We will start by creating a simple timer program. Each of the programs will show the difference in the timers and you should be able to look up the diagrams in Codesys to compare.
Create a simple start/stop for your program.
Build a program that flashes a green light on/off using TON every 500ms. This light must flash when in active state of the machine based on the program being started.
Add a TOF that flashes red if a limit switch is tripped. This will enable a red light to flash every 1 second to denote the machine has an error.
Make sure that you can reset your system back to its original state.
Once you have your active state blinking light and error state light working with a reset and limit switch, let's use a magnetic switch to count the number of pieces passing through.
Use a counter to continually count a group of metal objects being passed by. Use a CTU to process this request.
When the CTU reaches 100 parts, enable the flashing red light from the previous portion.
Make sure to be able to reset the CTU and TOF.

For next class...
Build a Visualization for the above program in Codesys. Make sure it is interactive and user friendly and uses simple tools.
Read Part IV, Chapter 9 of Programmable Logic Controllers - Hanssen
Answer the questions in both discussions. Comment on 2 other posts for each and try to help out or ask questions if you are not sure!
TOF/TON/CTU Program Submission

Week 6

You should now be comfortable with timers and counters! We will use these extensively to control our programs. We are going to setup for using our small PLC that we purchased for class and also start some structured text

Getting Started:
Download and install the Velocio PLC software, vBuilder and vFactory on your Windows machine
Review the TON flashing video to make sure you are off to the right start in the previous examples from last posting.

Supplemental Materials
vBuilder Manual
vBuilder Tutorials Page
Week 6 Discussion - ST
plcacademy - Structured Text Overview

Lab 5: PLC & ST
Make sure your setup your PLC properly with the software. We will be running through a few simple examples from the manufacturer.
Work through "Getting Started", "State Machines", "Timer Examples", "Rising Edge", and "Real Time Clock" to make sure you work through the flow of the tools.
Use the video tutorials provided and the examples as reference. The logic in these examples should be review.
Use the Structured Text overview to guide yourself through the next examples. We will be creating a traffic light example in Codesys using ST.
Start by defining your variables in ST in Codesys. You will need to make sure that there are 3 lights, and some inputs. The inputs will be car sensors. Use timers to change the lighting.
Build a process flow chart for your traffic light. Use draw.io or similar to make it happen!
Make sure to provide instances for a full intersection of traffic lights. This will include 2 separate systems that interact with each other.
Complete the example in ST and build a visualization for your simulation using colored lights.
Make sure that your traffic light instance works and can function either without car sensors or will change with them!

For next class...
Read Part IV, Chapter 11 of Programmable Logic Controllers - Hanssen
Answer the questions in discussion. Comment on 2 other posts for each and try to help out or ask questions if you are not sure!
Traffic Light Project Submission