Stock OD from Post Processor

Stock OD from Post Processor

dregalia2014
Enthusiast Enthusiast
1,100 Views
11 Replies
Message 1 of 12

Stock OD from Post Processor

dregalia2014
Enthusiast
Enthusiast

Hello all,

 

Quick question.  I want to bring the StockOD from my turning project into the post processor to spit out the following line:

G54 G0 X.625

Which I assume will set my offset for a project that requires it to be manually set, instead of just using G54 and it remembering where it's current X position is. 

Thanks

0 Likes
1,101 Views
11 Replies
Replies (11)
Message 2 of 12

ArjanDijk
Advisor
Advisor

This is what the Siemens post outputs for the stock diameter:

WriteBlock(
        "WORKPIECE" + "(" + ",,," + "\"" + "CYLINDER" + "\""  + "," + "256" + "," + zFormat.format(workpiece.upper.z) + "," + zFormat.format(workpiece.lower.z) + "," + "80" +
        "," + xFormat.format(workpiece.upper.x) + /*"," + yFormat.format(workpiece.upper.y) + */"," + xFormat.format(workpiece.lower.x) + /*"," + yFormat.format(workpiece.lower.y) + */")"

As you can see its more Xmin/max then cilinder size.

I don't know what you want a movement in the G54 line and what the purpose is


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 3 of 12

dregalia2014
Enthusiast
Enthusiast

Thanks @ArjanDijk, I'm trying to manually set the G54 offset

 

So, I am guessing that

 

Writeblock ("G54 G0 " + xFormat.format(workpiece.lower.x ))

Will give me the piece that i'm looking for in the line. 

I may not be explaining myself correctly.  I'm kinda new to turning profiles.  From what I understand tho, if my cutting edge is .625 away from the center of the stock, when I start a job, it will look at the machine position (.625) and remember that as the X offset.  

Since I do not have that, I need to set it manually in my gcode so it will work right after I generate it.  To make it simple, since I am always lining up my cutting edge to the outside diameter of the stock, I should be able to take that measurement and plug it into my G54 offset and it will work.  

Does that sound right?

0 Likes
Message 4 of 12

ArjanDijk
Advisor
Advisor

Sounds very wrong IMO.

 

Your toolposition need to be in the machinetooltable, so no matter what tool you select, when going to .625, it should touch the part. The gcode does not need adjustment for the tool. That needs to be in the tooltable.

Further: you need a safe start, so first a move in Z, then in X. Then your always in front of the stock 


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


Message 5 of 12

dregalia2014
Enthusiast
Enthusiast

I appreciate you taking the time to explain this part to me..it's a bit unknown right now how it all works.  I want to make sure I get it right before I start anything and ruin tools/tips/material/hardware.

 

Maybe there is a different code I should be looking at.  G10 maybe?

 

Let's say that I want to tell the machine position it's at X.625 already, even tho it says 0/0/0

So, if I were to pass the Gcode:    G0 X.725    the machine would move X .1... Would that be G10?

 

 

 

0 Likes
Message 6 of 12

ArjanDijk
Advisor
Advisor
G10 can shift your zero, but the center of your piece should always be X0. Never change that. G54 is meant for Z values. If part center is not X0, you need to set your G54 X and your toollenght

Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 7 of 12

grueneba
Participant
Participant

Hi everyone,

 

just found this Thread. I have a similar question @ArjanDijk for milling on the OD of a cylinder on a lathe i need to output this line at a certain point in the code:

"FGREF[C]=reference radius". I tried to input this

writeBlock("FGREF[C]" + xFormat.format(workpiece.upper.x));

 

is that wrong? Or do i need to input the whole thing you quoted in the upper part of this thread?

0 Likes
Message 8 of 12

ArjanDijk
Advisor
Advisor

Just try both and see what happens on the machine.


Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


0 Likes
Message 9 of 12

grueneba
Participant
Participant

Well I tried 😄

Unfortunately none of those will produce some code. When I postprocess it is always giving me an error.

It says :

 

###############################################################################
Fehler: ReferenceError: workpiece is not defined
Error at line: 1405
Error in operation: '2D Adaptive3'

0 Likes
Message 10 of 12

grueneba
Participant
Participant

@ArjanDijk Any Idea maybe?

I need my post to write:

FGREF[C]=stock radius in my post.

 

so i went with:

writeBlock("FGREF[C]=" + the stuff you sent/what @dregalia2014 sent);

But it just wont work.

I would be really glad for advice because I think that this is the last thing i need to do to get my post dialed in perfectly and i can finally get back to work 😄

 

EDIT: Oh sorry i forgot to say that my machine runs on a siemens 840d control

0 Likes
Message 11 of 12

ArjanDijk
Advisor
Advisor

Add this line before those commands:

 

var workpiece = getWorkpiece();

Inventor HSM and Fusion 360 CAM trainer and postprocessor builder in the Netherlands and Belgium.


Message 12 of 12

grueneba
Participant
Participant

Ah perfect thank you so much!

0 Likes