laser on too early

Hi,

When using inkscape with repetier plugin I made a g-code file of some text.
Manually I have to set the Z-height so the laser is focussed.

When I start the g-code the laser instantly switches on even before starting engraving the text.
So from the 0,0 coordinates to the start of the text laser already on.
My text is offset from center due to delta printer.
Is the a bug or is there a way to fix this problem?

thanks

Comments

  • Make sure the travel moves use G0 not G1. G1 will enable it on the way while G0 keeps laser off until target is reached.
  • Repetier said:
    Make sure the travel moves use G0 not G1. G1 will enable it on the way while G0 keeps laser off until target is reached.
    How do I do that?

    In de repetier plugin for inkscape there is no setting for that.

    This is the beginning of the code created bij repetier plugin:

    M452
    M3 S255

    G90
    G21
    G0 F5000
    G0 X46.6438 Y-14.1442

    G1 F1000.000000
    G1 X41.6608 Y-26.4583
    G1 X39.5773 Y-26.4583
    G1 X34.6273 Y-14.1442
    G1 X36.8763 Y-14.1442
    G1 X40.6907 Y-23.9448
    G1 X44.472 Y-14.1442
    G1 X46.6438 Y-14.1442
    G0 F5000
    G0 X32.224 Y-26.4583

    G1 F1000.000000
    G1 X30.1515 Y-26.4583
    G1 X30.1515 Y-19.4469
    G3 X30.125 Y-18.5998 I-13.5801 J-0.
    G3 X30.0523 Y-17.8594 I-10.4435 J-0.6527
    G3 X29.8921 Y-17.1318 I-4.3441 J-0.575
    G3 X29.6885 Y-16.6908 I-1.7785 J-0.5537
    G3 X29.3552 Y-16.2938 I-1.3851 J-0.8245
    G3 X28.8947 Y-16.0073 I-1.1513 J-1.337


    etc etc etc
  • And you see the code contains G0 and G1 moves as required, so that is ok.

    So at which point does laser turn on? You can send it line by line to check that. Maybe firmware is not configured correctly.
  • edited March 2019
    Hi,

    laser switches on (pin 57 HIGH) with this line: G0 X46.6438 Y-14.1442

    In configuration.h

    #define SUPPORT_LASER 1
    #define LASER_PIN 57
    #define LASER_ON_HIGH 1

    If I move the head manually using G0 X10 Y10  laser is on also when moving using repetier host manual control

    is this correct?

    thanks

  • In Commands.com you should have

    case 0: // G0 -> G1
    case 1: // G1
    #if defined(SUPPORT_LASER) && SUPPORT_LASER
    {
    // disable laser for G0 moves
    bool laserOn = LaserDriver::laserOn;
    if (Printer::mode == PRINTER_MODE_LASER) {
    if (com->G == 0 || (!LaserDriver::laserOn && !com->hasE())) {
    LaserDriver::laserOn = false;
    LaserDriver::firstMove = true; // set G1 flag for Laser
    } else {
    #if LASER_WARMUP_TIME > 0
    uint8_t power = (com->hasX() || com->hasY()) &&
    (LaserDriver::laserOn || com->hasE())
    ? LaserDriver::intensity
    : 0;
    if (power > 0 && LaserDriver::firstMove) {
    PrintLine::waitForXFreeLines(1, true);
    PrintLine::LaserWarmUp(LASER_WARMUP_TIME);
    LaserDriver::firstMove = false;
    }
    }
    }

    You see if (com->G == 0 sets laserOn false, so should be off at that move. And so far it always worked so wondering what you did that it does not work here. Does laser turn off for G1 instead? Then you might have LASER_ON_HIGH wrong also it would be safer that it only turns on with high signal. Also check no other function uses pin 57 to interfere.
  • Hi,

    Still not working correctly.

    I checked, no other assigned to pin 57 except #define ANALYZER_CH7 57 // ysig in Repetier.h
    The code in Commands.ccp is same so no issue there.

    I tried the following.

    Two letters, A and B about 5 cm apart from each other in inkscape
    made a gcode file using repetier plugin.

    The first move: G0 X30.0391 Y-17.3763 laser already on. 
    The other G0 move in the code laser is off. So very strange.

    Complete code below.

    M452
    M3 S255

    G90
    G21
    G0 F5000
    G0 X30.0391 Y-17.3763

    G1 F1000.000000
    G2 X29.8967 Y-18.7197 I-6.4116 J0.
    G2 X29.5182 Y-19.8071 I-4.5545 J0.976
    G2 X28.8966 Y-20.779 I-4.7076 J2.3261
    G2 X28.1167 Y-21.5434 I-3.6613 J2.9552
    G2 X27.0162 Y-22.2458 I-4.125 J5.2499
    G2 X25.8223 Y-22.7093 I-2.9101 J5.7274
    G2 X24.5677 Y-22.9521 I-2.1079 J7.528
    G2 X22.6597 Y-23.0565 I-1.908 J17.3764
    G1 X16.1112 Y-23.0565
    G1 X16.1112 Y-4.5894
    G1 X21.5807 Y-4.5894
    G2 X23.5986 Y-4.639 I0. J-41.0803
    G2 X24.6068 Y-4.7383 I-0.5083 J-10.336
    G2 X25.5858 Y-4.967 I-0.8941 J-6.0353
    G2 X26.5292 Y-5.3584 I-1.9335 J-5.9939
    G2 X27.4373 Y-6.0023 I-1.9373 J-3.6944
    G2 X28.0051 Y-6.735 I-1.9731 J-2.1153
    G2 X28.3355 Y-7.5991 I-2.9155 J-1.61
    G2 X28.464 Y-8.7318 I-4.9288 J-1.1327
    G2 X28.2807 Y-9.9873 I-4.3917 J0.
    G2 X27.7942 Y-10.9766 I-3.1768 J0.9478
    G2 X27.0325 Y-11.7857 I-3.603 J2.6292
    G2 X26.0083 Y-12.4525 I-3.4374 J4.1596
    G1 X26.0083 Y-12.5517
    G2 X27.73 Y-13.192 I-1.2076 J-5.8821
    G2 X28.9601 Y-14.2012 I-2.198 J-3.9332
    G2 X29.7397 Y-15.565 I-3.1229 J-2.69
    G2 X30.0391 Y-17.3762 I-5.3295 J-1.8112
    G1 X30.0391 Y-17.3763
    G0 F5000
    G0 X27.4842 Y-17.4755

    G1 F1000.000000
    G3 X27.382 Y-16.3838 I-5.884 J-0.
    G3 X27.1493 Y-15.7019 I-2.4963 J-0.4713
    G3 X26.7207 Y-15.1375 I-1.7795 J-0.9065
    G3 X25.9339 Y-14.5857 I-2.4837 J-2.7044
    G3 X25.318 Y-14.3443 I-1.4359 J-2.757
    G3 X24.4828 Y-14.1888 I-1.3528 J-4.9461
    G3 X23.6377 Y-14.1189 I-1.4372 J-12.2182
    G3 X22.424 Y-14.0896 I-1.2137 J-25.1894
    G1 X18.5669 Y-14.0896
    G1 X18.5669 Y-20.9605
    G1 X21.8163 Y-20.9605
    G3 X23.4248 Y-20.9115 I0. J26.4036
    G3 X24.458 Y-20.7993 I-0.6709 J10.9922
    G3 X25.4512 Y-20.5354 I-0.9241 J5.4789
    G3 X26.1447 Y-20.1792 I-1.1038 J3.0023
    G3 X26.7695 Y-19.6342 I-2.1779 J3.1273
    G3 X27.1617 Y-19.0754 I-1.9005 J1.751
    G3 X27.3888 Y-18.4319 I-2.1643 J1.1254
    G3 X27.4842 Y-17.4755 I-4.7455 J0.9565
    G1 X27.4842 Y-17.4755
    G0 F5000
    G0 X25.9091 Y-9.0543

    G1 F1000.000000
    G3 X25.8449 Y-8.3993 I-3.3752 J0.
    G3 X25.6858 Y-7.9257 I-1.9089 J-0.3776
    G3 X25.4034 Y-7.522 I-1.4092 J-0.6855
    G3 X24.9665 Y-7.1815 I-1.4244 J-1.3769
    G3 X24.3593 Y-6.9237 I-1.3744 J-2.3925
    G3 X23.5526 Y-6.7722 I-1.1877 J-4.1029
    G3 X22.7203 Y-6.7113 I-1.3999 J-13.4015
    G3 X21.4939 Y-6.6854 I-1.2265 J-29.0907
    G1 X18.5669 Y-6.6854
    G1 X18.5669 Y-12.0184
    G1 X21.7419 Y-12.0184
    G3 X22.8925 Y-11.9835 I0. J18.9557
    G3 X23.5774 Y-11.9068 I-0.4125 J6.7836
    G3 X24.2349 Y-11.72 I-0.6316 J3.4741
    G3 X24.8425 Y-11.4107 I-1.2825 J3.2703
    G3 X25.3464 Y-10.973 I-1.2257 J1.9202
    G3 X25.661 Y-10.4558 I-1.423 J1.2197
    G3 X25.8395 Y-9.8465 I-2.6736 J1.114
    G3 X25.9091 Y-9.0543 I-4.4762 J0.7922
    G1 X25.9091 Y-9.0543
    G0 F5000
    G0 X-31.3401 Y-23.0565

    G1 F1000.000000
    G1 X-33.957 Y-23.0565
    G1 X-35.7678 Y-17.9095
    G1 X-43.7549 Y-17.9095
    G1 X-45.5656 Y-23.0565
    G1 X-48.0585 Y-23.0565
    G1 X-41.3364 Y-4.5894
    G1 X-38.0622 Y-4.5894
    G1 X-31.3401 Y-23.0565
    G0 F5000
    G0 X-36.5243 Y-15.8011

    G1 F1000.000000
    G1 X-39.7613 Y-6.735
    G1 X-43.0107 Y-15.8011
    G1 X-36.5243 Y-15.8011
    G0 F5000
    G91
    G0 Z-0.20000000298023224
    G90
    G0 X30.0391 Y-17.3763

    G1 F1000.000000
    G2 X29.8967 Y-18.7197 I-6.4116 J0.
    G2 X29.5182 Y-19.8071 I-4.5545 J0.976
    G2 X28.8966 Y-20.779 I-4.7076 J2.3261
    G2 X28.1167 Y-21.5434 I-3.6613 J2.9552
    G2 X27.0162 Y-22.2458 I-4.125 J5.2499
    G2 X25.8223 Y-22.7093 I-2.9101 J5.7274
    G2 X24.5677 Y-22.9521 I-2.1079 J7.528
    G2 X22.6597 Y-23.0565 I-1.908 J17.3764
    G1 X16.1112 Y-23.0565
    G1 X16.1112 Y-4.5894
    G1 X21.5807 Y-4.5894
    G2 X23.5986 Y-4.639 I0. J-41.0803
    G2 X24.6068 Y-4.7383 I-0.5083 J-10.336
    G2 X25.5858 Y-4.967 I-0.8941 J-6.0353
    G2 X26.5292 Y-5.3584 I-1.9335 J-5.9939
    G2 X27.4373 Y-6.0023 I-1.9373 J-3.6944
    G2 X28.0051 Y-6.735 I-1.9731 J-2.1153
    G2 X28.3355 Y-7.5991 I-2.9155 J-1.61
    G2 X28.464 Y-8.7318 I-4.9288 J-1.1327
    G2 X28.2807 Y-9.9873 I-4.3917 J0.
    G2 X27.7942 Y-10.9766 I-3.1768 J0.9478
    G2 X27.0325 Y-11.7857 I-3.603 J2.6292
    G2 X26.0083 Y-12.4525 I-3.4374 J4.1596
    G1 X26.0083 Y-12.5517
    G2 X27.73 Y-13.192 I-1.2076 J-5.8821
    G2 X28.9601 Y-14.2012 I-2.198 J-3.9332
    G2 X29.7397 Y-15.565 I-3.1229 J-2.69
    G2 X30.0391 Y-17.3762 I-5.3295 J-1.8112
    G1 X30.0391 Y-17.3763
    G0 F5000
    G0 X27.4842 Y-17.4755

    G1 F1000.000000
    G3 X27.382 Y-16.3838 I-5.884 J-0.
    G3 X27.1493 Y-15.7019 I-2.4963 J-0.4713
    G3 X26.7207 Y-15.1375 I-1.7795 J-0.9065
    G3 X25.9339 Y-14.5857 I-2.4837 J-2.7044
    G3 X25.318 Y-14.3443 I-1.4359 J-2.757
    G3 X24.4828 Y-14.1888 I-1.3528 J-4.9461
    G3 X23.6377 Y-14.1189 I-1.4372 J-12.2182
    G3 X22.424 Y-14.0896 I-1.2137 J-25.1894
    G1 X18.5669 Y-14.0896
    G1 X18.5669 Y-20.9605
    G1 X21.8163 Y-20.9605
    G3 X23.4248 Y-20.9115 I0. J26.4036
    G3 X24.458 Y-20.7993 I-0.6709 J10.9922
    G3 X25.4512 Y-20.5354 I-0.9241 J5.4789
    G3 X26.1447 Y-20.1792 I-1.1038 J3.0023
    G3 X26.7695 Y-19.6342 I-2.1779 J3.1273
    G3 X27.1617 Y-19.0754 I-1.9005 J1.751
    G3 X27.3888 Y-18.4319 I-2.1643 J1.1254
    G3 X27.4842 Y-17.4755 I-4.7455 J0.9565
    G1 X27.4842 Y-17.4755
    G0 F5000
    G0 X25.9091 Y-9.0543

    G1 F1000.000000
    G3 X25.8449 Y-8.3993 I-3.3752 J0.
    G3 X25.6858 Y-7.9257 I-1.9089 J-0.3776
    G3 X25.4034 Y-7.522 I-1.4092 J-0.6855
    G3 X24.9665 Y-7.1815 I-1.4244 J-1.3769
    G3 X24.3593 Y-6.9237 I-1.3744 J-2.3925
    G3 X23.5526 Y-6.7722 I-1.1877 J-4.1029
    G3 X22.7203 Y-6.7113 I-1.3999 J-13.4015
    G3 X21.4939 Y-6.6854 I-1.2265 J-29.0907
    G1 X18.5669 Y-6.6854
    G1 X18.5669 Y-12.0184
    G1 X21.7419 Y-12.0184
    G3 X22.8925 Y-11.9835 I0. J18.9557
    G3 X23.5774 Y-11.9068 I-0.4125 J6.7836
    G3 X24.2349 Y-11.72 I-0.6316 J3.4741
    G3 X24.8425 Y-11.4107 I-1.2825 J3.2703
    G3 X25.3464 Y-10.973 I-1.2257 J1.9202
    G3 X25.661 Y-10.4558 I-1.423 J1.2197
    G3 X25.8395 Y-9.8465 I-2.6736 J1.114
    G3 X25.9091 Y-9.0543 I-4.4762 J0.7922
    G1 X25.9091 Y-9.0543
    G0 F5000
    G0 X-31.3401 Y-23.0565

    G1 F1000.000000
    G1 X-33.957 Y-23.0565
    G1 X-35.7678 Y-17.9095
    G1 X-43.7549 Y-17.9095
    G1 X-45.5656 Y-23.0565
    G1 X-48.0585 Y-23.0565
    G1 X-41.3364 Y-4.5894
    G1 X-38.0622 Y-4.5894
    G1 X-31.3401 Y-23.0565
    G0 F5000
    G0 X-36.5243 Y-15.8011

    G1 F1000.000000
    G1 X-39.7613 Y-6.735
    G1 X-43.0107 Y-15.8011
    G1 X-36.5243 Y-15.8011
    G0 F5000
    G91
    G0 Z0.20000000298023224
    G90
    M5 S0
    G0 X0 Y0
    M18




  • So it works correctly except first move?
  • That's right.

    Today I tried a few things.
    Replaced my Arduino mega -> no difference
    Uploaded the latest firmware -> no difference

    Still first G0 move laser on

    I am out of ideas ..
  • Repetier said:
    Does laser turn off for G1 instead? Then you might have LASER_ON_HIGH wrong also it would be safer that it only turns on with high signal. Also check no other function uses pin 57 to interfere.

    Like he said, does it move manually and remain off, with a G1 code? From the looks of it you have a G!,G2 and G3 code used between the G0 codelines.
  • edited March 2019
    Roko said:
    Repetier said:
    Does laser turn off for G1 instead? Then you might have LASER_ON_HIGH wrong also it would be safer that it only turns on with high signal. Also check no other function uses pin 57 to interfere.

    Like he said, does it move manually and remain off, with a G1 code? From the looks of it you have a G!,G2 and G3 code used between the G0 codelines.
    Beside this line: G0 X30.0391 Y-17.3763 its working as it should. laser is on when pin 47 is High.
    btw how doe I check if pin 57 is used by something else?

    If I use other software like 'laser engraver'  there is no issue at all.

Sign In or Register to comment.