Welcome to Our Community

Some features disabled for guests. Register Today.

NickEng's Sawstop Grbl interface / coding

Discussion in 'Other Software' started by NickEng, Feb 5, 2022.

  1. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Home all button on the toolbar :)

    Try $H not $h and make sure you aren't locked/alarmed
     
  2. chuck english

    Builder

    Joined:
    Aug 19, 2020
    Messages:
    90
    Likes Received:
    6
    it is not lit up or selectable. $H did not work either.
     
  3. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Then Homing Cycle is Disabled under Grbl Settings (off your Grbl parameters on the chip. We check, is Homing enabled? Yes, then we can ungray the button
     
  4. chuck english

    Builder

    Joined:
    Aug 19, 2020
    Messages:
    90
    Likes Received:
    6
    I’m an idiot. I still had the tx rx pins connected to the mega… it wouldn’t allow serial communication with control!

    So now I have calibrated with control but the movement is super slow! This is the same result I got when editing the grbl settings in the ide
     
    #34 chuck english, Feb 7, 2022
    Last edited: Feb 7, 2022
  5. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    So, what did you enter into Max Rate Grbl v1.1 Configuration · gnea/grbl Wiki - thats the speed limiter usually
     
  6. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    These are my current settings, but they are obviously not right.

    [13:17:32] [ $$ ] $0=254 ;Step pulse time, microseconds

    [13:17:32] [ $$ ] $1=0 ;Step idle delay, milliseconds

    [13:17:32] [ $$ ] $2=1 ;Step pulse invert, mask

    [13:17:32] [ $$ ] $3=7 ;Step direction invert, mask

    [13:17:32] [ $$ ] $4=0 ;Invert step enable pin, boolean

    [13:17:32] [ $$ ] $5=1 ;Invert limit pins, boolean

    [13:17:32] [ $$ ] $6=0 ;Invert probe pin, boolean

    [13:17:32] [ $$ ] $10=254 ;Status report options, mask

    [13:17:32] [ $$ ] $11=0.010 ;Junction deviation, millimeters

    [13:17:32] [ $$ ] $12=0.002 ;Arc tolerance, millimeters

    [13:17:32] [ $$ ] $13=1 ;Report in inches, boolean

    [13:17:32] [ $$ ] $20=0 ;Soft limits enable, boolean

    [13:17:32] [ $$ ] $21=0 ;Hard limits enable, boolean

    [13:17:33] [ $$ ] $22=1 ;Homing cycle enable, boolean

    [13:17:33] [ $$ ] $23=7 ;Homing direction invert, mask

    [13:17:33] [ $$ ] $24=500.000 ;Homing locate feed rate, mm/min

    [13:17:33] [ $$ ] $25=4000.000 ;Homing search seek rate, mm/min

    [13:17:33] [ $$ ] $26=244 ;Homing switch debounce delay, milliseconds

    [13:17:33] [ $$ ] $27=0.430 ;Homing switch pull-off distance, millimeters

    [13:17:33] [ $$ ] $30=1000 ;Maximum spindle speed, RPM

    [13:17:33] [ $$ ] $31=0 ;Minimum spindle speed, RPM

    [13:17:33] [ $$ ] $32=0 ;Laser-mode enable, boolean

    [13:17:33] [ $$ ] $100=10.200 ;X-axis steps per millimeter

    [13:17:33] [ $$ ] $101=250.000 ;Y-axis steps per millimeter

    [13:17:33] [ $$ ] $102=250.000 ;Z-axis steps per millimeter

    [13:17:33] [ $$ ] $110=7500.000 ;X-axis maximum rate, mm/min

    [13:17:33] [ $$ ] $111=500.000 ;Y-axis maximum rate, mm/min

    [13:17:33] [ $$ ] $112=500.000 ;Z-axis maximum rate, mm/min

    [13:17:33] [ $$ ] $120=25.000 ;X-axis acceleration, mm/sec^2

    [13:17:33] [ $$ ] $121=10.000 ;Y-axis acceleration, mm/sec^2

    [13:17:33] [ $$ ] $122=10.000 ;Z-axis acceleration, mm/sec^2

    [13:17:33] [ $$ ] $130=200.000 ;X-axis maximum travel, millimeters

    [13:17:33] [ $$ ] $131=200.000 ;Y-axis maximum travel, millimeters

    [13:17:33] [ $$ ] $132=200.000 ;Z-axis maximum travel, millimeters

    [13:17:33] [ $$ ] ok
     
  7. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Set to $1=255 to keep motor energised so it doesn't loose position


    Have you got your drivers wired Open Collector style? Usually you don't invert step signal (for most drivers)


    Set back to default $10=0 or $10=1 - 254 is not a valid option


    0.43mm might not be enough - rather do like 5mm or 10mm for reliability


    Use default of 250


    10 steps per mm is quite small, what is your drive system?
    Complete:
    • Microstepping
    • Pulley teeth count
    • Belt type
    • Motors 1.8 or 0.9 deg?
    Can probably go up to 1000 or even much more for a light load like a sawstop - slow acceleration means slow speeds on short distances - it needs space to "run up" to speed at whatever acceleration rate you need:

    For example, punching 10mm/sec2 into the Acceleration Calculator: RepRap Calculator - Prusa Printers if you want to get to 83mm/sec (which is 5000mm/min is what we use for Rapids on an Acro for example)

    You can see from the graph only after almost 350mm do you get to the speed you want, and it tops out at 100mm/sec (6000mm/min) after 500mm before it has to decelerate again.

    If you are just jogging 100mm, it won't get faster than 40mm/second (2500mm/min)



    upload_2022-2-7_20-36-33.png


    Looks good



    If you ever want to enable Soft Limits,best to set your actual travel distance

    Set to 0! NB as mentioned earlier!

    This may have messed with the Calibration too...
     
    #37 Peter Van Der Walt, Feb 7, 2022
    Last edited: Feb 7, 2022
  8. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    Ok, but the stepper seems to be locked now the way it is. Once I implement my "locking feature" which I am liking your air plunger idea, I would like the stepper to disable once it arrives at the destination.

    I'm not sure. I have a common ground to the arduino and pulse + and Dir+ are going to pins 2 and 5. I don't think this is inverted.

    I have a DM556 driver microstepping set at 400 for microstepping.
    The motor is a 2A 1.8 degree with what I think is a 20t count connected to shaft
    and another 20t connected for the idler gear
    The belt is a GT2 9mm wide and the entire travel distance is around 100"

    I'm confused. I thought $13=1 put it in inch mode? Or, am I understanding that CONTROL wants it in metric and then it converts it within CONTROL instead of changing it in GRBL?

    THANKS!
     
  9. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    It's not so set that back to 0

    See again from above ^


    and


    :) No confusion needed, OpenBuildsCONTROL wants $13=0 said thrice ^

    GT2 = 2mm pitch
    20T = 40mm/rotation
    400 microsteps per rotation = halfstepping = 10 steps per mm indeed


    We've lost hours now on the old settings. Lets do this:

    1) Take a backup of these settings in case you need it someday
    2) Hit that RESET EEPROM button to wipe the settings - much easier to deal with working defaults than old messes (;
    3) Start entering these parameters, then click Save and Reset when Prompted. Don't change anything else yet


    $1=255 (even with a pneumatic stop)
    $5=1 if you have NC switches
    $22=1 to enable Homing
    $24 and $25 Homing rates - set to what you want it to be
    $100 = X Steps-per-mm = 10 (should be very close to accurate)
    $110 = 10000
    $120 = 1000
    $130 = 2540
     
    David the swarfer likes this.
  10. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18

    Ok, I did as you said and now I think I have it close to right. I didn’t have much time, so I still need to tweak it a little. I’m not sure which setting was causing my slow movement when in inch mode and being accurate, but it’s fixed now.

    Now, I guess it’s time for me to explore the macros you are talking about. I am not familiar with JavaScript, but I do know c++ fairly well. I have the code working that I described earlier for two keypads and an lcd to be connected through serial to an uno with grbl. For proof of concept, it works. However, I do like your idea to use CONTROL and the macros as it would minimize much of the hardware and wiring.

    So, I am going to try to explain what I want in a little more detail, and if you don’t mind tell me if it is possible and how difficult it will be for someone that does t know JavaScript.

    I want to have all ten digits (0-9) present on the interface to press for distances and each of the 1/16th inch increments on the screen to press (ex. 1/16, 1/8, 3/16, 1/4, etc.). Along with an enter key when I have entered the desiredDistance for the saw stop to travel. So, for example if I want to cut a board that is
    24 - 11/16 inches long, I would type (or press) the buttons “2” “4” “11/16” “enter”. And it moves to this exact spot from where ever it is located.

    A couple of things I should note: I have the code in c++ to do all of this and it works.

    One issue I had to deal with is my “homing” spot and 0 location is as far away from the saw as possible (90 inches). So if I want to move to 25” to cut a board that link, I type in 25 inches and in the code it changes my inputted value like this (90 -25). This number is then saved to a variable and sent via gcode like this “G0 x65”. This puts me in the correct location.

    In saying all of that, can you tell me if it is going to be possible to do all this through CONTROL using the macros, and how hard is it going to be for me to translate this c++ code over to JavaScript?

    Thanks @Peter Van Der Walt again for all the help!
     
  11. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Metro 4 Components Library > Button uses Jquery to fill in a Form field > Metro 4 Components Library so you can see the number entered

    Ultimately still up to you which you end up using :)


    Home to Axis Maxima and use G10L20X<distancefromblade> so that "work zero" is the saw blade, and you don't need to do math. I mean you could (very easy in JS), but in my head it makes more sense if a "0" cut length has the sawstop touching the blade. A "1 inch" cut length has the stop 1 inch from the blade. Just feels more logical


    Less translate, more just building a new UI using the Metro4 stuff, and simple JS to handle buttons and sendGcode: See the examples in Getting started with Javascript Macros in CONTROL / Library of Macros created by the community
     
  12. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Something like this?

    upload_2022-2-8_16-40-28.png
     
    #42 Peter Van Der Walt, Feb 8, 2022
    Last edited: Feb 8, 2022
  13. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    Yes exactly!
    Wow!!! So how to do I implement that to the interface?
     
  14. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,462
    Likes Received:
    1,915
    I think you were misunderstanding 'report inches' mode..... GRBL is always, always internally metric. Not a single setting
    will ever be in inches. Setting 'report inches' means that numbers are converted to inches before reporting positions to ? queries.
    All the settings are still in millimeters.
    This is what 'setzero' is for (-: All CNC machines have a sense of self, the Machine Coordinate System, but we work in Work Coordinate System, which are offsets from the MCS. more here

    So you home to the far end.
    Now jog to 'against the blade'
    click the 'setZeroX' button.
    Now 'against the blade' is displayed as 0.
    Do
    G20 G1 X24 F24
    will move to 24" from the blade at 24 inches minute, so it should take a minute give or take few seconds to allow for acceleration and deceleration.

    Note that in OBControl if you type a number into the X display box and press Enter the axis will move to that position as a jog move.

    Note2: the offset that setZero saved will persist through power cycles, so you only have to 'setZero' if you change the blade or otherwise change the system. Power on, home, then goto0 should be sufficient to start your workday.
     
    Peter Van Der Walt likes this.
  15. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    I'll post it up later - can't work on it in work time per se but will see how much I get done during lunchtime today - was working on the UI side yesterday after work
     
  16. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    Wow. Well thanks! So, to do this, I’m lost on how to begin, but I am interested in how you are doing it. You download the metro 4 and use something like visual studio to implement the code that metro 4 creates in?

    Thanks!
     
  17. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    No, Metro's already in CONTROL. You can use its elements to build GUI templates in JS, See Getting started with Javascript Macros in CONTROL / Library of Macros created by the community for some instructions and examples
     
  18. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Right, not tested against a machine or anything, so consider this "draft 1"

    upload_2022-2-8_18-51-10.png


    In CONTROL > Macros tab > Add Macro

    Enter a name (like SawStop Mode), and click the Javascript tab
    Paste the following:

    Code:
    // Add some CSS classes
    $("<style type='text/css'> .keypadBtn {width: 80px;} .sawStopKeypadBtn {width: 80px;} .sawStopActionBtn {width: 280px; } </style>").appendTo("head");
    
    // variables placeholder
    window.sawStopValue = 0.0;
    window.sawStopFractionValue = 0;
    
    // Update the UI <span> fields to display value
    window.updateSawStopValueUI = setInterval(function() {
      $("#sawStopValue").html(sawStopValue.toFixed(0));
      if (sawStopFractionValue.length > 1) {
        $("#sawStopFraction").html("&nbsp;and&nbsp;" + sawStopFractionValue);
      } else {
        $("#sawStopFraction").html("");
      }
    }, 50);
    
    // keypad button
    window.sawStopBtn = function(val) {
      var currentValue = sawStopValue.toString();
      currentValue += val;
      sawStopValue = parseInt(currentValue);
    }
    
    // fraction button
    window.sawStopFraction = function(val) {
      sawStopFractionValue = val;
    }
    
    // backspace button
    window.sawStopBackSpace = function() {
      var sawStopcurrentValue = sawStopValue.toString();
      var sawStopNewValue = sawStopcurrentValue.slice(0, -1);
      if (sawStopNewValue.length == 0) {
        sawStopNewValue = "0";
      }
      sawStopValue = parseInt(sawStopNewValue);
    }
    
    window.sawStopMoveTo = function() {
      // Calculate Decimals from fractions
      if (sawStopFractionValue.length > 1) {
        var sawStopFractionSplit = sawStopFractionValue.split("/");
        var sawStopDecimals =
          parseInt(sawStopFractionSplit[0], 10) /
          parseInt(sawStopFractionSplit[1], 10);
        var decimalSawStopFractionValue = eval(sawStopFractionValue);
      } else {
        var decimalSawStopFractionValue = 0;
      }
      // add decimals to integers
      var sawStopFinalPosition = sawStopValue + decimalSawStopFractionValue;
      // Send move command to Grbl
      sendGcode("$J=G90 G20 X" + sawStopFinalPosition + " F10000");
    }
    
    // Create the User Interface
    Metro.dialog.create({
      title: "Saw Stop Macro",
      width: '90%',
      content: `
            <span class="display3" id="sawStopValue">0</span>
            <span class="display3" id="sawStopFraction"></span>
            <span class="display2">&nbsp;inch</span>
    
            <div id="sawStopNumbersUI">
    
            <table class="table striped compact">
            <tr>
            <td>
            <table>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(7);">7</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(8);">8</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(9);">9</button></td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(4);">4</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(5);">5</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(6);">6</button></td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(1);">1</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(2);">2</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(3);">3</button></td>
             </tr>
             <tr>
               <td></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBtn(0);">0</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopBackSpace();"><i class="fas fa-arrow-left"></i></button></td>
             </tr>
            </table>
            </td>
            <td>
            <table>
             <tr>
               <td colspan="3">
                 <hr>
               </td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('1/16');">1/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('3/16');">3/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('5/16');">5/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('7/16');">7/16</button></td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('9/16');">9/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('11/16');">11/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('13/16');">13/16</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('15/16');">15/16</button></td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('1/8');">1/8</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('3/8');">3/8</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('5/8');">5/8</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('7/8');">7/8</button></td>
             </tr>
             <tr>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('1/4');">1/4</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('1/2');">1/2</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFraction('3/4');">3/4</button></td>
               <td><button class="button outline sawStopKeypadBtn" onclick="sawStopFractionValue=0;">0/0</button></td>
             </tr>
             <tr>
               <td colspan="3">
                 <hr>
               </td>
             </tr>
            </table>
    
            </td>
            </tr>
            </table>
            </div>
    
            <hr>
            <button class="button outline sawStopActionBtn alert" onclick="sawStopValue=0; sawStopFractionValue=0;">CLEAR</button>
            <button class="button outline sawStopActionBtn success" onclick="sawStopMoveTo();">MOVE TO</button>
            <hr>
            <button class="button outline sawStopActionBtn warning" onclick="sendGcode('M8');">APPLY BRAKE</button>
            <button class="button outline sawStopActionBtn primary" onclick="sendGcode('M9');">RELEASE BRAKE</button>
            <hr>
            <button class="button outline sawStopActionBtn secondary" onclick="sendGcode('$H');">HOME</button>
            <button class="button outline sawStopActionBtn secondary" onclick="sendGcode('G10 P0 L20 X0');">SETZERO</button>
           `,
      actions: [{
        caption: "Exit Macro",
        cls: "js-dialog-close alert",
        onclick: function() {
          printLog("Saw Stop Macro Exited")
        }
      }]
    });
    
    
    Save it. Can assign tooltip, icon and a keyboard shortcut if you wish to

    Now when CONTROL starts, connect to the machine as usual, then launch the Macro (eiither from the Macros tab > click the button for the Sawstop Mode macro, or by pressing it's assigned keyboard shortcut if you assigned one
     
    David the swarfer likes this.
  19. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    ok I saved the code under js tab and applied. I see the newly created macro with the icon I selected. But, when I click the macro or enter the shortcut key nothing happens.
     
  20. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    You are connected to the controller correct?

    Ctrl+shift+i > Console tab > Any errors when you click the button
     
  21. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18

    I was connected to it when I tried earlier. I homed the machine first and it worked although it tried to home in the wrong direction to begin with and it didn't do this yesterday. I went in to the grbl settings and had to invert the homing to get it to go toward the limit switch. Not sure what changed there.

    But while I was connected, clicking the macro did nothing. It was lit up and not grayed out, but nothing happened when I clicked. At the moment, I have the laptop away from the machine and the icon is grayed out. I assume you can't run it without it connected to the machine?

    Thanks!
     
  22. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Yes, you have to be connected.

    When you are near the machine again:


     
  23. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    Ok, this may or may not make sense, but it did appear to work. I have a cnc router (uses the blackbox :):))

    I am not actually at the location where the saw fence is, but I remoted in to my cpu that is connected to the cnc and ran the macro, and it opened fine. I also ran it, and it moved the x axis as expected. I can't say if the accuracy was correct, but it looks promising! I'm still not sure why it didn't pull up on the laptop when I was connected to the sawStop via arduino. I will have to check it out later.

    Note: I did have someone there with hand on emergency stop button in case the experiment went south! ;);)

    Thanks!
     
  24. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Just also try recopy/paste in case you missed a line or something like that, works fine to launch:

    Screen recording below:

    macro works fine here.gif
     
  25. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    I will check. I am liking how this went, and I have also been thinking about the stop. I am considering ordering a cylinder like the link provided earlier and a valve similar to this:
    AOMAG 1/4" NPT Electric Solenoid Valve 110 V AC Air Water 2 Way Valve Normally Closed https://www.amazon.com/dp/B084YWDN3F/ref=cm_sw_r_cp_api_glt_i_GKZ8T9M9GQRRYTZG9FN5

    to control the air in. I have an ssr that is rated for 120v that I can use to connect to the arduino and have it energize the solenoid. When ready to “lock”. I think I want this done automatically when the move is complete. My plan with the c++ was to wait for the mega to receive an “idle” response from grbl and then initiate the “lock”. As I have no idea what you did to create this UI, I’m not sure exactly how this can be handled. I know you mentioned using the m8/m9 commands. But is this feasible? Also the mounting of this cylinder and a spring may be quite interesting…

    thanks a ton for writing that for me!
     
  26. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    See the section of code for the apply/release.

    If you want to lock it automatically, you can queue a \nG4 P0.1 (to wait for idle) and then the \nM8 in the same command string as


    so basically it becomes

    Code:
    sendGcode("$J=G90 G20 X" + sawStopFinalPosition + " F10000\nG4P0.1\nM8");
    I'd leave the release as a manual button
     
  27. Giarc

    Giarc OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Jan 24, 2015
    Messages:
    3,016
    Likes Received:
    1,682
    This is awesome! I was thinking of automating a table saw fence when I get done with the 3 other builds I have going right now.
     
    David the swarfer likes this.
  28. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18

    I tried again. Still nothing if I click on the macro. I have re pasted the code several times. The odd thing is if I check the box for the macro to run automatically when CONTROL opens, the macro will open and I get the new interface. The problem is I then can’t connect without closing the macro, connecting the uno and then the macro won’t open. I’m really lost as to why this would be… I used the control +shift+ I and I don’t see any errors when I click the macro icon. It’s just nothing, but to be honest, I don’t really know where im looking for an error at when it opens.

    thanks!
     
  29. NickEng

    NickEng Well-Known
    Builder

    Joined:
    Sep 10, 2020
    Messages:
    152
    Likes Received:
    18
    I want to use it for my table saw as well!
    Could possibly even add two more axis and control the height of the blade above the table and the angle of the blade

    Fitting the pneumatic cylinder on the stop for this project is going to be a challenge! And I’m not sure that it will work well with the fence on my table saw as it sits in the middle with no air plumbed near by. May have to change that up some, and see how pneumatics go with this project.
     
    #59 NickEng, Feb 8, 2022
    Last edited: Feb 8, 2022
  30. Peter Van Der Walt

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

    Joined:
    Mar 1, 2017
    Messages:
    15,051
    Likes Received:
    4,313
    Or go with a leadscrew actuator, should be solid without an additional clamp.
     

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