Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

G2 move has too much error

14 REPLIES 14
Reply
Message 1 of 15
SGoldthwaite
1897 Views, 14 Replies

G2 move has too much error

SGoldthwaite
Collaborator
Collaborator
I'm making a spur gear on my Shapeoko which uses a gShield board with GRBL firmware.  GRBL generates an error if a G2 or G3 command has more then 0.005" error.  GRBL is giving me this error for some gcode that Fusion 360 is generating.  You can find the Gcode here: http://pastebin.com/G6Ep09Ry.  Line 56 is the one causing a problem.
The error for this move is: 0.005007"
The post processor I'm using is a modification of generic grbl.  The modifications I made are not related to how it calculates G2 or G3 commands.

I attached my Fusion360 file.  The operation that generates this gcode is called "Teeth Finish"
I also attached the spreadsheet I used to calculate the error.

Are there some settings I can change to reduce the calculated error so it's less then 0.005"?
0 Likes

G2 move has too much error

I'm making a spur gear on my Shapeoko which uses a gShield board with GRBL firmware.  GRBL generates an error if a G2 or G3 command has more then 0.005" error.  GRBL is giving me this error for some gcode that Fusion 360 is generating.  You can find the Gcode here: http://pastebin.com/G6Ep09Ry.  Line 56 is the one causing a problem.
The error for this move is: 0.005007"
The post processor I'm using is a modification of generic grbl.  The modifications I made are not related to how it calculates G2 or G3 commands.

I attached my Fusion360 file.  The operation that generates this gcode is called "Teeth Finish"
I also attached the spreadsheet I used to calculate the error.

Are there some settings I can change to reduce the calculated error so it's less then 0.005"?
14 REPLIES 14
Message 2 of 15
SGoldthwaite
in reply to: SGoldthwaite

SGoldthwaite
Collaborator
Collaborator
Achim

I saw you posted a solution, but now it's gone.  Did you delete your post?
0 Likes

Achim

I saw you posted a solution, but now it's gone.  Did you delete your post?
Message 3 of 15
AchimN
in reply to: SGoldthwaite

AchimN
Community Manager
Community Manager
Jep, the code i posted wasn´t working for your issue, working on it now  😉


Achim.N
Principal Technology Consultant
0 Likes

Jep, the code i posted wasn´t working for your issue, working on it now  😉


Achim.N
Principal Technology Consultant
Message 4 of 15
AchimN
in reply to: SGoldthwaite

AchimN
Community Manager
Community Manager
try this code in onCircular please:

  var radius= Math.sqrt(Math.pow(xyzFormat.format(cx - start.x), 2) + Math.pow(xyzFormat.format(cy - start.y), 2));
  var error= Math.abs(Math.sqrt(Math.pow(xyzFormat.format(x) - xyzFormat.format(cx), 2) + Math.pow(xyzFormat.format(y) - xyzFormat.format(cy), 2)) - radius) /radius;
 
  if (getCircularPlane() == PLANE_XY) {
    if (error > toPreciseUnit(0.0049, IN)) {
      linearize(tolerance);
      return;
    }
  }



This will only work for XY arcs, what about YZ, ZX arcs?

Let me know if it is working.


Achim.N
Principal Technology Consultant
0 Likes

try this code in onCircular please:

  var radius= Math.sqrt(Math.pow(xyzFormat.format(cx - start.x), 2) + Math.pow(xyzFormat.format(cy - start.y), 2));
  var error= Math.abs(Math.sqrt(Math.pow(xyzFormat.format(x) - xyzFormat.format(cx), 2) + Math.pow(xyzFormat.format(y) - xyzFormat.format(cy), 2)) - radius) /radius;
 
  if (getCircularPlane() == PLANE_XY) {
    if (error > toPreciseUnit(0.0049, IN)) {
      linearize(tolerance);
      return;
    }
  }



This will only work for XY arcs, what about YZ, ZX arcs?

Let me know if it is working.


Achim.N
Principal Technology Consultant
Message 5 of 15
SGoldthwaite
in reply to: SGoldthwaite

SGoldthwaite
Collaborator
Collaborator
The post failed (see attached). 

I'm only doing x-y arcs right now, but I do want to do some 3D stuff in the future.
0 Likes

The post failed (see attached). 

I'm only doing x-y arcs right now, but I do want to do some 3D stuff in the future.
Message 6 of 15
AchimN
in reply to: SGoldthwaite

AchimN
Community Manager
Community Manager
The code was only into the wrong place into your post, thats why it failed, try this one please.


Achim.N
Principal Technology Consultant
0 Likes

The code was only into the wrong place into your post, thats why it failed, try this one please.


Achim.N
Principal Technology Consultant
Message 7 of 15

Laurens-3DTechDraw
Mentor
Mentor
Achim,
Where does this error come from?
Is the data from the system wrong or is the post just not using the info correctly?

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


0 Likes

Achim,
Where does this error come from?
Is the data from the system wrong or is the post just not using the info correctly?

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 8 of 15
AchimN
in reply to: SGoldthwaite

AchimN
Community Manager
Community Manager
What i´ve seen yesterday is that this is only because of rounding. When I use the values without any formats the error is something like 0,000004532, so nearly nothing. Another question, linuxcnc also supports radius format for G2/3 which is often the better choise to avoid exactly those issues. Did anyone try this on a linuxcnc?


Achim.N
Principal Technology Consultant
0 Likes

What i´ve seen yesterday is that this is only because of rounding. When I use the values without any formats the error is something like 0,000004532, so nearly nothing. Another question, linuxcnc also supports radius format for G2/3 which is often the better choise to avoid exactly those issues. Did anyone try this on a linuxcnc?


Achim.N
Principal Technology Consultant
Message 9 of 15

Laurens-3DTechDraw
Mentor
Mentor
Achim wrote:

What i´ve seen yesterday is that this is only because of rounding. When I use the values without any formats the error is something like 0,000004532, so nearly nothing. Another question, linuxcnc also supports radius format for G2/3 which is often the better choise to avoid exactly those issues. Did anyone try this on a linuxcnc?

Got ya!

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


0 Likes

Achim wrote:

What i´ve seen yesterday is that this is only because of rounding. When I use the values without any formats the error is something like 0,000004532, so nearly nothing. Another question, linuxcnc also supports radius format for G2/3 which is often the better choise to avoid exactly those issues. Did anyone try this on a linuxcnc?

Got ya!

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 10 of 15
SGoldthwaite
in reply to: SGoldthwaite

SGoldthwaite
Collaborator
Collaborator
Achim wrote:

The code was only into the wrong place into your post, thats why it failed, try this one please.


It's working now.  I even generated some gcode that was causing an error on GRBL and it's ran fine.  Thanks!
0 Likes

Achim wrote:

The code was only into the wrong place into your post, thats why it failed, try this one please.


It's working now.  I even generated some gcode that was causing an error on GRBL and it's ran fine.  Thanks!
Message 11 of 15
AchimN
in reply to: SGoldthwaite

AchimN
Community Manager
Community Manager
Ok perfect, thanks for the feedback. This code will be included in the generic post for future releases.


Achim.N
Principal Technology Consultant
0 Likes

Ok perfect, thanks for the feedback. This code will be included in the generic post for future releases.


Achim.N
Principal Technology Consultant
Message 12 of 15
fonsecr
in reply to: SGoldthwaite

fonsecr
Autodesk
Autodesk
I just looked at this example. And the error for the move you list is only 0.0002" which is well below then your 0.005" limit. So not sure why your CNC control would error out for this case. Since 4 decimals are used you can expect a maximum error around 0.0002" when coordinates are rounded up and down, respectively.

Maybe the CNC is actually failing for a different move?

René

René Fonseca
Software Architect

0 Likes

I just looked at this example. And the error for the move you list is only 0.0002" which is well below then your 0.005" limit. So not sure why your CNC control would error out for this case. Since 4 decimals are used you can expect a maximum error around 0.0002" when coordinates are rounded up and down, respectively.

Maybe the CNC is actually failing for a different move?

René

René Fonseca
Software Architect

Message 13 of 15
SGoldthwaite
in reply to: SGoldthwaite

SGoldthwaite
Collaborator
Collaborator
René Fonseca wrote:

I just looked at this example. And the error for the move you list is only 0.0002" which is well below then your 0.005" limit. So not sure why your CNC control would error out for this case. Since 4 decimals are used you can expect a maximum error around 0.0002" when coordinates are rounded up and down, respectively.

Maybe the CNC is actually failing for a different move?


Did you look at the spreadsheet with the calculation that's in the original post?
0 Likes

René Fonseca wrote:

I just looked at this example. And the error for the move you list is only 0.0002" which is well below then your 0.005" limit. So not sure why your CNC control would error out for this case. Since 4 decimals are used you can expect a maximum error around 0.0002" when coordinates are rounded up and down, respectively.

Maybe the CNC is actually failing for a different move?


Did you look at the spreadsheet with the calculation that's in the original post?
Message 14 of 15

Laurens-3DTechDraw
Mentor
Mentor
SGoldthwaite wrote:

Did you look at the spreadsheet with the calculation that's in the original post?


I just put it all in a SW sketch and the biggest error in those value's I can find is 0.0006.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


0 Likes

SGoldthwaite wrote:

Did you look at the spreadsheet with the calculation that's in the original post?


I just put it all in a SW sketch and the biggest error in those value's I can find is 0.0006.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 15 of 15
fonsecr
in reply to: SGoldthwaite

fonsecr
Autodesk
Autodesk
Yes, I used your spreadsheet. Just removed your divide by radius to get the error in inches.

René

René Fonseca
Software Architect

0 Likes

Yes, I used your spreadsheet. Just removed your divide by radius to get the error in inches.

René

René Fonseca
Software Architect

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report