- Posts: 22012
- Thank you received: 4
How would you design a real time application for cnc control in c / c++ ???
- tommylight
-
- Offline
- Administrator
-
Less
More
5 years 10 months ago #192638
by tommylight
Replied by tommylight on topic How would you design a real time application for cnc control in c / c++ ???
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 to join the conversation.
5 years 10 months ago #192653
by Aciera
Replied by Aciera on topic How would you design a real time application for cnc control in c / c++ ???
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:
Attachment not found
Please Log in to join the conversation.
5 years 10 months ago #192657
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
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.
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.
Please Log in to join the conversation.
5 years 10 months ago #192670
by Aciera
Replied by Aciera on topic How would you design a real time application for cnc control in c / c++ ???
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.
Attachment not found
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.
Please Log in to join the conversation.
5 years 10 months ago #192673
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
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.
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.
Attachment not found
Please Log in to join the conversation.
5 years 10 months ago #192966
by Aciera
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
Replied by Aciera on topic How would you design a real time application for cnc control in c / c++ ???
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
Please Log in to join the conversation.
5 years 10 months ago #193175
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
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
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
Please Log in to join the conversation.
5 years 10 months ago #193231
by Aciera
Replied by Aciera on topic How would you design a real time application for cnc control in c / c++ ???
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.
I also tried to build on a fresh ISO install.
Attachment not found
Please Log in to join the conversation.
5 years 9 months ago #193968
by bkt
Replied by bkt on topic How would you design a real time application for cnc control in c / c++ ???
I read these intresting post only now .... in these days I think about a similar project:
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
- Qt is canOpen ready
- 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
- 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 to join the conversation.
5 years 9 months ago #193990
by Grotius
Replied by Grotius on topic How would you design a real time application for cnc control in c / c++ ???
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.
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.
Please Log in to join the conversation.
Time to create page: 0.226 seconds
