JohnW (1 of 2),
Dan is a student.
He is exploring the possibilities in programming. He is trying to explore those possibilities in terms of relatively real processes. In the past, he has indicated that he wants to follow normal practices including the exploration of the various programming methods as well as recognizing and handling safety issues. I applaud him for his drive and ambition. He appears to be doing well.
However, whenever any student poses a project, a bunch of Chicken Littles begin running around yelling "Safety First! Safety First! LOCK-OUT/TAG-OUT! Safety First!"
Safety certainly is very important.
However, is this the time? Is it practical to design a process (program) around a safety device?
In most cases, the Safety factors are designed outside of the program.
Now, as to how those devices are actually incorporated into the final design... there are several valid methods. The exact method employed depends on the nature of the particular process.
Method-1: The E-Stop (in whatever form) kills power to EVERYTHING! (Including the PLC.)
In this case, the program is not aware of any E-Stop condition. The E-Stop condition simply turns OFF everything. This is a HARD-WIRED method... it is NOT a programming issue at all!
Method-2: The E-Stop (in whatever form) kills power to all Outputs. (The PLC and Inputs remain energized.)
In this case, the program IS aware of the E-Stop condition. The E-Stop condition turns OFF power to ALL output devices AND, at the same time, provides a signal to a PLC Input that the condition exists. This too is a HARD-WIRE method... however, in this case, there are programming concerns.
As long as the PLC is powered, the program can "know" that an E-Stop condition exists. Under this method, the program should be written to recognize and handle the E-Stop condition. While in this condition, the various modules in the program calling for activity (based more on Internal Relays than current input conditions) should be driven to cancel any "calls" for particular output activities.
Now, even though the process is under an E-Stop condition, believe it, or not, in some applications, it is possible for certain conditions to change.
While the E-Stop condition exists, and as long as the PLC is energized, if changes in the process-status are acceptable, then the program can simply continue to monitor input devices and can continue to use Internal Relays to track changes in process-status. (Plan carefully!)
In this case, when the E-Stop condition is removed, the process "knows" the "situation". Using that information, the process can "resume" running according to some particular "recovery process". The "recovery process" has to be designed carefully so as to make the resumption occur without creating new problems.
Now, in some case, these changes in process-status conditions might not be acceptable. If the program "knows" that an E-Stop condition exists, then the program can "watch" to see that the required conditions are maintained.
For example...
... a hydraulic ram is used to control the elevation of a particular device. There is a Temposonic indicating the position of the device.
The E-Stop causes power to the direction valve and the fluid source (pump) to be de-energized. Under this condition, the valve and cylinder is supposed to hold the device in position... however, there is this teeny, tiny, little leak in the lines or valve. Since the program "knows" that an E-Stop condition exists, it also "knows" that the device is not allowed to move. Since the program is still running, it can track the position indicated by the Temposonic. If the position changes by some particular amount, or to some particular value, then... since the device is NOT allowed to move under this condition, it would be nice to know that the cylinder is failing to hold its position.
Since the program is still running, it can detect a change in position... the program can cause an alert to be displayed on the HMI. An operator can press a button to acknowledge the alert.
Being the Computer...
Hmmm... the alert is on, but there is no acknowledgement.
I wonder if anyone of those idiots is even looking at the HMI?
Damn! Unless I see an acknowledgement, I have no way of knowing... maybe yes... maybe no.
Gee, it sure would be nice to be able to force someone's attention and then aggrevate them into providing a response...
...but then... that would mean turning on an Output... wouldn't it?
Hmmm.... can't do that under Method-1 or Method-2... sounds like a case for a different Method.
Method-1 and Method-2 are fairly common. The choice is usually related to the complexity of the particular process. If Method-2 is not required, then use Method-1. A judgement has to be made. I have several processes that use Method-1 and several that use Method-2.
Method-3: The E-Stop (in whatever form) kills power to particular Outputs (or not)... depending on particular program/process conditions.
Method-3 is less common. It is far more complicated and has certain risks. However, sometimes, this is the best choice. Whether or not this particular method should be used depends on what would happen if either Method-1 or Method-2 is used. If using Method-1 or Method-2 would make a bad situation worse, then, maybe this is the best way is to develop a particular E-Stop handler (sequence). This would bring the process to a "SAFER" stop condition. This, of course, means that the PLC has to be energized, the Inputs energized, and certain Output power is controlled.
Method-3 should NOT be used unless Method-1 or Method-2 causes more problems than it prevents. Employing this choice must be considered very, very carefully!.
To those of you that say you can't see any possible reason for using Method-3, I can only say, you simply haven't been around the block very many times. Just because you haven't seen everything there is to see, that is no reason to place your limited views on those that have seen more. (BTW, I am NOT suggesting that I've seen everything there is to see... but I have seen situations, and currently have a situation, where Method-3 is the preferred method.)
Even rookie designers know that the safety concerns must be accounted for. However, they simply need to decide the particular method they plan to use. It is best to start assuming Method-1. Then, as the design process develops, they might find a need to use Method-2 instead. Method-3 comes in with only the more complex processes.
In terms of the "learning process", using nothing more than output lights or bench devices, it is entirely reasonable to assume that Method-1 will be employed.
JohnW (2 of 2),
Second... Regarding the "HOLD CYCLE" and "RESUME" discussion...
This is part of the discussion with Rod where he stipulated that he was trying to find a way to resume running WITHOUT blowing off an uncompleted blank. As Rod indicated...
"This also HELPS prevent scrapping a valuable blank part ( scrapped two 4' x 8' x 1" blanks AND an $800 tool two weeks ago!)"
Rod wants, very badly, not to have to "blow the blank!"
So, your...
"What I do is, if a machine stop occurs during a punching cycle, eject the blank (or what's left of it as it probably compromised anyway) and reset the machine to its start postion..."
...simply doesn't apply. It's nice for you that the requirements placed on your particular process are so simple that you (the end-user) can afford to "blow a blank".
At no point did I suggest that a punch cycle be restored to a position that places the punch in mid-stroke.
What I suggested was that a particular punch sequence might consist of one to several strikes before changing to the next tool or indexing the blank. I then indicated that a decision needed to be made as to which particular strike-cycle to return to.
Apparently, I didn't make it clear enough what I thought was the general form of any punch cycle...
"Load the Part"
- "Loading the Part"
- "Part has been Loaded"
"Punch Part"
--- "Punch with Tool-1"
----- "Punching the Part"
----- "Part has been Punched"
*
*
*
--- "Punch with Tool-X"
----- "Punching the Part"
----- "Part has been Punched"
"Unload Part"
- "Unloading the Part"
- "Part has been Unloaded"
With respect to "Punching the Part", the smallest, indivisible, basic action in an individual punch-operation is...
----- "Punching the Part"
This requires that the punch be in position to "BEGIN" a punch action.
If the particular punch-action involves several strikes then it is a matter of deciding which strike to start with. In any case, a strike begins with the punch at the home position.
Just because one can "afford" to "blow a blank", that doesn't mean that is the only way available to handle the situation. What if one can not "afford" to "blow a blank"?
If the cost of unnecessarily "blowing a blank" is too extreme, AND, if an appropriate programming method MIGHT can be applied to SAVE THE BLANK then, by all means possible, that method SHOULD be applied!
Depending on the particular product being processed, it might be extremely costly to simply "blow a blank". Think Globally (in terms of your Customers), act Locally (in terms of your efforts for that Customer)!
The abilities provided by the basic programming capabilities in all reasonable PLCs allows you to do what has to be done... it is only a matter of YOU choosing to do what has to be done...
The question is... ARE YOU UP TO THE TASK?