Laser engraving – not really getting great results

New Home Forum Mostly Printed CNC – MPCNC Advice – MPCNC Laser engraving – not really getting great results

This topic contains 293 replies, has 20 voices, and was last updated by  Ryan 10 hours, 2 minutes ago.

Viewing 30 posts - 151 through 180 (of 294 total)
  • Author
    Posts
  • #88259

    Ryan
    Keymaster

    Okay, maybe, I don’t know.

    in Marlin.cpp there is this chunk.

    // Limit check_axes_activity frequency to 10Hz
    staticmillis_t next_check_axes_ms =0;
    if (ELAPSED(ms, next_check_axes_ms)) {
    planner.check_axes_activity();
    next_check_axes_ms = ms + 100UL;
    }
    }
    The fans use this, from planner.cpp
    /**
    * Maintain fans, paste extruder pressure,
    */
    void Planner::check_axes_activity() {
    uint8_t axis_active[NUM_AXIS] = { 0 },
    tail_fan_speed[FAN_COUNT];
    1 user thanked author for this post.
    #88261

    Ryan
    Keymaster

    So, does this mean they have purposely slowed down fan response? That equation does not seem to exist in the old Marlin, but the variable still is.

    #88263

    Ryan
    Keymaster

    Confirmed.

    I commented out that equation turned everything back on, perfect etch.

    CRAP. There is no easy fix. This needs to get some sort of config.h laser setting to turn it off. But while we are at it we might as well figure out why the heck it is acclerating of fan value changes as well. If we can get rid of that as well, laser on Marlin will be top notch.

    1 user thanked author for this post.
    #88264

    Heath
    Participant

    I am so stoked i got a great image! Now I leave it to people smarter than me to figure out how to get the latest firmware to do this.

    IMG_08022019_233545_1080_x_2222_pixel

    3 users thanked author for this post.
    #88266

    Jeffeb3
    Participant

    I bet it wants a particular segment to have a certain fan speed. So even if the moves are in a line, if the fans are different, then it will stop.

    So, what was wrong with the M3 stuff?

    #88267

    Jeffeb3
    Participant

    Haha. I love the image of Heath jumping around pumping his fist at the image of Garfield and his coffee.

    #88269

    Ryan
    Keymaster

    I bet it wants a particular segment to have a certain fan speed. So even if the moves are in a line, if the fans are different, then it will stop.

    I wish I could find it but the planner is soooo packed full of things.

    So, what was wrong with the M3 stuff?

    Even the marlin page has a comment, Not for laser use….even though it is says laser/spindle. When enabled you can not disable the delay, you can not set it to 0, even setting it to 1 still causes the machine to accelerate completely on every single value change. Basically dead in the water with all the value changes that happen on a laser every 0.1mm.

    That 10hz is killing us, 100%. If we get a solution we can submit it to github, but if not I will have to kick out some laser branches for every board…boooo.

    #88270

    IamSandX
    Participant

    Okay, maybe, I don’t know.

    in Marlin.cpp there is this chunk.

    // Limit check_axes_activity frequency to 10Hz
    staticmillis_t next_check_axes_ms =0;
    if (ELAPSED(ms, next_check_axes_ms)) {
    planner.check_axes_activity();
    next_check_axes_ms = ms + 100UL;
    }
    }
    The fans use this, from planner.cpp
    /**
    * Maintain fans, paste extruder pressure,
    */
    void Planner::check_axes_activity() {
    uint8_t axis_active[NUM_AXIS] = { 0 },
    tail_fan_speed[FAN_COUNT];

    So what did you comment out?

    #88273

    Ryan
    Keymaster

    Leave just this line, from that chunk, in marlin.cpp

    planner.check_axes_activity();

    1 user thanked author for this post.
    #88275

    Heath
    Participant

    Haha. I love the image of Heath jumping around pumping his fist at the image of Garfield and his coffee.

    I think I skipped like a schoolgirl from my shop to the house feeling all smart and accomplished with my piece of cardboard to show off to my wife (who pretended to be impressed) and my son (who is a Mechanical Engineer major in college and he wanted to talk about calculus and PID loops and other things I don’t understand and I realized I wasn’t so smart and accomplished after all).

    2 users thanked author for this post.
    #88276

    Jeffeb3
    Participant

    Oh, I see. It’s only checking to see what speed the fan should be at 10Hz.

    So, either:

    a) this is a bug. Doubtful, its doing what the commwnt says.
    b) this isn’t thw right way to laser. But the laser mode stops for every move.
    c) this should be a parameter. I think either adding a CONSTANT_FAN_CHECK configuration or setting the 100UL by a condiguration value is reasonable. It’s worth a PR.

    #88277

    Jeffeb3
    Participant

    Heath, the funny thing to me is Garfield with that look on his face watching you “skip like a school girl”.

    1 user thanked author for this post.
    #88279

    Ryan
    Keymaster

    Sounds like

    b-This would be the most proper thing to fix.

    c-Not sure why this was added in the first place.

     

    #88280

    Ryan
    Keymaster

    delay

    Can’t I just add a

    If >0

    before both of these?

    Attachments:
    #88283

    Jeffeb3
    Participant

    Either there, or wherever those functions are being called. That should work.

    #88284

    Jeffeb3
    Participant

    Maybe @bcdcmcnamara (BT) or @guffy would like to take a crack at the PR. Although you’re doing great so far Ryan.

    #88285

    IamSandX
    Participant

    So why is David’s working right, but the rest of us seem to be having problems. I’m running ramps and the same laser he is. It’s late here, and I’m burned, maybe I’m just missing something…?

    #88286

    Ryan
    Keymaster

    He is using a previous version of marlin, before the delay was added in.

    #88287

    Ryan
    Keymaster

    Maybe @bcdcmcnamara (BT) or @guffy would like to take a crack at the PR. Although you’re doing great so far Ryan.

    Feel free to have a crack at it. I am definitely not touching it this weekend.

    #88288

    Guffy
    Participant

    Ok, i read the thread. And what i think.

    Laser engraving is special case and may be marlin just not ready to serve it. Old versions works relative good just because of some luck.

    Let’s thinking logically.

    Activities that drive laser should be carefully synchronized with motion and i think should be added to motion queue.

    3d printer works precisely because the extruder is stepper! It driven by same queue and isr as axis steppers.

    If cooling fan or hearer turned on +- few mm it doesn’t matter so the firmware doesn’t care.

    M3 s/m5 for milling assumed a few sec pause so this pause could be enough to flush motions queue.

    M3 o doesn’t care about motions at all. Yes, i had reccomend it to use, but now i see that probably things not so easy as i thought.

    That’s it at the moment.

    Will check the code, maybe will say something additionally.

    And maybe it’s a time to involve marlin developers

    #88304

    dkj4linux
    Participant

    So why is David’s working right, but the rest of us seem to be having problems. I’m running ramps and the same laser he is. It’s late here, and I’m burned, maybe I’m just missing something…?

    The firmware is the problem… the board, laser, and gcode file are fine. What version of the firmware are your running?

    How do you have your RAMPS and laser connected? On my RAMPS, I have the D9 fan output (a +12v PWM signal) reamapped to pin 44 (now a +5v PWM signal) to feed the TTL modulation input to the laser. The M106/M107 gcode commands now control the laser’s power.

    Pictures help.

    — David

    1 user thanked author for this post.
    #88306

    Jeffeb3
    Participant

    Guffy,

    Ideally, similar to grbl’s laser mode, there wouldn’t be any changes to acceleration because of the laser, and the changes in acceleration would finely tune the laser power. This would be a bigger change, but it would be awesome. I don’t think we need to deaign it either, because grbl already has. IIRC, there is a min on laser setting, and when the acceleration is reducing the speed by X percentage, the laser power is reduced to X times the difference between the current set point and the min. The math isn’t hard, but finding when to set it, and what the acceleration reduction is (over all axes) is necessary.

    I’m sure the main devs would be able to whip it up.

    There are a lot of marlin laser machines out there, and I’ve been impressed with how much Marlin has adapted to corner cases.

    I agree thay fundamentally, the current spindle stuff is the wrong fit. So it the fan.

    That’s talking about the “right way”. There’s still the “Right Now” options. If bastardizing the fan or spindle options makes more sense, then that’s still a worthwhile configuration.

    #88307

    dkj4linux
    Participant

    Haha. I love the image of Heath jumping around pumping his fist at the image of Garfield and his coffee.

    If Heath would burn the Garfield image on a mirror… he could see himself jumping and skipping around like a school girl 🙂

    140800_8df2db0c2c78f5f7cd5bb11dd72537e5

    140802_83a83feb209ff9f47321fd97bfea7e8a

    We were playing around with the Garfield image and etching mirrors, a couple of years ago, over on my FliteTest thread…

    https://forum.flitetest.com/index.php?threads/cutting-foam-sheets-with-a-needle.24251/page-41#post-320435

    — David

    3 users thanked author for this post.
    #88316

    Ryan
    Keymaster

    Ideally, similar to grbl’s laser mode, there wouldn’t be any changes to acceleration because of the laser, and the changes in acceleration would finely tune the laser power.

    Shoot, this is complicated. Besides better timing, my bigger laser always overshot the raster image to allow for accelerations. So this could be a software fix, before you get to excited Heffe, This would not help with vector art…but with vector art a little darker near corners usually is not an issue. For through cuts no big deal. If you add a laser power curve (I doubt a laser powers linearly) to sync with accelerations then you would need a way to tune it.

    So get the laser working as is, and try to get the software fixed, or really try to get it all in the firmware?

    #88332

    Jeffeb3
    Participant

    IMG_20190209_092856

    IMG_20190209_092900

    I am right behind you guys, just another few months. 🙂

    1 user thanked author for this post.
    #88344

    Ryan
    Keymaster

    I am definitely not touching it this weekend.

    I lied. Woke up too early so I tried pulling out all the M3/5 related delays. That didn’t change anything. I really don’t understand the planner enough to know why it still stops each value change.

    #88347

    Jeffeb3
    Participant

    Someone else must be working on this. I wonder if there are open prs about it.

    #88349

    Heath
    Participant

    Okay, maybe, I don’t know.

    in Marlin.cpp there is this chunk.

    // Limit check_axes_activity frequency to 10Hz
    staticmillis_t next_check_axes_ms =0;
    if (ELAPSED(ms, next_check_axes_ms)) {
    planner.check_axes_activity();
    next_check_axes_ms = ms + 100UL;
    }
    }
    The fans use this, from planner.cpp
    /**
    * Maintain fans, paste extruder pressure,
    */
    void Planner::check_axes_activity() {
    uint8_t axis_active[NUM_AXIS] = { 0 },
    tail_fan_speed[FAN_COUNT];

    So what did you comment out?

    Leave just this line, from that chunk, in marlin.cpp

    planner.check_axes_activity();

    Am I understanding this correctly?  To get the laser working in the Marlin 2.0 code, comment everything except that one line?  So it would look like this?

    Three lines commented out in Marlin.cpp

    // Limit check_axes_activity frequency to 10Hz
    // static millis_t next_check_axes_ms = 0;  //commented out for mpcnc-laser
    // if (ELAPSED(ms, next_check_axes_ms)) {  //commented out for mpcnc-laser
    planner.check_axes_activity();
    // next_check_axes_ms = ms + 100UL; //commented out for mpcnc-laser

     

    Three lines commented out in planner.cpp

    /**
    * Maintain fans, paste extruder pressure,
    */
    // void Planner::check_axes_activity() { //commented out for mpcnc-laser
    // uint8_t axis_active[NUM_AXIS] = { 0 }, //commented out for mpcnc-laser
    // tail_fan_speed[FAN_COUNT]; //commented out for mpcnc-laser

     

    Because if I do that, the compile fails very quickly with this error:

    Marlin.cpp:31:20: error: Marlin.h: No such file or directory

    compilation terminated.

    exit status 1
    Marlin.h: No such file or directory

    2 users thanked author for this post.
    #88350

    Ryan
    Keymaster

    Just the ones in Marlin.cpp

    #88352

    Heath
    Participant

    Removing the comments in the lines in planner.cpp and compiling again, I get the same error.

     

Viewing 30 posts - 151 through 180 (of 294 total)

You must be logged in to reply to this topic.