variable speed

how can i program a variable speed between to points (acceleration-decceleration)

meaning startspeed at position 1 and endspeed at postition 2

Tricky…

The solution I will do is

  1. calculate the distance between the tow positions…

  2. then divide it in wery smal increments ..

  3. then calculate the ramp of the speed …

  4. Then loop and increase the speed and add the offset from start target to the end target.

Example of a spot welding “proc” Star and stop target

( + open and closing and open the gun ← 3 x MoveL)

Ps. do not reorient XYZ more then 45,45,45

PROC MoveSpot_L(

robtarget Startpos1,

robtarget StopPos1,

num antalp,

num avstandp,

num openGunBig,

num openGunSmall,

num timeS,

speeddata pSpeed1,

speeddata pSpeed2,

PERS tooldata pGun1

PERS wobjdata Wobj)

! startpos 1

VAR num xang1:=0;

VAR num yang1:=0;

VAR num zang1:=0;

VAR num x1:=0;

VAR num y1:=0;

VAR num z1:=0;

! stopPos 1

VAR num xang2:=0;

VAR num yang2:=0;

VAR num zang2:=0;

VAR num x2:=0;

VAR num y2:=0;

VAR num z2:=0;

! for offset TEMPpos

VAR num xang3:=0;

VAR num yang3:=0;

VAR num zang3:=0;

VAR num x3:=0;

VAR num y3:=0;

VAR num z3:=0;

! for LOOP

VAR num I:=0;

VAR robtarget Temppos;

VAR orient orint:=[1,0,0,0];

IF antalp<0 RETURN;

x2:=Startpos1.trans.x;

y2:=Startpos1.trans.y;

z2:=Startpos1.trans.z;

x1:=StopPos1.trans.x;

y1:=StopPos1.trans.y;

z1:=StopPos1.trans.z;

x3:=((x1-x2)/antalp);

y3:=((y1-y2)/antalp);

z3:=((z1-z2)/antalp);

xang2:=EulerZYX(X,Startpos1.rot);

yang2:=EulerZYX(Y,Startpos1.rot);

zang2:=EulerZYX(,Startpos1.rot);

xang1:=EulerZYX(X,StopPos1.rot);

yang1:=EulerZYX(Y,StopPos1.rot);

zang1:=EulerZYX(,StopPos1.rot);

xang3:=((xang1-xang2)/antalp);

yang3:=((yang1-yang2)/antalp);

zang3:=((zang1-zang2)/antalp);

antalp:= (antalp*3);

FOR I FROM 0 TO antalp STEP 3 DO

Temppos:=Offs(Startpos1,(x3I)/3,(y3I)/3,(z3*I)/3);

Temppos.extax.eax_a:=openGunBig;

Temppos.rot:=OrientZYX(zang1+(zang3I)/3,yang1+(yang3I)/3,x ang1+(xang3*I)/3);

! move to Pos FAST

MoveL RelTool(Temppos,avstandp,0,0)ID:=antalp,pSpeed1,z15, pGun1WObj?Wobj;

Temppos.extax.eax_a:=openGunSmall;

! move to Pos Slow

MoveL RelTool(Temppos,0,0,0)ID:=(antalp+1),pSpeed2,z0,pGun1WObj? Wobj;

! welding

WaitTime timeS;

! welding

Temppos.extax.eax_a:=openGunBig;

MoveL RelTool(Temppos,avstandp,0,0)ID:=(antalp+2),pSpeed2,z15,pGu n1WObj?Wobj;

ENDFOR

ENDPROC

Edit the For to bee … like this

FOR I FROM 0 TO antalp DO

Temppos:=Offs(Startpos1,(x3I),(y3I),(z3*I));

Temppos.rot:=OrientZYX(zang1+(zang3I),yang1+(yang3I),xang1 +(xang3*I);

!hmmmm can any one help me whit the syntax for the speed?

!((Speed2-speed1)/2)*i= speed3

MoveL Temppos,pSpeed3,z1, pGun1WObj?Wobj;

ENDFOR

and then remove …

num avstandp,

num openGunBig,

num openGunSmall,

num timeS,

and…

antalp:= (antalp*3);

speed data is like this :[“Liner_speed”,“reorientation_speed”,External_axis_liner_speed",“External_axis_reorientation_speed”]

ex.syntax for program instruction …

MoveSpot_L p111, p222, 1000,v100, v400, tGun1Wobj:=Car_Wobj;

now you are able to accelerate liner from one speed to a anther, hopefully