Welcome to Our Community

Some features disabled for guests. Register Today.

Cam software to add coolant off/on

Discussion in 'General Talk' started by coxsox, Jul 4, 2024.

  1. coxsox

    coxsox New
    Builder

    Joined:
    May 11, 2024
    Messages:
    41
    Likes Received:
    2
    When converting SVG to Gcode, Is it possible for the openbuilds Cam software to somehow add M8/M9 and G4 gcode commands. I'm suspecting it should do via some sort of customization, but not sure where to start....

    To give an example. If my acro wanted to draw a path....

    - Move to position X100 Y100
    - Run M8 (coolant on)
    - Run G4 P1 (dwell for 1 section)
    - Move to position X200 Y200
    - Run M9 (coolant off)
    - Run G4 P1

    then onto next path and so on.
    thanks.
     
  2. coxsox

    coxsox New
    Builder

    Joined:
    May 11, 2024
    Messages:
    41
    Likes Received:
    2
    Just to add....
    Looks like CAM can do something like this, but cant see the toolpath which uses M8/M9, closest seems to be Pen Plotter which uses M3.

    Also, any way to have multiple documents open and create multiple Gcode files taking filenames from documents ?
     
  3. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,430
    Likes Received:
    1,907
    why have you connected the laser to a coolant output? it should be connected to the PWM tool output so that M3/M5 can turn it on and off, but Sxxxx can set the power level
    why delay after the off command?

    in short, what you are trying to do is quite custom, so you are probably going to need a custom solution, something like a python or php script that inputs a standard Gcode file and transforms it into what you want.
     
    Peter Van Der Walt likes this.
  4. coxsox

    coxsox New
    Builder

    Joined:
    May 11, 2024
    Messages:
    41
    Likes Received:
    2
    Yeh, it does sound custom.....no I'm not using a laser, just need to operate an air feed, hence the coolant.

    Think you're right about a script though, I do manually edit Gcode files, and even using cut/paste/find etc, would be a lot easier with a simple script that takes a text file and replaces certain sections, just need to find one.
     
  5. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,430
    Likes Received:
    1,907
    one does not 'find a script', one WRITES a script (-:

    in the Linux world the sed command can do it in 2 lines (generated by chatgpt, so subject to testing)
    sed -i '/M3 S1000/c\M8\nG4P1' filename
    sed -i '/M5/c\M9' filename

    and here is chatgpt's attempt at python
    Code:
    # Read the contents of the file
    with open('filename.txt', 'r') as file:
        lines = file.readlines()
    
    # Open the file in write mode to replace the lines
    with open('filename.txt', 'w') as file:
        for line in lines:
            if 'M3 S1000' in line.strip():
                file.write('M8\nG4P1\n')
            elif 'M5' in line.strip():
                file.write('M9\n')
            else:
                file.write(line)
    
     
  6. coxsox

    coxsox New
    Builder

    Joined:
    May 11, 2024
    Messages:
    41
    Likes Received:
    2
    Thanks David, if you're a programmer, you may write it, but I FOUND a mate who could write one...(-:

    Anyway change of tact, discovered svg2gcode which seems to do most of what I wanted anyway, for the moment at least
     
  7. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    Regardless of what cam workflow you use, setting up machine to use m3 for tools and m8 for coolant is just smart. When driving any car do you expect the steering wheel to be the brake pedal? No. Follow standards.
     
  8. coxsox

    coxsox New
    Builder

    Joined:
    May 11, 2024
    Messages:
    41
    Likes Received:
    2
    probably reread the thread, didn't say I was using M3....
     
  9. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    14,868
    Likes Received:
    4,283
    Exactly. It should. Follow standard
     

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