Author Topic: Creating gcode loops for lasergrbl buttons  (Read 289 times)

curious aardvark

  • Newbie
  • *
  • Posts: 7
    • View Profile
Creating gcode loops for lasergrbl buttons
« on: June 02, 2018, 08:21:12 AM »
I have just spent an hour ot two going through every gcode loop method I can find (more than you'd think)) and none of them work for lasergrbl buttons.

I just want to repeat the outline for the thing about to be cut.

I can do it once with low power laser, no problem.

Quote
(start of loop would go here)

G0 X
Y[bottom] F3000
F2000
M4 S200
G1 X
Y[top]
G1 X
Y[top]
G1 X
Y[bottom]
G1 X
y[bottom]

(end loop would go here)

M5
G0 X0 Y0 F3000
But to get something correctly placed for engraving I need to remotely repeat that either till told to stop or a set number of times.

Anybody have a clue how to do this ?

I'm using a cheap eleksmaker a3 clone, with a few mods. So positioning of parts to be cut/engraved is a manual job and fairly crucial. 
Also I'm extremely new to g-code :-) So any explanations need to be pretty basic.

I have created a button that runs the outline 5 times with low laser, simply by copying and pasting the middle bit 5x.
 
Not elegant and not easy to change the number of iterations. But for the time being, it'll do the job. I suppose I can paste it 10x and make another button.
But would be a lot easier if you could just change one number and that would change the number of frame outlines.

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 2742
  • Administrator
    • View Profile
Re: Creating gcode loops for lasergrbl buttons
« Reply #1 on: June 02, 2018, 08:23:49 AM »
I've never seen any documentation on being able to loop g-code...I don't think it supports it.
Admin -- Ralph -- support @ BenCutLaser dot us
https://www.dropbox.com/s/qv1qee2vb65785t/SetupBenCutLaser3.2a.zip?dl=0
BCL Paid license: $49.95
via Paypal to bclpp@primemail.com

pascalp

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: Creating gcode loops for lasergrbl buttons
« Reply #2 on: June 02, 2018, 08:27:41 AM »
Gcode support loop (O code) but grbl didn't.
I hope that it will be implemented someday.
Eleksmaker A5 , 2500mW
Mana SE , home switches D9 , 1kohm resistor.  GRBL 1.1
Mostly Tablet and W10
T2 Laser : registered  .  BCL : registered

Administrator

  • Administrator
  • Hero Member
  • *****
  • Posts: 2742
  • Administrator
    • View Profile
Re: Creating gcode loops for lasergrbl buttons
« Reply #3 on: June 02, 2018, 08:39:01 AM »
On our controller boards there isn't any memory left to add new features such as a looping structure...so I'm not expecting to see it ever being added.

@pascalp you are correct: it's our Grbl versions that don't support g-code looping.

If you want to loop g-code (our grbl) you have to copy your g-code lines however many times you want to loop. That's the way I had to design BenCutLaser to implement 'multiple passes'.
Admin -- Ralph -- support @ BenCutLaser dot us
https://www.dropbox.com/s/qv1qee2vb65785t/SetupBenCutLaser3.2a.zip?dl=0
BCL Paid license: $49.95
via Paypal to bclpp@primemail.com

curious aardvark

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Creating gcode loops for lasergrbl buttons
« Reply #4 on: June 03, 2018, 10:15:39 AM »
Yeah came to the same conclusion.

I actually found 4 completely different ways to loop gcode. None of them work on the grbl code.

But the button I made does 5 loops round the frame with very low power laser. Not sure what it does if you're using offsets.
haven't tested that yet.
Attached my grbl buttons file anyway.
It's got: 5x frame loop button.
10% (ish) laser on button
100% laser on button
laser off button.

Why grbl doesn't come with these as standard I don't know. I've read the authors explanation: 'people can make their own buttons'.
Well yes, but I would have thought those 4 I made should be basic commands for any laser engraving software.

Even the fancy ones don't seem to have them.

And i think now I've tried most of them.

Anyway a nice slow 5 repeat loop clicked a couple of times lets you get pretty good object placement :-)

Hopefully my next problem will be as easily solved :-)