Welcome to Our Community

Some features disabled for guests. Register Today.

Confused about homing, machine position, zeroing, etc

Discussion in 'Control Software' started by Metalguru, May 13, 2016.

  1. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    545
    Hey guys:

    So, I just installed limit switches on my C-Beam machine.

    Using GRBL Panel, I'm having trouble getting things set up. There's not much info in the GRBL Panel wiki on this.

    What is the "Current Machine Position" box above the main position indicators? How do I zero this? Seems like every time I do a home function, it sets some or all of the position boxes to these values. Also, the smaller numbers under the main position indicators seem to just display random numbers, related to the "CMP" box above. Cant figure out how to zero these out. Some operations seem to reload these values into the main position boxes - again, does not seem to be any rhyme nor reason to it. Mebbe it's just me...

    Also, If I do a home, then do a z axis zero, then do home again, it changes my z axis position value. Is this supposed to happen? What is the correct procedure for doing a z axis zero using a probe command?

    Also, what is the proper procedure for setting the offsets in the offset window? Seems like every time I change them, they just get changed by the program to some other value.

    The explanation for all these in the WIKI is really dismal.
     
  2. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,239
    Likes Received:
    1,815
    GRBL home is at positive X and positive Y ends (top right), and Z 'up'.
    this is the industry standard, so that all of the work are is negative.

    once homed, you will jog the machine to where you want 'part zero', ie the 0,0,0 position your Gcode is set to use, then 'set 0' for each axis there. This will set the work offsets, usually for G54 (the default) co-ordinate system.
    There are (usually) 6 or more of these, G54 to G59, usually used for doing multiple parts in one setup, you set 0,0 for each of 6 fixtures, then run the Gcode in a loop
    G54
    run the file
    G55
    run the file
    G56
    run the file
    etc.

    so now you have 'machine zero' and 'work zero', and all the Gcode will use 'work zero' (unless you hand code some fancy stuff using G53 commands).

    dismal wiki eh? well, when you get it sorted out, please go and fix the wiki.
    that is what makes wiki's great, we the people can fix them!
     
  3. Joe Santarsiero

    Joe Santarsiero OB addict
    Staff Member Moderator Builder

    Joined:
    Oct 30, 2014
    Messages:
    902
    Likes Received:
    196
    I'm not sure there's a standard for machine home Dave. The reason I question this is because the equipment I've worked with has varied. They usually had machine home set at the automatic tool change position. In many cases this was (referencing the table) back Y and left X and in some instances middle x and middle y. I'm aware setting manual tool change positions is different.
    Regarding standards for axis designation and the rest of what you said, everything jives. Please pm me with any info you have on this. Maybe it's some software standard you're referencing?
    Adding to your post, according to the github, there are homing inverts that can set homing direction for all axis. $23.
    It may be useful to invert the default X to the left side of the gantry of you're machining parts in the first quadrant. Maybe the Y too. I'm just thinking about the jog length from machine home to part home and back. I'm picky :) You can also program G30 in GRBL which may be handy.

    Thanks

    Joe.
     
  4. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    545
    Thanks guys, but I am still not getting this at all. Still completely in the dark about this "current machine position" box in the Offsets tab and what it's for. And why do certain events trigger these values to get loaded into the Position boxes? And how do I reset it to 0,0,0 when the machine is in home position? Or any time, for that matter?

    Well, I don't really want Z set to zero. As I said, Z seems to be altered by a home command, if I probe set Z=0, then do a home, z ends up getting out by the offset that was in the "current machine position" box. This very frustrating. I need to home the machine after any problem with a g code file, so it starts over in the right place. But, if my z position keeps getting altered, the program will not restart properly because z is out of whack.

    Pressing the Zero buttons for the individual axes does not change the current machine position. I wish there was a way to manually load the current position in, as well as being able to zero it.

    As per majority of opinions, I always home to X -limit, Y -limit, and Z +limit (on the c-beam machine, this is the lower left corner of the table). This means all work is in quadrant 1, as Joe mentioned.

    I am also aware of the G54-G59 offsets, but I have not used them yet. If I go into the state box in the software, and set it to none, it doesn't work. G54 is still indicated as the "active offset".

    And David, f I was in a position to "fix the wiki" I wouldn't be asking these questions :) One would need a thorough understanding of how the program works, which typically only the author is in a position to do. I thought the wiki was there to help me, not the reverse...
     
  5. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,239
    Likes Received:
    1,815
    quite so, rather a 'convention' as per Sonny
    GRBL Controller Issues
    because homing a moving table mill at the positive ends means the table is conveniently placed for the operator to load parts.
    There are many ways to do this home thing, and ultimately it does not matter what you choose (because work offsets 'fix it'). My friends RJ1325 (1.3x2.5meter flat bed router) homes at front left so we always have to jog the gantry away in order to place parts on the table. But to have it home at the other end of the bed, 2.5m meters away, would take more time to jog it back for setting work zero.

    When I cnc my lathe I will have home 'away from the chuck', because that makes safety sense.
     
  6. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,239
    Likes Received:
    1,815
    I will have to fire up grbl-panel when I get home and see if I can make sense out of this for you.

    However, I can tell you now that 'machine position' is set when you run the home cycle and is only reset when you either home again or reset GRBL (which will require a homing cycle).

    All of our actual cutting is done relative to work co-ordinates.

    So, think of it as layers.
    first layer, at the bottom, is the machine itself, it needs to know where it is relative to the machine size so it does not harm itself.
    This 0,0,0 position can be anywhere convenient to the machine type and design considerations.

    By convention a vertical mill homes itself with the tool at right X, away Y and top Z. Other machines do it differently.
    Now the machine knows where it is, it can apply limits, something like 'from homeX I can move 34 inches negative and 4 inches positive before I hit something, so do not let the operator/program command movements longer than that'.
    and so on for Y and Z (and all other axes).

    After homing we do not need to change these co-ordinates, in fact doing so would make the machine unsafe.

    now, positioning every part relative to machine 0,0,0 and referencing it correctly in CAD (or manually) would be a royal pain, so work co-ordinate offsets were invented.

    next layer up is work co-ordinates, in the Gcode standard there are 6 available, G54 through G59.
    This allows us to tell the machine 'here is zero for this axis' anywhere convenient to the part/machine/brain.
    G54 is the default and is always active when you turn the controller on.

    For example for many parts to be cut from flat sheet, having X0 Y0 at the center of the sheet is convenient.
    For other jobs, say adding a cutout to an existing part, we need to be able to set 0,0 relative to the existing part, say by finding the corner of the part, or the center of an existing hole.

    Thus we set this 'next layer' of offsets to where we want it, giving us 0,0,0 where we need it, allowing easy setup both on the machine and in CAD software.

    so let's try a little exercise in the real world.
    turn your machine on and home it.
    now jog X to the middle of the bed, moving, say, 6 inches (or 150mm if you do metric) to the right
    in GRBL-panel, on the 'work' panel, click the 'o' button for X
    now you should see the readout change to 'o' for X, this is your work offset, all gcode will now work relative to this
    if you switch to the 'offsets' panel you should see machine X is 6 inches and the X offset for G54 has changed to match.
    all the other axes work the same, with the additional complexity of tool offsets if you want to use that.

    tool offsets allow you to set Z zero for one tool (the main tool, often the longest one) and then all other tools have their length set relative to that master tool.
    This means that you only have to probe once for setting Z zero to the top of the stock. for each tool after that you only tell it 'this tool is 1 inch shorter/longer' and that is automatically added to the Z zero work offset.
    This is most convenient if you have a tool changer and collet system that always mounts the tools in the same position.
    Our home systems tend to have hand changed tools that are not always the same stickout, so tool offsets won't work.
    BUT
    probing for the tool length does work for this scenario.

    If you home it, you need to probe Z again to find 'part zero', this is normal. and you also need to set the work co-ordinate again for X and Y. also normal.

    those set the work co-ordinates for work co-ordinates system G54 (unless you set some other work system). quite normal.
    there is never a way to change machine position, only work offsets.

    What are those '0' buttons doing?
    They are sending Gcode to the GRBL board.
    G10 - Coordinate System Data Tool and Work Offset Tables | Tormach Inc. providers of personal small CNC machines, CNC tooling, and many more CNC items.
    G Codes

    yes, G54 is the default work system, and you are always working with it. seems you are always placing your stock relative to machine zero and not changing the G54 offset from 0. Fine, but you are missing out on the convenience of separating machine 0 from work 0, and this is causing your confusion about changing machine co-ordinates.
    simply put, you DONT change machine co-ordinates, you change work offsets.
    indeed (-: , however the learning process is such that once you *have* figured it out then you can maybe help to clarify the wiki for others. Also, what you seem to be struggling with is not the program itself but the CNC concepts behind it and that is what I am trying to address (partly because I don't have a working GRBL-panel in front of me so cannot do a full 'do this, press that' walk through right now). Maybe @GerritV can help us with that?

    Maybe some videos will help you?
    cnc work offsets - YouTube
    They tend to be a bit machine specific, but I am sure after 2 or three the concepts will become apparent (-:
    This one is actually quite good and not machien specific
     
  7. Joe Santarsiero

    Joe Santarsiero OB addict
    Staff Member Moderator Builder

    Joined:
    Oct 30, 2014
    Messages:
    902
    Likes Received:
    196
    G28 and G30 are machine cordinates. They are saved to Grbl.
    Home your machine then click the set button for G28 in the settings tab.
    Now when the control software reads G28 in a line then it knows to send the machine to this position that you set. It will then do work in reference to that position.
    When you initiate a "homing sequence" via program all you're doing is confirming to yourself that the G28 is correct.
    Imagine that panel ignores G28 for the "homing sequence". You tell the machine to home out all axis and it doesn't care about G28. The controller then move each axis until its limits trigger them backs off a preset amount. At this point you and the controller know the machine is really at that G28 that you initially set at the beggining. Some controllers can really care less others might tell you after a given period of use or lines of code that a homing sequence might be a good idea.
    NOTE: When you call up a G28 command one machine can act quite differently from the next in response. You want to setup G28 to raise the Z axis to its G28 home first before it sends X and Y to their G28 positions. In some cases this may not happen. It could just take a straight line from the last cut and go through the part, holddowns, etc. You really want to know how this is going to act and make corrections when needed.

    G54. In GRBL panel it is asking you to input the machine cordinates position over the parts home position. The current machine position is giving you this info. So, locate your part X0 and enter the machine X coordinate into the G54 offset. Then do the same for Y and Z.
    With that in mind, what Dave was saying earlier is that the machine knows where it's home G28 location is at all times. It uses that info to know where to place the G54. When working from a part offset (G54 etc) it knows where that offset is located in relation to its G28.

    I think I've gone far enough, but let's go through some hypotheticals. For the sake of simplicity we will leave the Z out.

    You start with a freshly built machine. Current G28 is likely irrelevant.
    You initiate a homing sequence. The machine does its thing.
    Its current location is what you want for G28.
    Without moving anything you set G28 to zero.
    G28 machine home is now set.

    Following the previous sequence let me set up this hypothetical;
    Your goal is to mill a 5x5 square out of a random 12x12 piece of scrap sheetwood. You don't care about the edges of this scrap...you just want a 5x5 square out of some part of it.
    You've programmed the square in the 1st quad with your starting cut to be the lower left corner of the 5x5. Let's leave tool offsets out off this for now. You've verified your code will spit out a 5x5 piece.
    Your program line code also references part home as G54.

    Okay! now you want to tell the machine where to start executing this code at. This is in reference to its own position.
    You jog the machine to an eyeballed 2 inches in and 2 inches up into the scrap. Good enough.
    Whatever your machine position is at this moment you need to enter it into the G54 now.
    Next, tell the machine to go back home. Note: You're not initiating the homing sequence... you're just telling it to go back to the spot already designated as home.
    You initiate the code and pull off the most beautiful and perfect square ever cut.

    Now, just for the sake of completeness(and to make this even longer of a post) we have one more thing to cover. Setting G54 and accomodating for tool diameter. This is fairly straightforward.
    Here's the backstory:
    You want to cut a one by one square into that gorgeous 5x5 you just produced from that piece of scrap.
    You've written the program in sketchup (the whole time thanking Dave for his wonderful talent and contrisolutions to the community(making up words is fun)) and you have code that uses the bottom left of the 5x5 as part home.
    G54 is again the chosen part offset.
    NOTE: I really only use G54. The other offsets come in handy for multiple job fixtures or if you want to run the same code over at different locations.
    You've verified that the code will offset the tool correctly and produce a 1x1 in that 5x5.
    The 5x5 is fixed on the worksurface and it is known that it is sitting on the table true and square to the machine.
    You've homed the machine to make sure you didn't lose any steps on the last job (we know you didn't because you checked that square with a laser mic).
    The cutting tool is .25" diameter and it's in the holder.

    General sequence to set up machine and run part;
    This time around we need to tell the machine where this lower left corner of the part is. Before we didn't care because we were just hacking away at any random location of scrap for a 5x5...now we do because we don't want to ruin our perfect square(probably not a great band name!).
    Using the ol piece of torn off paper trick we will proceed to locate the X and Y edges of the 5x5.
    First the X(doesn't have to be first);
    Jog machine (X and Y) up close near the parts left side. The goal is to take our torn paper and slide it back and forth between the part and tool while simultaneously slowly jogging the tool in towards the part. As soon as the paper gets stuck we want to enter the machine location into G54 PLUS...half of the cutter diameter...in this case that is .125 (plus the paper thickness if you're a purist and this isn't real soft material).
    Purpose; What this does is puts the center axis of the cutter at the true 0,0 of the part when the machine is told to do work from G54.
    Then we rinse and repeat for the Y.
    NOTE: In any case we aren't adding anything to the Z G54 (paper thickness? :) ). Its location at the top of the part gets entered in as is.
    Send machine home.....!
    For the sake of complexity and sweetness let's add a second machine home.
    From the current machine home...Jog the table forward (Y positive) until the table is just about extended all the way out towards you.
    In your settings hit the set button for G30.
    Open your code with a text editor and replace the G28 near the end of the code with G30.
    Send the machine back to G28.
    Initiate program.
    Square in a square done.
    When machine finished it served the part to you as it were on a platter (Thanks G30)
    Hang square on wall with old photo of Aunt Betty.

    My conclusions and final words (just to blab further).
    I skipped over quite a bit here and just tried to stick to the basic structure in an attempt to help you wrap your brain around a few things.
    I covered the difference between the homing sequence and the machine home reference, the relationship between a parts home and the machine home reference that you yourself initially set, when and how to set those references, when to use the homing sequence and when not to, and how to look at some of the overall fundamentals of the programming structure.
    I hope I've helped clear up any of your misunderstanding. I agree that you shouldn't have to clarify the wiki when you're in need of clarification yourself.

    Sorry for another article!

    Joe

    Last note! If there are any grammar errors, spelling mistakes, or if I just fudged it all up (about a six pack in now kids!! Took a while to write) then please mention. Mods full permission to alter for clarity and corrections. Please notate.
     
    Adrian Tomren, CNCMD and Mark Carew like this.
  8. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    545
    Wow Joe! That actually made some sense. I'm gonna have to read it a couple more times to extract all the creamy goodness.

    Thank you! I'm sure I'll have a couple of questions after I have had time to osmose... :)
     
  9. Joe Santarsiero

    Joe Santarsiero OB addict
    Staff Member Moderator Builder

    Joined:
    Oct 30, 2014
    Messages:
    902
    Likes Received:
    196
    Thats fine. Take your time. Release your belt to digest. We're here when you're ready for desert.
    About to post after thoughts below.
     
  10. Joe Santarsiero

    Joe Santarsiero OB addict
    Staff Member Moderator Builder

    Joined:
    Oct 30, 2014
    Messages:
    902
    Likes Received:
    196
    After thoughts!! Yea. Sorry. Part of initial post below.

    Sometimes the basics of how something works isn't always the easiest to comprehend. This can be especially true for someone who may approach a subject with prior expectations that it is very tricky and complex, but it also may be true for someone that isn't initially intimidated and isn't ready for having to think in a different structure/fashion. For the latter this was definitely me taking digital electronics in college. Using Boolean math, simplifying logic circuits, and them **** truth tables! I went in completely oblivious to any of it and as a mechanical guy was forced to persevere by hitting curveballs the whole way through to earn that A.
    Regardless, I was somehow reminded by Dave's long post above that reviewing all of the code available and learning to program without the assistance of CAM can be priceless. All of these systems usually refer to things in a similar manner.
    When I took CNC machining(manual programming) and CAM/machining (I already had 15ish years experience as a tool and die maker which helped to an extent) I only ever operated and did basic program changes whenever I ran a CNC. Still not much lathe experience by the way. I hadn't ever written a full and complex program before. This caused me to have to restructure my thinking and I had to actually learn the code and the origin of the questions. This was straight manual programming and I know that at the present moment in the community we are handed these great programs that figure it all out for us. One of the most important things I remember about taking these manual courses was the instructors approach. It was very nonchalant. Everything was no big deal. This was the approach in CAM as well.
    That approach has stuck with me today and I highly recommend we all adopt it.
    Learning about the fact that different machines use some codes differently helps significantly, the origins and language across the board is somewhat standard, and most important to us is knowing how our own machines and controllers interpret the code we send it, how it relates to code used in other parts of industry, and when/how/why the post processors we chose generate code that is and sometimes isn't compatible with our equipment.
    For a good read pertaining to this and relevant to the above exhausting read
    here's a nice column post
    G28 Versus G53 : Modern Machine Shop
    Back on topic, recognizing the things mentioned above can really remove a lot of the mysticism and help you alter a program on the fly instead of having to go back and spend hours consulting the software or waiting days for a proper response from someone in the community. If you're making basic squares, circles, hole patterns, angled cuts for parts, and have no knowledge as to how to do that manually then I recommend you learn to do so. Heck, using the software to write a basic program then going through the code line by line with a gcode reference sheet is a great start. Let it be known, I'm not talking about programming Vectric type engraving, but when you have some of the fundamentals of manual while running 3d code the problems encountered are likely to be related to a fundamental solution or diagnosed through a fundamental understanding. Adding, sometimes software just sucks and your lucky if your a software expert... Like the swarf and Jeun.
    Point being, if you've gone as far to build one of these and aren't spending a little bit of time manually programming it then you're really missing out on a large opportunity from your investment and imho working less effectively in the long run. Write a basic program. Its nothing like software engineering, but it can be gratifying in itself telling a machine what to do by speaking on a layer of its own language.

    Cheers. Sorry again.

    Joe
     
    #10 Joe Santarsiero, May 17, 2016
    Last edited: May 17, 2016
    Mark Carew likes this.
  11. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    545
    Deep man. I mean truly profound. My osmoser just crashed...:thumbsup:

    Joe, do you live on top of a mountain, wear sandals and a sarong (turban optional)?
    Do you float inches above the ground in the lotus position?
    Do you play the Sitar?:cool:

    Or do you just have really good beer?
     
  12. Joe Santarsiero

    Joe Santarsiero OB addict
    Staff Member Moderator Builder

    Joined:
    Oct 30, 2014
    Messages:
    902
    Likes Received:
    196
    Really ****** beer and enough smokes.
    I think I've been writing and editing here for about 4hrs now for clarity and I'm still not sure I've covered all bases. I've been wanting to just do my nightly youtube routine the whole time. I almost hit select all and delete a few times. This is from my cell too, but I figured why not. Just post it. I still haven't really proof read any of it yet. I think at this point I'm done and will wait for other mods and forum members to step in and help with corrections and errors. Dave's post was pretty inspiring when I read it earlier and I just went from there by responding to your post that I quoted.
    I hate being in a situation where I know I'm capable of comprehending it, but I know I'm not getting the information in the order I need it. I think I saw that in the post of yours and just went from there while also thinking about future readers. I know that once you see it in the right light you'll really get it quite well(from experience, when this happens it gets locked in solid too and everything else falls into position easily from there).
    Anyways, I think that's all the fuel I have for the moment. Please read through that first post, ask for clarifications, and let us know how you progress. After all, one day someone else will be in your shoes when you happen to be standing by in sandals.

    Night

    Joe.
     
    #12 Joe Santarsiero, May 17, 2016
    Last edited: May 17, 2016
    David the swarfer likes this.
  13. David the swarfer

    David the swarfer OpenBuilds Team
    Staff Member Moderator Builder Resident Builder

    Joined:
    Aug 6, 2013
    Messages:
    3,239
    Likes Received:
    1,815
    agreed! as a programmer I don't understand how people can live without at least some programming knowledge (-:
    eg, a co-worker gives you a table of values that you need in a different format. if it is just 10 values, edit it in notepad, if it is 1000 values, write a few lines of java/ruby/python/php/awk to read the file line by line, convert to what you need, and write a new file.

    going through a program line by line and figuring out what it is doing is essential.
    let us look at Joe's 5x5 square he mentioned above.
    I will assume as G54 is zeroed at the right place on the material, and the top of the material is Z zero.
    Material is 1/4" thick

    first some setup stuff
    G20 ; set inch mode
    G90 ; set absolute mode
    G17 ; set XY plane as active, this affects how arcs are drawn
    M3 S10000 ; start the spindle at 10000rpm
    now some movement
    G0 Z0.5 ;; move Z to .5" above the material
    G0 X0 Y0 ; move rapidly to the 0,0 position
    G1 Z-0.25 F1 ; plunge down into the material at 1 inch per minute
    G1 X5 F10 ; cut to the right for 5 inches at 10 inches per minute feedrate
    G1 Y5 ; cut away in Y for 5 inches
    G1 X0 ; go back to the left in X, to 0
    G1 Y0 ; and finally send Y back to zero, coming toward you
    G0 Z1 ; retract Z to 1 inch above the material
    M05 ; stop the spindle
    M30 ; end the program

    Note that this program does not allow for the width of the cutter, so the cutter will move in a 5 inch square but the resulting cut part will be smaller by the cutter diameter (half diameter each side of the square will be removed).
    1 - Correcting the program so that the part left behind is exactly 5x5 inches is left as an exercise for the reader (-:
    2 - change the program so that the cut goes clockwise around the part.

    Quite agree Joe, the more understanding we have the we better we can operate a system. Take my sister, she has no understanding of how a car works and has never been a good driver, just adequate. Not that she causes accidents etc, but the poor cars suffer from her mechanical ignorance.

    Progamming is quite simple. Apart from knowing the language etc, it is really just breaking down a process into the tinyest steps in the correct order. In the Gcode above, if you swap 2 of the X and Y movement lines, you no longer get a square. Simple (-:
     
    Mark Carew likes this.
  14. Metalguru

    Metalguru Veteran
    Builder

    Joined:
    Dec 29, 2015
    Messages:
    752
    Likes Received:
    545
    Jeez guys...
    As an electronic hardware designer I don't understand how anyone can program with anything but solder...
     
    David the swarfer likes this.

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