PLC class project-5

BDKuhns

Member
Join Date
Sep 2003
Location
KC, MO
Posts
78
There are a total of eight projects in the PLC-1 class that I’m taking. This one involves counter. Here is the problem, and the ladder I developed that follows. Is there anything that anyone can see that I missed? The ladder solved the problem, but without a resource to compare to, I don’t know if I am missing something that would do the job in a better way, or should have include something else for future development.

A company that makes electronic assembly kits needs a counter to count and control the number of resistors placed in each kit. The controller must stop the take-up spool at a predetermined amount of resistors (10). A worker on the floor will then cut the resistor strip and place it in the kit. The circuit operates as follow:
1. A start button is pressed to start the spool drive.
2. A through beam photo sensor is used to count the resistors going by.
3. A counter with a preset of ten will automatically stop the take-up spool drive when the count is reached.
4. A second counter is required to track the grand total of resistors packaged per day.
5. A stop button is provided to stop the take-up spool at any time. The counters are not affected.

The Ladder-

Stop Start motor run light
I:3/7 I:3/6 C5:0/DN O:4/0
0 |------] [-------------] [----------------]/[------------------------------( )------------------|
| | | |
| | O:4/0 | |
| |-----] [-------| |
| |
| Start |
| I:3/7 C5:0/DN C5:0 |
1 |--------] [-----------------] [---------------------------------------------(RES)-----------|
| |
| Resister Counter |
| C5:0 I:3/4 -----CTU----------- |
2 |----]/[------------] [-------------------------------------| C5:0 |-(CU)-----|
| | Preset 10< | |
| | Accum 0< |--(DN)- |
| ---------------------- |
| |
| Resister Counter |
| I:3/4 -----CTU----------- |
3 |-------------------] [-----------------------------------| C5:1 |-(CU)- ----|
| | Preset 0< | |
| | Accum 0< |--(DN)- |
| ---------------------- |
4 |--------------------------------------------------------------------------(END)-------------|



I know it looks kind of simple, but I sent quite a bit of time trying to remedy a problem that I came up to first. I had to add the C5 exc in line 1 because the counter added an extra count when I pushed the start button.
What do you think?
Barry.

PS. Is there a better way to enter a ladder than the way I did?
 
Last edited:
Let's start with the presentation of the post itself. Bear in mind, I'm not attacking you, just offering observations. The first thing is to enclose typed in ladder logic in the [ ladder ] and [ /ladder ] tags. This would make the post much more readable and possibly get you more replies. Some people won't go past the first line of a badly formatted post. I myself will not read a six hundred word post put up all jammed together without paragraph breaks. It's just too hard on the eyes!

Next, in order to get more useful information on a screen, line numbers aren't usually included in short program snippets like this. It's a nice touch but unnecessary. Along this line, squeezing the rungs a bit tighter would help here, too. Don't be afraid to use the PREVIEW button.

It's a little confusing because you've named input I:3/7 as both START and STOP. No biggie here but in the "real" world you might break something.

As far as the ladder, it looks clean to me. It's really hard to simplify the things that are already simple.

I don't know if you've been introduced to one shots yet (and there are folks here who avoid them) but, my own preference would be to one shot the start button for several reasons.

1. As written, if the start button fails closed the motor will run continuously.

2. If the operator gets tired of pushing the button to feed only ten parts and decides to run out seventy or eighty at a time, there's nothing to stop it.

3. It's also possible that the machine is capable of feeding ten parts before the operator gets his finger off the start button. This would have the same effect as number 2 above.

Just my .02 :p
 
Barry:

Why can't we get more students at this site like you? I think you must be the very first, in the site's history, to post not just your homework, but your solution, and where you got stuck.

Thank you.

As for posting your code, I notice that you DID use the [ladder] codes correctly. As near as I can tell though, you created your post in Word, making just the way you wanted, and then copied and pasted it here.

The only problem is that you were using a proportional font (such as Ariel) in Word. When you included the LADDER tags, the font changed to a fixed width font when posting, and your spacing still got messed up.

As a community service, here is your code cleaned up:

STOP START MOTOR RUN
| I:3/7 I:3/6 C5:0/DN O:4/0
0 |-----| |------+-----| |-----+-----|/|------------------( )
| | |
| | O:4/0 |
| +-----| |-----+
|
|
| START
| I:3/6 C5:0/DN C5:0
1 |----| |-------| |-------------------------------------(RES)
|
|
|
| RESISTER COUNTER
| C5:0/DN I:3/4 +------- CTU ---+
2 |-----|/|-----------| |----------------| C5:0 |-(CU)
| | Preset: 10 |
| | Accum: 0 |-(DN)
| +---------------+
|
|
| RESISTER COUNTER
| I:3/4 +------- CTU ---+
3 |-------------------| |----------------| C5:1 |-(CU)
| | Preset: 0 |
| | Accum: 0 |-(DN)
| +---------------+



I never bother drawing the right power rail (and usually not the left)



One thing I noticed about your code is that I felt that rung 1 should come before rung 0. Why? When the START PB is pressed, C5:0.DN is set, having stopped the line. This means that on that first scan after pressing the START, the motor won't start. The counter gets reset on rung 1, and on the second scan the motor will start. That's OK - pushbuttons are rarely held down for only a single PLC scan. But it's something.



Finding the "problem" with the false "extra count" took a bit more detective work, but is actually related to the first comment.

Picture the system: You stop the line when the 10th part is in front of the eye, right? Is that part still there, blocking the eye, when the START is pressed? If so - that's what's giving you your "extra count". When you RESet the counter, the CU bit is also cleared (this bit is used by PLC bookkeeping to "know" that the input conditions haven't gone true-to-false.

So if that part is still there, that means that the operator didn't pick it up, which means that it is going to be part of the NEXT group of 10.

THE PLC WAS RIGHT TO ADD THAT EXTRA COUNT!!!

Perhaps a better way to solve the problem is to not stop the motor until the resistor has CLEARED the eye.

That is, you want the motor to keep running until the count is done AND the eye is not blocked.

Can you program this? All you will need to do is add I:3/4 to your current rung 0 (but I'm leaving the details to you).
When you do it, you will be able to eliminate that -|/|- of C5:0.dn on rung 2.

But very good work so far.
 
Last edited:
Thanks guys! I have refered this site to several of the other students in class. I believe some of them are just after the answer.
It's good to get feet-back from those who are actually in the industry in order to gauge my progress. This is helping a lot. :p
 

Similar Topics

I need to know how to take a schematic like this and solve it for let’s say a run time of 5 seconds By solve I mean determine which rungs are...
Replies
33
Views
9,094
Has anybody taught beginning PLC classes at a technical school or community college? I am looking for a good textbook that won't be too expensive...
Replies
4
Views
2,270
I have a Netbiter device that has EtherNet/IP that I want to use to grab data from an Allen-Bradley Compactlogix. Unfortunately it asks for the...
Replies
20
Views
13,835
Hello, We need to put a PLC control panel in a Class 1 Div 2 location. Unfortunately the location is fixed, there is no way we can put this panel...
Replies
4
Views
2,472
Greetings all, I am setting up a PLC training class for some inexperienced technicians. This will be very basic and will be based on three...
Replies
3
Views
3,564
Back
Top Bottom