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

Always Z retract after workplane change

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
ifuASTJY
1379 Views, 10 Replies

Always Z retract after workplane change

Hi all,

I tried different thing to get this to work without success, done the machine configuration, machine configuration files but I don't see that this is related to my problem.

Basically I need that after each plane change that is not 0 degree of the B axis ( or rotation of the B axis) to do first a Z Cleareance positioning.

We are working with a swivel head that goes from -90 to +90 degree.

the post processor is the latest SINUMERIK 840D.

I found on the forum a pp that works exactly how I described but I need to put that information into our own post.

I attach both pps. and nc.

Here is a correct example from the Eco mill post, the order of x,y and Z changes according to plane angle.

; %_N_1001_MPF
N0 ; 
N1 ; Maschine: DMG ECOMILL 70 / Siemens 840D
N2 ; Programmiert mit Autodesk Inventor HSM
N3 ; Institut f. el. Maschinen, Antriebe und Bahnen
N4 ; 
N5 ; T28 D=40 CR=0 - face mill
N6 WORKPIECE(,,,"BOX",112,0,-62.302,80,42.024,31,-42.024,-31)
N7 G90 G94
N8 G71
N9 G64
N10 G17
N11 G0 SUPA Z-10 D0
N12 CYCLE800(1,"DMG",100000,27,0,0,0,0,0,0,0,0,0,0)

N13 ; Face1
N14 M9
N15 T28 D1
N16 M6
N17 S5000 M3
N18 G54
N19 CYCLE800(1,"DMG",100000,27,0,0,0,0,0,0,0,0,0,0)
N20 G0 X64.024 Y-19.5
N21 G0 Z15
N22 M9
N23 R1=2400 ; Schneidvorschub
N24 R3=2400 ; Schlichtvorschub
N25 R4=2000 ; Einfahrvorschub
N26 G1 Z-1 F0
N27 G1 X42.024 F=R4
N28 G1 X-42.024 F=R3
N29 G17
N30 G2 X-42.024 Y11.62 Z-1 CR=15.56 F=R1
N31 G1 X42.024 F=R3
N32 G1 Z15 F0

N34 ; Face2
N35 CYCLE800(1,"DMG",100000,27,0,0,0,0,90,0,0,0,0,0)
N36 G0 Z57.024
N37 G0 X84.302 Y-19.5
N38 R1=2400 ; Schneidvorschub
N39 R3=2400 ; Schlichtvorschub
N40 R4=2000 ; Einfahrvorschub
N41 G1 Z41.024 F0
N42 G1 X62.302 F=R4
N43 G1 X0 F=R3
N45 G2 X0 Y11.62 Z41.024 CR=15.56 F=R1
N46 G1 X62.302 F=R3
N47 G1 Z57.024 F0

N49 ; Reset plane & move to toolchanger
N50 ; 
N51 CYCLE800(1,"DMG",200000,27,0,0,0,0,0,0,0,0,0,1,,0)
N52 G0 SUPA Z-152.805 D0
N53 G0 SUPA X-750.1 Y-552.76 D0
N54 M30
 

Here is what our SINUMERIK840D pp is , the order of x,y and Z does not change according to plane angle.:

; %_N_1001_MPF
N10 ; T="FR D40 Z4 AL" D=40 CR=0 - face mill
N11 G90 G94
N12 G71
N13 G64
N14 G17
N15 G0 SUPA Z799 D0
N16 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,0)

N17 ; Face1
N18 T="FR D40 Z4 AL" D1
N19 L6
N20 S5000 M3
N21 G54
N22 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N23 G0 X64.024 Y-19.5
N24 G0 Z15
N25 G0 Z-1
N26 G1 X42.024 F2000
N27 G1 X-42.024 F2400
N28 G17
N29 G2 X-57.584 Y-3.94 CR=15.56
N31 G2 X-42.024 Y11.62 CR=15.56
N32 G1 X42.024 Z-1
N33 G0 Z15
N35 G0 SUPA Z799 D0

N36 ; Face2
N37 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N38 D1
N39 G0 X84.302 Y-19.5
N40 G0 Z57.024
N41 G0 Z41.024
N42 G1 X62.302 F2000
N43 G1 X0 F2400
N45 G2 X-15.56 Y-3.94 CR=15.56
N47 G2 X0 Y11.62 CR=15.56
N48 G1 X62.302 Z41.024
N49 G0 Z57.024

N51 G0 SUPA Z799 D0
N52 G0 SUPA Y550 D0
N53 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N54 M30
 
Thanks
10 REPLIES 10
Message 2 of 11
ifuASTJY
in reply to: ifuASTJY

I found the problem when comparing the two posts.

If you download the latest Siemens SINUMERIK 840D pp, there is a missing "var" statement before the 

retracted = false;  in the 
function onSection()
 
Now it's working perfect.
I think the Siemens SINUMERIK 840D should be checked out and updated if needed. It could be a typo.
I am not a programmer just know the basics.var.jpg
Thanks!
Message 3 of 11
ifuASTJY
in reply to: ifuASTJY

Nearly there, after a few nc outputs I notice the following:

1. That the order Z retract is not consistent through the program.

2. When doing a tool change again to square 1, no more Z retract before x and y when at 90 degree.

Take a look at my nc ouput now:

I attach my project and pp again.

 

; %_N_1001_MPF
N10 ; T="BU D11D=11 CR=0 TAPER=135deg - drill
N11 ; T="BU D14D=14 CR=0 TAPER=135deg - drill
N12 ; T="FR D40 Z4 AL" D=40 CR=0 - face mill
N13 G90 G94
N14 G71
N15 G64
N16 G17
N17 G0 SUPA Z799 D0
N18 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,0)

N19 ; Face1
N20 T="FR D40 Z4 AL" D1
N21 L6
N22 T="BU D11"
N23 S5000 M3
N24 G54
N25 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N26 G0 X63.024 Y-19.5                                       // x and y correct because Z axis is far from part after tool change (N17 G0 SUPA Z799 D0)
N27 G0 Z15
N28 G0 Z0
N29 G1 X41.024 F2000
N30 G1 X-41.024 F2400
N31 G17
N32 G2 X-56.084 Y-4.44 CR=15.06
N34 G2 X-41.024 Y10.62 CR=15.06
N35 G1 X41.024 Z0
N36 G0 Z15
N38 G0 SUPA Z799 D0

N39 ; Face2
N40 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N41 G0 Z56.024                                               // Z retract is correct, if not we would have a collision.
N42 G0 X83.302 Y-19.5
N43 G0 Z41.024
N44 G1 X61.302 F2000
N45 G1 X0 F2400
N47 G2 X-15.06 Y-4.44 CR=15.06
N49 G2 X0 Y10.62 CR=15.06
N50 G1 X61.302 Z41.024
N51 G0 Z56.024
N53 G0 SUPA Z799 D0
N54 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,0)

N55 ; Face1 (2)
N56 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N57 G0 Z15                                   //here the first operation again but X and Y are after Z, it should be again X and Y first  after N53 G0 SUPA Z799 D0
N58 G0 X63.024 Y-19.5
N59 G0 Z0
N60 G1 X41.024 F2000
N61 G1 X-41.024 F2400
N63 G2 X-56.084 Y-4.44 CR=15.06
N65 G2 X-41.024 Y10.62 CR=15.06
N66 G1 X41.024 Z0
N67 G0 Z15
N69 G0 SUPA Z799 D0

N70 ; Drill1
N71 M1
N72 T="BU D11D1
N73 L6
N74 T="BU D14"
N75 S5000 M3
N76 G54
N77 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N78 G0 X-27.709 Y-15.405              //tool change here X and Y first then Z, correct, 0 degree plane
N79 G0 Z15
N80 M7
N81 G17
N82 F1000
N83 MCALL CYCLE81(5, 0, 5, -25, )
N84 X-27.709 Y-15.405
N85 X-0.702 Y10.176
N86 MCALL
N87 G0 Z15
N89 G0 SUPA Z799 D0

N90 ; Drill2
N91 M9
N92 M1
N93 T="BU D14D1
N94 L6
N95 T="FR D40 Z4 AL"
N96 S2500 M3
N97 G54
N98 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N99 G0 X27.596 Y-2.304     //tool change here again X and Y first then Z, NOT correct, 90 degree plane, head will collide with part
N100 G0 Z56.024
N101 M7
N102 G17
N103 F400
N104 MCALL CYCLE81(46.024, 41.024, 5, 16.024, )
N105 X27.596 Y-2.304
N106 MCALL
N107 G0 Z56.024

N109 G0 SUPA Z799 D0
N110 G0 SUPA Y550 D0
N111 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,-1)
N112 M30
 
Thanks
Message 4 of 11
ifuASTJY
in reply to: ifuASTJY

Hi all!

Any ideas here ?

Thanks

Message 5 of 11
andrea.amilo
in reply to: ifuASTJY

Hi @ifuASTJY ,

if you need to have first movement along Z after each plane change that is not 0 degree of the B axis, I think you could add this simple modification to your postprocessor ( lines 1303 and 1304 ) :

 

    var initialPosition = getFramePosition(currentSection.getInitialPosition());
    // if (!retracted && !insertToolCall)
    if (abcFormat.format(abc.y) != 0) {
      if (getCurrentPosition().z < initialPosition.z) {
        writeBlock(gMotionModal.format(0), zOutput.format(initialPosition.z));
        zIsOutput = true;
      }
    }

It means that when B axis ( = rotation around Y ) is different from 0 postprocessor will write Z first.

Please test it carefully and let me know.

 



Andrea Amilo

Senior Technical Consultant

Autodesk Knowledge Network | Fusion 360 Webinars | Autodesk Make
Message 6 of 11
ifuASTJY
in reply to: andrea.amilo

Hi,

Yes, this works now, very glad now, I will keep an eye on it but I see the code is good, I will output a more complex part and check it out.

 

I notice one thing ( this is a bit off topic) when I set machine.configuration "table= false"  it outputs XYZ in a single line, when it's true I have XY on one line and Z on the next line.

In our case we do not have a table, we only have rotary B axis.

For now I just keep it on " true" and the code is fine.

machineconfig.JPG

Many thanks this will save us a tone of time.

!

Message 7 of 11
ifuASTJY
in reply to: andrea.amilo

Hello @andrea.amilo ,

So after a few tests I have the following.

All is good except when it makes a tool change and keeps the same angle. The second tool does not retract on Z anymore. 

Can you please take another look?

Thanks

 

N112 ; B=90
N113 M9
N114 M1
N115 T="BU D14D1
N116 L6
N117 T="BU D12 LUNG"
N118 S2500 M3
N119 G54
N120 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N121 G0 Z40
N122 G0 X21.946 Y-2.304
N123 M7
N124 G17
N125 F400
N126 MCALL CYCLE81(30, 25, 5, 0, )
N127 X21.946 Y-2.304
N128 MCALL
N129 G0 Z40
N131 G0 SUPA Z799 D0

N132 ; B=90
N133 M9
N134 M1
N135 T="BU D12 LUNG" D1
N136 L6
N137 T="FR D10 Z4"
N138 S3000 M3
N139 G54
N140 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N141 G0 X21.946 Y-2.304
N142 G0 Z40
N143 M7
N144 G17
N145 F420
N146 MCALL CYCLE81(30, 25, 5, 0, )
N147 X21.946 Y-2.304
N148 MCALL
N149 G0 Z40
N151 G0 SUPA Z799 D0
N152 CYCLE800(1,"",0,57,0,0,0,0,0,0,0,0,0,0)
Message 8 of 11
andrea.amilo
in reply to: ifuASTJY

HI @ifuASTJY ,

 

could you please write exactly what you expects ?

...

N135 T="BU D12 LUNG" D1
N136 L6
N137 T="FR D10 Z4"
N138 S3000 M3
N139 G54

                                                                 <--- Do you need G0 SUPA Z here ?
N140 CYCLE800(1,"",0,57,0,0,0,0,90,0,0,0,0,-1)
N141 G0 X21.946 Y-2.304

...

 

Thanks

 



Andrea Amilo

Senior Technical Consultant

Autodesk Knowledge Network | Fusion 360 Webinars | Autodesk Make
Message 9 of 11
mbl_busse
in reply to: andrea.amilo

Hey there 🙂

 

I think the problem that @ifuASTJY has is the order in wich the machine approaches the start position of the cycle.

In line 121/122 it's Z first and then X&Y.

In line 141/142 it's X&Y first and then Z.

 

He want's to approach Z first, because otherwise the spindle may crash with the workpiece. I would't set it up like this, in my opinion X&Y first and then Z ist much safer, but the solution could be to add a retract between the orientation of the b-axis and the approaching.

In Heidenhain this would be M140 MB MAX, I don't know the command for Siemens.

The line to change should be in the OnSection function.

There are a few lines wich define the approaching-strategy if the machineconfiguration is a HeadConfiguration.

 

Hopefully this helps a bit.

 

Greetings from Germany

Message 10 of 11
ifuASTJY
in reply to: mbl_busse

Thank you for putting your time in my request. 

I try to simplify my problem with a sketch drawing.

Basically there are two cases:

Case 1 when B angle is 0 degree. - here I always need first approach to be X and Y and the Z Clearance Plane ( This is already working)

Case 2 is when B angle is any other angle then 0 degree - here I always need first approach to be Z Clearance Plane and then XY approach.

Keep in mind that every time when the work plane changes I have a Z retract ( SUPA Z799 D0) so like this it is safe to do Z Clearance plane first

I hope with your help I explained my needs better than before.

Thank you for your effortB=0.jpgB!=0.jpg

Message 11 of 11
andrea.amilo
in reply to: ifuASTJY

Hi @ifuASTJY ,

 

I think you could add a specific check for each tool changes ( at line 1318 ) :

 

    if (abcFormat.format(abc.y) != 0) {
      if (getCurrentPosition().z < initialPosition.z || insertToolCall) {
        writeBlock(gMotionModal.format(0), zOutput.format(initialPosition.z));
        zIsOutput = true;    
      }
    }

Please test it carefully and let me know.

 



Andrea Amilo

Senior Technical Consultant

Autodesk Knowledge Network | Fusion 360 Webinars | Autodesk Make

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

Post to forums  

Autodesk Design & Make Report