Swapping X/Y output in v1.6.00 causes laser not going back to start position

Swapping X/Y output to laser in v1.6.00 causes laser not going back anymore to start position after burning, when starting from current position :

  • My Laser offset is enabled : X= -16mm, Y=0mm becomes X= 0mm, Y=-16mm when enabling “Swap X/Y” (this is correct)
  • Starting from current position, after burning the final position is now offset from starting position X+16, Y-16.
  • Disabling “Swap X/Y output to laser” solves the problem… but I would appreciate to activate this option
    Regards
2 Likes

Hi Gaetan

Thank you for reporting this.
Will try to replicate my end and report back!

2 Likes

EDIT: I think i got it replicated.
Will update asap :slight_smile:

I seem unable to replicate it my side

Could i ask

  • Starting from current position, after burning the final position is now offset from starting position X+16, Y-16.
    Please click Save Gcode → Save as XY.gcode

  • Disabling “Swap X/Y output to laser” solves the problem… but I would appreciate to activate this option
    Please click Save Gcode → Save as NoXY.gcode

And upload both here please?

@Gaetan
Please check your Private Message.

The Dev team was able to find the issue and built a Patch Fix version.
Please give it a try and report back?

Thanks!

@gilaraujo Thank you for your very fast response !
There is progress… but sadly it is not totaly fixed.

This is quite interesting : the fix works for circles but not for squares or rectangles ; it works for some triangles but not all (!) : it looks like it depends upon the rotation angle of the triangle.
Let’s simplify :slight_smile:

  • Laser offset is enabled : X = 0, Y = -16mm
  • Burning from Current position, Job position = Top Left, Cut selected graphic = On, Use Selection Origin = On, Optimize Cut Path = On
  • In Lightburn create a triangle : “Create regular polygon” , shape properties = 3 sides. This is our initial triangle.
  • Burning this initial triangle, finish position is now offset from start position : X+22mm
  • Now, rotating this triangle with different values, we have this results :
    ** Rotation of initial triangle to 60° : finish position is now equal to start position :ok_hand:
    ** Rotation of initial triangle to 30° : finish position is offset from start position : X+22mm :point_right:
    ** AND Rotation of initial triangle to 15° : finish position is offset from start position : X-22mm :point_left: (yes, the opposite side)

Please note however that the framing is always correct and finishes in start position.

Regards,

1 Like

Good Morning Gaétan

I missed something there, Will replicate and report back to the team!

Thanks for the detailed write up!

Hi Gaétan

I tried to follow your steps exact, but I can’t really replicate the rotation error.

Would it be possible for you to send me a couple LRBN or better yet . Gcode files of the output of each of your tests?

Maybe we have some variable that is not the same for you and me
On all rotations my End position is correct.

EDIT : this forum don’t authorize me to send more than two files at once.

Good evening @gilaraujo
I try to figure out what’s going wrong and this is not easy…
I have found that there are problems with two parameters :

  • When Optimize Cut Pass is ON, AND Optimization Settings > Choose Best Starting Point is ON, sometimes the finish point is not the starting point
  • There is another problem with Job Origin : starting with Current position, changing Job origin from Top Left to Bottom Right give different finish points

I join two Lightburn files and some Gcode files :

Triangles - Choose best starting point.lbrn2 (546,0 Ko)
Triangles - Job Origin.lbrn2 (473,2 Ko)

Triangles - Choose best starting point OFF - Rot 0°.gcode (333 Octets)
Triangles - Choose best starting point ON - Rot 0°.gcode (322 Octets)

Triangles - Job Origin Bottom Right.gcode (329 Octets)
Triangles - Job Origin Top Left.gcode (340 Octets)

Maybe I have a clue.

I’m not familiar with Gcode, but typing this code in the Console should move the pointer and revert it to it’s start position, isn’t it ?
G91 G0 Y0X-16 G0 Y0X16

But for me it is not the case, finish position is offset from start position to Y+22mm

For my pointer to go back to start position, I have to type this code :
G91 G0 Y0X-16 G0 Y0X+16

And this is not dependent of the Swap XY option.

Type for me please in console
$#
Press enter
Copy/paste output

I am really trying to replicate what you are seeing, struggling a bit but i will get it :slight_smile:

Of course :
$#
$#
ok

I guess this is not the expected result?

You need to be connected to the machine and then you should get something like this:

[G54:-400.000,0.000,0.000]
[G55:0.000,0.000,0.000]
[G56:0.000,0.000,0.000]
[G57:0.000,0.000,0.000]
[G58:0.000,0.000,0.000]
[G59:0.000,0.000,0.000]
[G28:0.000,0.000,0.000]
[G30:0.000,0.000,0.000]
[G92:0.000,0.000,0.000]
[TLO:0.000]
[PRB:0.000,0.000,0.000:0]

XTool doesn’t actually use real GRBL firmware - they’ve hacked in a “GRBL compatibility” mode that doesn’t return normal results for settings or GCode state.

Have you tried the current public beta version (1.6.02) ?

1 Like

Hi.
Thank you for your response.
Sorry for the delay.
Thank you for the link to the 1.6.02 beta version. I have tried it and the problem is still there.
I have done countless tests to find what is wrong, and this is what I have found :

  • If I do not swap X/Y I have no problems
  • If I swap, sometimes it’s ok and sometimes not… this is irritating !

Now, simplifiyng the process, I have looked at the gcode and I’ve found that if I modify slightly the code generated by LightBurn, the problem is solved.

Example, this is the original gcode from LightBurn :

; LightBurn 1.6.02
; GRBL device profile, current position
; Bounds: X-0 Y-118.29 to X127.54 Y0

;USER START SCRIPT
M106 S0
;USER START SCRIPT

G00 G17 G40 G21 G54
G91
M4
; Cut @ 4000.002 mm/min, 20% power
M8
G0 Y-0X-15.668
; Layer Coupe
G1 Y127.543X15.668S0F4000
G1 Y-50.203X-118.289
G1 Y-77.34X102.621
M9
G1 S0
M5
; return to starting pos
G0 Y-0X15.668
M2

and this is the modified version :

; LightBurn 1.6.02
; GRBL device profile, current position
; Bounds: X-0 Y-118.29 to X127.54 Y0

;USER START SCRIPT
M106 S0
;USER START SCRIPT

G00 G17 G40 G21 G54
G91
M4
; Cut @ 4000.002 mm/min, 20% power
M8
G0 Y-0X-15.668
; Layer Coupe
G1 Y127.543X15.668S0F4000
G1 Y-50.203X-118.289
G1 Y-77.34X102.621
M9
G1 S0
M5
; return to starting pos
G0 Y-0X+15.668
M2

The only difference is in the penultimate line, the instruction to return to start position : I have added a “+” to X coordinate

Hope this helps.

Regards,
Gaetan
(Sorry, I’m French, excuse my English :wink: )

Hello @gilaraujo , have you seen my last message ? Does it make sense for you ?

That does not make any sense at all. The + should not be required because “15” is already a positive value. I wonder if the firmware is getting confused by the Y-0 (ie, the negative sign in front of the zero).

What happens if you remove the - sign in front of the zero, so it looks like this?

; return to starting pos
G0 Y0X15.668