Cancel
Showing results for 
Search instead for 
Did you mean: 

Defining laser event into the post builder

Experimenter
Experimenter

Hi,

 

I want to create a post processor for additive manufacturing applications. Hence, the laser has to be switched off during the rapid movement. Additionally, the signal for laser control should not be output at each line. There should be a "laser switch off"-command before the linear movement block and a "laser switch on"-command after the linear movement block.

 

Example:

rapid movement xyz

laser on

xyz

xyz

xyz

laser off

rapid movement xyz

rapid movement xyz

rapid movement xyz

laser on

xyz

xyz

xyz

laser off

rapid movement xyz

 

I am new to the post builder software. How can i insert the logic for the laser commands into the post builder? Which is the best way to realize it?

 

Thanks in advance.

Daniel

6 REPLIES

Re: Defining laser event into the post builder

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

I would do something like this.

Note I have not tested this code, so there may be typos/logic errors.

 

global mom_current_motion

global daniel_laser_status

if {$mom_current_motion== "rapid_move"} {
    if {[info exists daniel_laser_status] &&
        $daniel_laser_status} {
             # output code to turn off laser here
            set daniel_laser_status 0
    }
} elseif {$mom_current_motion== "linear_move"} {
    if {![info exists daniel_laser_status] ||
        !$daniel_laser_status} {
             # output code to turn on laser here
            set daniel_laser_status 1
    }

} else {
    MOM_output_text "mom_current_motion unknown value = $mom_current_motion"
    # could be "initial_move", "first_move", or something else?
}

You'll have to figure out for the "else" clause what should be done.  Note *if* (for example) "initial_move" is ALWAYS a rapid, you could change the first "if" clause to

 

if {$mom_current_motion== "rapid_move" ||
    $mom_current_motion== "initial_move"} {
Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Defining laser event into the post builder

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

That was the code.

Forgot to say...

Add this to a custom command (e.g. "PB_CMD_Daniel_Laser_Control") and add that custom command to the linear & rapid move blocks before the line with XYZ output.

I'm assuming you don't output circular moves...

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Defining laser event into the post builder

Experimenter
Experimenter

Thank you so much it works perfectly and I got an idea how the stuff works.

Two additional questions; how do you know which variable, e.g. mom_current_motion, is the correct one to get the information about a certain command? And where from do you know the possible values of the variables? Is there a help file somewhere?

Re: Defining laser event into the post builder

Experimenter
Experimenter

Is there also a variable for identification of layer/level changes?

Re: Defining laser event into the post builder

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

1) How to find variables

a) you can turn on the review tool (in the post itself, or in the "Postprocess" dialog.  Post.  Search thru the middle column of the TK dialog for likely candidates (click on each event, and scroll thru the list).  Note this will also create "*.out" files you can open in a text editor to search thru.

b) Search this forum for the "moog_show_globals" proc.  Read thru the thread on how to use.

c) In Post Builder, "Utilities" -> "Browse MOM Variables"

 

Option (c) will sometimes include list of possible values.  Otherwise...

After identifying likely variable(s), use MOM_output_text to output the variable(s) in posted code for different operations/moves/events/whatever.

ALWAYS in your post's tcl code, use an "else" clause to notify you of values not otherwise handled/expected.  (or in "switch" construct, use the "default" clause)

And before you use a variable, make sure it exists:

global your_variable

if {![info exists your_variable]} {
    # handle fact that variable doesn't exist
}

Handling may be either a "return" (don't do anything) or defining a default value, or something else.

 

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Defining laser event into the post builder

Experimenter
Experimenter

Hi,

 

thank you very much for the for the very informative answers. I need exactly the same but i cant use the post builder because I would like to implement it for an NX robotic application.

 

Can anybody help me with implementing the custom commands with the Kuka Postprocessor using the Post Confuigurator?

 

Best regards!

 

 

Learn online





Solution Information