Spindle orientation M19

Spindle orientation M19

Anonymous
Not applicable
2,639 Views
5 Replies
Message 1 of 6

Spindle orientation M19

Anonymous
Not applicable

Hello,

 

I am using the EMC post, for "Fine boring - shift" the orientation command needs to be M19 R followed by a degree value.

The EMC post provides only  M19.

Can anyone  please tell me which parameter contains "Spindle shift orientation"?

(I figured out "Boring Shift" is contained in "cycle.shift")

 

Thank you, best Regards

 

Markus

Boring.PNG

0 Likes
2,640 Views
5 Replies
Replies (5)
Message 2 of 6

Steinwerks
Mentor
Mentor

Hi @Anonymous,

 

It looks like the generic EMC post processor does not support a Fine Boring canned cycle.

 

For the orientation to work however it looks as though that code will need to be added from a parameter output by the CAM operation:

 

258: onParameter('operation:shiftOrientation', 180)

 

For that you would need to use a getParamter and create a variable to hold that value. Since the default behavior requires the toolpath to be output as an expanded toolpath I believe this will have to be added to the COMMAND_ORIENTATE_SPINDLE code under the onCommand section.

 

Do you know what the code needs to look like in this case? I know for a Haas it could be M19 P180. or M18 R180. for instance.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi Steinwerks,

 

thank you very much for your support.

 

At first I tried:

var ori = 180

if (mcode == 19) {
writeBlock(mFormat.format(mcode), "R"+ori);} else {writeBlock(mFormat.format(mcode)); }

This works fine ==> G Code: M19 R180

 

Then I tried :

var ori = getParameter("operation:shiftOrientation", 180); as  suggested which leads to an error:

Mismatching number of arguments for invocation of 'unsupported PostProcessor.getParameter(string) const'.

 

var ori = getParameter("operation:shiftOrientation")

Error: Parameter does not exist.

 

Please tell me, what I did wrong.

 

Thank you,

best regards

 

M. Huff

0 Likes
Message 4 of 6

Steinwerks
Mentor
Mentor

Sorry, this took me a while to get right. I wanted to make sure that if the spindle orientation offset was zero it wouldn't output a value, so here's what I came up with. Under the onCommand section you can add this line of code, for which the orientation will only take place for a Fine-boring cycle. I don't know of any other cycles offhand that utilize spindle orientation but if any are developed (IE probing) this may have to be altered to suit. I tested this with a fine-boring cycle with an offset of 180 and zero. As always, test carefully!

 

  case COMMAND_ORIENTATE_SPINDLE:
	if (cycleType="fine-boring"){
		var spindleOrientation = (getParameter("operation:shiftOrientation"));
		if (spindleOrientation > 0){
			writeBlock(mFormat.format(19) + " R" + (xyzFormat.format(spindleOrientation)));
		} else {
			writeBlock(mFormat.format(19));
		}
	}
	return;

 

 Here's the code it generated (.F3D file attached as well):

 

%
(1005)
(FINE BORE TEST)
(T1  D=1.25 CR=0. - ZMIN=-0.55 - BORING BAR)
N10 G90 G94 G17 G91.1
N15 G20
N20 G53 G0 Z0.
(BORING WITH OFFSET)
N25 M9
N30 T1 M6
N35 S5000 M3
N40 G54
N45 M8
N55 G0 X0. Y0.
N60 G43 Z1. H1
N70 G0 Z0.1
N75 G1 Z-0.55 F13.123
N80 M5
N85 M19 R180.
N90 X0.1
N95 G0 X0. Z0.1
N100 M3
N105 Z1.
(BORING NO OFFSET)
N115 M8
N120 G0 X0. Y0.
N125 Z1.
N135 Z0.1
N140 G1 Z-0.55 F13.123
N145 M5
N150 M19
N155 X0.1
N160 G0 X0. Z0.1
N165 M3
N170 Z1.
N180 M9
N185 G53 Z0.
N190 M30
%
Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 5 of 6

Anonymous
Not applicable

Thanks so much, works perfect!!!!

 

Best regards

 

M.Huff

0 Likes
Message 6 of 6

Steinwerks
Mentor
Mentor

Good to hear!

I'm pretty syre the code could be simplified but this was the most straight-forward and understandable solution I think.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes