Welcome to Our Community

Some features disabled for guests. Register Today.

PWM/TTL control in gcode? What am I missing?

Discussion in 'Laser Cutters' started by UniqueUserName2001, Jul 8, 2018.

  1. UniqueUserName2001

    Builder

    Joined:
    May 29, 2018
    Messages:
    5
    Likes Received:
    0
    I'm using a SparkConcepts CNC xPro v3 to control my ARCO with a 5W TTL Endurance laser. All works well when I put a constant 12V on the TTL line. Laser comes on, etches well, all good. But when I connect the TTL line up to the SparkConepts D11 pin (PWM/Spindle) the laser never comes on during a print.

    Question: My workflow is currently using Inkscape to create my gcode to Universal GCode Sender. What am I not getting regarding the Z-Axis that would be used to turn on/off the laser or even set a percentage power? What would that even look like in the Inkscape drawing program to set the PWM %? Grayscale vs black? I'm just not sure how make this final connection to what is so far a well performing system.

    A snippet of my gcode that works follows. How to I get commands in there to get the SparkConepts to actually tickle the PWM/TTL D11 pin properly?

    Thanks,

    Craig

    G21 (All units in mm)

    (Start cutting path id: path9)
    (Change tool to Cylindrical cutter)

    G00 Z5.000000
    G00 X74.461860 Y63.942400

    G01 Z-1.000000 F10000.0(Penetrate)
    G01 X90.874970 Y83.582360 Z-1.000000 F750.000000
    G03 X91.808550 Y85.194676 Z-1.000000 I-4.124773 J3.464811
     
  2. Scotty Orr

    Scotty Orr Journeyman
    Builder

    Joined:
    May 21, 2015
    Messages:
    315
    Likes Received:
    178
    Somewhere you need an M3 or M4 command and an Sxxxx command (S1000 sets the laser to full power). You can see info on GRBLs laser mode here: gnea/grbl

    I'm not familiar with inkscape G-code generation, so not sure that it's capable. I use Laser4Web. If I import a grayscale image, it generates the appropriate "S" value changes.
     
  3. UniqueUserName2001

    Builder

    Joined:
    May 29, 2018
    Messages:
    5
    Likes Received:
    0
    Thanks. That is what I needed. I just found those listed in the Endurance Laser Guide. ...

    Using the GRBL version that is installed on the CNC xPro you can set your Min and Max RPM values (which control the laser intensity).
    Add the settings: $30 = 255 (RPM Max)
    $31 = 0 (RPM Min)

    Laser ON 100%: M03 S255
    Laser ON 50%: M03 S127
    Laser ON 10%: M03 S25
    Laser OFF: M03 S0 (or M05)

    So now I need to figure out if someone has Inkscape experience on how to get grayscale lines to create the appropriate S values???.

    In the meantime I'll checkout Laser4Web. Thank you for that reference.
     
  4. Scotty Orr

    Scotty Orr Journeyman
    Builder

    Joined:
    May 21, 2015
    Messages:
    315
    Likes Received:
    178
    I guess it's called LaserWeb4 now. Here are some test pieces I did for Christmas presents last year (using LaserWeb4 and a 2.3W laser). Note: you will have to play with your contrasts a bit (depending on your medium) to get good results.

    20171230_051942.jpg

    20171231_121547.jpg
     
    GrayUK likes this.
  5. BNMaker

    BNMaker Well-Known
    Builder

    Joined:
    Jul 13, 2017
    Messages:
    62
    Likes Received:
    38
    Not an Inkscape user, but this should tell you all you need: Working with SVG - LaserWeb / CNCWeb

    One tip, set white space to 0% power, rather than turning the laser on and off. Much faster/safer as there's no millisecond delay while the driver spools up.
     
  6. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,125
    Likes Received:
    4,329
    T
    These look like Grbl 0.9 Settings. LaserWeb uses Grbl 1.1's built in Laser Mode (G0=laser off moves, G1=laser on moves. No need to send any on/off commands. M4 in start GCODE, M5 at the end of the Job, and G1 X?? Y??? S0-1000 (PWM Value) for each move

    Grbl 0.9 is terribly old, upgrade to 1.1 as soon as possible, LaserWeb basically wont even connect to anything older
     
  7. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,125
    Likes Received:
    4,329
    See Grbl Wiki -> Laser Mode -> gnea/grbl (In depth explanation)
     
    BNMaker likes this.
  8. djorima

    djorima New
    Builder

    Joined:
    Mar 11, 2019
    Messages:
    2
    Likes Received:
    0
    Bonjour,
    j'ai besoin d'aider pour savoir comment brancher en PWM / TTL Merci d'avances.
     

    Attached Files:

  9. ZombiEd

    ZombiEd New
    Builder

    Joined:
    Nov 14, 2017
    Messages:
    16
    Likes Received:
    4
    Peter,
    I'm using the Blackbox to control my C-beam with an Endurance laser (10w). I'm assuming that within Openbuilds CONTROL I still need the following to enable and disable laser mode:
    • To Enable: Send Grbl a $32=1 command.
    • To Disable: Send Grbl a $32=0 command.
    Then in the gcode M4 at the start of a job and then M5 at the end of the Job (So you prefer using M4 at the start over M3?)

    As I understand it, then
    • Use G0 to fast move and the laser with automatically turn off (for safety should I rely on this or set Sxxx to "0")
    • Use G1 to cut/engrave using Sxxx to set the laser power
    I'm using Estlcam to create my gcode and in some videos show using M106 S240 to Start Cut and M106 S0 to turn cutting off. Are these grbl ver0.9 commands? Should these be avoided.
    Also Estlcam tutorials say for lasers set max spindle speed to 100 and min to 0 so when I want 10% power S10 is what is generated.
    Finally, it doesn't look like I can change the spindle speed between cuts so to change power I would need to set up multiple tools; one for say 10% power and another for 50% power, etc.

    Sorry for the questions; I'm a complete noob and I don't think the wife would appreciate it if I burned the house down. Which reminds me of a couple more questions

    • Do you have a hardware emergency off switch? I don't think the on off button the Blackbox will function as one. (or does it?)
    • Do you have a fire extinguisher handy just in case? If so, what type, CO2?
    I have more questions, but this it for now.
     
  10. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,125
    Likes Received:
    4,329
    M106 is a Marlin command, so yeah outdated/wrong instructions

    S10 = 1% as Grbl uses the scale of 0-1000 by default. Can be changed as mentioned by changing the Max Spindle Speed, but 0-100 limits the resolution (255 physical pwm steps, at 100, you are jumping in 2.55 steps at a time for each value change). Perhaps consider cam.openbuilds.com or laserWeb4 both of which are more Grbl friendly (;

    E-stop. The BlackBox Power Switch will halt the motion control etc. But to me EMERGENCY can mean a lot of things! I like having an E-Stop on the incoming mains before the power strip. No way of anticipating whats catching fire! (Could even be the power strip!, Or the PSU. Or the work.) When I hit the E-Stop i want to cut power to EVERYTHING!

    So here's how I did mine:



    Fire Extinguisher - recommended yes - RE type, speak to your local fire department. I know some cities dislike CO2, and prefer powder. I'd hate to clean up the Powder though. If you are the by-the-seat-of-pants kind of guy, keeping the compressor full with a handheld airgun watching the job - a quick blast of air can blow out smallish flames (;
     
    David the swarfer likes this.
  11. Enrique Salcido

    Builder

    Joined:
    Jan 5, 2019
    Messages:
    9
    Likes Received:
    0

    Hello! I’m having the exact same problem, the laser is not burning when it is supposed to. Which parameters did you used for solving this?

    thanks for your time

    enrique s.
     
  12. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,125
    Likes Received:
    4,329
    Refer to the Grbl Wiki at github.com/gnea/grbl it explains it all. Worth reading the whole wiki. Its only for your own good
     

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