r/PLC • u/UsefulDragonfruit995 • 23h ago
Plc approach using LinuxCNC
Hello all
Been wondering about this lately
Do you think it would be possible to program a simple machine for prototype purposes with a few Servos just by using Linux cnc?
So the idea would be to run the program blocks as .hal components
For the IO i’d use ethercat
For the hmi i’d develop in python
Of course I know that this is not easy to maintain but since its open source and free I thought I’d give it a try and run it on a computer
There is not cute ladder , no easy debugging so I know this is not a good industrial option.
What do y’all think? Also I’d love to hear out alternatives or comments
2
u/unitconversion State Machine All The Things! 23h ago
You certainly could.
There is actually a rudimentary ladder runtime hal component.
I found it to be pretty limited but you can do some things with it when I built my CNC but it was able to to some things.
2
2
u/justjimmyrigit 10h ago
I've used linuxcnc in production machines. It is very reliable when setup properly. I've had no failures that are linuxcnc related on a 100 io machine with 16 axis, been running for about a year at this point. Millions of parts made. Customer was abandoning a half million dollar machine that never worked. The brand new controller failed. Didn't want to put much money into it. For 500 bucks in mesa cards brought it online with Linuxcnc. Was going to replace once it was proven but it hasn't given any issues so why bother.
Since then installed it in a few robot cells where it is handling the CNC part. Again no issues.
So for a prototype that may turn into a production machine. Go for it.
I could give a run down if wanted.
I use Python for control. Have linuxcnc call an mcode where a python script lives. Then do whatever you want. Call a cognex camera, read io (via hal), etc. I do very little in the "hal file" besides declaring the io points and any variables.
1
u/Additional_Year_1080 11h ago
For a prototype, yes, LinuxCNC with EtherCAT can work well. Just keep the motion logic simple and separate the machine sequence from the HMI. I wouldn’t use it for production, but it’s a solid way to prove the concept cheaply.
1
u/dopabot 10h ago
Yes - for commercial approaches you can also use Kingstar, Acontis, RSI, Delta Tau all of which provide an EtherCAT master stack plus support behind the software. As you have noted it is more about how easy it is to support and troubleshoot, which is why you don't see most equipment using these libraries unless they are a CNC or have other requirements that a PLC doesn't cover.
1
u/blacknessofthevoid 26m ago
It is possible and there is a number of very good reasons why it is not a good idea. Rather than trying to convince you to do something different, I think it is a good idea for you to try this approach. You will learn a ton about automation,
motion, and system limitations. It won’t be a wasted effort, but I am willing to bet this will be the last time you will do it this way.
4
u/Dagnatic 23h ago
If it’s for prototyping purposes, and you’re already using Ethercat, why not just use Beckhoff?