One of the main learning goals of this project was to understand and practice control panel design and assembly. This learning goal, in addition to the desire to house our components effectively and make troubleshooting easier, led us to design and build a control panel for our workcell.Â
Our first step was to list out all our components and figure out where things should go. We had no idea how control panels were typically laid out, so we had to do a lot of reading and researching here. We eventually ended up with this rough design.
Rough draft of our control panel design (assuming a 12"x12" panel). The light gray strips underneath the components represent DIN rails.
We then developed an electrical schematic based on this rough design. In the process of making this schematic, we realized several things. First of all, we didn't need to include as many terminal blocks as we had initially planned for, which gave us more space to work with on the upper DIN rail. We also realized that we had a LOT of power and ground wires, and we would need some method of power distribution to manage all of them. Given the limited amount of space in our panel and our limited budget, this method needed to be cheap and have a small space footprint. Based on these parameters, we decided that using stripboard (which we would attach to the perfboard) to build power rails was our best option. Based on these findings (and the fact that we found a relatively cheap 16"x12" enclosure on Amazon), we redesigned our control panel to the final design below. At this point, we also decided that integrating a Raspberry Pi into the control panel (instead of using a laptop) would be good in a future iteration of this system, and our final design reflects this.
Our final electrical schematic. We designed this assuming a Raspberry Pi would not be used.
Our final control panel design
Once our design was finalized, we ordered all the remaining parts and started putting it together. In order to make mounting our components to the DIN rails simpler, we bought multipurpose DIN rail mounts and designed/3D printed adapter plates for the necessary components. We also had to take the breadboard circuits we had and convert them over to perfboard, which was a long and time-consuming process (especially because we are pretty inexperienced when it comes to soldering.
A mockup of our control panel we used to validate our design
Laying out the arduino input and relay output circuits
Our soldering setup
We then installed and wired all of our components (which went surprisingly smoothly) and tested every individual module to ensure they worked.
Testing the vise and tormach-PLC interface subsystems
Before this project, my experience with PLCs was limited to a little bit of OpenPLC (a software that lets you emulate a PLC on an Arduino) and messing around with an RSLogix 5000 clone. As a result, I spent some time upfront to learn and practice ladder logic more effectively. The primary resources I used were SolisPLC, which was helpful for learning programming more generally, and Phillip Wade's CLICK PLC playlist, which was nice to get CLICK-specific programming tips.
In the earlier stages of the project, most of the PLC programming I did was writing very short programs for testing individual modules. Most of these programs were pretty trivial but were good practice with applying ladder logic to actual real-world scenarios. The program below was used to test the vise and Tormach communication systems together.
A program I wrote to test the workcell before the robot was integrated
The PLC code for the full workcell was slightly more complicated. The general process flow in the workcell is as follows:
Pressing the start button turns on the status light and starts a 5-second timer.
At the end of the timer, the PLC will then command the robot to load a part into the vise. Once the robot is finished loading, it will flip the load_DN relay on the relay module to high.
Once the robot is done loading, the vise will close, and the PLC will command the Tormach to start.
Once the Tormach is done running, it will momentarily flip the tormach_DN relay (using the custom M-Codes discussed in the Tormach-PLC interface section). The vise will then open, and the PLC will then command the robot to unload the finished part.
Once the robot is finished unloading, it will flip the unload_DN relay to high. The PLC will read this and then set the machine status to off.
The PLC code for running a single part through the workcell