- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
How would you design a real time application for cnc control in c / c++ ???
14 Dec 2022 05:42 - 14 Dec 2022 09:06 #259418
by akg1904
Replied by akg1904 on topic How would you design a real time application for cnc control in c / c++ ???
Hi,
Newbie here, I have a custom program for homing and Tool Change in C/C++.
I want to replace the existing homing and Tool change to integrate my homing an tool change program with LinuxCNC .
I don't know how to approach this problem so need some help to figure it out.
Thanks and Regards
Abhishek
Newbie here, I have a custom program for homing and Tool Change in C/C++.
I want to replace the existing homing and Tool change to integrate my homing an tool change program with LinuxCNC .
I don't know how to approach this problem so need some help to figure it out.
Thanks and Regards
Abhishek
Last edit: 14 Dec 2022 09:06 by akg1904.
Please Log in or Create an account to join the conversation.
17 Dec 2022 01:04 #259695
by andypugh
Replied by andypugh on topic How would you design a real time application for cnc control in c / c++ ???
It is only possible to supply an alternative homing component in version 2.9+ of LinuxCNC.
You can specify a new homing component in the INI file:
linuxcnc.org/docs/2.9/html/config/ini-co...l#sub:ini:sec:emcmot
There is an example homing component here:
github.com/LinuxCNC/linuxcnc/blob/master...onents/homecomp.comp (which is a C file with extra stuff at the top for the halcompile utility to parse)
I suspect that the homing component can only be C, not C++ as in some LinuxCNC realtime systems all realtime code has to run in kernel space.
I have had a look and I haven't found much in the docs about writing an alternate homemod.
You can specify a new homing component in the INI file:
linuxcnc.org/docs/2.9/html/config/ini-co...l#sub:ini:sec:emcmot
There is an example homing component here:
github.com/LinuxCNC/linuxcnc/blob/master...onents/homecomp.comp (which is a C file with extra stuff at the top for the halcompile utility to parse)
I suspect that the homing component can only be C, not C++ as in some LinuxCNC realtime systems all realtime code has to run in kernel space.
I have had a look and I haven't found much in the docs about writing an alternate homemod.
The following user(s) said Thank You: Aciera
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6433
22 Jan 2023 23:08 - 22 Jan 2023 23:17 #262684
by tommylight
Replied by tommylight on topic How would you design a real time application for cnc control in c / c++ ???
Subject tittle restored.
-
Do not change subject tittle when replying.
Thank you.
-
Do not change subject tittle when replying.
Thank you.
Last edit: 22 Jan 2023 23:17 by tommylight.
Please Log in or Create an account to join the conversation.
30 Jan 2023 00:00 #263197
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
I suspect that the homing component can only be C, not C++ as in some LinuxCNC realtime systems all realtime code has to run in kernel space.
User can write code in c++ for kernel modules, no problem. We use a wrap function mentioning "extern c" for this trick.
That's why high-end libs like orocos-kdl or ai can be included in a hal component.
User can write code in c++ for kernel modules, no problem. We use a wrap function mentioning "extern c" for this trick.
That's why high-end libs like orocos-kdl or ai can be included in a hal component.
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
05 Oct 2023 10:58 #282353
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
Hi Grotius. I've already added you to my project. You can start familiarizing yourself with it at your own pace. Here's what I've accomplished so far: I'm using a yaml file as a basic configurator. In it, several processes and real-time functions are created. Threads are described separately. Currently, the real-time functions are empty, and they need to be made similar to the emcmotController function in linuxcnc. There are many operations and references to structures there, which are difficult to understand - I'm in the process of figuring them out. I think you can guide me in the right direction. The plan is to move robots based on the pick and place principle, similar to what's done in twincat or codeys. There's also a started project working with the URDF file and the KDL library, but it's secondary for now. The graphical interface is in another project, where QML and all the qt libraries with the ULAPI parameter are used. It operates similarly to halmeter, extracting everything from the RAM that's related to hal and assigning an index to the model. Knowing this index, it can then be used in a designed QML project.
Please Log in or Create an account to join the conversation.
29 Oct 2023 14:48 #284025
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
mmm ... and how many axis would use for your project? Plus not understand you start more than one Lcnc istance inside a different thread? And it works in realtime? ..... thse is interesting ...
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
30 Oct 2023 14:55 #284132
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
It's not working yet, but the groundwork is there. This is necessary not just to start a single machine in one's garage, but for an entire complex of systems operating on a single controller. Like this:
This is an example of how such a system can be implemented on Codesys or Twincat. Accordingly, I am working on making this possible in the HAL environment. And of course, there are many axes involved. The processes work independently of each other. It's even possible to program it so that each process or task operates on a separate CPU core.)
This is an example of how such a system can be implemented on Codesys or Twincat. Accordingly, I am working on making this possible in the HAL environment. And of course, there are many axes involved. The processes work independently of each other. It's even possible to program it so that each process or task operates on a separate CPU core.)
Please Log in or Create an account to join the conversation.
30 Oct 2023 20:01 #284140
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
so you means start a Lcnc instance every core? so it will possible to run separate gcode on every cpu? .... and for share stat/command/error trought different core and istance? What about these? because rt capable shared info it will be very good .... you have any suggestion as starting point to study these?
regards
regards
Please Log in or Create an account to join the conversation.
- TheRoslyak
- Offline
- Elite Member
Less
More
- Posts: 238
- Thank you received: 37
31 Oct 2023 07:47 #284157
by TheRoslyak
Replied by TheRoslyak on topic How would you design a real time application for cnc control in c / c++ ???
In general, I can add you to my project if you provide your GitHub contact details. You will need to install the yaml-cpp library. And if you help not only with advice but also join the development, that would be even better.
Please Log in or Create an account to join the conversation.
31 Oct 2023 08:51 #284160
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
on your github new thread? (i'm not github specialist .... so not know github terms) but for sure share my contact ... is easy use yapps libs on qt c++? as all other c++ lib?
regards
regards
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- How would you design a real time application for cnc control in c / c++ ???
Time to create page: 0.171 seconds