Good day everyone,
I'm working on a project which involves generate a path along the surface of any give 3D geometry,I use Matlab to read a from an external stl file to get the surface point and its related normal vector(small triangle mesh and the normal vector),by writing a script processing these datas,I could come up with a series of point containing Cartesian coordinates and the orientation(X,Y,Z,A,B,C), I used SLIN point C_Dis to run these points,supposing that I could get a smooth path,but the robot either says approximation not possible or stutter.
anyone can teach me how to make the motion smooth,I even used spline block,the stutter disappeared but I got extremly slow speed. is there any rules that we could follow in order to generate the data for points so that we could get a smooth motion?? I used Matlab spline function to generate interpolation point hoping to help the transition in a smooth way,but it doesn't seems like to improve.
following is my code:
&ACCESS RVO
&REL 8
&PARAM EDITMASK = *
&PARAM TEMPLATE = C:\KRC\Roboter\Template\vorgabe
&PARAM DISKPATH = KRC:\R1\1
DEF shoes( )
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS(#INITMOV, 0)
$OUT[4] = False
$OUT[2] = False
$OUT[3] = False
BAS(#VEL_PTP, 1)
BAS(#ACC_PTP, 0.5)
slowspeed=0.01
fastspeed=0.33
midspeed=0.27
$VEL.CP=fastspeed
BAS(#BASE, 1)
BAS(#TOOL, 1)
$VEL_AXIS[1]=10
$VEL_AXIS[2]=10
$VEL_AXIS[3]=10
$VEL_AXIS[4]=10
$VEL_AXIS[5]=10
$VEL_AXIS[6]=10
$ACC_AXIS[1]=10
$ACC_AXIS[2]=10
$ACC_AXIS[3]=10
$ACC_AXIS[4]=10
$ACC_AXIS[5]=10
$ACC_AXIS[6]=10
$APO.CDIS=0.1
;FOLD SPTP P12 Vel=50 % PDAT4 Tool[1]:Tool1 Base[1]:Base1 ;%{PE}
;FOLD Parameters ;%{h}
;Params IlfProvider=kukaroboter.basistech.inlineforms.movement.spline; Kuka.IsGlobalPoint=False; Kuka.PointName=P12; Kuka.BlendingEnabled=False; Kuka.MoveDataPtpName=PDAT4; Kuka.VelocityPtp=50; Kuka.VelocityFieldEnabled=True; Kuka.ColDetectFieldEnabled=True; Kuka.CurrentCDSetIndex=0; Kuka.MovementParameterFieldEnabled=True; IlfCommand=SPTP
;ENDFOLD
SPTP XP12 WITH $VEL_AXIS[1] = SVEL_JOINT(50.0), $TOOL = STOOL2(FP12), $BASE = SBASE(FP12.BASE_NO), $IPO_MODE = SIPO_MODE(FP12.IPO_FRAME), $LOAD = SLOAD(FP12.TOOL_NO), $ACC_AXIS[1] = SACC_JOINT(PPDAT4), $APO = SAPO_PTP(PPDAT4), $GEAR_JERK[1] = SGEAR_JERK(PPDAT4), $COLLMON_TOL_PRO[1] = USE_CM_PRO_VALUES(0)
;send tape out signal
PULSE($OUT[3], TRUE, 1.0)
WAIT FOR ( $IN[10] )
$OUT[3] = False
;ENDFOLD
$ADVANCE=5
SLIN {X 400.00,Y -125.13,Z 217.66,A -53.62,B 53.74,C 168.74} C_Dis
SLIN {X 400.00,Y -124.51,Z 217.32,A -53.60,B 53.76,C 168.77} C_Dis
SLIN {X 400.00,Y -123.90,Z 216.99,A -53.58,B 53.79,C 168.80} C_Dis
SLIN {X 400.00,Y -123.29,Z 216.65,A -53.55,B 53.81,C 168.83} C_Dis
SLIN {X 400.00,Y -122.68,Z 216.31,A -53.53,B 53.83,C 168.85} C_Dis
SLIN {X 400.00,Y -122.06,Z 215.97,A -53.51,B 53.85,C 168.88} C_Dis
SLIN {X 400.00,Y -121.45,Z 215.63,A -53.48,B 53.88,C 168.91} C_Dis
SLIN {X 400.00,Y -120.84,Z 215.30,A -53.46,B 53.90,C 168.94} C_Dis
SLIN {X 400.00,Y -120.22,Z 214.96,A -53.44,B 53.92,C 168.97} C_Dis
SLIN {X 400.00,Y -119.61,Z 214.62,A -53.42,B 53.94,C 169.00} C_Dis
SLIN {X 400.00,Y -119.00,Z 214.28,A -53.39,B 53.97,C 169.02} C_Dis
SLIN {X 400.00,Y -118.38,Z 213.95,A -53.37,B 53.99,C 169.05} C_Dis
SLIN {X 400.00,Y -117.77,Z 213.61,A -53.35,B 54.01,C 169.08} C_Dis
SLIN {X 400.00,Y -117.16,Z 213.27,A -53.32,B 54.03,C 169.11} C_Dis
SLIN {X 400.00,Y -116.54,Z 212.93,A -53.30,B 54.06,C 169.14} C_Dis
SLIN {X 400.00,Y -115.93,Z 212.59,A -53.28,B 54.08,C 169.17} C_Dis
SLIN {X 400.00,Y -115.32,Z 212.26,A -53.25,B 54.10,C 169.19} C_Dis
SLIN {X 400.00,Y -114.71,Z 211.92,A -53.23,B 54.12,C 169.22} C_Dis
SLIN {X 400.00,Y -114.09,Z 211.58,A -53.21,B 54.15,C 169.25} C_Dis
SLIN {X 400.00,Y -113.48,Z 211.24,A -53.19,B 54.17,C 169.28} C_Dis
SLIN {X 400.00,Y -112.87,Z 210.91,A -53.16,B 54.19,C 169.31} C_Dis
SLIN {X 400.00,Y -112.25,Z 210.57,A -53.14,B 54.21,C 169.34} C_Dis
SLIN {X 400.00,Y -111.64,Z 210.23,A -53.12,B 54.24,C 169.37} C_Dis
SLIN {X 400.00,Y -111.03,Z 209.89,A -53.09,B 54.26,C 169.39} C_Dis
SLIN {X 400.00,Y -110.41,Z 209.55,A -53.07,B 54.28,C 169.42} C_Dis
SLIN {X 400.00,Y -109.80,Z 209.22,A -53.05,B 54.30,C 169.45} C_Dis
SLIN {X 400.00,Y -109.19,Z 208.88,A -53.02,B 54.32,C 169.48} C_Dis
SLIN {X 400.00,Y -108.57,Z 208.54,A -53.00,B 54.35,C 169.51} C_Dis
SLIN {X 400.00,Y -108.34,Z 208.41,A -52.99,B 54.36,C 169.52} C_Dis
SLIN {X 400.00,Y -107.72,Z 208.08,A -52.97,B 54.38,C 169.55} C_Dis
SLIN {X 400.00,Y -107.11,Z 207.75,A -52.94,B 54.40,C 169.58} C_Dis
SLIN {X 400.00,Y -106.49,Z 207.42,A -52.92,B 54.42,C 169.61} C_Dis
SLIN {X 400.00,Y -105.88,Z 207.08,A -52.90,B 54.44,C 169.64} C_Dis
SLIN {X 400.00,Y -105.26,Z 206.75,A -52.87,B 54.47,C 169.67} C_Dis
SLIN {X 400.00,Y -104.64,Z 206.42,A -52.85,B 54.49,C 169.70} C_Dis
SLIN {X 400.00,Y -104.03,Z 206.09,A -52.82,B 54.51,C 169.72} C_Dis
SLIN {X 400.00,Y -103.41,Z 205.75,A -52.80,B 54.53,C 169.75} C_Dis
SLIN {X 400.00,Y -102.80,Z 205.42,A -52.78,B 54.56,C 169.78} C_Dis
SLIN {X 400.00,Y -102.18,Z 205.09,A -52.75,B 54.58,C 169.81} C_Dis
SLIN {X 400.00,Y -101.56,Z 204.76,A -52.73,B 54.60,C 169.84} C_Dis
SLIN {X 400.00,Y -100.95,Z 204.42,A -52.71,B 54.62,C 169.87} C_Dis
SLIN {X 400.00,Y -100.33,Z 204.09,A -52.68,B 54.65,C 169.90} C_Dis
SLIN {X 400.00,Y -99.72,Z 203.76,A -52.66,B 54.67,C 169.93} C_Dis