Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PLC vs Microcontrollers.

Status
Not open for further replies.

lord loh.

Member
I am being taught PLC as a part of out course.

However, I am not able to appreciate PLC at all... When we have such low cost microcontrollers, Why on earth do we need PLCs?

I read that PLC programmes are easier.... How?

Why do we need PLCs today? Or are they just a relic from the pre-microprocessor days?
 
PLC's are usually built as complete modules with high voltage I/O Programming may be easier but that would only indicate that PLCS use a higher level language. Mind you modern PLC's are actually micro controllers/processors with a lot of hardware wrapped around them.
 
PLCs grew out of an industrial need to replace hardwired relay logic used in electrical field control panels. They have sense grown to include PID process control and communications of analog and digital inputs and outputs to central control systems and other high level functions.

PLCs requirements include wide temperature environment and rugged industrial reliability. Most were/are programmed using a relay logic symbology on PCs called ladder logic.

So while PLCs are micro controllers, they are a niche part that have very strict reliability and safety features designed into them and will probably remain a small special application of the total micro controllers market. Brand name and reputation is important to the people that use and specify such equipment, Allen Bradly is one major player in the PLC market.

Lefty
 
Hello.

Just found this forum today, and had to register to post in this thread :D

Comparing PLC's and Micro controllers is like comparing apples and oranges.

PLC's Have most of the I/O hardware bolted on, unless you want specific modules like A/D and PI/PID, which just plug in if they are needed.
It provides an unchanging standard platform, where you can train an engineer/technician ONCE to use it and with a bit of ingenuity can find a solution to many problems.

PLC are still in heavy use throughout industry, they are robust, easy to use, even easier to maintain. They never need reset and you don't need to learn any high/Low level languages.
Which is great if your maintainence team are mechanical fitters and electricians.
As there forte is not programming, its getting the job done, and done well, usually under pressure.

With the newer siemens technology's (step 5 and 7) it is much like using Labview.
OEM's like PLC's as the original code can't be tampered with much, and variables are easily edited, I.E. timers, KP's, etc.
Later additions to tools do not require a rewrite of the entire code. A new module is registered and the new code is added, Job done!
And many engineers would rather have a solid state logic controller as they are far more reliable.

For some however the common 24v I/O is a stumbling block, as lower voltage I/O are commonly desirable.

However a quick look through RS/farnell catalogues etc show a plethora of 24V devices.



On the other hand Micro controllers are far more designer friendly. You can pick and choose the :mu:C, the I/O the available memory, secure the code so it can not be downloaded or copied.
However :mu:C's can be a bit temperamental at times.
They are more susceptible to undesired conditions. Vibration, temperature, voltage regulation, or just having an off day.

:mu:C's can also be very compact, as you can leave out any modules that you do not wish to use, or you can design your own.

One of the most important factors of this argument is often ignored.
How the I/O is handled.

In a :mu:C the code is executed line by line, in unfaltering fashion, one clock cycle at a time.
However in a PLC all of the I/O is read in one cycle and loaded into a register. This makes coding PLC's tricky at times and even something as simple as a traffic light sequence, with a pedestrian button can be very confusing if this factor is ignored.
This does have advantages though,an EMO will work instantly on a PLC
However a :mu:C would have to wait until the emergency routine before it could stop the code.

I could ramble on all day about this, but i think that's enough to get started :D
 
You appear to be missing the point?, most modern PLC's are just a pre-programmed micro-controller or micro-processor system. The reason the programming is different is because it's designed to emulate a PLC, which makes it a lot slower than a native micro, but still much more than fast enough - the real world uses for PLC's are pretty slow applications.
 
Pretty slow in normal micro terms would be something like a 10ms loop, but for turbine speed control, compressor anti-surge control, that's quite quick.
Typical cycle times for temperatures would be 1000ms, for pressures and flows anything from 250ms to 500ms.

I'm in the Process Control business, and yes, it true, micro's form the heart of the system, but as n00beR has stated, PLC's and the way it's programmed makes it much easier for non programmers to follow the logic diagrams and debug the code to find a fault.

By the way, most modern PLC's adhere to IEC 61131-3, which makes Ladder logic only one of four ways of programming a PLC.

Most industries will not accept a home-built type micro controller, simply because of the maintenance requirements placed on these controllers. Most industries would simply brand these as BLACK BOXES and hope and pray that they never stop working, else they have problems.
 
lord loh. said:
Can I safely say that PLCs work parallel while the microController works in a sequential manner?

And can Rungs be interchanged in a ladder diagram?

Thanks in advance.

Not exactly. A PLC when it's in the Program Run condition has three states that it cycles through. First is the input scan mode where is reads all it's assigned inputs and updates it ram. Second mode is there is 'resolves' or solves all it's ladder logic equations that the user program defines. Third mode is an output scan where it updates all the output states. The PLC continously cycles through these 3 modes unless stopped by the user via programmer port or some hardware error condition or watchdog timer error, if used and activated.

Not sure what you mean about interchanging in a ladder diagram, but the user defines the desired application logic while in the program mode.

Lefty
 
I think it may be important to differentiate that a plc is the term used to describe an entire system that includes hardware and software. The reality is that plc's actually use some type of microcontroller or microprocessor internally The primary difference is the programming language that is used, often some type of ladder logic, that is simply a high level language that is either interpreted or compiled to machine code.
 
lord loh. said:
Can I safely say that PLCs work parallel while the microController works in a sequential manner?

No, a PLC internal processor, the same as that in your PC, and the PIC all execute one instruction line at a time. A PC CPU obviously does this at a much faster rate than the normal PIC, hence the appearance that code is executed in parallel. In the PLC controllers that I've worked on before (ABB AC450) the internal CPU was the same you got in the older range 486 series PC's. The onboard RAM in a PLC varies from 8Mb to 64Mb depending on how many programming applications you want to run. In the PLC environment you can run multiple PC programs in parallel, but again, it's only the appearance. The CPU only does one line of code at a time, staggering the execution of PC programs, with very long loop delays, (typically 500ms and more) giving a CPU that runs at 400Mhz, about 2.5ns to 10ns? for each instruction. That leaves more than enough time to scan the Input I/O, process the logic, and then update the Output I/O.

lord loh. said:
And can Rungs be interchanged in a ladder diagram?

Thanks in advance.

I have very limited experience with Ladder (only Allan Bradley PLC3 and PLC5 experience). There only one big code block existed. In other PLC environments you will find programming languages such as Function Block, Structure text, Sequential function chart, Status lists and Ladder Logic. We usually only program in Function Blocks and Structure text.

Function blocks gives a very clear and graphical representation of the logic as you code, and structure text is very much like Pascal, C++ etc. type of programming. By using a combination of these two languages we have a very wide range of applications that can be programmed, ranging from drive control blocks, PID closed loop control, Profibus, Can-Bus, Ethernet communication management, Communication management between different PLC supply vendors and much much more.

In conclusion. PLC's are here to stay. Process automation in factories, Power stations, Airplanes, Boats, etc cannot achieve automated control without PLC's and DCS's. Small Micro Controllers are ideal for single applications like washing machines, TV's, Electric Fence controller, Alarm units etc. But for a combination of controllers forming a massive production plant, Micro Controllers will simply be too complicated to commission, debug and maintain.
 
I have a couple of PLCs, made by Comfile Technology. They are no where near as expensive as Allen Bradley, or Siemens, but seem to function as well. They are programmed in ladder logic, and appear to run parallel processes. I didn't find programming them all that interesting; no where near as challenging as a microController. The one sitting in front of me has both an Atmega16 and a PIC 16c712. The other, more powerful one, is sealed in a case so I don't know what is in there.
 
BeeBop said:
I have a couple of PLCs, made by Comfile Technology. They are no where near as expensive as Allen Bradley, or Siemens, but seem to function as well. They are programmed in ladder logic, and appear to run parallel processes. I didn't find programming them all that interesting; no where near as challenging as a microController. The one sitting in front of me has both an Atmega16 and a PIC 16c712. The other, more powerful one, is sealed in a case so I don't know what is in there.

If it has two processors, then it can run two processes at once - but PLC's are such slow devices (which is all they need to be) that any decent micro-controller can easily give the impression of parallel processing - probably better than a Windows PC can?.
 
PLCs are more convenient than microcontrollers and you have the added advantage of it being built into a tough little box that's already been tested. All you do is write the software, connect it up and away you go. Implementing this same system using a microcontroller would involve many phases of protyping, in most cases it's actually cheaper to use a PLC as it saves the design costs.
 
I can say that in the industrial control world PLCs are considered 'fast' devices. Because the input and output scan times are consistant or 'deterministic'

They are favored for applications like anti-surge control on large compressors and steam turbines. Such applications are unsuited for the much slower main Distrubuted Control Systems that handle most of the normal process control applications.

Bottom line is that PLCs are wonderful, reliable and effective solution if applied to the right application. The hardware is considered very cost effective in the industry compared to other solutions. Only complaint I hear about is the high cost and scarcity of good PLC programmers that really understand process control and can develop the code on time and on budget :rolleyes:
 
Last edited:
Leftyretro said:
I can say that in the industrial control world PLCs are considered 'fast' devices.

Like I said, as fast as they need to be, the 'real world' is a relatively slow place - but in processor terms not very fast at all. It's always a bit of a shock using PIC's etc. for robots and mechanical control of any kind, because you find you spend almost all the processors time just wasting time.
 
Nigel Goodwin said:
Like I said, as fast as they need to be, the 'real world' is a relatively slow place - but in processor terms not very fast at all. It's always a bit of a shock using PIC's etc. for robots and mechanical control of any kind, because you find you spend almost all the processors time just wasting time.

Very well put Nigel ;)
 
Like I said, as fast as they need to be, the 'real world' is a relatively slow place - but in processor terms not very fast at all. It's always a bit of a shock using PIC's etc. for robots and mechanical control of any kind, because you find you spend almost all the processors time just wasting time.

Quite true indeed, but I suppose the low cost of a micro-controller should justify this wastage of time, I find that in most industries engineers are reluctant to modify or edit an existing program as there is a danger of the new program having bugs in them, and so causing loss in production.... in such cases it may be easier to design a proprietary system that uses a PIC or any other mcu...
 
People tend to forget what PLC's are designed for?, and it doesn't matter what's inside them - it's essentially a programmable module for 'non-technical' industrial people. It doesn't need to be fast, it doesn't need to be clever, it just needs to do it's job, reliably from day to day, just plodding along.

Really PLC's aren't the sort of things to be discussed on an Electronics forum, because it's not 'really' an electronic component, it's a complete simple computer with limited programming capability.
 
arunb said:
Quite true indeed, but I suppose the low cost of a micro-controller should justify this wastage of time,
I think you'll find that time is money and the amount of money spent on paying an engineer to design, manufacture and test a custom built module will far outweigh the cost of buying a PLC and paying a technician to program it.

I find that in most industries engineers are reluctant to modify or edit an existing program as there is a danger of the new program having bugs in them, and so causing loss in production....
Have you ever programed a PLC before?

I don't have a lot of experiance but I leant to do it at collegfe in a couple of lessons. PLCs are very easy to program, ladder logic is purely graphical, the program looks like a circuit made with relays, switches and timers; understanding and modifying a PLC program is as easy as reading a schematic.

in such cases it may be easier to design a proprietary system that uses a PIC or any other mcu...
No, not most of the time.

I would recommend PLCs in most control applications from traffic lights to conrtoling a plant watering and heating system in your greenhouse. A PLC gives you the confidence that the hardware is properly designed and providing you don't abuse it the most likely error is your programming.

The only time I would say that microcontrollers are more cost effective in control systems is when they're integrated into mass produced items like cars.
 
Hero999 said:
I think you'll find that time is money and the amount of money spent on paying an engineer to design, manufacture and test a custom built module will far outweigh the cost of buying a PLC and paying a technician to program it.


Have you ever programed a PLC before?

I don't have a lot of experiance but I leant to do it at collegfe in a couple of lessons. PLCs are very easy to program, ladder logic is purely graphical, the program looks like a circuit made with relays, switches and timers; understanding and modifying a PLC program is as easy as reading a schematic.


No, not most of the time.

I would recommend PLCs in most control applications from traffic lights to conrtoling a plant watering and heating system in your greenhouse. A PLC gives you the confidence that the hardware is properly designed and providing you don't abuse it the most likely error is your programming.

The only time I would say that microcontrollers are more cost effective in control systems is when they're integrated into mass produced items like cars.

That pretty much nails it. PLCs have been around sense the early 80s and were and still are a darling of the industrial control world, they are not likely to be replaced but rather continue to evolve in their own niche.

My main complaint with PLC systems that I've had to support over the years is the quality of the programming in three main areas:

1. Fault tolerance. Programmers without enough real world field experience seem to assume that external digital inputs and field output devices will never fail and therefore their programs often just stall, waiting forever, for a field condition that isn't going to happen, without any alarm to let anyone know that their program is stuck. A programmer should always ask themselves questions like what should my program do if the feedback contact from the field is broken at this step? It's not hard to add such steps as the PLC has plenty of functions to allow adding testing and timeout features.

2. User interface. Most field PLC installation lack field video displays or keyboard entry hardware. If required, there are usually just field push-button or selector switches and lamps to show the status of the application. Things like not designing a lamp test function for the field box can really confuse the operator needing to determine the status and action he/she needs to take next.

3. My last complaint is the unsuitability of ladder logic for large complex applications. There are other programming languages available to program PLCs but most PLC programmers never advance beyond the standard basic ladder logic language. So while ladder logic can be made to perform very complex application it can be a nightmare for someone who didn't write the original program to try and figure out what the heck they were trying to accomplish at any particular step. Good comments, as in any language, can be a help but with time being money it just doesn't seem to happen enough.

Lefty
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top