Ladder Logic 304: Timer Application

Today’s post is in response to Dave Tompkins, who posted a request for help last week for an application. Since he posted it on one of my series posts on ladder logic (204: Auto Sequences) I decided to frame it as a continuation on the 300 series.

“I am looking for a ladder diagram, 1 motor 2 contactors fast/slow, auto control where the motor runs for 2 mins in slow, when timed out the motor runs fast for 5 mins. manual control, when motor can be started in either fast or slow & latches in until the timer times out, also need the motor to run fast in inch mode when the 2 inch buttons are pressed, can anyone assist please.”

An important part of writing code for an application is determining specifics of what the customer wants. In this case, since Dave is not here where I can ask him questions, I will have to assume anything that is unclear.

One question I would have is what PLC is being used? Most ladder logic is pretty similar from platform to platform, but addressing and instruction sets vary widely. Since I have Allen-Bradley’s ControlLogix software handy, I will be using that. A useful side benefit of this platform is that since it is tag based, Dave can assign whatever addresses he wants to the tagnames.

I’ve started here by defining the outputs. This format is similar to what I covered in my 202:Outputs post from a couple of years ago. This is not the only way to approach programming, but it’s a pretty good one for discrete machinery. Note that all states of the motor control are pretty well defined here, though faults, control and system modes are defined in other routines. As an added safety, if the slow output is somehow turned on it will disable the fast, and vice-versa. *This does not apply if outputs are forced!

LL304_ControlA

This is the timer control part of the application. I used On Delay timers for these: a couple of notes. There is nothing here to prevent someone for taking the system out of Auto or Manual mode and ending the cycle early. If you want to prevent this, it should be done in the System Routine.

I also have not indicated where the Inch_2HandCtrl (“Inch Two Hand Control Command”) bit came from. Ideally, this would be either a hardware-based anti-tie-down relay or a software anti-tie-down routine. For more information on this, Google it or I’d be happy to write a post on it later. Do NOT do this:
LL304_Bad2Hand
In most cases this is not legal unless safety isn’t an issue. If the controlled devices are behind a light curtain or door you might be able to get away with it; the point is, someone could tape down one of the pushbuttons and operate it with one hand. Kind of defeats the purpose of a “2 Hand” control, doesn’t it?

I am including Faults in this post to elaborate on the 203:Faults post from a couple of years ago.

LL304_Faults

Again, note that there is nothing here about how the fault is acknowledged or reset, or how it is combined with other faults to create a system level fault.

This post took me about three hours to write today. The program itself took about an hour because I had to create all of the tags, set up a new processor and I/O structure and various other things. Much of the rest of the time was spent typing and doing screen captures of the logic for import.

The reason I mention this is that there are not a lot of good examples of ladder logic online, even on PLC manufacturer’s websites. This is because most programmers don’t have the extra time to type all of this up and post it; there are some really helpful folks on places like www.plctalk.net and other sites, but most of them are paid well for their time and can only go so far. This may help explain why people don’t always get answers to more complex ladder logic or application questions. Since I write a blog anyway, I am happy to cover it this time. Hope this helps!

Share
About

Electrical Engineer and business owner from the Nashville, Tennessee area. I also play music, Chess and Go.

3 Comments on “Ladder Logic 304: Timer Application

  1. Frank, I have only just discovered your site as I have only begun delving into the world of Ladder Logic and PLC/s (on Koyo/AD) as we are trying to bring a circa 1977 Amada Bandsaw out of the dark ages. I have read probably hundreds of “logic” pages over the past couple of weeks without a great deal of the “fog” lifting for me. That is, until I found your site/blog. I’m not much for blithering flatteries at people but I do want to give you some acknowledgment and gratitude for your knowledge and sharing. At my company I am considered the “head.” Every single day for me is filled with “this isn’t working” or “can you modify this machine” or “install this piece of new equipment.” Most of my coworkers know that I don’t know everything but come to me anyway because I seem to have a knack for figuring things out. It’s quite a treat to find someone to whom I can look to in the same way. Please don’t get discouraged about lack of feedback because there will always be somebody who is just discovering the amazing treasure trove of information that you have proffered. Thank you.

    Terry

  2. Frank,

    Once again great info !! every article you have written is wonderfull, detailed and to the point ! I am interested in purchasing your book , Amazon doesnt seem to have any in stock,where can I purchase one ?