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

More
21 Dec 2020 13:13 #192638 by tommylight
Yeah, the first thing i did after installing windoze was to remove everything regarding Alexa ( not the amazon one, the tracking one) that was included for nearly 10 years till someone noticed !

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

More
21 Dec 2020 14:38 #192653 by Aciera
Hm, I seem to have broken things. I reinstalled your iso on a different computer and copied the folders "build-Skynet-Desktop-Debug" and "Qt_skynet_app" over to the desktop my work machine. However when I try to run Skynet.pro in qt-creator I get errors:


Attachments:

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

More
21 Dec 2020 15:15 #192657 by Grotius
Hi Arciera,

This can be solved by checking the .pro file, this section points to hal, check your current hal includepath on your local pc :

#lcnc
INCLUDEPATH += /usr/lib/ \
/usr/lib/linuxcnc/modules/ \
/usr/include/ \
/usr/include/linuxcnc/
LIBS += -llinuxcnchal -lethercat -Iinclude -Isrc/emc/rs274ngc -Llib -lnml -llinuxcnc -llinuxcnchal -llinuxcncini -lposemath

@Tommy,

Kunena is embedding (not hosting) youtube video type's, but mp4's most be enabled by forum admin i suppose.
Microsoft, google, youtube, facebook, are all not my favo's. Maybe i can better host myself.
The following user(s) said Thank You: Aciera

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

More
21 Dec 2020 16:54 #192670 by Aciera
Ok, thanks. I guess that is because I removed the installed LinuxCNC and use a RIP install now. So I copied the "linuxcnc" folder into the /usr/include folder and it compiled a while before comming up with this:




I wonder if maybe I should just reinstall Linuxcnc through the package manager. Although I have been advised to remove that when using a RIP install.
Attachments:

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

More
21 Dec 2020 17:10 - 21 Dec 2020 17:28 #192673 by Grotius
Hi Arciera,

Ahh, i already thought about something like that.

Keep your Lcnc rip where it was compiled. Just link to the libs pointed out it in the pro file.

So your includepath's will be like : "/home/yourpath/linuxcnc/lib/" etc. Then it's ok.

It's a good practice, but reinstalling the iso takes 10 minutes, As the build-essentials for the rip are already in the iso.

--

As for the program, Tomorrow i am planning to bring 3 different app's together in one app.

1. Skynet app (opencascade viewer with robot model)
2. Kinematics app
3. Motionplanner app

This will save some hal pin's and i expect it will speed up the program a little bit.
The motionplanner is working with mdi command's for lineair moves now. I will pick this code up
later on again to finish a few things. For now it's ok.
Attachments:
Last edit: 21 Dec 2020 17:28 by Grotius.
The following user(s) said Thank You: Aciera

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

More
23 Dec 2020 15:08 - 23 Dec 2020 15:08 #192966 by Aciera

My workflow would be,

1. unzip skynet.zip.
2. load project, build one time. (this creates the factoryapp.xml file for you).
3. copy the folders : gcode, hal, etc to your created build dir.
4. run program.
5. edit code to your wishes and compile frequently.


It seems I fixed the linker problems and I can now build Skynet.pro again and load the Kuka project.
So point 1 and 2 are done.

However I'm still confused as to what needs to be done to change the robot.
3. I copy the three folders "gcode" "hal" "robot" from /Desktop/Qt_skynet_app to /Desktop/build-Skynet-Desktop-Debug?
4. with "run program" do you mean to click on the "Run" (green triangle) button in qt-creator or run the file /Desktop/build-Skynet-Desktop-Debug/Skynet?

Thanks
Last edit: 23 Dec 2020 15:08 by Aciera.

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

More
25 Dec 2020 12:57 #193175 by Grotius
Hi Arciera,

I made a new project, that's a minimal example containing 5 c++ files.
Try to study this project. And try to add your own robot model into this project. I'm sure you can do this !

If you download this project .

github.com/grotius-cnc/Skynet_Robot_Cont.../releases/tag/1.0.21



It has a minimal code example, without xml file input etc.

Files like stepfiles are now automaticly copied to the build directory when you pressed the qt run button "cntr+r".
So you only have to use the source directory.

If you want to load your own robot model. The easyest way is to replace the current stepfile's with your robot files.
To edit your kinematic structure, see kinematic.cpp.
To edit the opencascade structure, see opencascade.cpp function : Update_jointpos() => edit framevector.
To edit your loaded stepfiles, see mainwindow.cpp.

In this example, also the hal files can be edited in qt creator see : Other files/config/ethercat.hal
The following user(s) said Thank You: Aciera

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

More
26 Dec 2020 14:03 #193231 by Aciera
I get build errors about KDL. All reference about KDL seems to have been removed from Source and Header folders.
I also tried to build on a fresh ISO install.

Attachments:

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

More
03 Jan 2021 17:39 #193968 by bkt
I read these intresting post only now .... in these days I think about a similar project:
  1. Qt is canOpen ready
  2. is possible to send command to Lcnc via server/client to halui for example
  3. nml Lcnc status and error maybe is needed for read a lot of status and error signal
  4. actual pos with ethercat is everytime usable in Qt without vcp or other similar widget on QtPy

I did not understand what happens here .... skynet uses nml, hal and Lcnc core or has the trajectory planner also been totally rewritten?

regards
bkt

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

More
03 Jan 2021 21:24 #193990 by Grotius
Hi Arciera,

I think you have to look at the pro.user file of the project. Some of the links over there have to be aligned with your file structure.

Hi Bkt,

is possible to send command to Lcnc via server/client to halui for example
nml Lcnc status and error maybe is needed for read a lot of status and error signal
Yes examples of interacting with halui and nml : github.com/grotius-cnc/QT_C-_Linuxcnc_interface_gui

actual pos with ethercat is everytime usable in Qt without vcp or other similar widget on QtPy
Yes, trough hal connection. Qt creates a hal component & pins in c++ to read the ethercat signals. In fact you signals are working
after the hal "net" is done, after that the hal realtime ready sign is given trough a system command in c++.
See examples in source code.
The following user(s) said Thank You: bkt

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

Time to create page: 0.172 seconds
Powered by Kunena Forum