Welcome to Our Community

Some features disabled for guests. Register Today.

Delay after servo move

Discussion in 'DrawBot' started by Adam Haile, Sep 19, 2019.

  1. Adam Haile

    Builder

    Joined:
    Apr 22, 2019
    Messages:
    5
    Likes Received:
    2
    I'm using cprezzi's grbl-servo: cprezzi/grbl-servo
    Works great with only needing to use M3/M5 for servo control but there's very little to no delay between pen down and pen move. I know that I could use something like LaserWeb to inject a G4 dwell but I really am used to LightBurn which is meant for lasers specifically and has no way to add that dwell.
    Anyone able to make this work with *just* M3 commands? even if it requires a firmware mod, that's fine.
     
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    2,053
    Likes Received:
    1,150
    the right place to do it is in the Gcode.
    does lightburn have a 'postprocessor' section where you can edit the Gcode generation? or is it maybe opensource?
    if not
    a decent text editor like Notepad++ can do a search and replace to add a dwell after the M3 Sxxx lines.

    why do you want a dwell after pen down? maybe there is another way to solve it (-:
     
  3. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Project Maker Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    8,071
    Likes Received:
    2,670
    You need a G4 dwell to give the servo time to move to the correct position

    You could just use a text editor and find-replace instances of "M3" with "M3\nG4 Pxxx"
    Pxxx ie the key, no two systems are the same, more travel distance, faster or slower Servos etc. This allows you to customise the wait so you dont run short, nor waste time.

    Speak to the lightburn devs he'll add it in no time
     
  4. Adam Haile

    Builder

    Joined:
    Apr 22, 2019
    Messages:
    5
    Likes Received:
    2
    Yeah.... I'm just being lazy and was curious if I could get it to work without any gcode hacking and instead just straight for lightburn. Though, I actually figured out how to do it with lightburn last night which is to use a feature meant for thick materials that turns the laser on without moving for a brief amount of time.
     
  5. TheoZuffante

    Builder

    Joined:
    Mar 6, 2019
    Messages:
    15
    Likes Received:
    0
    Anyone know how to implement a delay after m3s255 and m3s0 within the firmware itself, instead of a dwell?

    I have a large plotter running a modded grbl to work with a servo (Im using "cprezzi grbl-servo" for the firmware). The only issue is the plotter starts moving the steppers before the pen hits the paper sometimes, so I need a delay after a pen down motion to prevent this. I know I can use a dwell but that would require me to use a post processer, which I'm trying to avoid.

    Anyone have experience literally adding a delay within the firmware? I did this on another plotter by literally adding a delay(1000); after the pen movement, but that's not a great way to do it, and I'm not even sure how to with this new firmware. Would it be possible to execute a g4 command from the firmware itself?
    Or any other ideas?
     
  6. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    2,053
    Likes Received:
    1,150
    If you are fluent in C and Arduino hardware then you can hack the GRBL code to delay after pen motion. Note that when I say fluent I mean really good and experienced in the language and the platform. The GRBL code is highly optimized and uses advanced hardware tricks to squeeze every last bit of performance from that little microprocessor. Anything you do will certainly cause sideeffects, undesireable sideeffects (there is no other kind :)

    But the correct way is to do it in Gcode with a dwell. What are you using to create the Gcode?
    OR reduce the retract distance so it does not take so long to come back down?
    OR recompile GRBL and remove the AMASS code (option in config.h) which MAY cause more of a delay between Z motion and XY motion.
     
    Peter Van Der Walt likes this.
  7. TheoZuffante

    Builder

    Joined:
    Mar 6, 2019
    Messages:
    15
    Likes Received:
    0
    Im using light burn to create and send the gcode. Problem is they don't have a post processer. Ya I don't think I have enough experience with c to not cause any problems. What is this amass code? Never touched that before.
     
  8. Peter Van Der Walt

    Peter Van Der Walt OpenBuilds Team
    Staff Member Moderator Project Maker Builder Resident Builder

    Joined:
    Mar 1, 2017
    Messages:
    8,071
    Likes Received:
    2,670
    cam.openbuilds.com supports the delay

    upload_2021-1-4_20-8-20.png
     
    David the swarfer likes this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice