Community
HSM Support Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drill Block

22 REPLIES 22
Reply
Message 1 of 23
franktpw
1116 Views, 22 Replies

Drill Block

We have a CNC Router - CR Onsrud - with both a spindle and a drill block.  When I call for tools (T1 - T8) the machine knows that I'm calling for the spindle and everything works out fine.  When I'm calling for T32 - T40, the machine knows that I'm calling for a drill and drops the appropriate drill head - but the entire drill block is positioned so that T36 is in the spot that the hole is to be drilled in - ie. the tool in the corner of the block (T36) is located where the hole to be drilled is located.  But what I would like is to have the particular drill that I have called located where the hole is to be drilled.  Is there some way to call this out in the tool library (eg. T35 is 32mm in the negative X direction from T36, while T38 is 64mm in the positive Y direction from T36) or is this best accomplished in the post processor?  If in the post processor, is there someone out there who has this working in their post processor who could snip out the java script and send it to me with a quick explanation of where in the post it was located?  I know that I'll have to do some work to make it work for my particular machine, but this would be a great foundation starting point for me!  Thanks in advance!

22 REPLIES 22
Message 2 of 23
parobillard
in reply to: franktpw

Hi

 

I think you'll have to make change in the post!

 

You could do something like:

 

Create 2 vars in the variable section of the post called like drillBlockXOffset = 0; and drillBlockYoffset = 0;

 

then in the "onSection" you can check what tool is selected and fill the 2 variables accordingly

 

then in the "onCyclePoint" section right after the { is open, do something like: x = x + drillBlockXOffset; y = y + drillBlockYoffset

 

I think it could work...

 

NOT TESTED!

Message 3 of 23
franktpw
in reply to: parobillard

This sounds real promising - Thanks!  I'll tell you how it goes and if it leads in a good direction.

Message 4 of 23

This is the same as the setTranslation but then fully written out by yourself instead of having the post do the calculations for you.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 5 of 23

Yup @Laurens-3DTechDraw is right! I didn't know about setTranslation when I wrote this!!

Message 6 of 23
franktpw
in reply to: parobillard

Both of these techniques seem real promising - thank you both.  I have one further question about where and how the additions go in:

 

You wrote:

 

Create 2 vars in the variable section of the post called like drillBlockXOffset = 0; and drillBlockYoffset = 0;  (got it)

 

then in the "onSection" you can check what tool is selected and fill the 2 variables accordingly  (here I'm a little confused - what would it look like to "fill the 2 variables accordingly"?)

 

then in the "onCyclePoint" section right after the { is open, do something like: x = x + drillBlockXOffset; y = y + drillBlockYoffset   (got it)

 

Thanks in advance for leading a newby to java script to a solution!

Message 7 of 23
parobillard
in reply to: franktpw

I've come with something but NOT TESTED

 

In the general var section (around the top of the post file) Add:

 

 

var drillBlockOffsets = {
"36": new Vector(0, 0, 0),
"35": new Vector(-32, 0, 0),
"38": new Vector(0,64,0)
}

in the onSection (right arter/under the { add:

 

if (drillBlockOffsets[tool.number]) {
setTranslation(drillBlockOffsets[tool.number]);
}
else {
setTranslation(new Vector(0,0,0));
}

 

I think it could work!

Message 8 of 23
franktpw
in reply to: parobillard

Thank you both for helping out here!  I am now in a place where things seem to be almost there - and have another question.  I have inserted the code that you suggested below (I had made a couple small mistakes when I first attacked this, and have just now gotten back to it, fixed my mistakes and am getting a pretty good result with just one major problem) - I have added in the following code in the sections you suggested:

 

In the general var section (around the top of the post file) Add:

 

 

var drillBlockOffsets = {
"36": new Vector(0, 0, 0),
"35": new Vector(-32, 0, 0),
"38": new Vector(0,64,0)
}

in the onSection (right arter/under the { add:

 

if (drillBlockOffsets[tool.number]) {
setTranslation(drillBlockOffsets[tool.number]);
}
else {
setTranslation(new Vector(0,0,0));
}

 

Now, my post sends the machine to the millimeter coordinate - but I am working in inches - and then brings the machine back to drill the hole in the correct placement in inches.  So it first reads the variable as if it were in millimeters, and then adjusts it to inches - see here:

 

N240 M06
N250 T32 D32
N260 M06
N270 T32
N290 G00 X130. Y2.  THE MACHINE SHOULD GO TO X7.0394 Y2. - BUT IT IS GOING TO X = 2(IN) +128(MM) INSTEAD
N300 G00 Z1.1
N310 G00 X7.0394  THEN HERE - IT HAS CORRECTED ITSELF - BEFORE IT ACTUALLY DRILLS THE HOLE, WHICH IS GOOD
N330 G00 Z0.7
N340 G01 Z0. F40.
N350 G00 Z0.7
N360 G00 Z1.1
N380 M05
N390 T0 D0

 

I saw the note in the thread to use toPreciseUnit(32, IN) on the spot of the value.  I'm not sure where this line of code should be inserted... nothing I've tried so far works.  If I switch and put in the inch values where I want the machine to drill at, then the machine moves to the correct coordinate first and then moves and drills the hole in the wrong coordinate.  I'm so close to having a working program - so great that you two are willing to help me out here!

 

Any ideas would be well appreciated!  Thank you -

Message 9 of 23
parobillard
in reply to: franktpw

@franktpw

 

can you send your post please

Message 10 of 23
franktpw
in reply to: parobillard

Here is the post - thanks for helping!

 

Lines 118 - 130 are the variable settings

 

Lines 654 - 661 are the translations in the onsection

Message 11 of 23


@franktpw wrote:

Here is the post - thanks for helping!

 

Lines 118 - 130 are the variable settings

 

Lines 654 - 661 are the translations in the onsection


Find the modified post attached.

The toPreciseUnit needs to know what unit this value is in and will convert it to whatever needed.

So you were really close just changed IN to MM.

 

At least this works for what I tested.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 12 of 23

@Laurens-3DTechDraw It is not working for me... the first output of each sections is always "original output + (translation * 25.4)" then every other output of the section is ok!

 

Look like a bug!

 

 

 

Message 13 of 23

I am getting the same situation as @parobillard - see below for the post:

 

N60 M06
N70 T36 D36
N80 M06
N90 T36
N110 G00 X2. Y2.
N120 G00 Z1.1
N140 G00 Z0.7
N150 G01 Z0. F40.
N160 G00 Z0.7
N170 G00 Z1.1
N190 M05
N200 T0 D0
(DRILL2)
N210 G54
(T32 D=0.125 CR=0. TAPER=118DEG - DRILL)
N220 L_parkz
N230 L_brtcN240 M06
N250 T32 D32
N260 M06
N270 T32
N290 G00 X130. Y2.  This SHOULD be "X7.0394 Y2." 
N300 G00 Z1.1
N310 G00 X7.0394  But then it corrects the X location here - before it drills, which is good, but the above line is a real concern!
N330 G00 Z0.7
N340 G01 Z0. F40.
N350 G00 Z0.7
N360 G00 Z1.1
N380 M05
N390 T0 D0
(DRILL3)
N400 G54
(T37 D=0.315 CR=0. TAPER=118DEG - DRILL)
N410 L_parkz
N420 L_brtc
N430 M06
N440 T37 D37
N450 M06
N460 T37
N480 G00 X2. Y-30. This SHOULD be "X2. Y0.7402" 
N490 G00 Z1.1
N500 G00 Y0.7402  But then again, it corrects the Y dimension before it drills...
N520 G00 Z0.7
N530 G01 Z0. F40.
N540 G00 Z0.7
N550 G00 Z1.1
N570 G40
N580 M05

 

I'm not sure where the program is generating the initial number - so strange!  Would love some further help if you guys might have an idea here?

Message 14 of 23
franktpw
in reply to: franktpw

Interesting thought here - I moved the translation code section from starting at line 654 to starting at 968 and got different results.

 

 

N60 M06
N70 T36 D36
N80 M06
N90 T36
N110 G00 X2. Y2.
N120 G00 Z1.1
N140 G00 Z0.7
N150 G01 Z0. F40.
N160 G00 Z0.7
N170 G00 Z1.1
N190 M05
N200 T0 D0
(DRILL2)
N210 G54
(T32 D=0.125 CR=0. TAPER=118DEG - DRILL)
N220 L_parkz
N230 L_brtc
N240 M06
N250 T32 D32
N260 M06
N270 T32
N290 G00 X2. Y2.  Now it goes to location of T36 - the corner tool.
N300 G00 Z1.1
N310 G00 X7.0394  Then it moves so that T32 - the tool that has been called is located, and drills in the correct place.
N330 G00 Z0.7
N340 G01 Z0. F40.
N350 G00 Z0.7
N360 G00 Z1.1
N380 M05
N390 T0 D0
(DRILL3)
N400 G54
(T37 D=0.315 CR=0. TAPER=118DEG - DRILL)
N410 L_parkz
N420 L_brtc
N430 M06
N440 T37 D37
N450 M06
N460 T37
N480 G00 X130. Y2.  Then it moves to X = 2in + the 128mm here!
N490 G00 Z1.1
N500 G00 X2. Y0.7402  Then it correctly moves to the place where we want T37 - the tool called - to drill...
N520 G00 Z0.7
N530 G01 Z0. F40.
N540 G00 Z0.7
N550 G00 Z1.1
N570 G40
N580 M05

 

I think that this tells us that the offending problem is between lines 654 and line 968?

Message 15 of 23

Guys,

 

What software are you using?

What unit is your document in?

What unit do you select in the Post processor dialog?

 

 

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 16 of 23

@Laurens-3DTechDraw

hsm express, inch, inch

 

everything is fine with mm units

 

The problem occur only in INCH

Message 17 of 23

I design in Solidworks 2017 - and use HSMWorks within Solidworks to create the tool paths - then use the post processor that we're trading back and forth here to create the GCode for our 2008 CROnsrud CNC Router - and all of the dimensions I typically design in are inches.  If we truly needed to switch to mm, I guess that wouldn't be the end of the world - but it would really confuse me as I am a lot less familiar with the metric system.  When I need 3D designs cut on this same machine, I use Fusion 360, but that is not as common for me.  I always select inches to design in and select inches in the post processor dialogue

 

Message 18 of 23


@parobillard wrote:

@Laurens-3DTechDraw

hsm express, inch, inch

 

everything is fine with mm units

 

The problem occur only in INCH


I see the problem.

I uploaded the wrong file. 

 

Try the attached version.

Laurens Wijnschenk
3DTechDraw

AutoDesk CAM user & Post editor.
René for Legend.


Message 19 of 23
franktpw
in reply to: franktpw

I just confirmed that it works when in millimeters...   hmm, but I sure would love to work in inches...

Message 20 of 23

I just used your latest post @Laurens-3DTechDraw we're close - but not quite there, for some reason:

 

N60 M06
N70 T36 D36
N80 M06
N90 T36
N110 G00 X2. Y2.
N120 G00 Z1.1
N140 G00 Z0.7
N150 G01 Z0. F40.
N160 G00 Z0.7
N170 G00 Z1.1
N190 M05
N200 T0 D0
(DRILL2)
N210 G54
(T32 D=0.125 CR=0. TAPER=118DEG - DRILL)
N220 L_parkz
N230 L_brtc
N240 M06
N250 T32 D32
N260 M06
N270 T32
N290 G00 X7.0394 Y2.  This is the correct position that we want T32 to drill in
N300 G00 Z1.1
N310 G00 X2.1984  But then is translates back to this coordinate?! before drilling (This is 5.039mm - instead of the 5.039inches more than the original 2inches!)  We've flipped the problem over somehow!
N330 G00 Z0.7
N340 G01 Z0. F40.
N350 G00 Z0.7
N360 G00 Z1.1
N380 M05
N390 T0 D0
(DRILL3)
N400 G54
(T37 D=0.315 CR=0. TAPER=118DEG - DRILL)
N410 L_parkz
N420 L_brtc
N430 M06
N440 T37 D37
N450 M06
N460 T37
N480 G00 X2. Y0.7402  Same here - this is the correct coordinate for T37 to drill in
N490 G00 Z1.1
N500 G00 Y1.9504  And then moves back to this coordinate before drilling - and this is 1.26mm = .049in -  instead of the 1.26inches less than the original 2inch location.
N520 G00 Z0.7
N530 G01 Z0. F40.
N540 G00 Z0.7
N550 G00 Z1.1
N570 G40
N580 M05

 

A bit of a mind bender here for sure!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report