Replacing PLCs in Industrial Applications with Microcontrollers

RobNevada

Joined Jul 29, 2019
66
Hi Dw,
Great response. I like hearing both sides of the discussion and you had some great points. I agree if you only learn one side of programming and that is ladder logic, C, or any other platform you will feel like a deer in the headlights if asked to move in a direction where you have to hurry up and learn something new. Most of the companies where I have provided my services, I included the software and any custom scripts I wrote. They can always reach me by phone or email and ask questions. I started with a Commodore 64 back in the day and was on the Arpanet to share a little of my background. In other words an old fart. My favorite new sensor is the time of flight board.
 

dwdohm

Joined Mar 8, 2019
16
Actually the first CNC project I did was using the AB 1771 PLC's in the 80's and they had just introduced their 1771-QC (bulletin 1388) servo positioning module. No writing of PID loops etc.
PLC's generally have not been used for CNC due to lack of interpolation for multi-axis.
Fortunately this was a single axis application.
I eventually went with Mitsubishi for both PLC and CNC, (the software was free!).

BTW, I guess Baby Boomers have something against paragraphs!?
Very hard to read.;)
Max.
Max....I'll try to pay more attention to my composition in the future....and perhaps not be so wordy. Good feedback!
David
 

dwdohm

Joined Mar 8, 2019
16
Hi Dw,
Great response. I like hearing both sides of the discussion and you had some great points. I agree if you only learn one side of programming and that is ladder logic, C, or any other platform you will feel like a deer in the headlights if asked to move in a direction where you have to hurry up and learn something new. Most of the companies where I have provided my services, I included the software and any custom scripts I wrote. They can always reach me by phone or email and ask questions. I started with a Commodore 64 back in the day and was on the Arpanet to share a little of my background. In other words an old fart. My favorite new sensor is the time of flight board.
Hey Rob,
Commodore 64! I knew an agricultural engineer in the Salinas, California area who used a VIC-20 as the processor on a field harvester. When I questioned him about maintainability, he pointed out that should the hardware fail, the folks in Yuma could always go down to the local Thrifty drugstore and get a replacement processor (at that time, the closest automation distributor was in Phoenix). Different perspectives, but I appreciate all.
Cheers, David
 

dendad

Joined Feb 20, 2016
4,451
Years ago, here in Oz, there was a pear grader system run from a C64. We had the job of upgrading it using our own custom hardware, but later it was scrapped altogether.
I do think the C64 system was from the USA as it was a 110V system.
 

dwdohm

Joined Mar 8, 2019
16
Hey Rob,
Commodore 64! I knew an agricultural engineer in the Salinas, California area who used a VIC-20 as the processor on a field harvester. When I questioned him about maintainability, he pointed out that should the hardware fail, the folks in Yuma could always go down to the local Thrifty drugstore and get a replacement processor (at that time, the closest automation distributor was in Phoenix). Different perspectives, but I appreciate all.
Cheers, David
Hi Dw,
Great response. I like hearing both sides of the discussion and you had some great points. I agree if you only learn one side of programming and that is ladder logic, C, or any other platform you will feel like a deer in the headlights if asked to move in a direction where you have to hurry up and learn something new. Most of the companies where I have provided my services, I included the software and any custom scripts I wrote. They can always reach me by phone or email and ask questions. I started with a Commodore 64 back in the day and was on the Arpanet to share a little of my background. In other words an old fart. My favorite new sensor is the time of flight board.
Rob, Since you seem very comfortable with Node Red perhaps you might have done an application that implemented a Drum Sequencer. I've looked around for a User Contributed node, and had no luck. My current thought is to roll my own, using an array and counter (essentially how some of the RLL packages seem to do it), but am lazy enough to take advantage of others work. Have you seen such a node in any of the libraries floating around? I'm planning on ditching the messy flow I created for irrigation using discrete timers and one shots, which has become quite ugly with UI buttons to initiate single zones when the whole place doesn't need water. Your Thoughts?
David (aka "DW")
 

RobNevada

Joined Jul 29, 2019
66
Hi David,
There should be Nodes that would fit your needs. If you search Node Red Library you will find hundreds of Nodes. You can also go to YouTube for videos on how to program. I usually use a Raspberry Pi for Node Red (Node Red is loaded when you image the Pi as a resident program) and then I/O to Arduino, other microcontrollers, or make a PCB. Node red also has a very user friendly display that is easy to program and use.
 

dwdohm

Joined Mar 8, 2019
16
Hi David,
There should be Nodes that would fit your needs. If you search Node Red Library you will find hundreds of Nodes. You can also go to YouTube for videos on how to program. I usually use a Raspberry Pi for Node Red (Node Red is loaded when you image the Pi as a resident program) and then I/O to Arduino, other microcontrollers, or make a PCB. Node red also has a very user friendly display that is easy to program and use.
Hi Rob,
I'm aware of some of what you mention in your reply.
I run my home automation system on Raspbian and Node Red with ESP8266 WiFi based wireless I/O nodes programmed in C++ for lighting and irrigation using an MQTT broker and messaging.
Much of what I've done is "purloined" from others, such as Peter Scarghill and "the Swiss guy with the accent" and modified to meet my needs. I simply haven't found, what I considered to be, a straightforward time based drum sequencer node similar to that which exists in RA Logix or Schneider programming environments.
I'll keep combing the User-Contrib Nodes, but thought you might have run across one in your deployments.
Thanks for the Reply,
David
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
Hi David,
I have to admit I don't know exactly what a drum sequencer is. Can you shed some light?
Drum sequencer, at least the ones I am familiar with are just that, a rotating drum that has raised points on it that operate contacts, so when the drum is indexed to the next position, the next sequence/operation is switched.
I believe I have a PLC version somewhere, if I can find it.
Max.
 

dwdohm

Joined Mar 8, 2019
16
Drum sequencer, at least the ones I am familiar with are just that, a rotating drum that has raised points on it that operate contacts, so when the drum is indexed to the next position, the next sequence/operation is switched.
I believe I have a PLC version somewhere, if I can find it.
Max.
Yes, Max's example is what I was describing.
The RSLogix instruction would be "SQO" for an output sequencer (I don't recall the equivalent in CodeSys).
How's that for brevity Max!
Now, the "rest of the story" .... Struthers Dunn and other manufacturers built mechanical drum sequencers that came in two versions, one with a synchronous motor (time driven sequencer) and one with a solenoid that drove a pawl and sprocket that advanced to the next step each time the solenoid was energized (event driven).
These were commonly used for tasks such as regeneration of water softeners and in palletizers.
Both drove a "drum assembly" that had a row of microswitches, each centered over wheels with removable spikes or cams, that could be adjusted to close the corresponding microswitch for one or more segments of rotation of the "drum".
Us saloon goers also enjoyed an earlier implementation ..... player pianos (Hey Miss Kitty, ya' feelin' lonely with Marshal Dillon out of town????).
I'm guessing I'll have to put together a node with an indexed array and timer myself, because I haven't found a user contrib node (and I'm fighting the impulse to pull out an old Micrologix that I used in another house or load CodeSys on a Raspberry Pi because Node Red would be a much more elegant solution).
Cheers,
David
 

RobNevada

Joined Jul 29, 2019
66
Hi David,
The same thing could be done with an Arduino with a small amount of coding. A digitalRead (sensor location)and a digitalWrite would do most of what you are after. You could also write a serial out to a Pi and monitor in Node Red.
 

dwdohm

Joined Mar 8, 2019
16
Hi Rob,
I considered doing the sequencer inside of the ESP8266 that I use as a valve controller. Issue is that I have more than one valve controller (banks of valves are in 3 separate locations).
This would mean that I would have to feed the steps for the other valves controlled by separate ESP8266 boards back to node red to have the logic there for manual override and UI indication.
I'm in the middle of experimentation with LoRa nodes (ESP32 Heltec units) and building and testing antennas to boost the range right now, so I probably won't get back to the irrigation controls until the rain becomes infrequent enough here in the Central Coast of California that I have to start watering again.
I think I may have purchased a "Sprinkler Pi" Hat a few years ago that is stashed in a box somewhere, so I may look into how I might use that as a basis for the irrigation (since I'm hosting Node Red on a Raspberry Pi). Depending on how easy it is to expand the number of valves and route the binary state out to my MQTT broker (directly or via Node Red) to publish the valve state to the remote ESP8266 controllers, this may also be a solution.
Thanks for your suggestions.
I'm off to look at impedance matching of folded dipole driven elements to see what might be the simplest method of fabricating them for use in Yagis.
If you find yourself fussing around with something similar, check out the Nano VNA-F vector network analyzer. One heck of a bargain, and does a real good job (especially when paired with the NanoVNA software package).
Cheers,
David
 

dendad

Joined Feb 20, 2016
4,451
If you go with the Pi, after it is all up and running, make the SD card file system read only. Otherwise the SD card wears out over a time. For instance, my telephone exchange died after about 4 years. That may seem like a long time, but I would have liked it to run for 100 ;)
As you may note. I did not know about the read only file system then.
 

vu2nan

Joined Sep 11, 2014
345
The Programmable Logic Controller or PLC, which was specially developed to cater to the needs of the automobile manufacturing industry, is robust and flexible and has proved itself capable of withstanding the demands of harsh industrial environments. Hence there is no question of it being replaced by microcontrollers.

Fifty years ago, the mainstay of automatic special purpose machine control was hard-wired relay logic which was supported by electro-pneumatic/motorised timers, electromagnetic digit-wheel counters, step selectors, and latched relays.

Special purpose machines had come into being for carrying out reliable, repetitive and sequential machining operations in the mass manufacturing of automobile components.

Then came electronic logic gates, hard-wired gate modules, timers, counters and shift registers followed by basic microprocessor control which did not gain ready acceptance (resistance to change).

The first microprocessor-based PLCs catered only to logic functions using input, output, timer, counter and latch modules. Proficiency in relay logic made 'Ladder Diagram' programming/troubleshooting easy and that enabled the take over of automatic special purpose machine control by PLCs.

Later, introduction of arithmetic and process control functions made the PLC quite versatile. Then came servo control & computer numerical control and the rest is history!

In the test and measurement field the industrial PC rules, with the support of dedicated modules for data acquisition & control, including software, from reputed manufacturers.

Regards,

Nandu.
 
Last edited:

RobNevada

Joined Jul 29, 2019
66
Plc's are microcontrollers. They just use a language of ladder logic which is a graphic user interface which, get ready is written in C and then is converted to machine language. This is one of the main reasons that microcontrollers are quickly taking over industrial applications. Since C is faster then ladder logic as it doesn't need to go through a conversion to get the message to machine language.
 

strantor

Joined Oct 3, 2010
6,782
Plc's are microcontrollers. [...] microcontrollers are quickly taking over industrial applications. [From PLCs? (Implied)]
Am I reading the wrong implication into it, or are you contradicting yourself?

C is faster then ladder logic as it doesn't need to go through a conversion to get the message to machine language.
I'm afraid this is false. Whether C or [the other C, ladder logic- as you described it], or any language, it is converted to machine code before running. In any case this only happens once, so it isnt something that would slow a PLC down.

Plc's are microcontrollers. They just use a language of ladder logic which is a graphic user interface which, get ready is written in C and then is converted to machine language.
That GUI is on the computer, not on the PLC. Still, the functions of the PLC which allow the GUI interface to work, are probably contributing factors toward a PLC being slower than a typical microcontroller (if it is in fact slower, I don't that to be true)
 

MaxHeadRoom

Joined Jul 18, 2013
28,617
Ironically PLC Ladder was originated to take over the old mechanical relay logic used in factory floor control systems and was way slower than any PLC.
I don't see PLC Ladder disappearing any time soon, they are a boon to the shop floor maintenance and imperative in production environments.
There are very few, if any at all, CNC machines that do not posses a PLC to control the general machine functions, the high speed co-processor is reserved for the servo motion control loops.
IOW, the original reason for the PLC's appearance in 1968 is still totally valid today.
Max.
 

Beau Schwabe

Joined Nov 7, 2019
155
Perhaps I missed it in the thread, but the heart of the communication regardless of the higher level language is going to more than likely be MODBUS over RS485, or TCP, etc. You need a backbone communication to the entire system that allows for a multidrop addressable network.

Now that said, if you can understand MODBUS (software layer) and know what the physical layer is (RS485 maybe) then you can program a PIC or any other micro with the correct physical layer interface to communicate with any other device on the network assuming you know the specs on the device you want to communicate with.
 
Top