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

More
12 May 2022 14:42 - 12 May 2022 14:48 #242798 by TheRoslyak
Hi everybody

Maybe someone can connect a Hal variable to QML C++.
I managed to do it. But they change if I interact with  interface. (I click on the button or etc). But I want it to be displayed as halmeter
Last edit: 12 May 2022 14:48 by TheRoslyak.

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

More
24 May 2022 09:58 #243671 by TheRoslyak
Hi everyone
I started to implement to make eoffset function in my application. - and "damage my brain" .
The thing is, I don't understand how to make a IRQ (interrupt request).
In fact is that eoffset works taking into account kinematics.But if I make additional thread. It conflicts with the main thread - and crash driver.
I tried to see how it is organized in Linuxcnc, but I didn’t understand anything.
Maybe there is someone who is well versed in the sources of Linuxcnc.

 
 
 

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

More
31 May 2022 13:08 #244283 by TheRoslyak
Hi everyoneI figured out a little in the linuxcnc sources and started doing something similarBut I have a problem with c/c language.
I create switch-case at switch-case and have error

Variable k changes drastically for any function. In my case - strcat()Is there anyone here who is well versed in c / c ++. Where did I wrong?
 
 
Attachments:

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

More
02 Jun 2022 09:43 #244432 by andypugh
I don't have an answer to the specific question, but I don't think you should #include a specific kinematics module. All kins modules should export the same symbols and the prototypes or those are in the generic kinematics header.

I your code needs to run in a thread, then implement it as a HAL component.

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

More
02 Jun 2022 11:30 #244441 by rmu

Hi everyoneI figured out a little in the linuxcnc sources and started doing something similarBut I have a problem with c/c language.
I create switch-case at switch-case and have error

Variable k changes drastically for any function. In my case - strcat()Is there anyone here who is well versed in c / c ++. Where did I wrong?

what are you trying to do? can you somehow describe your problem in non-video format, or at least crop the recording to the relevant window.

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

More
02 Jun 2022 11:59 #244444 by TheRoslyak
I don't quite understand what the "claim" is.
In generally. Main task is create app (like linuxcnc) with several processes.For example It was be 3 scara, 2 delta, 1 convyer and etc.
I study in detail the sources of Linuxcnc and try to make flexibly customize hal variable. For Now I make static creation oh hal varible (1 delta, 1 scara).
I study in detail "emcmotController" function in control.c. And generally I make create this module which is not as elaborate as linuxcnc. But but can move carry out movements in parallel by 2 robots.
If there is an opportunity to raise some points or fully join the project - your welcome:-)
PS So far, I realized that Grotius is well versed in these matters. But he disappeared somewhere

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

More
02 Jun 2022 12:05 - 02 Jun 2022 12:07 #244445 by TheRoslyak
There the problem is that the variable k is available for unknown reasons when calling any function.
There, in general, can make this module more competently, but I have not yet figured out how
 
Last edit: 02 Jun 2022 12:07 by TheRoslyak.

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

More
03 Jun 2022 11:07 #244507 by rmu

There the problem is that the variable k is available for unknown reasons when calling any function.
There, in general, can make this module more competently, but I have not yet figured out how

 

I'm sorry but I have no idea what you are talking about -- this doesn't make sense in context of C/C++. Can you post the code in question and what the real problem is? Also, it seems something is lost in translation, maybe try a different translation service or post in your native tongue.

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

More
04 Jun 2022 18:44 - 04 Jun 2022 18:47 #244581 by bkt
for sure your work in qt qml is more advance of mine .... but essentially think all work (the big one of grotius too) is based on few libs of linuxcnc packets .... forum.linuxcnc.org/47-hal-examples/44874...rs-tutorial-sort-off .... not finish yet because no time and because need to indagate better on what linuxcnc receive as, bit, integer, bool, float and char var .... but I think no need other .... with that fef libs you can make everithings ....

peraphs ... I integrate extra joint and eoffset whitout problem with qt hmi .... only problem was with managment of extrajoint emergency after homing .... but not qt related.

bkt
Last edit: 04 Jun 2022 18:47 by bkt.

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

More
06 Jun 2022 15:02 - 06 Jun 2022 15:41 #244674 by TheRoslyak
Hi bkt.
Problem with QML - I think not. Everything is imported and everything interacts with the application. If there are any problems, I ask on QML forum. I don't spend time on design now - the main thing is the main core. I'll be using Abobe Illustrator for a while. - And there will be design of AAA game.
I have already solved the problem of creating a flexible project. Function "hal_pin_float_newf" is more flexible then "hal_pin_float_new".
Now I'm facing the problem that I need to create a thread (like linuxcnc) directly in the application itself.
Before that, I created component "threads" in hal file. But it was not actually used. (Just spinning in the background)
To get my emcController to run at servo-thread frequency. I need to create it in the app itself (like EMCMOT = motmod). But the problem is I can't use the "hal_create_thread" function.
This function is in Hal.h but it is hidden. Сan anyone tell me how to use this function in my project. (Through "halcompile"  everything works)

PS I think I will bring the project to a certain point and put it in the public domain on git. I would like that it would be possible to do level projects on it as in the video

 
Attachments:
Last edit: 06 Jun 2022 15:41 by TheRoslyak.

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

Time to create page: 0.107 seconds
Powered by Kunena Forum