-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Home Position, post operation #14
Comments
Hi, GRBL's Homing and Post-Processor 'Returning to Home' are two separate things and they don't interact... After the NC job has completed, the post-processor will include some GCODE to move the spindle to a certain location (also called Home, but could be different from GRBL's HOME). It does this by inserting some G53 (move in absolute machine coordinates) code. It first makes the Z-axis move, then makes the XY axis move (together). So find out the machine coordinates where you want the spindle after the job, and put these X, Y, Z in the related parameters. |
What soft are generating your G-code? |
Might also use G28 (safe position). e.g. Fusion 360 built-in postprocessor does. In this case @CriticalPoint needs to update the G28 position to be wherever the spindle shall get parked. |
@maumontel The Post-Processor is intended for Fusion360. The PostProcessor itself is JavaScript language. @CriticalPoint I prefer G53 over G28 - it is much more versatile. I'd rather have the intelligence in the CAM-file and not rely on the intelligence of the machine. The problem with G28 it is one command to 'return home' but in fact you always need the spindle to move to a safe height first, and then move XY home. G23 can do this with an 'intermediate' point it needs to pass through. I think all this is making things complicated for no reason.. |
off the top of my head (will check at home) |
@Strooom Sorry, of course it is Fusion, my bad |
"I prefer G53 over G28 - it is much more versatile." - I have my work cut out for me as I wasn't aware there was a choice. I've spent this year building an OX (Openbuilds) and familiarising myself with the hardware, the xPRO v3, and how it all works together. Then also software, Fusion360, Solidworks, and GRBL v1.1. I thought I understood the WCS and Offsets, however after today, I have clearly missed something essential to the process. I started out with UGS, but could never get that to connect to the xPRO, so I went through the motions of ChiliPeppr, bCNC, CamBam, various others, and finally settled on Grbl Panel. Today was a big push as the end of the year is fast approaching and being dissatisfied with progress, I've taken a few days off work to get a consistent workflow sorted (2 kids, job, all that jazz) so I built myself a spoil board and I was adding hardware buttons for the xPRO. I drew it all up in the F360, setup CAM and processed the job using your Post Processor as F360's (as you're no doubt aware) always paused for an M6 tool change. First thing I noticed was a 'Z -3' very early on in the G Code. Although I've always matched the position of the tool to the WCS stock point in Fusion CAM, so that obviously plunges into my stock. That's the small hole to the bottom left in the image (Later cut all the way through). Anyway, being a spoilboard, it's was a bit annoying, but I'm learning so that's the cost of doing business, as they say. There were 3 jobs, 1 to cut 4 circles, 1 to clear 3 pockets, and 1 to engrave. As you can see, after each job the tool plunged into the stock, and travelled back to the WCS origin point on the drawing (start point, I guess you'd call it). Leaving some very frustrating trenches, and of course breaking my 1/16" engraver. Any idea why this happened? I am clearly missing something, I just can't nail it down! Clearances in F360 are spot on, the tool is set the the WCS origin on the model, and the machine zeroed and, in fact, the first cut (4 holes) this didn't happen, it was perfect, but the holes we're slightly too small, so I amended the sketch and made the holes slightly wider, and then regenerated the Toolpath. There was no REST machining, no contouring, no roughing or smoothing, just straight forward jobs. What's most frustrating, is that simulating the toolpath clearly shows the bit leaving the stock at the end of the job, which I would then expect your Z up, X+Y home to kick in, but it appears that this only comes after the trench has been made. Noted that the travel speed when returning (destroying) itself to the WCS point is quick, so I this tells me that it thinks it's not in the stock. I know this isn't a forum, and it quite likely isn't an issue with your PP, but do one of you gentlemen have any ideas on where I might be fluffling it?! |
Hi Mike, I know it's a long learning curve. Can you share the Fusion file with me (look for share link)? Pascal |
Hi Mike, I think my problem was similar, the paths in the wood looks the same. |
One problem I've noticed is the GCode Sender application.. G53 G0 Z-3 moves the spindle up to machine coordinate -3 (in my case 3 mm below the top). however.. G53 ... now the first line does nothing : there is no G0 or G1 on the same line You can check for this problem by sending the lines manually and check the machine behaviour. |
Guys, I really appreciate the assistance, I can't thank you enough. With your help I now understand where the G53 G0 Z-3 is generated from; it's the Post-Process property, MachineHomeZ. Thankfully in GRBL Panel, I have the ability to execute these commands line for line, which is helping me immensely! From reading the Wiki (I have this bookmarked!) as I understood it, a G53 G0 X0 (and/or) Y0 (and/or) Z0, should send the axis/axes to the actual position where they were zero'd, so (after zeroing and aligning the tool with the WCS position) I would assume then that the G53 G0 Z0 command would essentially do nothing, as zero had previously been established and already achieved. As an aside, GRBL Panel randomly hits a go-slow, which delays commands and mouse clicks by up to 10 seconds, and sometimes also throws a fatal error, so I've switched PC's for the sake of problem solving. @Strooom - Here is the Fusion file, I've done nothing to change it since the cuts as this would defeat the purpose. As you've likely already noticed from the image above, GRBL Panel (at least) doesn't insert a line break in the G53 command. Further explanation; Here is the process, I might well be overlooking something super simple! I always home the machine using $23=1 (reverse X axis/rear left of the machine as observed from the front) I have a 2mm pull off value for $27. I then; 1 - Zero G54 in the offsets tab I really hope I'm not being an idiot but at the same time, I'm hoping it's really easy and I'm missing a trick. Again, further thanks for your help on this @Strooom and @maumontel |
And further to this, once I've got the machine parked at the WCS origin, I can manually execute G53 G0 Z0 and the Z axis will remain in position, as one would expect. I can then manually raise it 10mm and execute it again, and it will return to the WCS origin, right on top of the stock, ready to mill. I then load the job (exactly as below) and step through to G53 G0 Z0, and the Z runs high and hits the switch. The 'why' has me totally stumped! Is it me, or should this not be a thing? 😆 I've familiarised myself with lines 1 through 17, and I can't see anything there that would affect the machine position, only plane selection, units, feed rate and various (really helpful, thank you) comments... |
Let me explain Machine Coordinates versus Workpiece Coordinates (WCS) : After hitting the limit switch, GRBL will move the machine a small distance away from the (0,0,0) position, so that the limit switches are not really on the edge any more, preventing that they are not falsely triggering for any small vibration or other reasons. this is your 2mm pull off value (-2,-2,-2) ie. 2 mm away from each limit switch. Workpiece Coordinates are relative coordinates measured from a reference point on your workpiece. CNCs use Workpiece because it means you can have the same CAM file, no matter where your workpiece is on the machine : You put the stock anywhere on the machine, move/jog the spindle to the reference point (the 'setup' point in Fusion), then you 'Zero' the axis. Because Fusion generated GCode relative to the 'Setup Origin' and you Zeroed the Workpiece Coordinates with the same physical point, they work toegether. There are 6 (or more) different 'sets' of Workpiece Coordinates (sometimes called G54 G55 G56 etc, referring to the gcode that selects them). I think you will only need one, I suggest G54. So each point has 2 coordinate values : absolut machine coordinates (measured from hime limit switch, negative) and workpiece coordinates (measured from workpiece origin) Workpiece Coordinate 0,0,0 most likely maps to some negative Machine Coordinates. Normally Gcode contains a G54 meaning all the coordinates are to be treated as being Workpiece coordinates When using G53, you tell the controller (for this line of GCode) to interprete coordinates as Machine Coordinates : so G0 G53 Z0 tells the controller to move the spindle up all the way. Because this Z0 is the position where it tripped the limit switch during the Homing cycle, it will trip the switch again. This is why machineHomeZ should be a small distance before zero, eg -2 (remember machine coordinates are always negative), this will move the spindle all the way up, 2 mm below the upper limit switch. Now, after all this, here is the proper sequence to do things :
Tip : by moving the machine to the well know stock point, then moving it up 20 mm and then Zeroing, your WCS origin is 20mm above the Fusion origin. If you then execute the file, it will do everything, only 20mm above the stock, just milling in the 'air'. This may be a good first test to see if all is going well. Good Luck |
@Strooom, thank you. I've since flipped my X to conform to the standard, so now everything is negative, one less thing to factor in. I followed your '5 Steps to Success' and here is the (almost) finished test I quickly drafted up in F360 Simply adding the negative value of -2 as a variable when Post Processing in F360 has sorted the hitting of the limit switch, turns out it was very simple, I simply lacked understanding. Your knowledge and advice is invaluable and I am forever grateful. One further question; How do I buy you a beer? |
When my machine returns home, it's ignoring $23, which I have set to 1. Any chance it can invert the X so it returns to true HOME?
The text was updated successfully, but these errors were encountered: