Diagonal lines sometimes becoming right angles? [SOLVED]

Discussion about the arduino based g-code interpreter, grbl
BHSPitMonkey
Posts: 26
Joined: Thu Sep 13, 2012 8:25 pm

Diagonal lines sometimes becoming right angles? [SOLVED]

Post by BHSPitMonkey » Mon Jan 21, 2013 12:00 am

I attempted my first cut on the ShapeOko today, and have a few issues to figure out. The main problem I had was that at various times, the diagonal line being cut would suddenly change into a right angle (in other words, a line that was supposed to go from (0,0) to (5,5) would become a line from (0,0) to (0,5) followed by a line from (0,5) to (5,5).

Here's a photo showing what I mean: (The correct path is overlaid in yellow, and I've pointed out the problems in orange.)
stairstepping.jpg
Example of stairstepping issues overlaid with correct path
stairstepping.jpg (63.3 KiB) Viewed 4693 times
I'm using GRBL 0.8c on an Azteeg G1 controller board. Anyone know what causes this to happen?

(P.S. As you can see, I also had some issues with heat as well as depth inconsistency; I'm guessing these are related to feed rate and the quality of my clamping.)

EDIT: SOLUTION

I've gotten all of my issues in this thread figured out. After posting on the GRBL issue tracker for assistance, I was told that the problem was because GRBL 0.8c only accepts lines of Gcode up to 50 characters, truncating any excess characters. Inkscape's Gcodetools extension outputs all of its coordinates with 6 digits after the decimal point, so its output lines are almost always teasing this limit (and, with arcs, the codes are so long that this is pretty much a guaranteed issue). By rounding all of the numbers in my Gcode down to 2 or 3 decimal places, I was able to make perfect cuts free of deviations.

Also, in response to this, the GRBL devs released a new v0.8c build with the following changes:
  • The line limit was bumped from 50 to 70, making it generally safe to use the Gcodetools output without rounding
  • GRBL will now treat lines that exceed the limit as an error case, returning an error message instead of continuing to cut using truncated codes
You can get this new GRBL version from here: https://github.com/grbl/grbl#downloads- ... ve-link-as
Last edited by BHSPitMonkey on Mon Apr 08, 2013 1:33 am, edited 2 times in total.

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by Will Winder » Mon Jan 21, 2013 2:59 am

This looks like a stepper driver overheating. Do your drivers have heatsinks? A small fan pointing at them is also helpful.
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

BHSPitMonkey
Posts: 26
Joined: Thu Sep 13, 2012 8:25 pm

Re: Diagonal lines sometimes becoming right angles?

Post by BHSPitMonkey » Tue Mar 26, 2013 4:14 am

Sorry for the delay; I haven't had a chance to make another attempt until this week.

Since the previous attempt, I rigged up a 24v fan to keep the board cool just in case the steppers were getting too hot. Unfortunately, this time, the exact same deviations happened. I also had the same problem where certain parts of the cut were much shallower than the rest, even though I'm very confident in how flat/stable my material is mounted this time.

I've attached the gcode in case anyone wants to take a look at it. It simulates correctly in OpenSCAM for me. :(
Attachments
wing_0001.ngc
Code generated by Gcodetools.
(14.59 KiB) Downloaded 134 times

Improbable Construct
Posts: 997
Joined: Tue Apr 10, 2012 3:21 am
Location: Fairhope, AL
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by Improbable Construct » Tue Mar 26, 2013 5:04 am

I went and took a look at your build photos, the DW660 is a lot of spindle for a stock shapeoko.
The problems you are seeing could be from the spindle overpowering the gantry causing it to twist and rack.
Try running the job with the spindle running in the air and see if if tuns correctly or not.
If it does try running it so that it just skims (.25mm or so) the material to be cut.
Keep trying deeper cuts until it fails then you know your max pass depth.
If it fails in the air you have a control problem or the v wheels are too tight.
Shapeoko #Classified some of the bolts may be original parts.
Shapeoko 1 # ???? Stainless plates, still in the box.
Shapeoko 2 # 3926 not stock
Shapeoko 3 # 0003
Store:
http://ImprobableConstruct.com
Twitter:
https://twitter.com/ImprblConstruct

BHSPitMonkey
Posts: 26
Joined: Thu Sep 13, 2012 8:25 pm

Re: Diagonal lines sometimes becoming right angles?

Post by BHSPitMonkey » Tue Mar 26, 2013 5:34 am

Improbable Construct wrote:Try running the job with the spindle running in the air and see if if tuns correctly or not.
Hmm. Very odd. Even in the air, it's still performing the exact same deviations. Seems very deliberate.

But it simulates perfectly in OpenSCAM! What could this mean? Possible bug in my board or GRBL version? (0.8c)

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by cvoinescu » Tue Mar 26, 2013 1:15 pm

Can you please post your G-code? Sometimes it's just a matter of formatting. For instance if, at some point, a newline gets inserted in the middle of a G1 command, your controller will do the X and Y moves separately, resulting in a right angle where you wanted a slanted line.
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

PsyKo
Posts: 430
Joined: Thu Aug 30, 2012 8:42 pm
Location: France

Re: Diagonal lines sometimes becoming right angles?

Post by PsyKo » Tue Mar 26, 2013 1:25 pm

I think Catalin is on the right track here.
It explains why the Shapeoko goes back to the target point (not in diagonal, but in 2 X and Y moves).
If the drivers were to overheat, the overall shape wouldn't match, which is the case here except for the highlighted issue.

Opening the GCode file in Notepad++ doesn't show anything wrong. No unexpected linefeed...
What software are you using to stream GCode ?
Is this your first job ? How did the previous job go ?
Shapeoko #736
Kress 800, Z Axis upgrade, dual Y, 600mm X&Y rails, metal spacers and V Wheels, home switches, 4th axis
Goko - Free CNC Control Software - http://www.shapeoko.com/forum/viewtopic ... 380#p44380

cvoinescu
Posts: 4442
Joined: Thu Jul 19, 2012 6:50 pm
Location: Camberley, UK
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by cvoinescu » Tue Mar 26, 2013 2:02 pm

I'm sorry, I haven't noticed you posted the code. It has line feeds (Unix newlines), so if you're using it on Windows, maybe that confuses your G-code sender. Just for the sake of completeness, try this version attached here, and please tell us what OS and what you use to send the G-code.
Attachments
wing_0001a.ngc
(14.88 KiB) Downloaded 105 times
Proud owner of ShapeOko #709, eShapeOko #0, and of store.amberspyglass.co.uk

Will Winder
Posts: 435
Joined: Fri Apr 20, 2012 2:40 pm
Location: Hudson, MA
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by Will Winder » Tue Mar 26, 2013 4:22 pm

I opened both G-Code files with Universal G-Code Sender and they both looked the same. One strange thing is that the straight lines are red, meaning they are made up of arc segments. Its possible you found a bug in GRBL where it is unable to handle these arcs in an expected way.
Attachments
wing.png
wing.png (8.17 KiB) Viewed 4499 times
ShapeOko #367: Dual-Y drive, Belt on outside, 1000mm Y-Axis, DW660 Spindle, Nema-23 X/Y motors.

Primary developer on Universal Gcode Sender.

twforeman
Posts: 1347
Joined: Tue Jan 29, 2013 4:51 pm
Location: Minneapolis, MN
Contact:

Re: Diagonal lines sometimes becoming right angles?

Post by twforeman » Tue Mar 26, 2013 6:08 pm

What tool chain did you use to generate the part and the g code. The g code file says "gcodetools for inkscape" so I can guess...

The number 1 rule for CNC programming is keep it simple.

With a simple part profile like this I would draw it in LibreCAD (free, opensource, works great) since it's a 2D profile, as lines and arcs. You want straight line cuts wherever you can get them.

Then I would use CamBam to generate the G Code. The first 40 runs are free and I'm going to end up buying it.

CamBam will see the straight lines as lines and generate point to point moves for them, instead of the large arcs that gcodetools is creating.

I know a lot of people say use InkScape, but for 2D profiles LibreCAD is my go-to.
Ender 3 3D Printer
ShapeOko v3 serial #0004 - upgrade thread
All of my ShapeOko related blog posts

Post Reply