Request G6, Ellipse and G7, bezier curve

More
24 May 2020 10:18 - 24 May 2020 10:22 #168776 by Grotius
Hi,

I have a programmer request for adding a G6, Ellipse and a G7, Bezier curve to the Linuxcnc source code.

This request is done because the cubic spline G5, is already available for Linuxcnc. For my cam software i want
the possiblily to output G5, G6 and G7 code format's. This would be inline with a uniform program output.

At this moment i see a non uniform output for linuxcnc happening :
We can output a cam G5 for spline, but we can only output fragmented linestrips to cnc a Ellipse or Bezier curve.


Attached c/c++ basic function's that can be adapted to the Linuxcnc Gcode intepreter with minimal changes.
This tiny step forward in linuxcnc source code, is a huge step for cnc cam program's. The power of
a G6 and G7 output is that the cam program does not have to facetate a ellipse into a fragmented linestrip. This results in
thousand lines of code when the cam program's calculate a very accurate cnc path. Let linuxcnc do this real time calculation
while the machine is moving.

I hope some linuxcnc programmer will pick this up and put it in the next Linuxcnc release.

WIch Gcode Numbers are used, doesn't matter for me. G6 and G6.1 are fine for example. G7 is already used for lathe.

Warning: Spoiler! [ Click to expand ]


Warning: Spoiler! [ Click to expand ]
Last edit: 24 May 2020 10:22 by Grotius.
The following user(s) said Thank You: tommylight

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

More
24 May 2020 11:46 #168784 by rodw
Grotius, I wish I knew more about the internal code but you gave me an excuse to read a bit more of it

Can you give some gcode examples of how you think these could be used in a Gcode file?
The following user(s) said Thank You: Grotius

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

More
24 May 2020 12:52 #168790 by Grotius
Hi Rod,

Can you give some gcode examples of how you think these could be used in a Gcode file?
Sure,

Attached example is in line with current Gcode programming style.

For ellipse the example is an open ellipse, the ellipse itself is defined under a angle. So the most difficult ellipse example
can be done in 1 line of gcode.

For bezier curve the input is like the cubic spline. I,J are first control points. P,Q are second control points.
Gcode can be done in 1 line of gcode.

Attachments:
The following user(s) said Thank You: tommylight, rodw

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

More
10 Jun 2020 10:43 - 10 Jun 2020 10:50 #170942 by Grotius
Okey,

After some research about the current linuxcnc G5 Cubic splines and G5.1 Quadratic splines i came to the conclusion yesterday this
type of splines are not compatible with following open source programs :

Freecad
Inkscape
Librecad (uses two types of splines)
Cadcam

The linuxcnc G5 Cubic splines and G5.1 Quadratic splines are in my opinion not preferred to use for robot trajectory.
The perfect spline to use to stay in line with above programs : mathworld.wolfram.com/CubicSpline.html


What we miss is the G code command for a Ellipse and Bezier curve and a Gcode command for
a cubic spline that is constructed of piecewise third-order polynomials.

So i can do 3 things.

1. Lean back in my chair and do nothing about it.
2. Post this on the forum and hope someone will add it to the source code.
3. Add it to the linuxcnc source code myself.

What would you do? :laugh:

Imagine the above criteria is integrated in the linuxcnc source code. The G-code output will reduce with 80-96%.
The cnc machine will be more accurate to the path, because it no longer depends on interpolating the path over 1000+ line segments,
wich are not interpolated as should be in my opinion.
Last edit: 10 Jun 2020 10:50 by Grotius.

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

More
10 Jun 2020 10:53 #170944 by tommylight
Might be better to post that question on the LinuxCNC IRC channel as most of the developer hang out there.
webchat.freenode.net/?channels=%23linuxcnc
It requires registering the nic to be able to post, due to spammer protection.
The following user(s) said Thank You: Grotius

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

More
10 Jun 2020 11:37 #170951 by rodw

Grotius wrote: Okey,

So i can do 3 things.

1. Lean back in my chair and do nothing about it.
2. Post this on the forum and hope someone will add it to the source code.
3. Add it to the linuxcnc source code myself.
.


In my experience, the only way to make it happen is option 3. But 1 is a lot easier.
I also want to make some changes to the core code. Maybe we can work together...
I think the new G code will need to align with an existing gcode flavour so that there is post processor support.
The following user(s) said Thank You: Grotius

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

More
10 Jun 2020 12:18 #170956 by bbsr_5a
most cam will split this bezier in 2-3 regulair radius ones
never have had any problem on this on freecad or sheetcam with imported DXF
freecad draft can also make you regular rad out of bezier
The following user(s) said Thank You: Grotius

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

More
10 Jun 2020 13:08 #170958 by Aciera
Sounds interesting BUT
It seems to me that NURBS-interpolation has kind of fallen by the wayside in professional machine controllers due to the increase in processing speed and memory size.
What CAM can actually output the code required for NURBS interpolation on the controller?
The following user(s) said Thank You: Grotius

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

More
10 Jun 2020 13:46 #170961 by Grotius
Hi Rod,

I also want to make some changes to the core code. Maybe we can work together...
Is oke for me. Did you already find out how to make a external c connection to hal?
If not, let me know over here. What change do you want to make?

I think the new G code will need to align with an existing gcode flavour so that there is post processor support.
I agree. But for 99% of the cam program's it will not work at this moment.
They have to improve their source code first.
For my CadCam program this new Gcode is working right away, this is how i would like to see a Cam program shitting out some gcode. High end gcode output. It opens more then only that. Pockets algoritmes, build up from splines. Wow. B)

@Aciera,
Sounds interesting BUT
It seems to me that NURBS-interpolation has kind of fallen by the wayside in professional machine controllers due to the increase in processing speed and memory size.

Nurbs are a kind of special. I never seen them around in dxf files. More common used one's are splines, ellipses and beziers.
I like the Nurbs idea and tested them yesterday in linuxcnc. A spline path instead of a nurb path can be considered as a good alternative.

What CAM can actually output the code required for NURBS interpolation on the controller?
That's the whole point. Now is the time to get Cam outputs in line with Cad data, and now is the time to get the EMC software up to date to do this job. B)

@bbsr,
most cam will split this bezier in 2-3 regulair radius ones
So far i know, sheetcam, dxf2gcode, pronest, etc will shit out thousands of line segments instead of one line of special G5 code.
And it is loosing path accuracy this way. For a cnc electron microscope, or a stealth fighter you can not interpolate this way.

never have had any problem on this on freecad or sheetcam with imported DXF
Actual, there is no real problem. There is a linuxcnc source code improvent request.

freecad draft can also make you regular rad out of bezier
But linuxcnc don't accepts this kind of shapes today. If linuxcnc has this option, you will see all cam program's will
improve their souce code.
The following user(s) said Thank You: tommylight, rodw

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

More
10 Jun 2020 14:45 #170965 by Aciera

If linuxcnc has this option, you will see all cam program's will
improve their souce code.

I see you're an optimist! Good on ya!
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.142 seconds
Powered by Kunena Forum