Other ways to interface with LinuxCNC

More
3 years 1 month ago #280310 by HerrNamenlos123
I did look at ROS and found out that it is not good at all for realtime control or synchronized motion. I just mentioned it because I think it demonstrated the idea of an extensible interface. I do not have or want Mesa cards, that is the entire point of my project. Ideally the only hardware I need is an Arduino, that receives motor data via Ethernet in realtime.

As said, HAL2Arduino looks very promising, from my understanding it is a python program that is loaded as a HAL component, and this python program gets the data from LinuxCNC and passes it to an Arduino with a HAL2Arduino Firmware. This is exactly what I want, but JUST the part that talks to LinuxCNC, minus the Arduino Serial interface.

Talking about HAL: In the HAL2Arduino source code it states that this HAL solution is only for testing and has a lot more lag than a proper parallel port, and should never be used on a production machine. Now, is this always the case for HAL, or would it be as fast if i write the HAL component in C++ and load it as an RT component?

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280312 by Aciera

Now, is this always the case for HAL, or would it be as fast if i write the HAL component in C++ and load it as an RT component?

The problem is that python is an interpreted language and as such not suited for real time applications so, yes, you would want to use a compiled language like C++, compile it and load that as an rt component.
Also I believe that ROS 3 is real time capable and 'machinekit' (a now largely abandoned fork of linuxcnc) had an interface for ROS, although I'm not sure whether that was for ros2 or ros3.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280313 by rodw
I don't believe you can use your arduino for step generation becauuse the USB connection to the PC is not going to be real time (due to USB architecture limitations)

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280314 by Aciera
Yes, the hardware interface would have to be real time capable as well, which USB is not.
The following user(s) said Thank You: rodw

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280315 by rodw

In many of my projects, having a fully featured CNC controller core like LinuxCNC (with trajectory planning, PID tuning, homing cycles, etc...) would be very useful and I am not aware of LinuxCNC alternatives that are this advanced. 

I suspect its not clear to you that Linuxcnc IS_THE_MOTION_CONTROLLER so everything to do with motion happens on the PC, not on an external board.

Please Log in or Create an account to join the conversation.

More
3 years 1 month ago #280316 by HerrNamenlos123
I am aware of that, which is why I would probably use an SPI Ethernet board to communicate with the Arduino. But the point is that it does not need to be an Arduino, as soon as the program works.

I think I am close, actually, I wrote a HAL component using a .comp file, compiled with halcompile, and loaded using loadrt. I can already manipulate position commands and axis velocities in C, which is exactly what I wanted. Now, (given that the Arduino connection can keep up of course), will this be just as fast as any other hardware, allowing for high-precision motion, or is this halcompiled realtime component still slower than a real parallel port?

Please Log in or Create an account to join the conversation.

Time to create page: 0.204 seconds
Powered by Kunena Forum