Clarification re: stop.g please...
-
I've sort of asked this before, but have only just got around to completing this task and would like some clarity, please.
stop.g: As I understand it, this is called when a (CNC or a printing) job finishes, or if you enter M98 P"stop.g" in the command line.
Are there any other situations when stop.g is run, other than being called specifically from within another macro, please?
Going on from this, if a job completes and the code within the stop.g file moves the spindle to a 'safe place' (rather than being moved to Work X0, Y0, Z+5, which happens at the moment, although I'm not sure why), will this affect the actual Work X0, Y0, Z0 coordinates, if I want to run the job again? I appreciate I would need to adjust Z0 if I change the cutter and/or the material thickness might be different, for example.
I was thinking of using just this code within the stop.g file:
G1 Z{max(move.axes[2].userPosition+5,move.axes[2].max-5)} F2400 ; move the Z axis to a safe height G0 X273.5 Y560 ; move XY to a safe place
Thank you
-
@Nightowl
M0
also calls stop.g
I believe in 3.5 its going to be ran automatically rather than requiring to be called.
If those coordinates are actual rather than workplace, putG53
in front, e.g.G53 G1 X10 Y10
and the actual coordinates will be used rather than the workplace. -
The last few lines of the generated .gcode file are these:
G2X229.500Y0.000I0.000J-1.000 G0Z2.000 M5 G0Z5.000 G0X0.000Y0.000
Am I correct in thinking these are set by the post processor? If so, then I'll need to change the pp to reflect those settings above, or just replace those lines with M0 and use the stop.g code to move the spindle to the safe place.
@jay_s_uk said in Clarification re: stop.g please...:
If those coordinates are actual rather than workplace, put G53 in front,
Oh, really? And I thought I was beginning to understand these things! So, using G53 to move the spindle to the save coordinates won't affect the work zero, so if I run the same job it won't start at some other random spot, but exactly where it started the last time?
I just want to be sure..
Thanks
-
@Nightowl yes, those last few lines look like they've been added by the post processer.
And yes, G53 doesn't affect the workplace coordinates and only applies to that line it's on. So each line would need G53. Useful for when you have different workplace offsets for each job.
-
Thank you, @jay_s_uk , and just to be a PITA, which would be the best option...
a) Amend the PP to:
M5 G53 Z{max(move.axes[2].userPosition+5,move.axes[2].max-5)} F2400 ; move the Z axis to a safe height G53 X273.5 Y560 F2400 ; move XY to a safe place
...or...
b) Amend the PP to:M5 M98 P"stop.g"
...or...
c) Amend the PP to:1| M5 2| M0
... with options b) and c) requiring the stop.g file to be like this:
; stop.g M5 G53 Z{max(move.axes[2].userPosition+5,move.axes[2].max-5)} F2400 ; move the Z axis to a safe height G53 X273.5 Y560 F2400 ; move XY to a safe place
...or doesn't it really matter?
(I'm not exactly sure where the Z height line came from, but I think DC42 commented on it before. I'll need to check...)
Thanks
-
@Nightowl I would say that it would be C but without M5, so purely M0.
The z line looks like it will probably always move to max-5.
But anyway, that all looks good -
Hmm, I must have missed something...
The last few lines of the gcode file look like this (where are the line numbers?):
... G1X69.400Y15.600 G1X69.597Y15.747 G1X69.828Y15.831 G0Z8.000 M0
...and this is the code in the stop.g file (there are line numbers here, though!):
; stop.g M5 G53 Z{max(move.axes[2].userPosition+5,move.axes[2].max-5)} F2400 ; move the Z axis to a safe height G53 X273.5 Y560 F2400 ; move XY to a safe place
...but, when I run the short test file, the spindle appears to move up, but not to the XY coordinates set in line 4.
EDIT: Actually, this was a dry run, so the spindle was off. I'll check if the M5 command works in the next couple of days).
-
@Nightowl the G53 command by itself doesn't cause motion, it just affects how coordinates in the rest of the line are interpreted. So you need to use G53 G1 Z...
-
Thank you, @dc42 . It had to be something straightforward
And thank you for being here on Christmas Eve!
-
This post is deleted! -
Never mind, Iām sorted
-
-