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

More
18 Dec 2020 20:41 - 19 Dec 2020 05:20 #192383 by Grotius
This is a nice example of 4 different s-Curve motion commands.

Picture 1 is a command that can not reach the max velocity.
Therefore the code shorts the motion command into a shorter period of acc and dcc.

Picture 2,3 and 4 are quite nice. These can be used as a motion command between a M3 and M5 traject.
The motioncommand has 4 types to assign the S-curve :
-- type 0 = S-curve at left and right.
-- type 1 = No left S-curve
-- type 2 = No right S-curve
-- type 3 = No S-curve on both sides.



3 motion commands executed from a bucket (vector).
Stopwatch: 9.99986 sec
Calcuations: 24619 (threat pause = 900000 ns).
Attachments:
Last edit: 19 Dec 2020 05:20 by Grotius.
The following user(s) said Thank You: tommylight, thefabricator03

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

More
19 Dec 2020 07:27 - 19 Dec 2020 08:07 #192431 by Grotius
Hi,

Video of Scurve with motors connected to Robot.

The robot has to go through 4 points.
Points :
Warning: Spoiler!


Setup :
- quite old pc
- rtos Skynet iso
- rt Hal
- rt Ethercat + steppers
- rt kdl Kinematics
- rt Scurve motionplanner
- Opencascade step viewer updated every 100ms.

video 1
streamable.com/ss9u4j
video 2
streamable.com/2fcbhj
Last edit: 19 Dec 2020 08:07 by Grotius.
The following user(s) said Thank You: chimeno, Clive S, thefabricator03, Aciera

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

More
19 Dec 2020 08:44 #192437 by thefabricator03
The following user(s) said Thank You: Grotius

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

More
19 Dec 2020 10:14 - 19 Dec 2020 10:26 #192443 by Aciera

To start and try out a little bit, you have only to edit the FactoryApp.xml file.


I thought I'd start by building the robot model but I guess I'm a bit confused about the workflow of qt creator:

I notice that FactoryApp.xml that defines the kinematic chain lives in the folder "build-Skynet-Desktop-debug" while in qt-creator I build the file "Skynet.pro" that lives in the folder "Qt-skynet-app". How does the new model get transferred to the qt-project?

I'm sorry you might have pointed that out somewhere but it all a bit of a blur.

[edit]
I notice that the step files for the model also live in the folder "Qt-skynet-app" so having the FactoryApp.xml in a different folder seems a bit odd. Does qt-creator somehow know to fetch the FactoryApp.xml from the folder "build-Skynet-Desktop-debug"?

[edit2]
Just realized that FactoryApp.xml in the folder "build-Skynet-Desktop-debug" seems to be overwritten when building Skynet.pro. So now I'm really wondering where the kinematic chain is defined.
Last edit: 19 Dec 2020 10:26 by Aciera.

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

More
20 Dec 2020 12:15 #192519 by Grotius
Hi Arciera,

Normally i copy the folders : gcode, hal and robot to the build directory by hand.
From there it is used by the program.

The FactoryApp.xml is made in the build directory to show it as example. To prevent overwrite you could rename your xml file, or
you could outcomment : Cmainwindow.cpp : // create_xml_templates().create_robot_xml("FactoryApp.xml");
Then it will no longer overwrite the FactoryApp.xml file.

Take a look how the xml file is made. Xml/create_xml_templates.cpp, you could consider to edit this file into your configuration.
That's problably what i would do.

The Chain is readed by : Xml/read_xml.cpp
Take a look by going trough that file.

The robot data is stored by read_xml.h this file contains the data buckets, see struct SEGMENT and struct CHAIN.
The following user(s) said Thank You: Aciera

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

More
20 Dec 2020 13:36 - 20 Dec 2020 13:36 #192535 by Aciera
So I made a copy of the folder "Qt-skynet-app" and changed the dimensions in Xml/create_xml_templates.cpp, which seems easy enough to do. However now I get errors when trying to build:



I even get this error when trying to build the original Skynet.pro from the unchanged "Qt-skynet-app" that used to build fine before.

Thanks
Attachments:
Last edit: 20 Dec 2020 13:36 by Aciera.

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

More
20 Dec 2020 19:10 - 20 Dec 2020 19:14 #192563 by Grotius
Hi Arciera,

Copying the whole source directory is not a good idea.

What happens is that your copy has overwritten parts of the build directory, but not everything.
To restore this, delete your copy directory. (eventually save your edited xml files).

After that you have to do a => build => clean all projects from your orginal Skynet directory (open qt => skynet.pro)
This will remove all build files except your "hal, robot, gcode folder".
Then compile the orginal source again.

If this is not working, delete all, unzip the downloaded Skynet project again.

changed the dimensions in Xml/create_xml_templates.cpp, which seems easy enough to do.
Oke nice !

Working with Qt takes some experience. I have dealed with most of the issue's already.

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.
Last edit: 20 Dec 2020 19:14 by Grotius.
The following user(s) said Thank You: Aciera

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

More
21 Dec 2020 02:49 - 21 Dec 2020 03:58 #192602 by Grotius
Hi,

The motion planner works quite nice. I integrated adaptive feed from -1 to 1. It can move back without restrictions.
In lcnc the restriction is (or was) a maximal reverse run until a M3/M5 is reached.

In the picture the last motion is build up from 2 half assigned Scurve commands. Next thing to do is Dtg (DistanceToGo).
And maybe a live velocity control.

The motor output speeds are still tested oke.

After some trial and error I mentioned that the chrono timer can best be used with a delay command,
instead of calculating the disired delay.


On github is a ngc274 intepreter for download. This one can be attached to the program quite easy when we are ready for it.



Source : projects

The news of today is :

It is now possible to upload video's to your github channel.
Can we now get rid of youtube finally? I hope embedding is possible, not sure, have to try this.

Test video.
user-images.githubusercontent.com/448801...d89-07bfb7872e0a.mp4

Embedding mp4 seems not to work on this forum.
Attachments:
Last edit: 21 Dec 2020 03:58 by Grotius.
The following user(s) said Thank You: tommylight, thefabricator03, Aciera

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

More
21 Dec 2020 12:27 #192632 by tommylight
Did github get bought by Microsoft?
They are much worse than google/youtube, although lately it is hard to separate them.
If i remember correctly, LinuxCNC server is in someones home, so not much capacity and bandwidth there, but it works properly so i do not mind it does not handle videos.

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

More
21 Dec 2020 13:02 - 21 Dec 2020 13:02 #192637 by Aciera
Wikipedia:

GitHub, Inc. is a subsidiary of Microsoft which provides hosting for software development and version control using Git.

Last edit: 21 Dec 2020 13:02 by Aciera.
The following user(s) said Thank You: tommylight, Grotius

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

Time to create page: 0.159 seconds
Powered by Kunena Forum