open and close suction vents

Results 1 to 14 of 14

Thread: open and close suction vents

  1. #1
    Member
    Join Date
    Aug 2007
    Location
    New Zealand
    Posts
    55
    Downloads
    0
    Uploads
    0

    Default open and close suction vents

    I have built my down draft table on my plasma with air rams to open and close each section of the table so i can direct the suction to the area the torch is working in, i would like to automate this process.

    I originally was going to build some switches into the zones on the y travel path and arduino it up to open and close but I think it would be more elegant if its handled within the uccnc software.

    Once the machine is homed then the vents become available, this way i don't have vents opening and closing randomly because that origin is off.
    Once available, Y position (machine coordinates) would

    Y0 - 999mm output 1
    Y1000 - 1999mm output 2
    Y2000 - 2999mm output 3
    y3000 - 3999mm output 4

    I suppose you could even go Y 500 - 1500 output 1&2, i think you get the idea.
    I would prefer not to have this solved by embedded outputs in the gcode (from the post processor).

    Can someone smarter than me suggest how I would go about making this work?

    Similar Threads:


  2. #2
    Member ger21's Avatar
    Join Date
    Mar 2003
    Location
    Shelby Township
    Posts
    35538
    Downloads
    1
    Uploads
    0

    Default Re: open and close suction vents

    macroloop?
    If you ask on the UCCNC forum, someone may even write one for you.

    Gerry

    UCCNC 2017 Screenset
    [URL]http://www.thecncwoodworker.com/2017.html[/URL]

    Mach3 2010 Screenset
    [URL]http://www.thecncwoodworker.com/2010.html[/URL]

    JointCAM - CNC Dovetails & Box Joints
    [URL]http://www.g-forcecnc.com/jointcam.html[/URL]

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Member
    Join Date
    Apr 2014
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Do you want to enable the outputs only while g-code is running?



  4. #4
    Member
    Join Date
    Apr 2014
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    I didn't wait for you answer. Set the limits and the output pins as your needs. If the outputs are active low, change ventxNeg to "true". Save code to Mxxxxx.txt where xxxxx is a number (e.g. M10000.txt) and go to General settings / Config macroloops, add 10000 (or the number you selected) to an empty row, set Auto run, click Run, click Save settings. Ready.

    Code:
    // ================================================================================================
    // Auto open vents
    // ================================================================================================
    
    int newState = 0;
    double yPos = 0.0;
    
    if (exec.GetLED(RunLED))
    {
      yPos = exec.GetYmachpos();
      if ((yPos >= lim0) && (yPos < lim1))
        newState = 1;
      else if ((yPos >= lim1) && (yPos < lim2))
        newState = 2;
      else if ((yPos >= lim2) && (yPos < lim3))
        newState = 3;
      else if ((yPos >= lim3) && (yPos < lim4))
        newState = 4;
    }
    
    if (newState != lastState)
    {
      Clroutpin(vent1Port, vent1Pin, vent1Neg);
      Clroutpin(vent2Port, vent2Pin, vent2Neg);
      Clroutpin(vent3Port, vent3Pin, vent3Neg);
      Clroutpin(vent4Port, vent4Pin, vent4Neg);
      switch (newState)
      {
        case 1:
          Setoutpin(vent1Port, vent1Pin, vent1Neg);
          break;
        case 2:
          Setoutpin(vent2Port, vent2Pin, vent2Neg);
          break;
        case 3:
          Setoutpin(vent3Port, vent3Pin, vent3Neg);
          break;
        case 4:
          Setoutpin(vent4Port, vent4Pin, vent4Neg);
          break;
      }
      lastState = newState;
    }
    
    // ================================================================================================
    
    #Events
    
    // ================================================================================================
    
    // =============== Constants
    
    const int vent1Port = 2;                                                        // Port number of vent 1
    const int vent1Pin = 2;                                                         // Pin number of vent 1
    const bool vent1Neg = false;                                                    // Invert pin of vent 1
    
    const int vent2Port = 2;                                                        // Port number of vent 2
    const int vent2Pin = 3;                                                         // Pin number of vent 2
    const bool vent2Neg = false;                                                    // Invert pin of vent 2
    
    const int vent3Port = 2;                                                        // Port number of vent 3
    const int vent3Pin = 4;                                                         // Pin number of vent 3
    const bool vent3Neg = false;                                                    // Invert pin of vent 3
    
    const int vent4Port = 2;                                                        // Port number of vent 4
    const int vent4Pin = 5;                                                         // Pin number of vent 4
    const bool vent4Neg = false;                                                    // Invert pin of vent 4
    
    const double lim0 = 0.0;                                                        // Zone limits
    const double lim1 = 1000.0;
    const double lim2 = 2000.0;
    const double lim3 = 3000.0;
    const double lim4 = 4000.0;
    
    const int RunLED = 19;                                                          // On when code is running
    
    // =============== Static variables
    
    static int lastState = 0;
    
    // =============== Set/Clr output
    
    void Setoutpin(int port, int pin, bool neg)
    {
      if (neg)
        exec.Clroutpin(port, pin);
      else
        exec.Setoutpin(port, pin);
    }
    
    void Clroutpin(int port, int pin, bool neg)
    {
      if (neg)
        exec.Setoutpin(port, pin);
      else
        exec.Clroutpin(port, pin);
    }




  5. #5
    Member
    Join Date
    Aug 2007
    Location
    New Zealand
    Posts
    55
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by dezsoe View Post
    I didn't wait for you answer. Set the limits and the output pins as your needs. If the outputs are active low, change ventxNeg to "true". Save code to Mxxxxx.txt where xxxxx is a number (e.g. M10000.txt) and go to General settings / Config macroloops, add 10000 (or the number you selected) to an empty row, set Auto run, click Run, click Save settings. Ready.

    Code:
    // ================================================================================================
    // Auto open vents
    // ================================================================================================
    
    int newState = 0;
    double yPos = 0.0;
    
    if (exec.GetLED(RunLED))
    {
      yPos = exec.GetYmachpos();
      if ((yPos >= lim0) && (yPos < lim1))
        newState = 1;
      else if ((yPos >= lim1) && (yPos < lim2))
        newState = 2;
      else if ((yPos >= lim2) && (yPos < lim3))
        newState = 3;
      else if ((yPos >= lim3) && (yPos < lim4))
        newState = 4;
    }
    
    if (newState != lastState)
    {
      Clroutpin(vent1Port, vent1Pin, vent1Neg);
      Clroutpin(vent2Port, vent2Pin, vent2Neg);
      Clroutpin(vent3Port, vent3Pin, vent3Neg);
      Clroutpin(vent4Port, vent4Pin, vent4Neg);
      switch (newState)
      {
        case 1:
          Setoutpin(vent1Port, vent1Pin, vent1Neg);
          break;
        case 2:
          Setoutpin(vent2Port, vent2Pin, vent2Neg);
          break;
        case 3:
          Setoutpin(vent3Port, vent3Pin, vent3Neg);
          break;
        case 4:
          Setoutpin(vent4Port, vent4Pin, vent4Neg);
          break;
      }
      lastState = newState;
    }
    
    // ================================================================================================
    
    #Events
    
    // ================================================================================================
    
    // =============== Constants
    
    const int vent1Port = 2;                                                        // Port number of vent 1
    const int vent1Pin = 2;                                                         // Pin number of vent 1
    const bool vent1Neg = false;                                                    // Invert pin of vent 1
    
    const int vent2Port = 2;                                                        // Port number of vent 2
    const int vent2Pin = 3;                                                         // Pin number of vent 2
    const bool vent2Neg = false;                                                    // Invert pin of vent 2
    
    const int vent3Port = 2;                                                        // Port number of vent 3
    const int vent3Pin = 4;                                                         // Pin number of vent 3
    const bool vent3Neg = false;                                                    // Invert pin of vent 3
    
    const int vent4Port = 2;                                                        // Port number of vent 4
    const int vent4Pin = 5;                                                         // Pin number of vent 4
    const bool vent4Neg = false;                                                    // Invert pin of vent 4
    
    const double lim0 = 0.0;                                                        // Zone limits
    const double lim1 = 1000.0;
    const double lim2 = 2000.0;
    const double lim3 = 3000.0;
    const double lim4 = 4000.0;
    
    const int RunLED = 19;                                                          // On when code is running
    
    // =============== Static variables
    
    static int lastState = 0;
    
    // =============== Set/Clr output
    
    void Setoutpin(int port, int pin, bool neg)
    {
      if (neg)
        exec.Clroutpin(port, pin);
      else
        exec.Setoutpin(port, pin);
    }
    
    void Clroutpin(int port, int pin, bool neg)
    {
      if (neg)
        exec.Setoutpin(port, pin);
      else
        exec.Clroutpin(port, pin);
    }
    Im not sure this will solve the problem, when i do things like rip cut the vents wont open? If i understand correctly

    Sent from my SM-G920I using Tapatalk



  6. #6
    Member
    Join Date
    Apr 2014
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Sorry, I don't know what is "rip cut". I thought you only need the vents while running. If you write some more details of what you need, then I can modify this macro.



  7. #7
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by dezsoe View Post
    Sorry, I don't know what is "rip cut". I thought you only need the vents while running. If you write some more details of what you need, then I can modify this macro.
    Guessing what he means is cutting along the X axis. Obviously the macro you provided is easily editable and you can only guess how his table/vent ports are setup.

    "Thank you Dezsoe" I copied and saved for future reference.

    Dan



  8. #8
    Member
    Join Date
    Apr 2014
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    He can cut along the X axis. If the Y is in the given ranges the vent will be on. Maybe, he wants to cut with MDI commands or manual jog. It can be enabled, of course, but I thought, it's not important to run the vent while no code is running.



  9. #9
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by dezsoe View Post
    He can cut along the X axis. If the Y is in the given ranges the vent will be on. Maybe, he wants to cut with MDI commands or manual jog. It can be enabled, of course, but I thought, it's not important to run the vent while no code is running.
    Yes I see that, what vent is open is dependent on Y position, I was just pointing out that its easily editable to adjust.
    Makes perfect sense to me only activate when Gcode is running.

    I was also trying to subtly point out he could of been more appreciative you taking your time to write it..



  10. #10
    Member
    Join Date
    Aug 2007
    Location
    New Zealand
    Posts
    55
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Ive pretty much solved this by having a homing routine then having a macro running to enable disable the output given on the x and y position.



  11. #11
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by jrslick22 View Post
    Ive pretty much solved this by having a homing routine then having a macro running to enable disable the output given on the x and y position.
    Not going to post your macro solution that could help others??



  12. #12
    Member
    Join Date
    Apr 2014
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by jrslick22 View Post
    Ive pretty much solved this by having a homing routine then having a macro running to enable disable the output given on the x and y position.
    Nice! That is what my macro does. The only difference is that the request was to check only the Y axis.



  13. #13
    Member
    Join Date
    Aug 2007
    Location
    New Zealand
    Posts
    55
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    the dude who did the work for me did it on the condition that I protected his I.P. happy to point people in the right direction tho



  14. #14
    Member
    Join Date
    Mar 2010
    Location
    America
    Posts
    813
    Downloads
    0
    Uploads
    0

    Default Re: open and close suction vents

    Quote Originally Posted by jrslick22 View Post
    the dude who did the work for me did it on the condition that I protected his I.P. happy to point people in the right direction tho
    OK Np, If anyone similar to your needs can just use the macro Dezsoe posted... it works well.

    Dan



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

open and close suction vents

open and close suction vents