variable speed
jack01
✭
how can i program a variable speed between to points (acceleration-decceleration)
meaning startspeed at position 1 and endspeed at postition 2
0
Comments
-
Tricky...<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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,(x3*I)/3,(y3*I)/3,(z3*I)/3);
Temppos.extax.eax_a:=openGunBig;
Temppos.rot:=OrientZYX(zang1+(zang3*I)/3,yang1+(yang3*I)/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,(x3*I),(y3*I),(z3*I));
Temppos.rot:=OrientZYX(zang1+(zang3*I),yang1+(yang3*I),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, hopefullyvulpes_h2007-12-20 23:41:140
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 800 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings