# G Code Generation

04 Oct 2012 15:33 #24948

I have represented all shapes (lines, circles, ovals, beziers, splines, etc) with parametrics curves C(t) = [X(t), Y(t)] 0<t<1. I need transform this parametric curves to optimal GCode. I have intended with piecewise of curve but this generate big file GCode and my machine run very slow speed.

I have dxf2GCode and this do a optimal Gcode with line and circular arc aproximation. I need do a similar software but I dont know how.

06 Oct 2012 22:27 #25080 by andypugh
Replied by andypugh on topic Re:G Code Generation
I think that this might be a limitation in the current LinuxCNC.

The problem is that the trajectory planner only looks as far as the end of the next move.
In effect all the way through move N it blends to move N + 1 and assumes that move N + 2 is a dead stop.

This means that on very short moves the speed is much lower than it needs to be.

This is pretty much top of the list of things that will be changed in the next version. (i.e., LinuxCNC 3.0)

That might be a long wait, though.

In the meantime, you could try longer moves, and let the LinuxCNC blending smooth it out.

07 Oct 2012 01:29 #25081
Replied by diegoroman17 on topic Re:G Code Generation
Now understand the because of slow moves but why it problem if LinuxCNC have look ahead?

How can I recreate a parametric curve with large moves?

07 Oct 2012 01:37 #25082 by andypugh
Replied by andypugh on topic Re:G Code Generation
diegoroman17 wrote:

Now understand the because of slow moves but why it problem if LinuxCNC have look ahead?[/quote[
The point is that LinuxCNC does't look ahead very far. If the next 3 moves are all one nanometer long then LinuxCNC will only move at the speed that allows it to stop dead in 3nm.

How can I recreate a parametric curve with large moves?

Maybe make the step/precision bigger?

07 Oct 2012 01:50 #25084
Replied by diegoroman17 on topic Re:G Code Generation
It is posible only with big tolerance.

Andy could we try to make that improvement LinuxCNC now? I am very interesting in contribute with this.

07 Oct 2012 02:04 #25085 by andypugh
Replied by andypugh on topic Re:G Code Generation
diegoroman17 wrote:

Andy could we try to make that improvement LinuxCNC now?

I am not currently involved in that part of LinuxCNC, and it is a huge change. The whole nature of hoe G-code gets to motor commands needs to be done differently.

The idea, as I understand it, is to convert the G-code into a linear list of moves, and then to propagate allowed speeds back down the chain (backwards in time).

07 Oct 2012 02:51 #25088
Replied by diegoroman17 on topic Re:G Code Generation

07 Oct 2012 11:58 #25100 by BigJohnT
Replied by BigJohnT on topic Re:G Code Generation
From the user side there is this chapter

linuxcnc.org/docs/html/common/User_Concepts.html

From a programmer side you would have to examine the code.

John

08 Oct 2012 13:22 #25122
Replied by diegoroman17 on topic Re:G Code Generation
I have readed linuxcnc.org/docs/html/common/User_Concepts.html. In critical distance say that A is 1/2 of Max aceleration but in the examples use the complete aceleration.