Cancel
Showing results for 
Search instead for 
Did you mean: 

G68.2 with RPY option

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi! 

 

It´s possible to use RPY option with G68.2 instead of euler angles?

 

I take sim_05_fanuc_mm MCF parser and i get and error executing my gcode. 

       G68.2 P1 Q123 X0 Y0 Z0 I-90 J0 K-90.

 

What method is executed for calculate matrixrotation?

 

Best regards

Ivan

14 REPLIES

Re: G68.2 with RPY option

Creator
Creator

Hi

 

Please ref custom commands  PB_CMD_set_csys for  matrix calculation or import custom command pb_cmd_coordinate_system_rotation.tcl and check in PB_CMD_set_csys.

Re: G68.2 with RPY option

Legend
Legend

Hi,

The standard Fanuc parser only works with G68.2 for Euler angles (without P parameter).
If you want to use another format G68.2 P1, you should edit this parser and add the handler of P parameter there. For P1 the following method of calculation can be used:

calculateRotMatrix(LV_i*PI/180.0,LV_j*PI/180.0,LV_k*PI/180.0,"RPY")

Re: G68.2 with RPY option

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi, 

 

I´m trying to develop the G68.2 and G53.1 commands with RPY solution. 

 

The machine have the same kinematics as the new machine on NX11: sim18. 

I make a Method in Machine Configurator using the folowing commands:

    ("g68.2_RPY_1.JPG")

 

But if I debug the vector values they are always equal to zero.

- getVectorX(getMatrixTranslation(getTrafoMatrix("TABLEROTATE")))
- getVectorY(getMatrixTranslation(getTrafoMatrix("TABLEROTATE")))
- getVectorZ(getMatrixTranslation(getTrafoMatrix("TABLEROTATE")))

 

I have check the following points and there are all of them corrects:
- Chain definition correctly in kinematic model? Using correct chain name? --> GV_strSwivelingChainName
- Origin of machine zero correctly? Move all axes to zero and check if the tool mount position matches with the machine zero
- GeoAxis definition in channel configuration correclty?
- Axis Limits correct? GV_dFifthAxisLimitMax/Min, GV_dFourthAxisLimitMax/Min
- Vector settings correct? GV_dFourthAxisX/Y/Z, GV_dFifthAxisX/Y/Z
- Axis names correct? GV_strFifth/FourthAxisName

 

I try to use calculateIKSLinears to calculate the translation caused by the rotation:

    ("g68.2_RPY_2.JPG" & "g68.2_RPY_3.JPG")

LV_vecDispl= calculateIKSLinears(GV_strSwivelingChainName,LV_coordCurrent,getJointValue(GV_strFifthAxisName),getJointValue((GV_strFourthAxisName))

and then DisplaceOrigin with "TABLEROTATE" transformation.

 

But the vectors: getVectorX(LV_vecDispl) , getVectorY(LV_vecDispl) and getVectorZ(LV_vecDispl) are incorrects. 

 

Anyone have any idea about it

Best Regards

Ivan

Re: G68.2 with RPY option

Siemens Phenom Siemens Phenom
Siemens Phenom
Hi Ivan,

thanks for the very well prepared question and nice implemenation!

One idea from my side
When you´re doing the calculateRotMatrix you use the joint values from the rotary axes. Have the axes been moved before the calculation started? From my point of you it doesn´t make sense because the axes will be positioned based on the calculated angles?!

It´s more a cosmetic point...
Whats the intention to use the GV_strFourth/FifthAxis axis names in your calculation. You can also query the rotary axes for the current active chain with the 'getKinematicChainAxis' function. It´s similar to the implementation for the coordinate axes X, Y Z but with parameter 'partrotaryaxis' and 'toolrotaryaxis'

Thomas

Re: G68.2 with RPY option

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi Thomas,

 

If I understood correctly i change my variables GV_strFourth/FifthAxis by:

LV_strPartChainAxis=getKinematicChainAxis(GV_strSwivelingChainName, "partrotaryaxis")

LV_strToolChainAxis=getKinematicChainAxis(GV_strSwivelingChainName, "toolrotaryaxis")

 

And then I introduce it in the function calculateRotMatrix and in calculateIKSLinears in the following way:

LV_matRot=calculateRotMatrix(getRadians(getJointValue(LV_strToolChainAxis)),getRadians(getJointValue(LV_strPartChainAxis)), 0, "RPY")

 

LV_vecDispl=calculateIKSLinears(GV_strSwivelingChainName, LV_coordCurrent,getJointValue(LV_strPartChainAxis),getJointValue(LV_strToolChainAxis))

 

But the vectors are equally incorrect.

 

Best Regards

Ivan

Re: G68.2 with RPY option

Siemens Phenom Siemens Phenom
Siemens Phenom
Hi Ivan,

as I said the second point was more cosmetic and will not influence the calculation itself as long as the GV variables are correctly filled. The usage of LV_strPart/ToolChainAxis in your implemenation looks good so far.

What about my question? "Have the axes been moved before the calculation started?" I guess this is the problem. getJointValue returns '0' because the axes are not moved and then the calculation is also '0'

Thomas

Re: G68.2 with RPY option

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi Thomas, 

 

This is the NC code: 

 

(O1001)
N1002 G00 G53 Z698
N1004 G00 G53 X#520 Y#521
N1006 M08
N1008 M13
N1010 M11
N1012 G5.4 Q1
N1014 G5.1 Q1 R7
N1016 S1000 M03
N1018 G43 H01 P3 L1
N1020 G00 X200. Y0.0 A0.0 B90.
N1022 Z1.
N1024 G68.2 P1 Q123 X0.0 Y0.0 Z0.0 I0.0 J90. K0.0
N1026 G53.1
N1028 M12
N1030 M10
N1032 G49
N1034 G43 H01
N1036 X400. Y0.0 Z200.
N1038 G01 X0.0 Y0.0 F1000.

 

You can see that effectively the axes are rotated before the G68.2 been executed. 

The problem is not in getJointValue(LV_strToolChainAxis) or partaxis, there are okey, in these case:

          getJointValue(LV_strToolChainAxis)=0

          getJointValue(LV_strPartChainAxis)=90

 

The problem is that I am not able to calculate the translation that this rotation causes me in the coordinate system. 

 

if I try to use getVectorX, Y or Z (getMatrixTranslation(getTrafoMatrix("TABLEROTATE"))) the value is always 0. 

 

Best Regards 

Ivan

Re: G68.2 with RPY option

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi Ivan,

 

I tried to reproduce it on the sim18 machine. Now it´s more clear. Thanks for showing the NC Code.

The calculation is as expected! There is no offset when moving the tool mounting junction to machine zero position (all axes '0') and the table rotates around B axis (part axis). What offset do you expect? (Ingore the stuff below the red marked frame in cse variables)

 

There can be an offset when you´ve defined a different machine zero position and using initial values. So please check your machine zero definition in the kinematic model. 

 

It is essential for correct IKS usage that the tool mounting position must match the machine zero posture when all axes are 0. 

 

2017-11-08 13_24_49-NX 12.0.1.3 - Manufacturing.pngThomas

Re: G68.2 with RPY option

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi Thomas, 

 

In essential i´m trying to reproduce the behavior of the simulation with G68.2 (euler angles) with my G68.2 (RPY angles). 

 

When I use sim18 simulation with sim18 postprocessor default i get this NC code: 

%
O0001
(CREATED BY : GUTIERREZ_IVAN )
(DATE : 08.11.2017 , 14:00 )
(PARTNAME : EJ_SIM_SIM18.PRT )
G17 G21 G94 G90

(G68_2 , TOOL : MILL)

N1 G0 G53 Z607.5
N2 T01 M6
N3 G54
N4 G68.2 X0. Y0. Z0. I90. J90. K-90.
N5 G53.1
N6 G17 G43 G94 G1 G90 X400. Y0. Z200. F1000. S0 H1 M3
N7 X0.
N8 G69
N9 M5
N10 G49
N11 G0 G53 Z607.5
N12 M2

 

If i go to X0 Y0 Z0 after the G68.2 and G53.1 execution the machine go to the position below (image01.jpg).

You can see that zero have and offset (X-200 Z-200) caused by the B rotation. 

Its true that if I debug IKS the values are 0 in all of cases (image02.jpg)

 

What I want is to obtain that displacement of the zero that the G68.2 produces by the movement of the axes in my new parser.

 

My problem is that I don´t know how to calculate that offset that the G68.2 default calculate.

 

Best Regards

Ivan

Learn online





Solution Information