Author Topic: Learning to use a PLC (Programmable Logic Controller)  (Read 5811 times)

Offline Bobo

  • Survivor
  • ***
  • Posts: 104
  • Karma: 4
Learning to use a PLC (Programmable Logic Controller)
« on: July 19, 2012, 07:54:34 PM »
So, I've decided that I'm going to learn how to program a PLC. I think it could be really useful for everything from automatic control of a water tank levels, air conditioners, watering systems, rabbit feeders, chicken feeders, heater control systems, electrical power control systems, intruder systems, ect... pretty much anything that I might have to do over and over again, I want to automate.

My format of choice will be the MicroLogix 1000 from allen bradley. The controllers are around 75-250 each, the software is free, and the programming cord is about 50 dollars.

Does anyone have any ladder logic code written which can help me understand how to do this better? Has anyone else done this on their homestead?

Offline reefmarker

  • Survivalist Mentor
  • *****
  • Posts: 486
  • Karma: 24
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #1 on: July 20, 2012, 10:40:00 PM »
Yikes!  While I agree a PLC can be used to do lots of usefull things, Allen-Bradley and inexpensive are two mutually exclusive things!

I don't know the layout of the MicroLogix but usually the controller is inexpensive compared to everything else you have to drop onto it to make it do something usefull.  Digital ins and outs and analog ins and outs can add many $100's of more expense to the project.  I have been involved as the specifier and end user of lots of PLC's from allen bradley that we use for motion control, and they are very robust, but they are not the worlds most friendly products.  The level of "free" help from AB is really close to zero.

From what you are talking about, you may want to look at the numerous house controllers that are out on the market now.  They are not cheap (well they are compared to AB), but they are made for doing exactly what you want and they are easy to use.

Sorry to be a wet blanket about this.  If you do get into PLCs the hardest thing most people have trouble grasping is everything happens at the exact same time.  The first line of the ladder logic is not executed before the last line it all happens at once, just like if it was a bunch of relays all wired together (which is what is simulating).

Offline Bobo

  • Survivor
  • ***
  • Posts: 104
  • Karma: 4
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #2 on: July 22, 2012, 02:26:43 PM »
Do you have a recommendation on which pre-made house controller is more preferred and why?

Offline JC2

  • Senior Survivalist
  • ****
  • Posts: 221
  • Karma: 14
    • Harvesting Grace Farm
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #3 on: July 25, 2012, 01:07:02 AM »
Ive been watching this thread and wondering how much input you would get. I do find this very interesting because there are alot of things that could be automated. I did buy an automatic door opener (from McMurray) for the chicken coop, and that is but one example of automation to make your life a bit easier. With a basic stamp that could be done for for a lot less than what i paid for it. Of course that takes basic knowledge of programming.
I use to go all out for halloween and started getting into the basic stamp and logic controllers, but it has been awhile. I would suggest visiting a few halloween forum sites and look at their props (automated not static)  section as alot of individual use the automation and can help getting you some basic commands for programming.
Im sure this sounds alittle on the odd side (visiting a hallowreen forum for homesteading ideas), just concentrate on the mechanics behind the prop and see how it wrould apply to what you are doing.
I.E at a haunted house you step on a mat and something jumps out at you - translate that to stepping on a mat or waving your hand in front of a sensor and your gate to the barn opens automatically for you. The cost would be about 30 bucks.
Currently i am overseas but when i get home, adding automation to my farm is something i will do.

Offline Bobo

  • Survivor
  • ***
  • Posts: 104
  • Karma: 4
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #4 on: July 25, 2012, 08:36:49 AM »
Totally a great idea. I'm an electrical engineer, so building basic circuits which work on 24VDC relays is a piece of cake. Most of my parts for circuits I source from www.taydaelectronics.com which has awesome prices, cheap shipping and no tax.

I think as time goes on, I'll start to post what I've done with PLC for the community and hopefully get some good constructive feedback!

Offline Bradbn4

  • Dedicated Contributor
  • ******
  • Posts: 1242
  • Karma: 38
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #5 on: July 25, 2012, 08:44:52 AM »
For folks looking for some hardware / software development tools in this area  - might be worth looking at http://melabs.com/

Another interesting site is http://www.sparkfun.com/categories/103/?page=all  the arduino kit style can be easy to plug and play into some really complex stuff.

However; if folks want nothing more than a timer and a way to control an on/off switch - I figure it might be easier to hack a low voltage relay along with a simple timer.  Heck, they have those for sale at Lowes / Home Depot as water control valves.





Offline Jeremy Downing

  • Senior Survivalist
  • ****
  • Posts: 208
  • Karma: 3
  • Poodle loving prepper
    • Jeremy Downing's Blog
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #6 on: July 25, 2012, 11:55:11 AM »
You can use a Microchip microcontroller to likely do any controls for anything you need.  Laying a board out for one of those parts is certainly within the realm of an EE to do.  You can get them prototyped for a reasonable price and use them to control almost anything.  Try the dsPIC 33f parts for big complicated stuff or rest on the old but good 16f or 18f parts.  You don't have to use Microchip of course, its just what I've fiddled with at work.  We also have TI micros, which are ARM-based.  My future aquaponics install may be automated with such microcontrollers.  ;)

Offline jetta2337

  • Senior Survivalist
  • ****
  • Posts: 246
  • Karma: 3
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #7 on: July 25, 2012, 12:00:47 PM »
I am a PLC programer for my job and work with AB PLC and micro's. I could help you with the code easy. I have taken old micros that have a bad point in and taken them home to do things with. Nothing major just sprinkler systems and such but you could use the PLC's to quite a bit. One buddy of mine has his house wired to where he can control everything on his phone down to setting the stove temp and time.

Offline JC2

  • Senior Survivalist
  • ****
  • Posts: 221
  • Karma: 14
    • Harvesting Grace Farm
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #8 on: July 25, 2012, 11:11:32 PM »
Since you're an electrical engineer, hopefully you know a mechanical engineer.
The PLC and micro's may be the brains but somehow automation needs to be put in motion. I use to scan ebay for things like solenoid actuators, hydraulic cylinders, linkages, etc.
Most people that are on the halloween forums do a lot of hacking of other products and they also look for cheaper solution, i.e. instead of a hydraulic cylinder they would use old storm door closers. For me half the fun was the designing phase.
Of course somethings are already out there on the cheap - an old deer feeder can become a chicken feeder. Definetly a lot easier then redesigning a new system but still adds some automation to make things easier for you:)

Offline pawonfire

  • Prepper
  • **
  • Posts: 34
  • Karma: 2
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #9 on: July 26, 2012, 12:27:43 PM »
So this is pretty much my day job, programming PLCs and microcontrollers.  I would definitely recommend a PLC for this over a PIC, aurduino, or something similar.  Reefmaker is close when he mentioned "everything happens at the exact same time".  It actually only appears this way from the outside, down to a very small period of time.  (I can go into it much further if you want!)

For the hardware, ebay is a great place to shop for some stuff.  For new, I feel AB is very expensive, and hard to get any support out of.  I know, I have to use them on almost all of my machines.  You should check out the stuff from automation direct.  Their click series is $69 for a small amount of I/O, the software is free and not crippled, and the cable is $14.  You can easily add on from there.  Also, their manuals are much, much better for beginners.

Last bit of advice here is if you use a digital I/O module controlling a solenoid, relay, or other coil, you need to use a snubber diode.  Go google it.  If not, your output will eventually fail.

Good luck, let us know if you have any more questions!

Offline hillclimber

  • Dedicated Contributor
  • ******
  • Posts: 1093
  • Karma: 28
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #10 on: July 27, 2012, 03:05:09 PM »
Our sawmill, planer mill, dry kilns, boiler all run on PLC stuff. It works pretty good, right up until it doesn't work at all.  :o  One good thunderstorm is all it takes sometimes. I take care of the mechanical stuff and let someone else run around with a laptop.
We have one guy that really good at PLC code, and a couple of guys that try and keep up.
It has cut way back on the number of people it takes to run the mill.
We have a pretty wide range of stuff, but alot of it is Allen+Bradley.

Offline scubasteve4sq

  • Prepper
  • **
  • Posts: 13
  • Karma: 0
  • New TSP Forum member
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #11 on: August 01, 2012, 08:28:37 AM »
Smartflix.com has a great DVD how to course you can rent. Also, check your local community college
 Lots of industrial and manufacturing plants send their mechanics to 40 hour courses paid for by government grants.

Offline Bobo

  • Survivor
  • ***
  • Posts: 104
  • Karma: 4
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #12 on: August 18, 2012, 09:17:41 AM »
thanks everyone for all the really great input! If I run across a programming challenge, I'll post it in the forums to all the PLC/ladder logic guru's in our community!

Offline Special K

  • Survivor
  • ***
  • Posts: 198
  • Karma: 23
  • Confused...Mostley...I think...
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #13 on: August 18, 2012, 11:20:33 AM »
As an alternative to A/B you might want to check out Automation Direct at http://www.automationdirect.com/adc/Home/Home We've cut our cost in half on the machinery we build by dumping A/B (plc's and sensors) and Turck and Banner (sensors) and using Automation Direct almost exclusively. And don't forget sensors. Without external feedback and well thought out input control most plc applications are pretty limited.

Offline flunsmagnify

  • Fledgling Prepper
  • *
  • Posts: 1
  • Karma: 0
  • New TSP Forum member
Re: Learning to use a PLC (Programmable Logic Controller)
« Reply #14 on: February 13, 2019, 01:31:29 PM »