FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We are updating our platform to a new
system.
Read more: Important
information on the platform change.
08-30-2024 09:12 AM - edited 08-30-2024 09:16 AM
Is it possible to use the 3D circular interpolation function to make a 2D circular interpolation for example for a XZ cartesian robot or I must use the 2D circular interpolation functions?
Here you have my code: if I run it for the 3 axis intepolatin plane XYZ is working good but I get an error when I run it for the 2 axis interpolation XZ
// Circular Interpolationplane XYZ
IF I_KinPlane = enXYZ THEN
stML_KinMoveCircleData3D.In.KinName := I_strKinName;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Meaning := IP_X;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Value := I_IntermediatePosition[0];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Meaning := IP_Y;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Value := I_IntermediatePosition[1];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[2].Meaning := IP_Z;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[2].Value := I_IntermediatePosition[2];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[2].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleDataSize:=3;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Meaning:= X;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Value:=I_EndPosition[0];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Meaning:= Y;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Value:=I_EndPosition[1];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[2].Meaning:= Z;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[2].Value:=I_EndPosition[2];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[2].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTargetSize:=3;
stML_KinMoveCircleData3D.In.Source := 'Kin MoveCirc3DAbs function ';
ML_KinMoveCircle3D(Data:= stML_KinMoveCircleData3D);
END_IF
// Circular Interpolationplane XY
IF I_KinPlane = enXY THEN
stML_KinMoveCircleData3D.In.KinName := I_strKinName;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Meaning := IP_X;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Value := I_IntermediatePosition[0];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Meaning := IP_Y;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Value := I_IntermediatePosition[1];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleDataSize:=2;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Meaning:= X;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Value:=I_EndPosition[0];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Meaning:= Y;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Value:=I_EndPosition[1];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTargetSize:=2;
stML_KinMoveCircleData3D.In.Source := 'Kin MoveCirc3DAbs function ';
ML_KinMoveCircle3D(Data:= stML_KinMoveCircleData3D);
END_IF
// Circular Interpolationplane XZ
IF I_KinPlane = enXZ THEN
stML_KinMoveCircleData3D.In.KinName := I_strKinName;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Meaning := IP_X;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Value := I_IntermediatePosition[0];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Meaning := IP_Z;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Value := I_IntermediatePosition[1];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleDataSize:=2;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Meaning:= X;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Value:=I_EndPosition[0];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Meaning:= Z;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Value:=I_EndPosition[1];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTargetSize:=2;
stML_KinMoveCircleData3D.In.Source := 'Kin MoveCirc3DAbs function ';
ML_KinMoveCircle3D(Data:= stML_KinMoveCircleData3D);
END_IF
// Circular Interpolationplane YZ
IF I_KinPlane = enYZ THEN
stML_KinMoveCircleData3D.In.KinName := I_strKinName;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Meaning := IP_Y;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Value := I_IntermediatePosition[0];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Meaning := IP_Z;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Value := I_IntermediatePosition[1];
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleData[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdCircleData.CmdKinCircleDataSize:=2;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Meaning:= Y;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Value:=I_EndPosition[0];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[0].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Meaning:= Z;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Value:=I_EndPosition[1];
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTarget[1].Attribute:=ABS_VALUE;
stML_KinMoveCircleData3D.In.CmdKinPose.CmdKinTargetSize:=2;
stML_KinMoveCircleData3D.In.Source := 'Kin MoveCirc3DAbs function ';
ML_KinMoveCircle3D(Data:= stML_KinMoveCircleData3D);
END_IF
09-04-2024 02:18 PM - edited 09-05-2024 08:22 AM
I did some tests with following results:
Working:
Not working:
I added my test program here so you can open it.
In short: For commanding an 2D kinematic an 2D circle commands needs to be used.
In long: A 3D circle is not possible to use with a 2D kinematic, as the calculations are done 3-dimensional and so 3 coordinates are expected, but the transformation is not supporting 3 dimensions so only 2 coordinates are useable.