Stepping out onto just about any factory floor you’ll find complex automatons building anything and everything imaginable. These machines need to be controlled somehow and before the age of computers these manufacturing robots were controlled with relays wired together to produce a multitude of actions. Relays, no matter how reliable and bulletproof the are, can’t be programmed without rewiring the entire machine. Now, factories have programmable logic controllers to take care of their automation tasks.
[Thiago] built his own programmable logic controller and released it as open hardware.Included in the OpenPLC are four 24V inputs, four 24V outputs (two with PWM), 0-10V analog inputs, and USB, SPI, and I2C for programming and expansion.
If you’re building anything from an industrial machine in your garage, or simply want really awesome Halloween (or Christmas) decorations, the OpenPLC can take care of driving all the solenoids, motors, and actuators needed. With the extendable I2C and SPI busses, it’s possible to add a plethora of sensors to bring a project to life.
The OpenPLC is based on an ATMega328 and is compatible with Arduino code. There are a few extension boards for digital and analog IO, as well as Ethernet.
Design looks good. Here’s a comment on the low-power +12 generator (a 10K voltage divider) won’t hold that voltage when Q1 and Q2 are on. its going to drop to ~5.5V, shouldn’t be a problem. you might want relabel ‘+12 generator’ to something like ‘output transistor biasing’.
In your output circuits 1 and 4, you could eliminate the inverters and Q1 and Q2 altogether (you’re doing double inversion). Having them in the circuit is a good thing so you can drive the opto coupler harder (required for fast PWM). If you have issues with PWM speed, increase the drive current, the opto-coupler current transfer gain is less than 1.
Keep going.
At 24v, those regulators are probably only good for a few mA.
How is this ANY different than an Arduino?
The OpenPLC is based on an ATMega328 and is compatible with Arduino code.
It has 24v inputs and outputs
● 4 Protected 24V Digital Inputs
● 4 Protected 24V Digital Outputs
Only 4 though. Just use a 4P relay or 4 1P relays.
I see the 1 – 10v pins and all but this really isn’t anything other than a poorer version of a Ruggeduino. Which lets you use every pin and feed it 24v.
PLCs are programmed using ladder logic… Industrial applications require systems that are proven robust, and I can tell immediately that this does not meet that criteria.
Not all PLC’s are (only) programmed in Ladder, most can also be programmed in their own language (that typically has more features, or at least allows you to do the same thing with less effort)
The Ruggedurino is only overvoltage tolerant. This project here is designed to actively interface with 10V and 24V signals via optocouplers and driving circuitry.
If this had the same voltage protections and such but also integrated optical isolation and 10v to 5v scaling and 4 to 20 ma to 5v scaling on every pin, we would really have something.
This is a good start but needs a lot more work to be truly useful.
More than just over voltage tolerant.
Power In
The Ruggeduino is powered from one of three sources:
USB port: 5V is provided directly from the USB port. A 500mA PTC (resettable fuse) protects the computer from overcurrent.
DC power jack: a 2.1mm center-positive DC power adapter can supply 7V – 24V. This power input is also protected by a 500mA PTC (only on the Ruggeduino!)
Vin: this connector pin can either source power to the Ruggeduino (7V-24V) or draw power from the DC power jack.
When more than one power source is present, the automatic power switching circuit selects external power (DC power jack or Vin, whichever is higher) when available, otherwise USB power is used. This behavior is the same as the Arduino UNO.
Power Out
The Ruggeduino can supply power to shields or external circuits in three ways:
+5V output: the +5V connector pin is the same voltage seen by the microcontroller. The current from this output is naturally limited by thermal protection on the on-board 5V regulator when externally powered, or limited to 500mA by a resettable fuse when USB-powered.
This +5V output can typically source 500mA when the DC power jack voltage (Vext) is 9V or less, and less current as Vext increases due to thermal loading on the 5V regulator.
On the Ruggeduino, the +5V output is protected against applied high voltage. If, for example, you apply 24V to this pin by mistake, the Ruggeduino will not be damaged. If you do the same thing on an Arduino UNO, you will destroy it!
+3.3V output: the +3.3V connector pin sources 350 mA (Vext is 9V or less). Note that this is quite a bit more than the 50mA limit of the Arduino UNO.
As with the +5V output, the +3.3V output is protected against applied high voltage; if you apply 24V to this pin by mistake, the Ruggeduino will not be damaged.
Vin: the Vin connector pin can draw power from the DC power jack. This power output is limited to 500mA by a PTC (resettable) fuse. The 500mA PTC fuse protects this output against conditions like short circuits to GND (which would damage an Arduino UNO).
Parameter
Arduino UNO SMD
Ruggeduino
Main microcontroller
ATmega328P SMD
ATmega328P SMD
Main microcontroller frequency
16 MHz (resonator)
16 MHz (crystal: 0.005% accuracy)
USB microcontroller
ATmega16U2
ATmega16U2
USB microcontroller frequency
16 MHz (crystal)
16 MHz (crystal)
Main microcontroller bootloader
Optiboot
Optiboot
USB microcontroller bootloader
LUFA DFU/serial
LUFA DFU/serial
Allowable external input voltage
7V to 12V
7V to 24V
3.3V output current
50mA
350 mA
USB/Vext power switching
Automatic
Automatic
I/O pin current protection
None
30 mA resettable fuse on every I/O pin
I/O pin voltage protection
None
withstands 24V applied voltage
Total microcontroller current protection
None
protected to 150 mA
5V output pin protection
None
withstands 24V applied voltage
3.3V output pin protection
None
withstands 24V applied voltage
USB current protection
500mA resettable fuse
500mA resettable fuse
Vin reverse voltage protection
None
protected up to 30V
Vin current protection
None
500mA resettable fuse
Is it just me or can anyone find the firmware/software for this?
There is a source svn link that just results in an empty folder…
Maybe I won’t stop working on my PC based ladder logic software. (linux has a modbus library)
I suspect you just use the stock arduino firmware (probably the uno)
It’s true (as of 10/28/12) that the svn download is an empty folder. You’ll need to try the “Downloads” menu instead.
Welcome to hackaday. This is a PLC in the same sense that something that plots the input on a microcontroller’s A/D input is an “oscilloscope”.
LOL! Made my day
i cant find the software for it.i presume it does ladder logic. ldmicro is one i used in the past anyway
Have been working with PLCs in industry automation applications since the late 80s so I have now about 25 years of experience.
A few strange things that sticks out.
1) Transistor outputs are normally source outputs (meaning they provide 24V to the load). Here we see sink outputs (meaning the pull the load down to 0V).
2) Relay outputs. This is normally not used in PLCs because you want to be able to replace the relays when they break so you always put them outside the plc. So basically have source outputs in the PLC and let them drive 24V relays outside of the plc (in sockets).
In the design the 10K resistor on the digital inputs is a bit too large. Select the resistor so that you have around 7mA of current @ 24V. That will give you better noise immunity on the input for instance when hooking up a push button.
In general both the digital output and input circuitry needs some work. For instance the 74HC04 inverter can be left out or perhaps even replaced with a schmitt trigger inverter like the 74HC14 instead so you get a cleaner input signal.
I can’t say much about the actual design here, but I really, really hope somebody comes up with a an honest-to-FSM Open Hardware PLC.
That said, I don’t know why people are obsessed with ladder logic. I’ve only worked with one industrial PLC, but it certainly didn’t use LL.
I know this is an old post- but I know I refer to these for info later, so here is a little info on PLCs. Ladder logic is not an “obsession” it is an automation industry standard that evolved from relay logic- back when relays, cam timers, and the like were the “program” hard wired into the circuit. “ladder” logic diagrams led to the ladder language that was familiar to controls engineers. It evolved out of the automation and manufacturing industries, in large part along with the automation of automobile production. Industrial PLCs now use a family of international standard languages referred to by IEC-61131-6. One of them is a structured text language with pascal roots, as well as ladder, function block, sequential function chart, statement list, and continuous function chart. If you used an industrial PLC it used one of those- or it was not likely a PLC but an industrial “PC” running some other hopefully real time operating system. PLCs are dedicated to automation tasks and must be deterministic- that is you can not wait around like you do with Windows for the OS to do something whenever it gets around to it. It must happen predictably in real time.
Perhaps the ladder fanatics have seen only ladder logic plc boxen. As you step in controller performance different control languages replace ladder logic. Most of them are semigraphical descriptions of boolean logic or fuzzy logic with the occasional flowchart thrown in. Some are truly graphical and some have word languages.
Ladder logic doesn’t go very far in high performance control situations and complex mathematical algorithms such as FFT are pretty hard to describe in ladder.
Again- I know these are old, however PLCs are an important technology, and the comments here are obviously by people that know zero about them- or industrial automation in general. take a look a the IEC 61131-6 languages that include ladder among others. Any “high performance” control system must be deterministic and real time- most control applications do not involve FFT. Ladder is actually very good in the right applications, and you use another language or mix when it is not, If you are interested in automation, you had better actually learn about them.
I think a true PLC replica would have a 4-20 in AND out. And a least one of each
So, in spite that PLC is used in the article.
What PLC source is available for the AVR/PIC ?
I did find ldmicro as suggested, are there any others ?
Thanks
don
what’s up with open plc soft ?! there is no Settings in menu so there is no way to select mcu target ?! is there any difference between open plc and ld micro, except that ?
Mile, the OpenPLC Ladder is a modified version of the ldmicro to generate code specifically for the OpenPLC hardware. You can have more information at the project’s new website: http://www.openplcproject.com