On
27 February 2024 at 20:05 Nealeb Said:
I would like to ask a question, if I may, as there is something here I don’t quite understand. I’m not a complete CNC numpty – in fact my first CNC router used LinuxCNC – and I have used Linux a bit, although never as my main operating system. Since that first machine, I have used external motion controllers with various bits of software including Mach3, mainly on Windows but once on Linux. My understanding is that the motion controller offloads time-critical stuff like pulse generation. Useful for higher speeds with steppers and almost essential for high-resolution servos/encoders. Mach3, UCCNC, PlanetCNC, MyCNC, all do that.
I looked at LinuxCNC and Mesa card for my latest project, rebuilding the electronics in a Denford CNC lathe. Two things put me off. One was that every time I looked at the Mesa web site, what seemed to be the most relevant card (might have been 7i76e but not sure now) was listed as unavailable. The other was that as far as I could see, LinuxCNC never offloaded pulse generation to an external motion controller. In fact, the more I looked, the more the Mesa card looked like a very sophisticated Ethernet breakout board. This is a very crude description, but in essence I mean that it does not have the kind of processing that my other motion controllers have, and as I understand it, the LinuxCNC architecture is not amenable to using that style of motion controller at all.
So, am I right in thinking that LinuxCNC with its real-time kernel is capable of generating very high pulse rates but is limited by the parallel port, and the Mesa card via the Ethernet interface allows this high pulse rate to be demultiplexed from the Ethernet data to pass to the servo drivers? Conventional PC hardware running LinuxCNC is capable of doing all the trajectory planning and pulse generation required, and just needs a way of getting the pulse streams out? And Windows-based systems cannot because Windows is a long, long way from being real-time?
If this seems a trivial question to those in the know, I can only say that in common with another post above, I find the available information goes from hand-waving top-level description to bits and bytes depth without drawing breath! Although my main reservations for going LinuxCNC were as above, I was somewhat discouraged by the fact that I would have to reverse-engineer an understanding of things like getting a spindle encoder connected and working from HAL examples where with my chosen software I just had to click a couple of boxes! Happy to agree that simple things are easy with LinuxCNC and that it is capable of doing some very clever things – but once you go past the three-axis-and-steppers level, there is a steep learning curve!
I think you have most of it.. Yes – linuxcnc needs a realtime kernel. The printer port is just an interface as is mesa. (whenever I am talking about linuxcnc hardware – I usually say – ‘external interface hardware’ instead of ‘external motion controller’. Linuxcnc is the motion controller (in the computer) Linuxcnc uses the pc for what it does well – calculating trajectory’s and such.
The printer port when used with linuxcnc is just raw i/o. Within linuxcnc hal (hardware abstraction layer) you have software modules like pwmgen, encoder, step generators.. These require a high speed realtime thread that can do the step pulses, read encoder inputs and such. So – you are limited by how fast the realtime thread can run (linuxcnc terms – the ‘base thread’) Depending on the computer – this can be anywhere between 30 and 50khz.. (this is the limit of what you can do with raw i/o)
Now – external interface hardware like mesa or such moves the high speed stuff (like pwm generation, encoder counting, step generation) to the hardware. So linuxcnc only needs a 1 to 5khz thread to do the trajectory planning and such.. So – every ms – linuxcnc sends a packet setting pwm amounts/stepgen data/ i/o and reads back encoder positions, stepgen velocity and so on (depending on what you are doing)
The external motion devices are buffered.. You send it info and the motion device figures out the timings.. This has issues with delays and such (remember the feed hold issue with mach?)
The big advantage with the motion controller being in the computer is that any feature added to linuxcnc works with any interface device. You can rigid tap with the printer port if you want. With an external motion device – you better make sure it does everything you want it to before buying it – or hope that it is added later.. (like rigid tapping, gear hobbing and such)
The other thing is – Linuxcnc scales. You want to run a simple table top router with steppers? No problem. Want to run a 5 axis horizontal machining center with pallets and tool changer? You can do that too. Linuxcnc has a built in plc which works very well (I used it on the K&T and others) Ethercat? Yes!
As far as availability – Yes – mesa has been hit with supply issues like everyone else. I think it has gotten better..
might try https://mesaus.com/
If I missed anything – please ask away – I will answer the best I can.