“Why do you engineers insist on using sequencers in your PLC programs?â€
Mike asked that question the last time I was over at the local washing machine manufacturer. Mike works in the maintenance department there. As usual, a five minute job had turned into over two hours of frustration, and I just happened to be the sympathetic shoulder.
First, let me disclose a little known secret about how washing machines work. You see, early in the days of washing machines, certain garments, usually socks, ended up getting wrapped around the spindle causing a jam, and this eventually causes the motor to overheat and burn out. Frustrated by this problem for over a decade, manufacturers finally solved this problem by incorporating a device known affectionately in the industry as a “sock shredderâ€. When wayward socks start to get tangled around the spindle, the extra torque on the motor activates a torsion bar that engages a spinning cutting head that pulverizes the sock into fine enough fibers that most of it simply gets carried away in the rinse cycle. Even though companies were worried about the backlash from customers, the initial consumer trials showed that most people were rather ambivalent about the missing socks, so the device is now incorporated into every washing machine on the market today.
(Not only did the laundry industry benefit from this innovation, but sock manufacturers reported a 62% rise in demand over a 5 year period, unprecedented in the undergarments industry both before and since.)
Anyway, back to Mike and his frustration. Apparently the plant had received complaints that a few washing machines were experiencing premature failure of the motor. Apparently the machines had left the plant without the sock shredders installed. Mike explained to his boss that it would be easy to install a photoeye that checked for the presence of the sock shredder at the spindle insert station, and stop the inserter if the sock shredder wasn’t detected.
After wiring in the photoeye, Mike went online with the PLC, started looking for the output that actuated the inserter cylinder but was surprised to discover it wasn’t referenced as a coil. As you can probably guess by now, the outputs were being driven by a sequencer instruction.
Ancient History
PLCs first appeared in the 60’s. While most historians believe that PLCs were intelligently designed, a few skeptics maintain that they evolved from less advanced technologies. But I digress…
Back in prehistoric times (before PLCs), machines used mechanical drum sequencers (just like the valve timing in older automobiles) to sequence the actions of the machine. The drum triggered electrical cam switches that would turn on outputs in the correct sequence to operate the machine. When PLCs first hit the market, the PLC designers thought it would be a good idea to create a “sequencer” instruction that would mimic the operation of the drum sequencer to make it easy for machine manufacturers to convert their existing machines over to PLCs. That was decades ago. So, why are engineers still using sequencers?
Machine builders use sequencers because they’re building a machine with a standard operation and it’s easy to go straight from a timing diagram to a sequencer. (Some programmers will tell you that sequencers use less PLC memory, but with the price of memory these days, that’s not a valid excuse.) Of course, when the machine hits the plant floor and needs to be modified, the presence of sequencer instructions frequently triggers severe hair loss in the maintenance department.
Solution
Sequencers can easily be replaced with logic made up of contacts and coils. Each step can be represented by a single coil that is sealed in when the step is complete. I find it convenient to also use a second coil for each step called “step in progressâ€, which is equivalent to “previous step complete and current step not completeâ€.
Use the “step in progress†coils to drive the outputs directly. The logic goes from obfuscated to obvious.
Steps don’t have to be numbered either. With tag based PLC processors you can create steps called Lather, Rinse, and Repeat. Then if you need to add a new step called Scrub between Lather and Rinse, there’s no awkward shuffling of step numbers.
Bottom Line
For Mike’s sake, don’t use sequencers!
References
- http://www.eod.gvsu.edu/~jackh/books/plcs/chapters/plc_adv_func.rtf
- http://www.plcs.net/chapters/history2.htm
Hey Scott,
Nice post. What’s your source for the sock shredder in washing machines? That’s fascinating. I’d love to learn more about it.
Thanks.
@Peter: It’s a little bit tongue-in-cheek. 🙂 Just needed an example.