OpenPLC is Ready for Hacking

It’s been nearly four years since we covered [Thiago]’s OpenPLC project. He never stopped working on it, and now it’s in a highly polished state.

If you read our initial coverage of this project, it would be easy to assume that he just wanted to control some halloween decorations. He is actually a PhD student at the University of Alabama in Huntsville. His research topic is SCADA (aka Industrial Control Systems) cyber security. His goal was to find vulnerabilities in PLCs and, hopefully, fix them. However, no PLC manufacturer releases their source code, and he was having trouble getting a deep understanding of something so closed.

So, since no one was going to open their code and hardware for him he simply made his own. OpenPLC can be programmed in all 5 IEC 61131-3 languages: ST, IL, LADDER, FBD and SFC. On top of that, it lowers the barrier of entry to developing this kind of industrial hardware by being compatible with all the favorites Arduino, Raspberry Pi, Windows, Linux, etc.

“The OpenPLC is the first fully functional standardized open source PLC. We believe that opening the black-box of a PLC will create opportunities for people to study its concepts, create new technologies and share resources.”

Pong on Industrial Controllers

Programmable Logic Controllers (PLCs) are a staple of control automation. Sometime in the 60s or 70s, they replaced a box full of relays to implement the kind of “if-this-then-that” logic that turns thermostats on or directs machinery. Sometime in the 90s or 2000s, some more computing power was added, giving us the Programmable Automation Controller (PAC). And if reading Hackaday has taught us anything, it’s that if you give people a little bit of computing power, they’ll implement Pong (or Snake or Doom!).

We were sent a link where [AbsolutelyAutomation] does just that: implements a remotely-playable Pong on a bit of industrial control. Even if you don’t have a PAC sitting around, the details are interesting.

The first step is to get graphics out of the thing. The PAC in question is already able to speak Ethernet, so it’s “just” a matter of sending the right packets. Perhaps the simplest way to go is to implement the remote framebuffer (RFB) protocol from VNC, and then use a VNC client on the PC to send the graphics. (As they point out [CNLohr] has done this quite nicely on the ESP8266 (YouTube) as well.) So an RFB library was written. [AbsolutelyAutomation] points out that this could be used to make boring things like user-friendly configuration and monitoring screens. (Yawn!)

Graphics done, it’s easy to add a Pong layer over the top, using the flowchart-based programming interface that makes homage to the PLC/PAC’s usual function as an industrial controller. (Oddly enough, it seems to compile to a Forth dialect to run on the PAC.) And then you’re playing. There’s code and a (PDF) writeup available if you want more info. If you don’t have a PAC to run it on, the manufacturers have a simulator for you.

We’ve never worked with a PLC/PAC, but we know the hacker spirit when we see it. And making something that’s usually located in the boiler room play video games is aces in our book. This sparks a memory of an industrial control hacking room at DEF CON a few years back. Maybe this is the inspiration needed to spend some time in that venue this year.

We know we’ve got controls engineers out there. What’s the strangest thing you’ve programmed into a PLC?

Reading Smart Cards from a PLC (with a Little Arduino Help)

If you’ve spent any time on a factory or plant floor, it is a good bet you’ve run into PLCs (Programmable Logic Controllers). These are rugged computers that do simple control and monitoring functions, usually using ladder logic to set their programs. [plc4u] wanted to connect a smart card reader to an Allen Bradley PLC, so he turned to an Arduino to act as a go-between.

The Arduino talks to a USB card reader using a USB host shield. Then it communicates with the PLC using an RS232 link and the DF1 protocol that most Allen Bradley PLCs understand. You may not need a smart card, but once you know how to communicate between an Arduino and the PLC, you could do many different projects that leverage other I/O devices and code available on the Arduino and connects to existing PLC installations. Just remember that you’ll probably need to ruggedize the Arduino a bit to survive and be safe to the same level as a PLC (which might include a NEMA enclosure or even an explosion-proof box).

Continue reading “Reading Smart Cards from a PLC (with a Little Arduino Help)”

Hackaday Links: November 15, 2015

There are a surprising number of Raspberry Pis being used in industrial equipment. This means the Arduino is left behind, but no longer. There’s your PLCs that use Arduinos.

A few weeks ago, Google introduced a machine intelligence and computer vision technique that made the world look psychedelic. Now, this library is available. On another note, head mounted displays exist, and a sufficiently creative person could mash these two things together into a very, very cool project.

Welcome to Kickstarter! Kickstarter is an uphill battle. People will doubt you because you don’t have a ‘target audience’ or ‘the rights to this franchise’ or ‘any talent whatsoever’, but that’s what crowdfunding is for!

Several years ago, Apple shipped a few million 17″ iMacs with defective displays. They’re still useful computers, though, especially if you can find a replacement LCD. Apple, in all its wisdom, used a weird connector for this LCD. Here’s the adapter board, and this adapter will allow displays running up to 1920×1200.

[Jan] has earned a reputation of building some very cool synths out of single ARM chips. His previous build was a Drumulator and now he’s shrinkified it. He’s put four drum sounds, pitch CV, and audio out on an 8-pin DIP ARM.

YouTube gives you cadmium! [AvE], recently got 100,000 subscribers on his YouTube channel. Apparently, YouTube sends you a terrible belt buckle when you manage to do that. At least he did it without playing video games and screaming.

Custom PLCs for Automation Industries

For many years, factories have used PLCs for automated control over industrial equipment. These systems are usually expensive, proprietary, and generally incapable of being reprogrammed. [Oliver], an engineering student in Ireland created a system for factories to develop their own application-specific PLCs as a final project for Automation Engineering.

In-house PLC creation has many benefits for manufacturers, not the least of which is the opportunity for customization. Making your own PLCs also means no licensing fees and total control over equipment automation. This system is a complete setup including an HMI interface with touchscreen input and a SCADA system for remotely controlling various pieces equipment of equipment from a laptop.

[Oliver] built a metal frame out of industrial-grade strut channel to house an XP machine, two monitors, and the beautifully breadboarded PLC design station. It’s based around a PIC16F887 and includes rugged features expected of a system that never goes into sleep mode, like eight channels of opto-isolation. [Oliver] also developed an environment for engineers to easily program their custom PLCs through a simple HMI interface and ladder logic.

800 inches per minute at 0.00025″ Resolution

The folks over at PONTECH have just released a pretty impressive opensource PIC32 library for controlling a linear slide at speeds of 800 inches per minute!

PONTECH makes the Quick240 (Quick Universal Industrial Control Kard) which is based on the open source chipKIT platform. It was designed for industrial automation systems, where typically a ladder logic PLC might be used. The benefits to using a system like this is that because it is open, you are no longer stuck with proprietary hardware, and it is much more flexible to allow you to “do your own thing”. Did we mention it is also Arduino compatible?

Using this system they’ve successfully controlled two 8″ Velox slides at a whopping 800 inches per minute with a resolution of 0.00025″ — just take a look at the following video to appreciate how freaking fast that is.

Continue reading “800 inches per minute at 0.00025″ Resolution”

Festo Creates Bionic Kangaroo; Steve Austin Unimpressed

 

festo-roo

[Dr. Wilfried Stoll] and a team at Festo have created an incredible robot kangaroo. Every few years the research teams at Festo release an amazing animal inspired robot. We last covered their smartbird. This year, they’ve created BionicKangaroo (pdf link). While The Six Million Dollar Man might suggest otherwise, Bionics is use of biological systems in engineering design. In this case, Festo’s engineers spent two years studying the jumping behavior of kangaroos as they perfected their creation.

Kangaroos have some amazing evolutionary adaptations for jumping. Their powerful Achilles tendon stores energy upon landing. This allows the kangaroo to increase its speed with each successive jump. The kangaroo’s tail is essential for balancing the animal as it leaps through the air. The Festo team used a thick rubber band to replicate the action of the tendons. The tail is controlled by electric servomotors.

Festo is known for their pneumatic components, so it’s no surprise that the kangaroo’s legs are driven by pneumatic cylinders. Pneumatics need an air supply though, so the team created two versions of the kangaroo. The first uses an on-board air compressor. The second uses a high-pressure storage tank to drive the kangaroo’s legs. An off the shelf Programmable Logic Controller (PLC) acts as BionicKangaroo’s brain. The PLC monitors balance while controlling the pneumatic leg cylinders and electric tail motors. Unfortunately, BionicKangaroo isn’t completely autonomous. The Thalmic Labs Myo makes a cameo appearance in the video. The Kangaroo’s human controller commands the robot with simple arm movements.

While the BionicKangaroo is graceful in its jumps, it still needs a bit of help when turning and taking simple steps. Thankfully we don’t think it will be boxing anytime soon.

Continue reading “Festo Creates Bionic Kangaroo; Steve Austin Unimpressed”