Is a Micro-controller a Practical Replacement for a PLC?
Since AutomationDirect is in the business of making automation hardware, including PLCs in all shapes and sizes, we’ve been watching the development of micro-controllers for some time. Indications are these devices can do all sorts of sophisticated functions, rivaling PLCs, at an extremely low price point. We see evidence of users experimenting with them, launching dozens of discussion posts on our website asking questions like, “Can an Arduino do this,” or, “I’m trying to use a Raspberry Pi to do that.” A recent article in Control Design magazine takes on this very subject.
The author is Doug Reneker, an experienced circuit designer with no prior PLC experience. His objective was to make an Arduino controller perform a typical industrial application using standard industrial hardware and communications. This meant working with equipment outside of an Arduino’s normal capabilities and outside of the normal “maker” world. As the article describes the challenge:
The demonstration equipment uses standard off-the-shelf industrial components: A Rosemount 3051SFP Integral Orifice flowmeter and Fisher Easy-Drive control valve, both provided by Emerson Automation Solutions.
The first step is converting the 4-20 mA signal coming from the flowmeter to 0-5 V, or better, 1-5 V to retain the live zero. This is not an uncommon situation, and converters are available from multiple sources. However, in keeping with the DIY character of the experiment and to keep costs down, I created one from scratch. It was built on an Arduino prototype shield to mount on top of the main board. A simple 250-Ohm resistor converts the 4-20 mA signal to 1-5 V.
As Doug points out, the notion of converting 4-20 mA to 0-5 V and the reverse is fairly common, so the input end of the process is pretty easy for the Arduino, but the output end is much harder. The Arduino’s output is PWM, but there aren’t many industrial actuators able to use this kind of signal, and the required conversion is much more challenging, but Doug figured out how to do it.
Arduino PWM outputs run at 500 Hz. A low-pass filter removes the 500 Hz signal and its harmonics, resulting in a dc signal proportional to the PWM duty cycle. A second-order Sallen-Key active filter was designed with a cutoff frequency of 7 Hz to provide sufficient attenuation of the 500 Hz component. An operational amplifier (op-amp) is used to convert the low-pass filter output to current.
This is a pretty serious effort to make the conversion, and we can’t help but wonder how many Arduino experimenters are up to such a challenge. Of course a PLC, even a model at the low end of the product range, offers a selection of I/O options requiring only simple configuration. With all the choices available, there will certainly be one able to offer the specific needs of the application.
This was Doug’s first Arduino project, and as mentioned he’d never worked with a PLC either. AutomationDirect offered Doug our new BRX PLC, and he took on the challenge of making it run the same application—same flowmeter and valve in the same setup. He got no help from us beyond the resources available to anybody on our website. He could have of course called our award-winning tech support, but he didn’t have to because our training videos and other online information proved to be sufficient. Just as Doug had to figure out how to program the Arduino, he had to figure out how to program our BRX PLC, but this turned out to be much easier.
I came to this project with no prior experience with PLC programming or knowledge of ladder logic, making the comparison with Arduino objective, albeit more challenging than it would have been for an experienced PLC programmer. The PLC has one analog output and one analog input, both configurable for 4-20 mA current loop operation, along with several discrete inputs and outputs. Programming access to the PLC is from an external Windows PC via Ethernet. The first step was downloading and installing the Do-more Designer software on a PC, a free download from www.automationdirect.com.
Left to his own devices and with no help from us, Doug made it work. Both controllers made the loop behave as needed in the application, but he made some important realizations in the process.
Beyond the basic, core level of operation, the PLC offers a wide variety of the common support functions often needed in an industrial application such as limit detection, reporting and data recording. Compared to our Arduino demo, where each function must be written from scratch, this PLC allows the system designer to focus on the application and how it fits into a larger production system, instead of the details of controller hardware and software.
In the real world, much hinges on these critical points. Do you want to spend your time and effort experimenting and effectively re-inventing the wheel, or would you prefer using tested and proven industrial automation products and concentrating on the application instead of the controller?
To learn more about programmable control, click here.