Topics

ALWAYS End G-Code with return to X0.00 Y0.00 Z1.00 - HOW? #pcbgcode

John Ferguson
 

Hi guys,

I have to do manual tool changes between etching the bottom of a PCB, Drilling, and cutting it out of the larger board.

Right now, the G-Code generated by pcb-gcode lifts the cutter to Z 1.000 but doesn't home it.  I've spent the morning trying to make this happen by editing user-gcode.h without success.  This must somehow be coded into the routine somewhere and maybe it would be better to fix it there. But where and how?

I would prefer something like:

G00 Z1.0000

G00 X0.0000 Y0.0000

Also the G-Code locates some end of file text at the joint between the trace etching and the spot-drilling but then doesn't show them at the actual end of file. This is not a big deal but I would truly like to no longer have to manually jog the tool in X and Y axes to return it to home.

What should I try?

best regards to you all,

John Ferguson

florin2901
 

There is a command just for automatic change of tool. All that you need is to add after that G00 Z1.000 a new line with G91 G28 Z0. This will lift your tool to the "Home Z position". You need to add after this, the command G90 for return to "Absolute coordinate system".

John Ferguson
 

Where should I add this? I want it done by pcbgcode and not have to add it to each gcode output file.

On 4/10/20 3:38 PM, florin2901 via groups.io wrote:
There is a command just for automatic change of tool. All that you need is to add after that G00 Z1.000 a new line with G91 G28 Z0. This will lift your tool to the "Home Z position". You need to add after this, the command G90 for return to "Absolute coordinate system".

florin2901
 

As I say before, you have to add that command just after that "G00 Z1.000" in a new line.
So it will look like this:
your code...........
......................
...................
G00 Z1.000
G91 G28 Z0
G90
M30
%

John Ferguson
 

florin, I know this. 

I can add these lines to the end of every G-Code file I generate, but that requires time and since I want it in every file I do, I want to change something in the pcbgcode.ulp so that it does it automatically. 

Right now what I'm getting is it lifts the tool to Z1.0000 and then shuts down.

So the real question is where in the pcbgcode is this action found?

thanks for helping,

john

On 4/10/20 4:31 PM, florin2901 via groups.io wrote:
As I say before, you have to add that command just after that "G00 Z1.000" in a new line.
So it will look like this:
your code...........
......................
...................
G00 Z1.000
G91 G28 Z0
G90
M30
%

florin2901
 

Look for the option which defines the header and the end of code generated. Maybe there you can find a way.

John Johnson
 

Hey John,

You should be able to add code in user-gcode.h in one or more of the TOOL_CHANGE_ strings. Like this:

TOOL_CHANGE_BEGIN[ALL] = "G01 Z1\n"
                         "G01 X0 Y0\n"
                         "M06\n";

This code would be added to your gcode files for the beginning of tool changes for ALL sides of the board (top and bottom).

Regards,
John

On 10 Apr 2020, at 15:34, John Ferguson via groups.io wrote:

Hi guys,

I have to do manual tool changes between etching the bottom of a PCB, Drilling, and cutting it out of the larger board.

Right now, the G-Code generated by pcb-gcode lifts the cutter to Z 1.000 but doesn't home it.  I've spent the morning trying to make this happen by editing user-gcode.h without success.  This must somehow be coded into the routine somewhere and maybe it would be better to fix it there. But where and how?

I would prefer something like:

G00 Z1.0000

G00 X0.0000 Y0.0000

Also the G-Code locates some end of file text at the joint between the trace etching and the spot-drilling but then doesn't show them at the actual end of file. This is not a big deal but I would truly like to no longer have to manually jog the tool in X and Y axes to return it to home.

What should I try?

best regards to you all,

John Ferguson

John Ferguson
 

Hi John,

My confusion is that I want it at the end of a file. I want the tool to return to X0 Y0 Z1.0 at the end of every job.  This sets me up for turning off the machine, manually raising the head, changing the for the next stage, and then setting the height which I do by rolling the tool tip against a short piece of 1/4 inch steel drill stock.

Once this is done, I re-home the z axis and do the next run - drilling in this case.

The reason I need X0 and Y0 is that this is a clean part of the work piece and is a good place to set tool height.

I run the etch, then the drill, then mill.  there is no tool change in the end of the etch gcode, or for that matter the drill, or mill code now. I tried doing what you recommended just below the END_OF_FILE (bottom), but it wouldn't take.

somewhere in your code you are sending an M02 but I couldn't find it.  What I'd like is instead of the M02 by itself Id like to send:

|"G01 Z1\n" "G01 X0 Y0\n" "M02\n"; How can I do that? and thanks much for looking into this with me. john ferguson |

On 4/10/20 6:43 PM, John Johnson wrote:

Hey John,

You should be able to add code in user-gcode.h in one or more of the TOOL_CHANGE_ strings. Like this:

|TOOL_CHANGE_BEGIN[ALL] = "G01 Z1\n" "G01 X0 Y0\n" "M06\n"; |

This code would be added to your gcode files for the beginning of tool changes for ALL sides of the board (top and bottom).

Regards,
John

On 10 Apr 2020, at 15:34, John Ferguson via groups.io wrote:

Hi guys,

I have to do manual tool changes between etching the bottom of a
PCB, Drilling, and cutting it out of the larger board.

Right now, the G-Code generated by pcb-gcode lifts the cutter to Z
1.000 but doesn't home it.  I've spent the morning trying to make
this happen by editing user-gcode.h without success.  This must
somehow be coded into the routine somewhere and maybe it would be
better to fix it there. But where and how?

I would prefer something like:

G00 Z1.0000

G00 X0.0000 Y0.0000

Also the G-Code locates some end of file text at the joint between
the trace etching and the spot-drilling but then doesn't show them
at the actual end of file. This is not a big deal but I would
truly like to no longer have to manually jog the tool in X and Y
axes to return it to home.

What should I try?

best regards to you all,

John Ferguson

John Ferguson
 

Bingo,

I modified a line in gcode-defaults.h to do what I was looking for and it works fine.

see attachment.

On 4/10/20 4:41 PM, florin2901 via groups.io wrote:
Look for the option which defines the header and the end of code generated. Maybe there you can find a way.

kcress1x@sbcglobal.net
 

Why not go to options > job options > parking.  Set 0,0,whatever?

John Ferguson
 

I didn't think of it.  great idea.

On 4/11/20 6:43 AM, kcress1x@... wrote:
Why not go to options > job options > parking. Set 0,0,whatever?

John Ferguson
 

kcress1, where did you find this option?

On 4/11/20 6:43 AM, kcress1x@... wrote:
Why not go to options > job options > parking.  Set 0,0,whatever?

John Johnson
 

Hi John,

Did you try putting your code in

FILE_END[ALL] = "(End of every file)\n";

?

Regards,
John

On 10 Apr 2020, at 19:16, John Ferguson via groups.io wrote:

Hi John,

My confusion is that I want it at the end of a file. I want the tool to return to X0 Y0 Z1.0 at the end of every job.  This sets me up for turning off the machine, manually raising the head, changing the for the next stage, and then setting the height which I do by rolling the tool tip against a short piece of 1/4 inch steel drill stock.

Once this is done, I re-home the z axis and do the next run - drilling in this case.

The reason I need X0 and Y0 is that this is a clean part of the work piece and is a good place to set tool height.

I run the etch, then the drill, then mill.  there is no tool change in the end of the etch gcode, or for that matter the drill, or mill code now. I tried doing what you recommended just below the END_OF_FILE (bottom), but it wouldn't take.

somewhere in your code you are sending an M02 but I couldn't find it.  What I'd like is instead of the M02 by itself Id like to send:

|"G01 Z1\n" "G01 X0 Y0\n" "M02\n"; How can I do that? and thanks much for looking into this with me. john ferguson |


On 4/10/20 6:43 PM, John Johnson wrote:

Hey John,

You should be able to add code in user-gcode.h in one or more of the TOOL_CHANGE_ strings. Like this:

|TOOL_CHANGE_BEGIN[ALL] = "G01 Z1\n" "G01 X0 Y0\n" "M06\n"; |

This code would be added to your gcode files for the beginning of tool changes for ALL sides of the board (top and bottom).

Regards,
John

On 10 Apr 2020, at 15:34, John Ferguson via groups.io wrote:

Hi guys,

I have to do manual tool changes between etching the bottom of a
PCB, Drilling, and cutting it out of the larger board.

Right now, the G-Code generated by pcb-gcode lifts the cutter to Z
1.000 but doesn't home it.  I've spent the morning trying to make
this happen by editing user-gcode.h without success.  This must
somehow be coded into the routine somewhere and maybe it would be
better to fix it there. But where and how?

I would prefer something like:

G00 Z1.0000

G00 X0.0000 Y0.0000

Also the G-Code locates some end of file text at the joint between
the trace etching and the spot-drilling but then doesn't show them
at the actual end of file. This is not a big deal but I would
truly like to no longer have to manually jog the tool in X and Y
axes to return it to home.

What should I try?

best regards to you all,

John Ferguson

John Ferguson
 

Hi John,

check a later post. I put it in gcode-defaults.h in probably a less than optimalplace but it does what I want.

Maybe I should do what you suggest.  It makes more sense.

john

On 4/11/20 11:34 AM, John Johnson wrote:

Hi John,

Did you try putting your code in

FILE_END[ALL] = "(End of every file)\n";

?

Regards,
John

On 10 Apr 2020, at 19:16, John Ferguson via groups.io wrote:

Hi John,

My confusion is that I want it at the end of a file. I want the tool to return to X0 Y0 Z1.0 at the end of every job.  This sets me up for turning off the machine, manually raising the head, changing the for the next stage, and then setting the height which I do by rolling the tool tip against a short piece of 1/4 inch steel drill stock.

Once this is done, I re-home the z axis and do the next run - drilling in this case.

The reason I need X0 and Y0 is that this is a clean part of the work piece and is a good place to set tool height.

I run the etch, then the drill, then mill.  there is no tool change in the end of the etch gcode, or for that matter the drill, or mill code now. I tried doing what you recommended just below the END_OF_FILE (bottom), but it wouldn't take.

somewhere in your code you are sending an M02 but I couldn't find it.  What I'd like is instead of the M02 by itself Id like to send:

|"G01 Z1\n" "G01 X0 Y0\n" "M02\n"; How can I do that? and thanks much for looking into this with me. john ferguson |


On 4/10/20 6:43 PM, John Johnson wrote:

Hey John,

You should be able to add code in user-gcode.h in one or more of the TOOL_CHANGE_ strings. Like this:

|TOOL_CHANGE_BEGIN[ALL] = "G01 Z1\n" "G01 X0 Y0\n" "M06\n"; |

This code would be added to your gcode files for the beginning of tool changes for ALL sides of the board (top and bottom).

Regards,
John

On 10 Apr 2020, at 15:34, John Ferguson via groups.io wrote:

Hi guys,

I have to do manual tool changes between etching the bottom of a
PCB, Drilling, and cutting it out of the larger board.

Right now, the G-Code generated by pcb-gcode lifts the cutter to Z
1.000 but doesn't home it.  I've spent the morning trying to make
this happen by editing user-gcode.h without success.  This must
somehow be coded into the routine somewhere and maybe it would be
better to fix it there. But where and how?

I would prefer something like:

G00 Z1.0000

G00 X0.0000 Y0.0000

Also the G-Code locates some end of file text at the joint between
the trace etching and the spot-drilling but then doesn't show them
at the actual end of file. This is not a big deal but I would
truly like to no longer have to manually jog the tool in X and Y
axes to return it to home.

What should I try?

best regards to you all,

John Ferguson