Category: CNC Machines
Hi there,
I implemented an DIY Arduino a few weeks back into my automatic injection molding machine. So cool to see that topic popping up again!
For the background, I have two CNC machines running on LinuxCNC as well and I am familiar with some Arduino-Coding too.
In the beginning I evaluated the exact same question as you here and went with the Arduino based PLC-Route as it is easier to implement hardware and manage timers easily, which there are a lot of in injection molding as many events in a cycle are time-based.
A few lessons learned so far were:
- The evaluation of "Readymade" ESP32/Arduino resulted that there is no real all in one provider like Beckhoff Ethercat modules. That drove me away from it as you still need additional "raw PCB boards" for e.g. temperature input. Then "real" PLCs like Ethercat are freaking expensive if you need anything but standard IOs. Could be an option if you base everything on second hand components!
- These modules are really nice: sequentmicrosystems.com/products/eight-t...bj3cF5BPXDmnSfa68zMp
They are a bit more expensive then a MAX31855 etc. but a very clean solution, easy to install and you can just stack it on top of a Raspberry PI. And are very well documented too + some Libraries exist. Not affiliated with them, just made a really good impression!
- Having temps all in one controller is nice for process debugging
- Used Breakout boards as Optocouplers, SSR Output boards (240V AC 1-2A), external SSRs (40A) and DC Relay boards (24V) and the Temp input board of Sequent Microsystems.
To be honest I would next time spend a bit more with Sequent Microsystems - they seem to be fairly well priced and offer a lot more IOs and flexibility then the "All in one" Arduino based PLCs. But if money is a big constraint you can go with the single modules too.
- I prefer SSRs just because they are silent, and basically free today and never had a cheap Asian branded fail
- For the IO side Arduino is pretty nice and fast as it is easy to connect components and debug them. E.g. for installing a linear scale I did not need a Mesa card or other boards just connected it to an interrupt and fed it to an existing Library.
- I used BlockNot to create parallel tasks, such as asking for sensor states at fixed intervals, have interrupts for linear encoders, run all the cycle timers... that is a very cool lib to work with!
- Okay now the butttt...
As soon as you want to build an GUI for it it becomes annoying. Maybe its my lack of experience for it or I am not aware of better solutions. Let me know if anyone is aware of a similar GUI solution to LinuxCNC (in flexibility) but for simple controllers?!
I tried to use Nextion Displays - which are displays with their own IC. That is cool as they mostly run smooth without Display lags in comparison to other solutions and have a GUI editor.
The pain is that you need to manage the whole communication between the display IC and the IO-IC (e.g. Arduino) manually. Eg. read button pushes from the display and feed data back. That is not impossible but a ton of (unnecessary?) work. Additionally the GUI modules come with good limitations in all directions- e.g. you can only have 4 data inputs into a diagram display which is already limiting on e.g. temp tracking. The graph you get is also not really useful in manner of navigation as zoom/ set scale etc. There are many things that need to be build to get something usable.
So I got stuck and ran it from basically a serial console + manually edition code for changes. That kind of works for home/DIY but is not a "solution" I would say as I run this machine for work. Okay that is a bit funny, but its actually some kind of special setup that does not exist on the market.
So my position is that I have a working machine, but no real interface.
I consider now to mange all the IO's by Arduino as nothing is really time critical and the linear encoders in my app don't need to be updated to the GUI in real time. You can also mix both options and use a motion card like Mesa or a simple Breakout card for motor control and safety IOs and do the rest with an external "PLC".
Some strong points for LinuxCNC in this application:
- Easy to build GUIs
- Real time IO's for motors+safety
- ShowHAL+HalScope is priceless for real-time debugging of states, that would need to be programmed as special IO's otherwise
- Settings can easily saved in files - I would miss-use a .nc file to save projects, temps and timings?
Weak points for LinuxCNC in this application:
- Calculations and conditions are just painful as you need to do everything with components, which would be a simple calc sign otherwise :/
- Not sure how to implement a nice cycles with timings? Could be several timers connected to each other! Would be cool to be able to activate/deactivate these in real time on GUI input to control auxiliary devices.
- Is there an option to use e.g. the HalScope inside a GUI? Or have another graph implemented?
Let me know your thoughts and considerations, happy to exchange ideas here!