How would you design a real time application for cnc control in c / c++ ???

More
14 Dec 2022 05:42 - 14 Dec 2022 09:06 #259418 by akg1904
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
Last edit: 14 Dec 2022 09:06 by akg1904.

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

More
17 Dec 2022 01:04 #259695 by andypugh
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.
The following user(s) said Thank You: Aciera

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

More
22 Jan 2023 23:08 - 22 Jan 2023 23:17 #262684 by tommylight
Subject tittle restored.
-
Do not change subject tittle when replying.
Thank you.
Last edit: 22 Jan 2023 23:17 by tommylight.
The following user(s) said Thank You: phillc54, rodw, Grotius, JT

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

More
30 Jan 2023 00:00 #263197 by Grotius
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.

 

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

More
05 Oct 2023 10:58 #282353 by TheRoslyak
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.

More
29 Oct 2023 14:48 #284025 by bkt
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.

More
30 Oct 2023 14:55 #284132 by TheRoslyak
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.)

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

More
30 Oct 2023 20:01 #284140 by bkt
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

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

More
31 Oct 2023 07:47 #284157 by TheRoslyak
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.

More
31 Oct 2023 08:51 #284160 by bkt
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

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

Time to create page: 0.171 seconds
Powered by Kunena Forum