Welcome to Our Community

Some features disabled for guests. Register Today.

Grbl Panel Control

Discussion in 'Control Software' started by Mark Carew, Aug 13, 2015.

  1. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    to move from the home position to a known point is easy, just use the Machine Coordinate System (as opposed to the work coordinate system, G54 and friends - when you set part zero you are setting G54 Work Coordinates)

    2 ways I can think of, G28 and G53
    for G28 you will have to store the values in GRBL, but then moving to the position is as simple as 'G28' in your macro. I cannot find a way bar manual command in UGS to set G28.
    so you move to the position you want and then give
    G28.1
    which will store the current absolute position.
    G28 will then move back to the stored position.
    'G28 Z0' would be safer as that would move Z to safe height first and then move to the stored position.

    I like G53 a bit better for safety, I am not sure what G28 will do in the face of G90/G91 and G20/G21 combinations.
    something like
    G21 G53 G0 X-100 Y-200 Z-10
    will move to that position relative to the home position. Since the home position is conventionally at the positive ends of travel your values here will always be negative.
    HOWEVER, for safety it is better to move Z first
    G21 G53 G0 Z-10; G21 G53 G0 X-100 Y-200
    (or whatever format UGS needs for multiline macros)
     
  3. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    Thanks guys. G53 was the missing key. I was getting confused by the G90/G91 and didn't see G53.

    Here is was is working for me know. First as stated I have a C-Beam with home switches and homing moves the x to the right y to the back (or table full forward) and z full up. I have homing set to back off 1 inch. I think in inches and use that measure.

    This sequence raises z first then moves the table forward and nearly centers the router on x:
    G53 G20 G00 Z-1.0
    G53 X-6.5 Y-1.0
    G90​

    First line G53 sets machine coord. G20 sets measure to inch. G00 moves all axes at the same time if called for. The z is move 1 inch down from 0.
    Second line G53 sets machine coord. and then x and y are moved per the G20 and G00 set in the first line. I had to issue another G53 as it seems that is not persistant and without it the router was moved using work coord. as if a G90 was issued.
    Last line G90 is just to insure work zero is being referenced and not machine zero going forward.

    At least this is the way I understand the Gcode. Please correct me if I'm wrong.

    David, in GRBL Panel G28 is set to 0,0,0 by the homing command (that is probably the GRBL home command really). It is a pain to set G28 manually so that is where it stays for me. I'd like to have a button (macro) that goes to work 0,0,1 as you describe and was going to try to figure that out next, thanks. I was trying to set the special position button 1 to go to G54 by changing that setting on the GP setting page, but that didn't seem to work for me. I could have done something wrong. But as you point out I probably really don't want G54 cause the bit would be touching the work. I'd like to figure out how to move the router to just the x and y coord. of G54. Any ideas?

    Thanks

    Bruce
     
  4. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    Setting G28 in GrblPanel should be trivial, on the Settings page near bottom. Type in the machine position values you want and click the button.

    G54 et al are relative to the machine position, they are Work offsets. So not sure how you can 'go to G54'? Unfortunately there is not a way to read the values of a Work offset and plug that in as a variable to another command. I expect Mach3/4 and LinuxCNC have parameters you can read but not Grbl/GrblPanel.
     
  5. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    David, setting G28 isn't hard to do but another step. G28 and G54 are set to machine 0,0,0 by the home command. Going to G28 or G54 then hits the limit switches and sets alarms so I don't understand their usefulness set this way.

    After a home command I jog the bit to work 0,0,0 and set xyz to zero and set G54 to 0,0,0 in the offsets cause G54 is always active in GRBLPanel. Setting G28 would bean additional step but and would then give a way to quickly return to that point but I really want to return there cause the bit would hit the part. I've created another macro, G00 X0 Y0 Z1 which moves the the Z up to a safe height then to X0Y0 then down to 1 inch above Z0 or X0Y0Z1. Here is that macro:
    G53 Z-1
    G90 G00 X0 Y0
    Z1​

    GRBLPanel has two quick buttons on the Interface Work page. Go To Spcl Posn 1 and Posn 2. On the settings page there is a field to edit what these buttons do but it is limited to a single G code. In other words youo could enter G20 or G90 rather than G28 or G30 but you can't enter G90 X1 Y1. And no matter what you set in the setting page for either of these buttons, when you hover over them they say they will go to G28 or G30 though they don't unless that is what you actually have set in the fields in the settings page. This is a minor bug. The buttons would be more useful if you could use them to call any length of Gcode or maybe even a macro in my opinion.
     
  6. NeoMorph

    NeoMorph New
    Builder

    Joined:
    Jul 1, 2017
    Messages:
    68
    Likes Received:
    20
    I do wish that GRBLPanel had more than 5 macro slots... but I’ve heard that the program isn’t being updated lately so I’m looking for another controller... hopefully one that has canned operation support and unlimited macros as well as keyboard jogging.
     
  7. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    It's open source, know how to code?
     
    GerritV likes this.
  8. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    And I wish someone would just give me a CNC mill to work with :) Without a working machine anymore there is not a lot of motivation to keep adding features or tweaking existing ones. If/when the ARM version of Gnea comes out I will take a look at another major iteration if by then I might have a machine running as well.

    The source code is there for people to enhance. Give it a try and create a pull request. I will happily take a look and add it to a release. This is how Macros got implemented in the first place.
     
  9. phil from seattle

    phil from seattle Journeyman
    Builder

    Joined:
    Mar 17, 2017
    Messages:
    315
    Likes Received:
    138
    Thank you Gerrit!! Wish I had a spare mill to give you.
     
  10. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    Yes Gerrit, thank you. I'm certainly not complaining.

    If I knew how to do the coding I would probably add the features I want and share them.
     
    GerritV likes this.
  11. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    If Home clears G28 then there is a bug somewhere, in my code or in Grbl. You should move to Gnea 1.1 version, I will check that in a week's time when I get near an Arduino Gnea device again. Don't have one with me. You can check by doing $# in the MDI at anytime tere is no file running.

    G54 is active by default, you can set and switch to the other Work Offsets easily in several ways.

    The text you are seeing on Spcl Posn is the Hint hover text. I suppose it could reflect what is in the Settings page but really?? The buttons exist to execute to go to those 2 preset positions, perhaps it would have been better to not make the content configurable.

    Regarding G28/G30 behaviour you need verify that Grbl/Gnea follows The EMC2 G Code Language implementation. IOW the device should move to what you give for xyz (like a safe position) in the G28 command and then it should go to what was stored in the preset.
     
    #191 GerritV, Feb 5, 2018
    Last edited: Feb 5, 2018
  12. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    BTW I can write any text I want into the Spcl Posn 1 and 2 items on the Settings page?? Clicking the button happily sends them
     
  13. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    What is Gnea 1.1?

    Yes I realize the text you see when you hover it is the hint yet depending on what you put in the field in the setting page the hint is not correct. I called it a minor bug, it is not really, it's just not a 100% correct hint. A better hint would not have a reference to G28 or G30 as it is configurable. Or even better, but more coding I'm sure, for the hint to show what is currently configured in the setting page

    I just checked again and, surprise, the Special position 1 and 2 setting are completely configurable. For some reason when I tired it earlier today it wasn't accepting anything but a single G code. o_O

    I also tested whether homing resets G28. It does not. I thought it was. Now I see why I might want to take the time remember to set G28 to work 0,0,0. Wish I could make a macro to set both G28 and G54 to work ,0,0,0.

    Again appreciate your time and work on what has been done and any you might do at some point in the future with GRBL Panel Gerrit.
     
  14. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    Answered my own question. GNEA 1.1 is the latest version of GRBL.

    I'm confused about upgrading to 1.1 from V.9. Will I have to reconfigure how my homing switches are wired to my Spark Concepts xPro v2 board if I upgrade from GRBL V.9 to 1.1?
     
  15. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    Glad I could fix it without code :)

    I thought you wanted to use G28 to move to a known physical position, why are you referring to a Work Offset (G54). If you want to go to your physical Home position, you need to set G28 to the location _after_ you Home, with the 1" pull off included. Else you will trip the limits going to machine 0,0,0. You would set G28 location once and then leave it alone, just use it as final destination of Spcl Posn 1. You could/should probably set Spcl Posn1 to be G28 Z0 to get the spindle up out of the way before it goes to the final position (If Grbl/Gnea operates the way as expected)
     
  16. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    I don't know, they are others here who would have done that already? The big pin change was from 0.8 to 0.9. there might also be related answers on the Gnea Issue list. Check for Closed issues as well
     
  17. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    I believe it was David who suggested using G28 to go to a known position. I never set G28 to anything other that 0,0,0 because I was under the impression it would just be reset. You pointed out and I confirmed I was wrong on G28. I think G30 is set by the home to my home pull off position of 1" as that is what it is set at. But I was wrong about G28 and probably wrong about G30. I probably reset G30 manually days ago and have homed and moved my router a hundred times trying and looking at the result of what was changed and what not and trying to make heads or tails of it all and figure out how it all works. As my G30 was set to -1,-1,-1, my pull offs, I assumed it was being reset automatically by the home command.

    I was trying to go to G54 because in this time of testing and figuring it out I realized I needed to set G54 to work 0,0,0. and I was doing that. I wanted a way to go back to that position.

    I may not have made this clear, and it may not be the standard way, but my C-Beam homes to the back right corner. I cut mostly in the front left corner or center. So I would home to the back. Load the material to cut. Jog forward and left. Set work 0,0,0. Make a cut. Use G30 which was set to machine -1.-1.-1 to move the router out of the way unload the work. Then maybe reload another piece of material in the same place or nearly so and have to manually jog the machine from the back corner to the front and reset work 0,0,0 if a new cut or if all went well and I was doing a repeat cut and I had the material registered correctly I'd just jog close and run the file again.
     
  18. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    Bruce that is the right/best way to operate. LinuxCNC treats G30 as the tool change position in some setup. Either way G28/G30 does what you need.

    In case you missed it in all my typing, try set the Spcl Posn 1 to G28 Z0, that _should_ result in zooming the Z up out of the way, followed by move to whatever position you set the G28 in the Settings/Grbl.
     
  19. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    Thanks Gerrit. I did take note of the G28 Z0 suggestion. It would seem that G28 and G30 will do what I want/need, I just couldn't see it. That's what makes forums and people like yourself and many others willing to help, great.
     
  20. NeoMorph

    NeoMorph New
    Builder

    Joined:
    Jul 1, 2017
    Messages:
    68
    Likes Received:
    20
    Didn’t know that... and I used to be a programmer... I say used to because I had to stop because the pain meds I’m on tends scramble my brains. But I might give it a go.

    Edit: Looks like it’s VB.Net... shouldn’t be that hard to learn... maybe lol.
     
    #200 NeoMorph, Feb 5, 2018
    Last edited: Feb 5, 2018
    GerritV likes this.
  21. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    I have lost track of the number of languages I have learned so far. Started in 1965 in assembler on an NCR315. They all look sort of the same after a while.
    The next iteration of GrblPanel, if/when there is one, will be C#, wish i had used that instead of VB.Net but I was more familiar with that at the time. I didn't expect the program to grow as much as it did :)
     
  22. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    nope, it just defaults to 0,0,0 when you flash GRBL onto the processor. It will not change unless you change it.
    The definition says that you move the machine to where you want it then issue a G28.1 command which will store the current position. After that issuing a G28 will go back to that absolute position.

    Right now I don't know how GRBLpanel is setting the G28 position , ie going from the edit boxes to the contoller.
    Here is the definition for G53
    G Codes
    In short, G53 is the machine coordinate system, and is not modal = will not be remembered so you have to give it on every line. It also ignores the G90/G91 setting and always uses absolute machine coords.

    So to go to machine 0,0,-1 safely
    G53 G0 Z-1
    G53 G0 X0 Y0

    To go to the current work position 0,0,1 SAFELY
    G53 G0 Z-1 ; raise Z to safety height
    G90 ; use absolute coordinates
    G0 X0 Y0 ; go to 0,0
    G0 Z1 ; go to Z1 which means the tool will come down toward the work

    Since this does not mention G54 it will work for any of G54 to G59, whatever is current.
    G90 G0 X0 Y0
    but this is dangerous because it does not ensure that Z is at a safe height.

    I did a job the other day where I had 5.6mm of Z travel available. The hold down bolts stuck up about 15mm! Yes I had to hit emergency stop after hitting my 'return to MCS' button and it headed directly toward a hold down bolt.

    Fortunately GRBL stores the offsets in EEPROM so my work zero was restored after the reset.
     
  23. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    Gerrit, how are you setting the position into GRBL? According to the LinuxCNC docs the only way to set it is to go there and give G28.1
     
  24. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    No, homing does not change G54
     
  25. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    (redundant answer I know, but there are folks who do not read the whole thread....)
    G53 G0 Z-1 ; safe height for Z
    G90 G0 X0 Y0 ; work home
    G90 G0 Z1 ; 1 inch above work home

    note that the above assumes inches. once you issue a G20 it is retained in that mode because it is modal. So unless a Gcode file you run changes it, it will remain in inch mode.
    EVERY Gcode file must have a G20 or G21 at the top, NEVER assume you know the mode.

    again some redundant answers, just for completeness
    you can program a macro or just type
    G90 G0 X0 Y0
    and it will rapid back to your work coordinates. For a macro button I would always include a G53 G0 Z0 before that.
     
  26. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    The Set button sends a G28.1, I think the boxes contain the current Machine Position at all times. I can't verify as I don't have a Grbl with me.
     
  27. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    David, can you verify that Grbl executes the position coordinates on a G28 line before going to the position set by G28.1? e.g. G28 Z0 should send the Z up, then go to what was stored with the G28.1
     
  28. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,455
    Likes Received:
    1,915
    using bCNC and GRBLpanel 1.0.9.13 I am seeing:
    given
    [G54:-120.000,-120.000,-20.000]
    [G28:-90.000,-110.000,-10.000]

    give 'G28 Z0' it will go to Z0 and then to Z-10, X and Y do not move (same for G28 X0, moves to X0 then to defined coord -110)
    give 'G28', all axes move to the defined machine coordinates.

    so, not quite what the LinuxCNC docs say it should do but it does work in that setting the position is stored correctly and restored by a plain G28.
    in fact I can see a use for this, an easy to set and restore position to give space to change material etc and safer than typing absolute move commands.
     
    GerritV likes this.
  29. Bruce Fenstermacher

    Builder

    Joined:
    Dec 28, 2014
    Messages:
    75
    Likes Received:
    5
    Went to test what David discovered in his last post. Tried to type G28 Z0 in the settings field for Spcl Posn 1 and once again as I previously reported, I could not type in the Z. In fact I could type some letters and not others. Here are the letters I can type directly into this setting field.
    QWETUIPDGHJKLCVBNM qwetuipdghjklcvbnm​
    Notice no lower or cap R, Y, O, A, S, F, Z or X . I can type all the numbers and I tested some punctuation and they worked.

    I can however copy and paste anything into the field. I know realize this is how i got the gcode into the field after Gerrit said I should be able to. I copied and pasted from the manual command field.

    This is weird. I'm on a HP lap top with Windows 10 running and for some reason that field won't accept all the keyboard characters. Maybe you guys recognize why? I have no idea.

    BTW I did by copy and paste confirmed the same movements David did with G28 Z0.
     
  30. GerritV

    GerritV New
    Builder

    Joined:
    Jul 22, 2015
    Messages:
    69
    Likes Received:
    8
    Bruce, I just looked back to see what version you are at, you need to update to .17, there were some peculiarities with keyboard handling that are fixed.
     

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