plc unit 4 lab brett bloomberg-1

22
EET310 – Programmable Controllers and Robotics Unit 4 By: Brett Bloomberg Instructor: William Routt Online EET Department ECPI University Date: 10/17/2016 ECPI’s Honor Pledge: I pledge to support the Honor System of ECPI. I will refrain from any form of academic dishonesty or deception, such as cheating or plagiarism. I am aware that as a member of the academic community it is my responsibility to turn in all suspected violators of the honor code. I understand that any failure on my part to support the Honor System will be turned over to a Judicial Review Board for determination. I will report to a Judicial Review Board hearing if summoned. Brett Bloomberg

Upload: brett-bloomberg

Post on 14-Apr-2017

36 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PLC unit 4 lab Brett Bloomberg-1

EET310 – Programmable Controllers and Robotics

Unit 4

By: Brett Bloomberg

Instructor: William Routt

Online EET DepartmentECPI UniversityDate: 10/17/2016

ECPI’s Honor Pledge: I pledge to support the Honor System of ECPI. I will refrain from any form of academic dishonesty or deception, such as cheating or plagiarism. I am aware that as a member of the academic community it is my responsibility to turn in all suspected violators of the honor code. I understand that any failure on my part to support the Honor System will be turned over to a Judicial

Review Board for determination. I will report to a Judicial Review Board hearing if summoned.Brett Bloomberg

Page 2: PLC unit 4 lab Brett Bloomberg-1

Objective:

This lab helped us become better programmers by learning how to control the PLC in terms of instructions that the PLC needs to carry out. It was more data control instead of using inputs and outputs we were able to control what rung the PLCs code was running with the use of the JSR, SBR, JMP, and LBL instruction sets. We also used math and Binary to decimal conversion to turn on and off a thermocouple to indicate temperature. These were advanced labs that really showed us how to manipulate the code of the PLC.

Lab 9-4

This lab asks us to implement the Jump to subroutine PLC program. With this lab we demonstrated how to use the jump to subroutine instruction and how it’s executed.

This ladder logic wasn’t a difficult program, and it wasn’t difficult to make the jump to subroutine, but what the students have to understand is that you can’t have a SBR( which is subroutine) and a JSR( Jump to routine) in the same ladder logic program. The subroutine is just that a separate ladder logic program that is nested within the system that your main program runs so the programmer doesn’t have to code the same rungs multiple times.

The inputs are shown below

Off/On I:1/0

Stop I:1/1

Start I:1/2

Sensor I:1/3

Motor O:2/0

PL1 O:2/1

Sol O:2/2

Tim T4:0

T4:1

Page 3: PLC unit 4 lab Brett Bloomberg-1

The program is shown below which includes the subroutine.

Running just this program will lock up the PLC and cause it to fault. This is because you can’t have a JSR and a SBR in the same program. The lab does try to explain that it should go into a different file, but the student has to know what they are reading. With this if lab I believe it is a good learning exercise to make the mistake of compiling the whole program on one line. Making this mistake will help the student learn that we will make mistakes and it helps with the trouble shooting process.

The picture below is the normal program without the attached subroutine. This program is pretty simple to understand once you have watched it run a couple of times. The motor is really anything just a motor. The user of this program will hit the start button which will lock the motor into the run position and will continuously run until the Stop button is pushed. Once the motor runs long enough the sensor will trip and cause the system to jump into the subroutine. It will also turn off the Pilot light. If the sensor is still unmade and the user hits the on off button the Solenoid will run. This however is only a momentary action and will not lock in the solenoid. The jump instructions are below.

Page 4: PLC unit 4 lab Brett Bloomberg-1

The subroutine pictured above is a simple one. When the sensor is made it will jump to complete the tasks that are in the subroutine. I added a programmer purposes switch so I could stop the program in the subroutine and watch it complete the logic that is within it. This switch doesn’t need to be in the program, but I added it for my own purpose of observation. The timer T4:0 will instantly start counting to 20. Once that is done it turns on another counter which when that timer T4:1 is running Pilot light 1 will turn on. Once the second timer is done running the Pilot light will turn back off until the sensor is unmade again which will turn the pilot light back on again.

Conclusion:

This lab was interesting and really let us understands how subroutines worked and the parameters or instructions they need in order to operate properly. I found that once you understand that the subroutine is a separate file and a separate ladder diagram everything starts to come together and work properly.

Page 5: PLC unit 4 lab Brett Bloomberg-1

Lab 9-9

This lab like the last lab asks us to implement the Jump to subroutine. This lab however uses the instruction of JMP and LBL which are two other unique control instructions that the PLC can use to control what logic is being looked at when. This program is pretty large in terms of everything that is going on and the inputs being used. The inputs are as follows

S1 I:1/1 S2 1:1/2 S3 I:1/3 S4 I:1/4 S5 I:1/5 S6 I:1/6

S7 I:1/7 S8 I:1/8 S9 I:1/9 S10 I:1/10 S11 I:1/11 S12 I:1/12

S13 I:1/13 PL1 O:2/1 PL2 O:2/2 PL3 O:2/3 PL4 O:2/4 PL5 O:2/5

PL6 O:2/6

The ladder logic is as follows

Page 6: PLC unit 4 lab Brett Bloomberg-1

The subroutine is as follows

When Switch one is made it turns on PL1. When S 2 is made it starts the jump to subroutine. When S 3 is made this Is when it jumps to the lbl which starts the timer: However, this only starts when S7 is also made. S4 turns on PL 6. S9 is another jump to the LBL to start the timer again. Which when it is done timing will reset itself. S8 turns on PL 2. S 10 jumps to the sub routine. S 11 turns on PL 4. The sub routine is interesting in that it needs a few Switches made in order to run properly. With the Subroutine S 13 needs to be made in order to turn on PL 3. S12 needs to be made to in order to jump to the timer in the subroutine, but in order for it to start timing S6 also needs to be made.

This is a simple program and doesn’t take much to understand. This program deals more with the logic control then the actual inputs and outputs. Even though when first looking at this program you would that that the Switches are important to the functions which they are in a way, but the real control is the jump commands and the subroutines.

Conclusion:

This program wasn’t hard to make or even to understand. At first glance it looked a lot harder then what it really was. It helped reinforce our knowledge of control commands and instructions that are more advanced than the basic inputs output latching we have been dealing with.

Page 7: PLC unit 4 lab Brett Bloomberg-1

10-18

This lab asks us to implement the set point temperature control of a heater unit. The tank is to maintain a temperature of 102 Hex BCD with a catiation from 100 Hex BCD to 104 Hex BCD between the ON and OFF cycles of the heater. Temperature control is to be applied any time the process is running. Demonstrate the correct operation of the program. Use the batch sim to simulate the program.

The inputs as follows

S1 ( ON / OFF) I:1/10

Thermocouple I:3 this is the entire input of the Input 3 group.

Heater O:2/4

LED display O:4

The program is as follows

This is a simple program and with a little knowledge the ability to understand it is just as easy. When the Unit is turned on it starts to read the temperature of the tank with the thermocouple. When we adjust the readings of what the thermocouple should be reading by turning on the inputs of position unit 3 We can adjust and control what temperature the thermocouple is seeing. If the temperature reaches less than or equal to 256 binary the low temp stays on. If the temperature goes above 260 binary the heater turns off. Once the heater is turned on its locked to stay on until the temperature goes above 260 binary. The only way the heater turns on is if the user operated switch is turned on.

Page 8: PLC unit 4 lab Brett Bloomberg-1

Conclusion:

As you can see from the pictures above if the temperature seen by the thermocouple is less than or equal to 256 binary the heater remains on, but if that goes higher than 260 the heater will turn off. This is a simple data control ladder logic program that uses simple data comparisons and variable input ranges to determine what the system does. I would also imagine that this simple circuit is what’s used in a thermostat in our homes for heat, or ac. It could be a user set temperature just by varying the settings a little bit from a LCD display if needed. The possibilities of this simple code really go far behind its basic use.

Page 9: PLC unit 4 lab Brett Bloomberg-1

Lab 10-22

This lab asks us to implement the data compare program. It asks us to determine at what accumulated counter values the pilot lights will turn on and be energized and the highest count before the counter is reset.

This lab is a fairly easy program to understand. The ladder logic allows this by the use of checking the counters count and comparing that number to a set of different commands in the form of ladder logic The fist rung in the set of commands to check the counter is a greater than or equal to which resets the counter after it reaches a certain number in this instance that is 19. The second rung is simply an equal to rung. If the counter equals this number turn on the pilot light which is pretty easy to understand. The third rung of this program is a little different. It has two precise measurements that turn on the pilot light if meet. The first requirement of the counter is that the counter needs to be higher than 5, but it also has another instruction that the number has to be lower than 9. This means that in order to turn on pilot light 2 the counter has to be between counts 5 and 9. The third rung is very much like the last with the counter needing to be between 10 and 18.

Page 10: PLC unit 4 lab Brett Bloomberg-1
Page 11: PLC unit 4 lab Brett Bloomberg-1

Conclusion:

As you can see from the pictures that pilot light 1 and pilot light 2 will not activate at the same time since the first solution to energizing pilot light 2 is that the counter has to be greater than 5. If it was equal to 5 it would activate. This could cause for errors down the line if the programmer happened to make it. This was a fairly simple comparator program when thinking about it, yet when you need to do this within logics pro things do become interesting. Counting within PLC’s is an interesting topic with the data manipulation that can happen. Being able to key into certain numbers of the counter to do certain things like change the mixture of a liquid that’s being poured into a tank based on how many gallons have already been pumped into the system. It does allow for a versatile application.

Page 12: PLC unit 4 lab Brett Bloomberg-1

Lab 11-4

This lab asks us to implement the overfill alarm program. In this application the subtract function is used to indicate a vessel overflow condition. It requires an alarm to sound when the system leaks 2 pounds or more of raw material into the vessel after a preset weight of 5 pounds has been reached. With this we use the BCD sim.

The inputs are as follows:

Stop pb I:1/0

Start I:1/1

Weight transducer I:5

Fill SOL O:2/0

Filling PL O:2/1

Full PL O:2/2

Alarm O:2/3

With this lab we used the I:5 input field which is part of the input outputs. I did not take a snap shot of this because for me at the time I didn’t think it was important. I did use it during this lab but failed to take a screen shot of the actual numbers that the scroll wheel allowed. I did take a lot of pictures of the program as it was running.

The first rung is the basic control rung that turns on and off the solenoid and the solenoid output locks in the momentary push button for the system to keep running. The program will keep the Solenoid active until the system is great than or equal to 5. When this is greater than or equal to 5 the output for the tank being full is turned on. This turns on another rung which subtracts the amount of water that was filled into the tank by 5. If this number is less than 2 an alarm will sound. The alarm will sound if the system leaks 2 pounds or more of the water. That goes into a 5 gallon container.

Page 13: PLC unit 4 lab Brett Bloomberg-1
Page 14: PLC unit 4 lab Brett Bloomberg-1
Page 15: PLC unit 4 lab Brett Bloomberg-1

Conclusion:

This little program does do a lot of good. I would say in order for it to run automated. The I:5 would need to be an actual weight transducer. This machine doesn’t necessarily have to use water exclusively, but if it did you would need to change the sensor to a flow sensor. Once the system sees 5 pounds it should shut off the pump.

Page 16: PLC unit 4 lab Brett Bloomberg-1

Lab 11-14

This lab asks us to implement the conversion from Celsius to Fahrenheit. In this application the thumbwheel switch indicates Celsius temperature. The program is designed to convert the Celsius temperatures to Fahrenheit values for display. Use the BCD sim.

With this program I took picture of the I:5 input and what the numbers were at, and the conversion would be displayed in the I:6 column. This was a very simple data manipulation program that just required a little for thought. Taking the number entered and converting from Celsius to Fahrenheit isn’t a hard task to complete as long as you know the formula.

First we multiple the number by 9 then we divide the number by 5. Once this has been done we add 32 to the total number which gives us the conversion from Celsius to Fahrenheit. This ladder logic is broken up into each rung preforming a certain function of the formula to convert Celsius to Fahrenheit.

Page 17: PLC unit 4 lab Brett Bloomberg-1
Page 18: PLC unit 4 lab Brett Bloomberg-1

As you can see from the pictures above that this program works with multiple inputs from I:5.

Conclusion:

With these labs some of them ask to use different simulators. I still find using these difficult and unhelpful in terms of what’s actually going on. I got stuck in the beginning with having a subroutine nested inside my programs ladder logic. This caused my system to crash and not works properly once I figured this out I was able to run my programs without any trouble. These were more advanced control programs than what we have dealt with before. These labs helped us learn more about PLC’s and the advanced functions that they are capable of. I enjoyed these labs and learning more about the control functions.

References:

Petruzella, F. (2011) Logixpro PLC lab mamual for use with programmable logic controllers ( fourth ed). New York, NY: McGraw-Hill

Petruzella, F. D. (2011). LogixPro PLC lab manual for use with programmable logic controllers. New York, NY: McGraw-Hill.

LogixPro (Version TLP) [Computer software]. (n.d.).

Page 19: PLC unit 4 lab Brett Bloomberg-1