- LinuxCNC
- General LinuxCNC Questions
- Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
- Askjerry
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 308
- Thank you received: 35
22 Apr 2018 20:06 #109451
by Askjerry
Odd behaviour in a routine... G83 Peck Drill... double drills some holes. was created by Askjerry
Here is an odd one... I made a Bolt Hole Circle routine... the user defines the number of holes, depth, peck depth, feed, and spindle feed... this gets passed to the routine. All that works great.
here is the odd part... the FIRST and LAST hole are drilled as expected... every other hole gets drilled TWICE.
So if I specify 5 holes... then #1 and #5 get drilled as expected... but #2, #3, and #4 will get drilled twice.
What the heck am I missing????
Jerry
Code attached... and feel free to use it or a derivative in your machines.
here is the odd part... the FIRST and LAST hole are drilled as expected... every other hole gets drilled TWICE.
So if I specify 5 holes... then #1 and #5 get drilled as expected... but #2, #3, and #4 will get drilled twice.
What the heck am I missing????
Jerry
Code attached... and feel free to use it or a derivative in your machines.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4866
01 May 2018 21:39 #109951
by andypugh
Replied by andypugh on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
Normally you would have the ^1000 on the same line as the canned cycle.
Once in canned-cycle mode you get a hole every time you specify a position.
So, it enters G83 mode and drills a hole at the current positon.
Then it moves ^1000 and drills a hole
Then is loops round and drills a hole at the current position
Try putting the G83 outside the loop, and then have a G80 after the end of the loop.
Or put the ^1000 on the same line as the G83.
As things are both lines in the loop drill a hole.
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g80
Once in canned-cycle mode you get a hole every time you specify a position.
So, it enters G83 mode and drills a hole at the current positon.
Then it moves ^1000 and drills a hole
Then is loops round and drills a hole at the current position
Try putting the G83 outside the loop, and then have a G80 after the end of the loop.
Or put the ^1000 on the same line as the G83.
As things are both lines in the loop drill a hole.
linuxcnc.org/docs/2.7/html/gcode/g-code.html#gcode:g80
The following user(s) said Thank You: Askjerry
Please Log in or Create an account to join the conversation.
- Askjerry
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 308
- Thank you received: 35
02 May 2018 00:40 #109982
by Askjerry
Replied by Askjerry on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
I'm going to have to think about that one... I need it to work several times... so I will need to me in a loop.
The only thing I can think of at the moment... is to have a routine file... with another routine... then within the loop... call the drill routine and return. Kinda the same... but not.
The interesting thing is that it doesn't do it on the first or last hole...
I guess I'll have to play around with it... thanks for the info... at least now I have something to go on.
Jerry
The only thing I can think of at the moment... is to have a routine file... with another routine... then within the loop... call the drill routine and return. Kinda the same... but not.
The interesting thing is that it doesn't do it on the first or last hole...
I guess I'll have to play around with it... thanks for the info... at least now I have something to go on.
Jerry
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
Less
More
- Posts: 405
- Thank you received: 163
02 May 2018 02:01 #109988
by MaHa
Replied by MaHa on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
When i made my bolthole subroutine, it worked only like this to move to next position.
G0 G61 X[#<CPA> + [#<RAD> * [COS[#<HH3>]]]] Y[#<CPO> + [#<RAD> * [SIN[#<HH3>]]]].
Maybe G0 G61 works with polarcoordinates as well. After it will enter G83 mode anyway in the loop.
G0 G61 X[#<CPA> + [#<RAD> * [COS[#<HH3>]]]] Y[#<CPO> + [#<RAD> * [SIN[#<HH3>]]]].
Maybe G0 G61 works with polarcoordinates as well. After it will enter G83 mode anyway in the loop.
Please Log in or Create an account to join the conversation.
- Askjerry
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 308
- Thank you received: 35
02 May 2018 02:14 #109990
by Askjerry
Replied by Askjerry on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
That is what I thought... well... similar... do the cycle, rotate the point either by using math to calculate the coordinates, or by using G10L2 R__ or something similar to do the rotation. Once I get something that works... I'll post it here for follow-up and to help others. If someone out there has a working routine... please share so we can all learn!
Thanks,
Jerry
Thanks,
Jerry
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
Less
More
- Posts: 405
- Thank you received: 163
02 May 2018 03:00 #109993
by MaHa
Replied by MaHa on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
I can share my routine, no problem. Call example:
o<holes2> call [141] [68] 109/2 [45] [90] [4] [83] [-19.5] [-6] [3]
You can choose g81,g82,g83 or g89
o<holes2> call [141] [68] 109/2 [45] [90] [4] [83] [-19.5] [-6] [3]
You can choose g81,g82,g83 or g89
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23178
- Thank you received: 4866
02 May 2018 10:14 #110008
by andypugh
Replied by andypugh on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
Maybe I didn't explain clearly enough.
G83 is modal. That means that after a G83 any movement comand (X, Y, Z, @ ^) is taken as defining the start of a new hole.
You loop therefore has two holes every time through
enter loop
G83 - drill a hole at the current position
^#1000 - move and drill a hole
back to the top
G83 - drill a hole at the current position
^#1000 - move and drill a hole
...
Put the ^#1000 on the same line as the G83 and you will only get each hole once.
Alternatively put the G83 before the loop and only have the ^#1000 in the loop.
Or put a G80 before the ^#1000
Or make the ^#1000 a G0 #^1000 (to change the motion node from G83 to G0)
G83 is modal. That means that after a G83 any movement comand (X, Y, Z, @ ^) is taken as defining the start of a new hole.
You loop therefore has two holes every time through
enter loop
G83 - drill a hole at the current position
^#1000 - move and drill a hole
back to the top
G83 - drill a hole at the current position
^#1000 - move and drill a hole
...
Put the ^#1000 on the same line as the G83 and you will only get each hole once.
Alternatively put the G83 before the loop and only have the ^#1000 in the loop.
Or put a G80 before the ^#1000
Or make the ^#1000 a G0 #^1000 (to change the motion node from G83 to G0)
Please Log in or Create an account to join the conversation.
- Askjerry
- Topic Author
- Offline
- Elite Member
Less
More
- Posts: 308
- Thank you received: 35
02 May 2018 15:51 #110032
by Askjerry
Replied by Askjerry on topic Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
Ah... perfect... I see... set the first hole... then just do the rotations and the next hole is drilled by how the function works.
I'm flying today, home tomorrow... I'll give it a try and post the updated code when I have it working properly.
Thank you Andy.
Jerry
I'm flying today, home tomorrow... I'll give it a try and post the updated code when I have it working properly.
Thank you Andy.
Jerry
Please Log in or Create an account to join the conversation.
- LinuxCNC
- General LinuxCNC Questions
- Odd behaviour in a routine... G83 Peck Drill... double drills some holes.
Time to create page: 0.097 seconds