Author Topic: Programmable Logic Controller  (Read 841 times)

Offline kvom

  • Full Member
  • *****
  • Posts: 2508
Programmable Logic Controller
« on: November 28, 2020, 12:50:46 PM »
A friend of mine asked for some help in using a PLC to control a machine he has designed and built.  The machine operates in a short cycle (10 secs or so) involving a foot switch, two air operated rams, and a proximity switch.

Using a Click PLC from Automation Direct, I needed to learn "ladder programming", which is totally different from the procedural programming I did for decades.  Luckily there are excellent training videos online.

Looking to try out V1 of the program early next week.

Offline nj111

  • Full Member
  • ****
  • Posts: 133
Re: Programmable Logic Controller
« Reply #1 on: November 28, 2020, 01:19:45 PM »
During the last 20 years I've built some relatively simple machines using PLC's ,often controlling air rams and drill spindles for our industrial requirements.  I mainly used Siemens logo controllers and software. They are cheap to buy and easy to programme, with good simulation from the software.   I've also replaced the odd PLC on complex CNC machines as original replacements were not available. That process I didn't enjoy so much but got the machines working eventually. Have fun!
Nick

Offline Hugh Currin

  • Full Member
  • ****
  • Posts: 631
  • Box Elder, SD, USA
    • www.currin.us
Re: Programmable Logic Controller
« Reply #2 on: November 28, 2020, 03:01:00 PM »
I did a little PLC programming in the lab some time ago. Must have been 10-15 years. The PLCs were from Automation Direct but I don't see that model on their web site anymore. I had trouble getting my head around ladder logic.

I think if I needed one again I'd try to use an Arduino. They use a version of the C language which I find easier than ladder logic. Might be a little more trouble adding I/O, like relays, but quite doable. It looks like the Click PLC has add on modules that would be easy integrate. Also a true PLC may be more robust than an Arduino.

Depending on the situation an Arduino might be a valid substitute, next time. Sounds like you're pretty far into the development now though. Keep us updated.

Thanks.
Hugh

Offline kvom

  • Full Member
  • *****
  • Posts: 2508
Re: Programmable Logic Controller
« Reply #3 on: November 28, 2020, 09:29:32 PM »
For me, the first important idea to understand is that the ladder logic uses 0/1 on off bits to represent input switches, outputs, timer expirations, etc., as well as local states.

The second idea to grasp is that any output controlling bits become active only at the end of each scan by the PLC's CPU.  So the order these outputs are turned on within a scan don't matter as long as the logic is correct.

For the machine I'm working on, I identified that there are 5 consecutive states the machine can be in, and I defined 5 bits for these states.  With proper programming only one of these bits will be set at any one time.  The state transitions are caused by a foot switch, a proximity switch, and 3 different timers.  One cycle of 5 states should take 10 seconds.

Offline Don1966

  • Full Member
  • *****
  • Posts: 6496
  • Morgan City, LA (Along the Gulf Coast)
Re: Programmable Logic Controller
« Reply #4 on: November 29, 2020, 05:08:45 PM »
I have done programming in PLC and smart relays. With the amount of states you listed a smart relay would be the way to go. They have eight inputs and four outputs and expandable. For a little over a hundred dollars. I program them with function blocks.


Regards Don

Offline kvom

  • Full Member
  • *****
  • Posts: 2508
Re: Programmable Logic Controller
« Reply #5 on: November 30, 2020, 01:16:59 PM »
The PLC we're using is also a bit over $100 as well.  It has ethernet connection for programming and a battery backup.  Cheaper ones uses RS232 and cost less than $90.

8 inputs and 8 outputs expandable.  Latest iteration of the machine added a 5th output.