You are on page 1of 9

MECH470 / MECH970 Applied Topics in Mechatronics Spring Session 2013 - Dr Emmanuel Blanchard Name: TUTORIAL QUIZ 1: Problem 1: (30

MARKS)
Write a ladder program for a system with the following specifications: A first motor (M1) is switched on when a start switch is momentarily activated. M1 remains on for 10 seconds. At the end of the 10 seconds, a second motor (M2) is switched on for a further 20 seconds. A third motor (M3) is switched on 5 seconds before M2 switches off and remains on for 30 seconds. This cycle repeats itself until a stop switch is activated. There is no need to use the start switch again to go to the next cycle.

Student number:

Feedback and Solution: First of all, the most significant mistake is to have a ladder programs with rungs such as the rungs below. You should have inputs on the left and outputs on the right of the rungs. Rung x does not control rung x+1! Rung 00 below has no outputs. It does nothing. It says if I1 = 1 and I2 = 1, do nothing. Rung 01 says run M1 (no matter what happens) What you need is to have I1, I2 and M in the same rung (then it would be if I1 = 1 and I2 = 1, run M1). A rung can affect another rung later (for instance if I1 was actually calculated in a previous rung, if it was a control relay for instance, or a timer bit, ), but the actions controlling a specific output must be on the left of the output, in the same rung.

Remember: the programs is executed one rung at a time (in order), every few microseconds or so. Then is runs again starting at rung 00 again.

Here is a first possible solution. After START = 1, CR =1. Next time we come back to rung 00, CR = 1 will keep CR =1 (unless STOP = 0, then CR1 = 0 until START = 1 again). You could have CR1 (or NOT_STOP) in from of every Motor (and every counter too, they need to be reset when you stop everything), but it would be redundant. Indeed, when STOP = 1, CR = 1 after executing Rung 00. Then T4:0 / EN = 0 in Rung 01 which yields T4:0/DN = 0, which means than in Rung 02, well have T4:1/EN = 0 and T4:2/EN = 0 as inputs to the timers which will yield T4:1/DN = 0 and T4:2/DN = 0 which will then also reset T4:3 in rung 03. The ENs bits in Rungs 04-05-06 will be equal to 0 stop the motors. Another important aspect is to see how the cycle repeats itself. When T4:3/DN finally = 1 in rung 03, then we go back to rung 01 a few microseconds later, T4:0/EN = 0 (input to T4:0) and therefore T4:0/DN = 0 as a result, which yields T4:1/EN = 0, T4:2/EN = 0 and therefore T4:1/DN = 0, T4:2/DN = 0 in rung 03 and T4:3/EN = 0 and therefore T4:3/DN = 0 in rung 04. All timers are reset (without being reset, they would be stuck at t = 10, 20, 15, 30 s). The next time we go back to rung 01 (a millisecond later or so), T4:3/DN = 0 means NOT_ T4:3/DN = 1 which restarts the first timer.

Here is a second possible solution. Note that without T4:2/TT in Rung 02, the timers T4:2 and T4:4 would only run for a microsecond or so. After 10s, T4:1/DN becomes = 1 and T4:2 and T4:3 start, but at the next cycle (a microsecond later or so), we have T4:1/TT = 0 and T4:3/DN still = 0, which yields T4:1/DN = 0. Then, rung 02 yields T4:2/EN = 0 and T4:4/EN = 0, which stops both timers. They are not stopped because T4:2/TT was already = 1 (the timers started during the previous cycle). Please try to understand everything else using a similar approach.

Problem 2: (30 MARKS)

At t = 0, the start selector in Figure 1 goes from OFF to ON. Show the values of the output bits (O:2/0, O:2/1, O:2/2), the enable bits (T4:0/EN, T4:1/EN, T4:2/EN), the timing bits (T4:0/TT, T4:1/TT, T4:2/TT) and the done bits (T4:0/DN, T4:1/DN, T4:2/DN) for each of the three timers T4:0, T4:1 and T4:2 from t = 0 to t = 70 s (all timers EN, TT and DN bits are false before the start selector is switched on at t = 0). You should therefore show the values of 12 bits between t = 0 and t = 70 s. Make sure you label the time when the value of a bit changes, every time. Also, make sure you show changes that occur for a very short time (just show these as less than 1 second long to represent what would actually be a few microseconds) (30 Marks 2.5 marks for each bit)

Figure 1

Solution: Note that in this solution we should have 2s for Amber and 1s for Green instead of 0s. It should be labeled Green T4:1/EN, Green T4:1/TT, Green T4:1/DN, Amber T4:2/EN, Amber T4:2/TT, Amber T4:2.

Problem 3: (30 MARKS) Add a few rungs to the ladder logic shown below in Figure 2 in order to determine the production rate in cans per minute that are moving through the production system. Simply accumulate the can count every 60 seconds (i.e. every 60 second, the number of cans that went through the production system is determined). Reset the count after 60 seconds. (Note 1: this figure is in my slides if you need to zoom in on it) (Note 2: my solution for this problem has 3 extra rungs, but there are several ways to do that, so you do not necessarily need exactly 3 extra rungs)

Figure 2

Solution: (I meant to write C5:3 below, not C5:0) Note that storing the value in memory (when can then read the latest value at the end of the last 60 seconds instead of seeing the counter going up again) was not asked. The timer needs to be reset after 60 s (otherwise, it gets stuck at 60 s and stops counting seconds), and the counter needs to have PRESET > 2400 to make sure we can count all the cans if all the cans go through in less than a minute. The counter needs to be reset every 60 seconds.

The most common mistake Ive seen was having the sensor before the timer. It means that youre only having the timer counting the time when a can is just below the sensor. Youre not counting 60 seconds, youre counting 60 seconds of having cans below the sensor (when T4:0/EN = 1, otherwise, T4:0/EN = 0 and the timer is stuck). However, each can might be there only for a very short time. For instance, in the diagram below, a timer would only incremented by 0.2seconds instead of more than 30 seconds. Youd therefore be counting many more cans per minute than the actual rate because your minute ould be a very long minute (a minute of SENSOR = 1, not a minute of actual time)

Problem 4: (10 MARKS) Rank the four stop systems below from safest to least safe. Justify your answer. Hint: consider a few things such as what happens if there is a fault and the switch cannot be operated and what happens if the PLC stops working.

Stop system A:

Stop system B:

Emergency Stop System C:

Emergency Stop System D:

Answer: Safety must be a priority in the design of a PLC system. Thus, emergency stop buttons and safety guard switches must be hardwired and not depend on the PLC software for implementation, so that, in a situation where there is a failure of the stop switch or PLC, the system is automatically safe. The system must be fail-safe. Thus if failure occurs, the outputs must revert to a fail-safe mode so that no harm can come to anyone. For example, the guards on a machine must not be open or be capable of being opened if the PLC fails. With a PLC system, a stop signal can be provided by a switch as shown in Figure 4.1 ( Stop system A unsafe). This arrangement is unsafe as an emergency stop because if there is a fault and the switch cannot be operated, then no stop signal can be provided. Thus to start we momentarily close the pushbutton start switch and the motor control internal relay then latches this closure and the output remains on. To stop we have to momentarily open the stop switch; this unlatches the start switch. However, if the stop switch cannot be operated, we cannot stop the system. What we require is a system that will still stop if a failure occurs in the stop switch. We can achieve this by the arrangement shown in Figure 4.2 ( Stop system B -safe). The program has the stop switch as open contacts. However, because the hardwired stop switch has normally closed contacts, the program has the signal to close the program contacts. Pressing the stop switch opens the program contacts and stops the system. For a safe emergency stop system, we need one that will provide a stop signal if there is a fault and the switch cannot be operated. Because there might be problems with a PLC, we also need the emergency stop to operate independently of the PLC. Putting the emergency stop in the input to the PLC gives an unsafe system (Figure 4.3). For a safe emergency stop system, we need one that will provide a stop signal if there is a fault and the switch cannot be operated. Because there might be problems with a PLC, we also need the emergency stop to operate independently of the PLC. Putting the emergency stop in the input to the PLC gives an unsafe system (Figure 4.3 Emergency Stop system C - unsafe). Figure 4.4 (Emergency Stop system D - safe) shows a safer system where the emergency stop switch is hardwired in the output. Pressing the emergency stop button switch stops, say, a running motor. When we release the stop button, the motor will not restart again, because the internal relay contacts have come unlatched.

Conclusion: 1) D (safest) 2) C 3) B 4) A (least safe)

You might also like