To start with, this project should probably be called "BASPLC3" because this is my 3rd attempt at building a PLC. Here's a bit of history:
PLC5Sim: This was a software-only simulator for the Allen-Bradley PLC5 family. It included not only an emulator but a GUI (based on Eclipse RCP) for building ladder programs. I learned a lot about the PLC instruction set and architecture doing that project. I got it to the point of implementing 90% of the PLC5 instruction set and it would run ladder programs reliably. It bogged down as I tried to emulate the somewhat complex PLC5 I/O model and modules; there are something like 24 different flavors of processor alone. The whole project was over-complicated because I tried to stick very closely to the PLC5 design. Lesson learned: Keep it simple and build the complexity later. Some portions of this project will likely reappear in BASPLC2.
BASPLC: You can read about that by using the BASPLC category on this blog. This was an attempt to build custom hardware using microcontrollers (MCUs) and related chips. On the plus side, this was a great learning experience: 8-bit MCUs, SPI, I2C, CANbus, and a few other driver chips, not to mention Eagle for developing boards. That latter took me back to my days at CADAM working on one of the very first commercial CAD/CAM systems. What killed that project was a combination of distractions ("Squirrel -- I mean 3D printing!") and over-design (again!) I still had the PLC5 model in my head and that affected how I looked at things. For instance, the idea that any peripheral modules had to be physically separated led to designing a bus protocol based on CANbus that would emulate the protocol used by the PLC5. I also ran into some serious limitations trying to use an 8-bit MCU for the main controller. The lack of floating point was one problem (solved by adding a separate FPU) and the other was limited RAM. Some of the ATmel (now Microchip) MCUs can have outboard memory but that was moving beyond my hardware design skills.
So, after a long break, I'm back with BASPLC2. I hope to avoid the pitfalls of the previous projects; of course, there will be plenty of opportunity for finding new ones! Here are some basic concepts/requirements:
- Use COTS (Commercial Off The Shelf) hardware wherever possible.
- Probably 32-bit MPUs such as AVR from Microchip or ARM from a number of manufacturers;
- Prototype boards with these chips, along the lines of Raspberry Pi or Arduino;
- Standard extension interfaces like the Arduino R3 shield stacking model.
- Simplify the instruction set.
- Start with some basic instructions and leave room for expansion;
- Take a phased approach to implementation.
- Simplify the configuration.
- Avoid the "multiple flavors" that over-complicated PLC5Sim tremendously;
- Use an I/O model closer to the lower-end PLCs on the market; for instance, the MicroLogix series.
I think that's enough to get us started. As I go along, I'll try to apply some of the systems engineering and program management principles that I've been learning as part of my MS program. The trick there is to not over do it on a small personal project. That'll just bog things down even more.