Elekslaser with servo and homing



  • Hi!
    I'm trying to add home switches to my eleksmaker laser (used mostly with pen-servo) and I have couple of questions/problems.
    Everything was working fine with grbl 0.9j but I obviously, couldn't use homing. I flashed grbl-servo and got home switches working with partially working servo.

    Currently I have two problems:

    • X,Y axes are not waiting (?) for servo to come down/up during drawing -> on short lines pen barely touches paper because servo movement is very small.

    • After finished drawing, servo is not rising pen before going back to home.

    @Zax could you, please tell me what are default settings for servo in your 0.9 grbl? I can't really find anything related to my problem in config.h but maybe I'm missing something.

    Of course I have #define SPINDLE_IS_SERVO uncommented in config.h

    Using T2Laser v1.5y (Registered)


  • Developer of T2Laser Software

    @Piramidowy If you disable laser mode ($32) it should wait for the servo, although I haven't used Grbl 1.1 with servo.



  • Unfortunately this doesn't change a thing. It acts exactly the same.

    Here is my config, maybe I'm blind and something obvious is configured incorrectly.

    $$
    $0=10 Step pulse, microseconds (10)
    $1=25 Step idle delay, milliseconds (25)
    $2=0 Step port invert, mask (0)
    $3=3 Direction port invert, mask (0)
    $4=0 Step enable invert, boolean (0)
    $5=0 Limit pins invert, boolean (0)
    $6=0 Probe pin invert, boolean (0)
    $10=3 Status report, mask (1)
    $11=0.020 Junction deviation, mm (0.020)
    $12=0.020 Arc tolerance, mm (0.020)
    $13=0 Report inches, boolean (0)
    $20=1 Soft limits, boolean (0)
    $21=0 Hard limits, boolean (0)
    $22=1 Homing cycle, boolean (0)
    $23=3 Homing dir invert, mask (0)
    $24=100.000 Homing feed, mm/min (100.000)
    $25=1000.000 Homing seek, mm/min (1000.000)
    $26=250 Homing debounce, milliseconds (250)
    $27=1.000 Homing pull-off, mm (1.000)
    $30=255 Max spindle speed, RPM (255)
    $31=0 Min spindle speed, RPM (0)
    $32=0 Laser mode, boolean (1)
    $100=100.000 X steps/mm (80.000)
    $101=100.000 Y steps/mm (80.000)
    $102=80.000 Z steps/mm (80.000)
    $110=5000.000 X Max rate, mm/min (5000.000)
    $111=5000.000 Y Max rate, mm/min (5000.000)
    $112=5000.000 Z Max rate, mm/min (5000.000)
    $120=800.000 X Acceleration, mm/sec^2 (800.000)
    $121=800.000 Y Acceleration, mm/sec^2 (800.000)
    $122=5000.000 Z Acceleration, mm/sec^2 (5000.000)
    $130=350.000 X Max travel, mm (400)
    $131=240.000 Y Max travel, mm (300)
    $132=200.000 Z Max travel, mm (200)


  • Developer of T2Laser Software

    @Piramidowy Grbl release notes say this should work since the servo is operating as a spindle (PWM). It appears when Grbl was modified for servo mode this was removed or replaced. I'm not sure what other options you have, perhaps post on the github to see if there's a solution.



  • What about your version of grbl 1.1? Is it possible to remove for example CoreXY support and add servo as it is in 0.9?
    Is there uncompiled version of hexes available anywhere so I can try to "mix" 1.1 with 0.9? Or it's not possible?


  • Developer of T2Laser Software

    @Piramidowy 0.9 and 1.1 are very different, you won't be able to mix them. As a workaround perhaps you can reduce the acceleration so the axis don't move so quick and the servo has time to lower?



  • Ok, thank you for clarification.
    I'll try fiddle around with settings and maybe I'll be able to figure out which one is responsible for delay when servo is moving.



  • I've tried reduced acceleration, but it doesn't help neither. I found some posts on GitHub suggesting that it has to do something with spindle delay/G4 command after lowering pen.
    At this point I've tried couple of various grbl forks but non of them worked 100%.
    I guess I have to stick to 0.9 without homing and swap grbl each time when using laser (which kinda sucks). Can't believe there is no easier/more convenient way to use laser and servo at the same time.

    Edit: G4 not M4.



  • @Zax after some tests I was able to get it (partially) working. Now I'm able to use servo + homing on grbl 1.1h.

    As I said at the beginning, with grbl 1.1 there is a problem with X&Y axes not waiting for servo to move up/down (which is obvious without additional delay- servo is just too slow compared to laser). There is need to insert dwell delay G04 of about 250-500 ms (depends of servo angle) during downwards and upwards movement. This means you need G04 P0.5 command after every M03 S255 (servo down) and after every M05 (servo up).
    First case is not a problem because there option implemented for that already (screen ->CNC mode -> plasma mode + spindle delay). Unfortunately this works ONLY for M03 and not M05. After inserting G04 P0.5 manually after every M05 commend, drawing is fine.
    Is it possible to add this feature to T2Laser? For example add servo mode working like current plasma mode but for both M03 and M05?

    G-code with plasma mode and spindle delay 0.5:

    ( Generated by T2Laser ) ![alt text](image url)
    ( DXF2Gcode for Grbl )
    ( Start Point: LL )
    ( Frame Mode : Abs. )
    ( X Maximum : 297 )
    ( Y Maximum : 209 )
    ( Laser Power: 255 )
    ( Vector Rate: 2000 )
    ( Rapid Feed : 4000 )
    ( Vector Name: Formatka_V4.dxf )
    G21
    G90
    F2000
    M05
    G01 X81 Y45 F4000
    M03 S255
    G04 P0.5
    G01 X79 Y45 F2000
    M05
    G01 X1 Y45 F4000
    M03 S255
    G04 P0.5
    G01 X0 Y45 F2000
    M05
    G01 X80 Y45 F4000

    G-code with plasma mode and spindle delay 0.5 + delay after M05 -> in this case servo is working perfectly fine

    ( Generated by T2Laser )
    ( DXF2Gcode for Grbl )
    ( Start Point: LL )
    ( Frame Mode : Abs. )
    ( X Maximum : 297 )
    ( Y Maximum : 209 )
    ( Laser Power: 255 )
    ( Vector Rate: 2000 )
    ( Rapid Feed : 4000 )
    ( Vector Name: Formatka_V4.dxf )
    G21
    G90
    F2000
    M05
    G04 P0.5

    G01 X81 Y45 F4000
    M03 S255
    G04 P0.5
    G01 X79 Y45 F2000
    M05
    G04 P0.5

    G01 X1 Y45 F4000
    M03 S255
    G04 P0.5
    G01 X0 Y45 F2000
    M05
    G04 P0.5

    0_1583771936547_plasma mode.png


  • Developer of T2Laser Software

    @Piramidowy You should be able to do this already with a custom post processor, I say should as this is new territory and I will need to do some testing. If not, then yes of course I could add a "servo mode" which does a delay in both directions.

    I will do some testing in a few minutes and see if the post processor works as I expect.

    Edit

    Well that didn't work. It does add the G04 P0.5 after any M05 but that's only at the end of the file, what you actually need is for any M03 S0 to include the dwell.

    Edit2

    I had another idea, enable Laser D12 and it will automatically convert all M03 S0 to an M05 and then the post processor laser off option can be used to add the dwell. It appears to work but of course I don't have your exact setup.

    0_1583772833525_upload-92b5a3c8-4c73-4cd6-bc62-502104f2fc06



  • @Zax I did some tests and it seems to be working, however I can't understand syntax of those custom fields. What is the meaning of those three fields? ("M03 S", "M05 G04 P.0.5" "0") Why M03 S and 0?

    Moreover, is generated g-code supposed to change after switching to Laser D12 and custom g-code? Because mine doesn't change at all- even if there is visible difference "on paper"

    BTW, it seems to work exactly the same with Grbl selected instead of Laser D12.


  • Developer of T2Laser Software

    @Piramidowy The first command is the laser on, the next is laser off and the last one is the format of the power value.

    Post processor actions do not change the on-screen G-code, they act as the data is being sent - hence the name "post processor". In my testing the standard Grbl selection even with the custom settings would not issue the delay, it required the Laser D12 but I don't have the machine to test it thoroughly.



  • @Zax, after more testing I can confirm that this setup is working perfectly good:

    • grbl-servo flashed (grbl 1.1 with custom spindle_control from cprezzi)
    • Plasma mode turned on, Spindle delay about 0.3 <- delay for servo to go down
    • Custom M05 G04 P0.2 <- delay for servo to go up

    0_1583950780585_grbl_settings.png

    I tried to add delay for laser on (servo down) with custom command that includes G04 delay instead of Plasma mode but it's not working (tried M03 S G04 P0.5 and M03 S100 G04 P0.5).
    While doing my research, I found more posts like this on various groups (elekslaser + servo addon users), so maybe you would like to consider adding "servo mode" switch to realize all of this in next version so it would be possible to use laser/servo without flashing arduino every time.

    Anyway, thanks a lot for help!


  • Developer of T2Laser Software

    @Piramidowy So the servo is delayed going up and down using my workaround. That's great news.

    The dwell command for laser on won't work as the spindle value is appended and that is no longer valid G-code.

    There is no way in software to do what you suggest, it is the firmware that is configured for servo PWM or laser PWM.



  • @Zax said in Elekslaser with servo and homing:

    There is no way in software to do what you suggest, it is the firmware that is configured for servo PWM or laser PWM.

    Yes, I understand that it PWM has to be changed either for servo or laser. I found some fork with switchable PWM via $32 command (0-spindle, 1-laser, 2-servo) but I'm yet to test it. As i understand it should be possible to modify grbl in a way that allows that (maybe I'm wrong :) )
    The "servo mode" I was asking about would be only for specifying servo up/down delays. So it wouldn't be necessary to turn on plasma+custom post-processor.


  • Developer of T2Laser Software

    @Piramidowy I would be interested in that firmware if it works. I have only tried to implement CoreXY, Servo and Homing and there was no way to get the size within Nano limitations but for your application that should be possible.

    Yes, I can add a servo mode to easily implement the pre and post dwell although I prefer using a post processor than modifying the base G-code (this keeps it standard).


Log in to reply
 

Looks like your connection to Offical Forum was lost, please wait while we try to reconnect.