# PLC Help



## Jlarson (Jun 28, 2009)

How about replicating various motor control circuits. 

I'll toss one out, control a well pump to fill a tank using 2 float switches.


----------



## HARRY304E (Sep 15, 2010)

dronai said:


> First PLC programming lesson. Starts off with this simple latch circuit. I tested and it worked.
> 
> Then the studies jump to a very complicated conveyor system. Anyone have a simplier idea for lesson two ?


Watch this stuff...:thumbsup:







http://www.youtube.com/watch?v=zvS_BuQlSXo&feature=player_embedded


----------



## dronai (Apr 11, 2011)

Jlarson said:


> How about replicating various motor control circuits.
> 
> I'll toss one out, control a well pump to fill a tank using 2 float switches.


 
Hey Jlarson, this one I could use sometimes !


----------



## Jlarson (Jun 28, 2009)

Cool. Real world, useful lessons are the best IMO.


----------



## MDShunk (Jan 7, 2007)

Another popular one is a stop-start pushbutton station to pull in a starter. 

Complicate it with a hand off auto. 

Complicate it more with for-rev. 

More with PLC monitored overloads. 

More with a 4th contact interlock in the motor local disco for run permission.


----------



## dronai (Apr 11, 2011)

MDShunk said:


> Another popular one is a stop-start pushbutton station to pull in a starter.
> 
> Complicate it with a hand off auto.
> 
> ...


 
All good stuff, but changing it from mechanical to Logic is my headache !


----------



## dronai (Apr 11, 2011)

This doesn't work- Showing errors. Any examples ?


----------



## eric7379 (Jan 5, 2010)

dronai said:


> This doesn't work- Showing errors. Any examples ?




There are several ways to do it, depending on how complicated you want the program to be. 

You could have it as the float switches going to inputs and energizing coils in the program and using the "contacts" from the coil to turn/off the pump. Or have the float switches in series with the pump starter. 

Other possiblities include a timer to eliminate the flutter from the high tank float.


----------



## industrial951 (Jan 29, 2011)

what do the errors say?


----------



## industrial951 (Jan 29, 2011)

heres a simple one for a pump, programmed with a N.C. Low Level and a High Level Float switch.


----------



## Mike in Canada (Jun 27, 2010)

dronai said:


> This doesn't work- Showing errors. Any examples ?


 You've got multiple outputs in that line. That first 'CR' shouldn't be in an output box in that position.


----------



## Jlarson (Jun 28, 2009)

Think simple start stop circuit, no reason to get more complicated then that most of the time.

Really no need to mess with settling timers either.

Sent from my brick phone


----------



## Jmohl (Apr 26, 2011)

dronai said:


> This doesn't work- Showing errors. Any examples ?


Change the CR2 output enable to examine if closed... you can only have one output on the rung and not in the middle of the rung.


----------



## dronai (Apr 11, 2011)

Jmohl said:


> Change the CR2 output enable to examine if closed... you can only have one output on the rung and not in the middle of the rung.


Thanks !


----------



## dronai (Apr 11, 2011)

*Thanks !*

This diagram works


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Think simple start stop circuit, no reason to get more complicated then that most of the time.
> 
> Really no need to mess with settling timers either.
> 
> Sent from my brick phone





Mike in Canada said:


> You've got multiple outputs in that line. That first 'CR' shouldn't be in an output box in that position.





industrial951 said:


> heres a simple one for a pump, programmed with a N.C. Low Level and a High Level Float switch.





industrial951 said:


> what do the errors say?





Jmohl said:


> Change the CR2 output enable to examine if closed... you can only have one output on the rung and not in the middle of the rung.


Much Thanks guys !


----------



## Jlarson (Jun 28, 2009)

Cool, now add booster pump controlled by a pressure switch.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Cool, now add booster pump controlled by a pressure switch.


This one tested good ! I have only four inputs, and four outputs. Getting maxed out.


----------



## Jlarson (Jun 28, 2009)

Remember your phase converter post? Try doing that logic now.


----------



## Jmohl (Apr 26, 2011)

The only thing I would do dif, would be that the Red pilot lt. would be output enabled on examine if open from the pump run output energized bit.
There's a million ways to skin any one of these cats, just remember K.I.S.S.


----------



## dronai (Apr 11, 2011)

Jmohl said:


> The only thing I would do dif, would be that the Red pilot lt. would be output enabled on examine if open from the pump run output energized bit.
> There's a million ways to skin any one of these cats, just remember K.I.S.S.


 
Jmohl, I don't know enough to do much, without seeing it first. Could you show me an example in a schematic ?


----------



## Jmohl (Apr 26, 2011)

I can do that tomorrow, no tools of the trade at the house. Just remember to be patient with it and like I said, people do programming different ways. Not that any are wrong, just different.


----------



## industrial951 (Jan 29, 2011)

> There's a million ways to skin any one of these cats, just remember K.I.S.S.


 whats K.I.S.S.?


----------



## dronai (Apr 11, 2011)

industrial951 said:


> whats K.I.S.S.?


 
An old saying, which means, Keep it simple stupid ! 

Having to dig through heaps of material, to figure out, how to set up a simple time delay in the Logic.


----------



## 76nemo (Aug 13, 2008)

dronai said:


> An old saying, which means, Keep it simple stupid !
> 
> Having to dig through heaps of material, to figure out, how to set up a simple time delay in the Logic.


 
Exactly what is stumping you dronai..... you can pull this off with relay logic very simply. Review some notes on paper, draw this out and apply it to the program. FWIW, **** the program if you must, do you have instrumentation guys? If you want to learn PLC programming after years of being hardwired with relays, you're in for new schooling. I've always worked with an instrumentation crew. They can program the chit I could give a flying **** about.

I'm not about to find answers or solutions from a laptop, I'll find it the old fashion way.......and that's just me,...old school.


----------



## Jmohl (Apr 26, 2011)

Nemo, yeah, you can certainly do anything a plc can do with a relay logic system. However, the plc has several advantages, such as smaller equipment, less devices, ease of modification, ease of troubleshooting, and lower power consumption. I have worked in industrial for seven years now and while I don't have encyclopedic plc knowlege and skills, I have learned a lot. As far as schools, there are lots of sources for the training and the cost is pretty fair for some of them. The learning pit has computer based training for AB that is very reasonable and the software emulates the project to show if/how it will work.


----------



## dronai (Apr 11, 2011)

*JLarson*



Jlarson said:


> Remember your phase converter post? Try doing that logic now.


 
This isn't right, but I don't know how to make the TD parallel off of the 0 Rung ?


----------



## Jlarson (Jun 28, 2009)

Where's the phase converter start? The float should start the RPC and enable the timer at the same time.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Where's the phase converter start? The float should start the RPC and enable the timer at the same time.


Here, but I still don't know how to get the branch to come off after the Holding contact.


----------



## dronai (Apr 11, 2011)

*Jlarson*

This maybe ? Or maybe it's time for the Ron Beaufort Boot Camp ! I just want basic things like this, that I can use. Not all that clutter !


----------



## Jlarson (Jun 28, 2009)

Have you gone over timers in the lessons yet?


----------



## MDShunk (Jan 7, 2007)

dronai said:


> This maybe ? Or maybe it's time for the Ron Beaufort Boot Camp ! I just want basic things like this, that I can use. Not all that clutter !


I recommend Ron's class highly.


----------



## Jlarson (Jun 28, 2009)

dronai, take a look at these PDF's 

http://www.canadu.com/lp/pdf/itv-m2.pdf

http://www.canadu.com/lp/pdf/itv-m4.pdf


Hint, I'm looking at a program with 4 rungs (one being end) and no branches.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Have you gone over timers in the lessons yet?


The lessons I received are a joke ! very vague, and all over the place. It says to look at the TON box. I did and it doesn't explain how to use the values ?


----------



## dronai (Apr 11, 2011)

MDShunk said:


> I recommend Ron's class highly.


Thanks, I think I might have to.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> dronai, take a look at these PDF's
> 
> http://www.canadu.com/lp/pdf/itv-m2.pdf
> 
> ...


Thanks, I'll check this out friday. I think I might have this PDF from AB.


----------



## MDShunk (Jan 7, 2007)

dronai said:


> Thanks, I think I might have to.


I took it when 5000 came out, to ease the transition from 500 

I'm looking for a decent structured text class to take, at the moment.


----------



## Jlarson (Jun 28, 2009)

The one on timers should make it clear. I'll give you some hints right now, remove the rung branches and you need to use the timers DN output.


----------



## MDShunk (Jan 7, 2007)

DN output? Weird way to say it. I've normally called that the "done bit".


----------



## Jlarson (Jun 28, 2009)

MDShunk said:


> DN output? Weird way to say it. I've normally called that the "done bit".


Done bit, DN bit, DN output, I probably say it differently every time.


----------



## lefleuron (May 22, 2010)

MDShunk said:


> I took it when 5000 came out, to ease the transition from 500
> 
> I'm looking for a decent structured text class to take, at the moment.


 Structured text, I had one semester and felt I wasted my time and money. Here are a few of the problems:

You cannot trouble shoot using ST. Its not like L.L. where you can visually follow in/outs. You cannot easily find faults in your program.

Nor can you break the program in a "stop" sort of way to check the in/out image tables.

Typing := and, IF, efelse, endif etc. ; gets to be monotonous.
Its only really good for process control, like PID.

And again, no matter the ((explanation)) breaks you give, normal people are not going to T-shoot with this.



They are going to call you at 3 AM.


Function block is at least fun to do, and can be followed by a sharper version of person looking at it with minimal difficulty.

Matter of fact, I took that ST class two years ago, and have yet to use it. Even now its starting to get foggy already.


----------



## lefleuron (May 22, 2010)

Dronai,


500 timers (be it TON or TOF) are going to have three major bits for you to concern yourself with.

EN (enabled) this bit goes true when the timer is actually...well enabled.

TT (timer timing) say you set for 1000 seconds. I believe TT starts at 1 second and remains true to 999 seconds. This could turn on anything you like while the timer is actually accumulating- before it starts, or when it no longer accumulates- the bit is 0.

DN (done) this will be on as long as the timer is finished, and has not been reset.

So typing these addresses, and assuming we are using file #0 here are the three addys you would use.

T4:0.EN
T4:0.TT
T4:0.DN

I do not remember if there is an .ACC you can use with a 500 or not as a LES or GRT

Each of these are off the same timer, just different values or pointers of that timer.

I hope this helps a little, and maybe Mr. Shunk can jumpin and clear up my mistakes. We have been moving from 500 at a brisk pace, and are now going at 5000 and Siemans, and its hard to keep this all in memory at times.


----------



## Jmohl (Apr 26, 2011)

Ok, so lets see if I can help you make sense of this one.... Ok, think of the timer as a output, it goes at the end of the rung. Now, you need something to turn the timer on, a bit or input. Then you can use one of the bits to enable an output. In the case of your diagram, I would use the float switch as an input to the timer. Next, I would use the DN bit (timer done) which would in this case be something like T4:0/DN as examine if closed to turn on the RPC starter output. Now, using the RPC starter examine if closed, turn on the pump starter output. You can use the RPC starter XIC (examine if closed) to lock in across the flow switch, but you should use another input or bit XIO (examine if open) to drop it out. (something like a normally closed low level limit switch...


----------



## dronai (Apr 11, 2011)

Here is Jlarsons Ladder of what needs to happen. Now to convert to ladder logic


----------



## dronai (Apr 11, 2011)

Is this what my ladder should look like ? Has 4 rungs ,three rungs with enabling bits DN, TT, EN


----------



## industrial951 (Jan 29, 2011)

dronai said:


> Here is Jlarsons Ladder of what needs to happen. Now to convert to ladder logic


this is pretty similar on how your program should look, with a few exceptions.:thumbsup:


----------



## dronai (Apr 11, 2011)

*Jlarson*

*I got it* ! Tested good. 

Some things I could improve on. 

1) When the Low Float is enabled, it opens the normaly closed contacts, 
and disables *both* the RPC, and the Well Pump. Is that ok ?
2) When the low float is activated, the holding contact is still enabled ? Even though the contacts are open to the motors.


----------



## Jmohl (Apr 26, 2011)

Looks good, just remember to keep things in sequence and learn the Mnemonics and uses for the dif. types of bits.:thumbsup:


----------



## Mike in Canada (Jun 27, 2010)

Just as an aside, some PLCs don't accept a time base of 1.0 second, so if you might be using different kinds of PLCs then it might be worth your while to standardize on a time base of 0.01 second and get used to thinking in hundredths of seconds (so 500 for five seconds). It might save you some head-scratching later.


----------



## dronai (Apr 11, 2011)

Mike in Canada said:


> Just as an aside, some PLCs don't accept a time base of 1.0 second, so if you might be using different kinds of PLCs then it might be worth your while to standardize on a time base of 0.01 second and get used to thinking in hundredths of seconds (so 500 for five seconds). It might save you some head-scratching later.


Did you ever design that sequencing project you were working on ?

Yes, it's seemed odd at first why the breakdown of the seconds, but I guess some processes require this.


----------



## Frank Mc (Nov 7, 2010)

Hi Dronai

Heres another plc app that i have used for some home projects....

http://cq.cx/ladder.pl

HTH

Frank


----------



## dronai (Apr 11, 2011)

Frank Mc said:


> Hi Dronai
> 
> Heres another plc app that i have used for some home projects....
> 
> ...


 
A whole new set of instructions, and definitions though. 

Did you use it for home automation projects, or just designing ?


----------



## Frank Mc (Nov 7, 2010)

dronai said:


> A whole new set of instructions, and definitions though.
> 
> Did you use it for home automation projects, or just designing ?


Hi 

I used it on my vegie garden irrigation project....

http://s195.photobucket.com/albums/z38/frankmc_2007
/Vegie%20Garden%20Controller/

Also used it on a Point to Point tester i made......
http://s195.photobucket.com/albums/z38/frankmc_2007/PTP TESTER/

Both projects used the same controller board....
http://www.futurlec.com.au/PIC16F877_Controller.jsp

Another project were i have used the plc app was a voltage / current simulator....
http://s195.photobucket.com/albums/z38/frankmc_2007/Current_Simulator/

Frank


----------



## HARRY304E (Sep 15, 2010)

Frank Mc said:


> Hi
> 
> I used it on my vegie garden irrigation project....
> 
> ...


Good stuff frank thanks..:thumbup:


----------



## Jlarson (Jun 28, 2009)

So we're doing two floats now?

For pump up (well filling tank) I'm thinking first rung with an XIC as the high float, an XIC as the low float next and then a branch around the low float with an XIC for the RPC hold contact, then the on delay timer at the end of that rung.

Then the second run is an XIC using the timer's enable bit to turn on the RPC start output. 

Finally the third rung is an XIC using the timer's done bit to do the well starter.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> So we're doing two floats now?
> 
> For pump up (well filling tank) I'm thinking first rung with an XIC as the high float, an XIC as the low float next and then a branch around the low float with an XIC for the RPC hold contact, then the on delay timer at the end of that rung.
> 
> ...


Jlarson, My design is for an actual job I did, but not using PLC. A flood control Well pump, on a private property. Pump 1 was a small sump pump, on it's own float control, and power supply. Pump 2 was a 25hp 3 phase pump (single phase service), that starts when the level gets too high (pump #1 not adequate) Used to *empty the well. *They seem to use 3 float systems, High Low, and alarm.

I will do another one using your fill instructions.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> So we're doing two floats now?
> 
> For pump up (well filling tank) I'm thinking first rung with an XIC as the high float, an XIC as the low float next and then a branch around the low float with an XIC for the RPC hold contact, then the on delay timer at the end of that rung.
> 
> ...


 
* Jlarson's - Note: Shouldn't the High float be XIO ?*
Also, you taught me how to use the EN, as well as the dn. :thumbsup:


----------



## Jlarson (Jun 28, 2009)

dronai said:


> Jlarson, My design is for an actual job I did, but not using PLC. A flood control Well pump, on a private property. Pump 1 was a small sump pump, on it's own float control, and power supply. Pump 2 was a 25hp 3 phase pump (single phase service), that starts when the level gets too high (pump #1 not adequate) Used to *empty the well. *They seem to use 3 float systems, High Low, and alarm.
> 
> I will do another one using your fill instructions.


Ah ok, so you where doing a pump down system. 



dronai said:


> * Jlarson's - Note: Shouldn't the High float be XIO ?*
> Also, you taught me how to use the EN, as well as the dn. :thumbsup:


Typically I use 2 NC floats (closed when down) for wells. So when the tank level drops below the low float they are both closed. In pump up systems I use 2 NO floats.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Ah ok, so you where doing a pump down system.
> 
> 
> 
> Typically I use 2 NC floats (closed when down) for wells. So when the tank level drops below the low float they are both closed. In pump up systems I use 2 NO floats.


 
Still your design is much better, only 2 rungs, and the timer doing two jobs. 

Give me another assignment.


----------



## Jlarson (Jun 28, 2009)

Try a program to alternate between two loads. Time to play with counters.


----------



## Jmohl (Apr 26, 2011)

Learning pit has you do a traffic control system so why not do that? Four lights with R,Y,G lamps. N&S traffic go together, E&W likewise. Walk/no walk signs on E and South crossings with a p/b to request a walk. Prox sensor mats on all four corners. 10 second yellow before green, Red 5seconds before Green on opposing side. Got it?


----------



## dronai (Apr 11, 2011)

Jlarson said:


> Try a program to alternate between two loads. Time to play with counters.


This too, I see with pump stations. Two alternating pumps, They take turns pumping, but not at the same time.


----------



## dronai (Apr 11, 2011)

Jmohl said:


> Learning pit has you do a traffic control system so why not do that? Four lights with R,Y,G lamps. N&S traffic go together, E&W likewise. Walk/no walk signs on E and South crossings with a p/b to request a walk. Prox sensor mats on all four corners. 10 second yellow before green, Red 5seconds before Green on opposing side. Got it?


I saw that, on that site. But can I use my PLC, or do I have to download their simulator software ?


----------



## Jmohl (Apr 26, 2011)

Your software will work for the programming, I don't know if yours has a simulator function or not. Just draw it out on a piece of paper, put the inputs, outputs, then figure it out.... You can do eeeet!


----------



## Jmohl (Apr 26, 2011)

just re-read your post, you have a plc to practice with? No problem... Plc don't care....


----------



## dronai (Apr 11, 2011)

*Counter Project*

I don't know if this is the right idea. It tested and worked fine, but the sequence, 2 motors, 1 starts right away when limit switch starts counter up. When count is compete, it enables Motor #2 Any comments welcome, and thanks to all.


----------



## industrial951 (Jan 29, 2011)

On rung 001 do you want the motor to run only momentarily every time the counter counts up? Or do you want the motor to turn on and stay on after the first count? your gonna need a seal in contact if you want it to stay on, rung 002 your gonna need a seal in contact also, as soon as motor 2 starts it resets your counter as well as resets your counter done bit and will drop out motor 2.


----------



## Jlarson (Jun 28, 2009)

You're getting there with it. You just need to figure out a way to "flip-flop" between which motor to start when the switch closes.


----------



## dronai (Apr 11, 2011)

A drum switch ? Haven't figuered that out yet. How about a simple 3_way ?


----------



## Jlarson (Jun 28, 2009)

dronai said:


> How about a simple 3_way ?


All that's in an alternating relay is a ice cube, the micro controller in there switches it to switch between the loads so yeah pretty much.


----------



## industrial951 (Jan 29, 2011)

I can send you an example of an alternating output program to help get you started and get the ideas flowing.


----------



## dronai (Apr 11, 2011)

Jlarson said:


> All that's in an alternating relay is a ice cube, the micro controller in there switches it to switch between the loads so yeah pretty much.


 *I've never heard about an alternating relay before. :blink:*



industrial951 said:


> I can send you an example of an alternating output program to help get you started and get the ideas flowing.


*I would appreciate it, I have to spend a lot of time online researching. :thumbsup:*


----------



## Jlarson (Jun 28, 2009)

dronai said:


> *I've never heard about an alternating relay before. :blink:*












or the all mechanical version


----------



## dronai (Apr 11, 2011)

So that's how it's done ! I thought maybe it was a combination of logic that could do it. 

Same with a 3-Way switch ?


----------



## dronai (Apr 11, 2011)

*Alternating Pump Schematic*

Need to program this to logic. I found this online

*Flip-Flops* are ok for a 2-pump alternator, but what if you need a 3-pump alternator, or an X-pump alternator?

I would use a counter, then you have generic logic to create an alternator for however many pumps you need. Using a counter also makes it nice for omitting pumps as well.

If counter = 1 and request for lead then pump 1.
If counter = 2 and request for lead then pump 2.
If counter = X and request for lead then pump X.

If counter = X and pump X not available then increment counter.


----------



## Jlarson (Jun 28, 2009)

:thumbsup:


----------



## Jlarson (Jun 28, 2009)

So you figured out how to use basic counters. Did you learn to use reset?


----------



## dronai (Apr 11, 2011)

This was work to find the info


----------

