Welcome, Guest. Please login or register.
September 03, 2010, 05:51:01 PM
Home Help Login Register
News: Any Problems or Experience with Industrial Robots ?
Register and place your Question / Answer to worldwide Robotexperts right here !

+  Robotforum | Support for Robotprogrammer and Users
|-+  Robot Help and Discussion Center
| |-+  Yaskawa Motoman Robot Forum (Moderator: somar)
| | |-+  Rotate all points in a program?
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: Rotate all points in a program?  (Read 653 times)
TylerRobertson
Full Member
***
Offline Offline

Gender: Male
Posts: 146

www.inhousesolutions.com


WWW
« on: July 01, 2009, 03:28:55 PM »

Hey all,

I've got a programming challenge - I'm not sure if it's something easy you can do on a program.

We've got a table with a userframe (1) that is painstakingly aligned to the center of the table.
A program is created with that userframe, but sometimes the program needs to be rotated, say, 15 degrees for a different part of the job.

Usually this could be done with user frames, but without manual entry for user frames -etting a new frame with the values of (1) and then changing the Rz value to whatever is impossible.

I'm looking for a way to rorate an entire program when at the control. Like a parrallel shift, but with rotations. if parrallel shift had Rx,Ry,Rz values it would be mint.


I'm sure I could do this programming by storing a rotation matrix and multiplying points by this value, but if there's an easier way right on the control I'd love to know!

Thanks!!

Logged

________________________________________
Robotmaster Applications Engineering
Robo Guru
Full Member
***
Offline Offline

Gender: Male
Posts: 241



« Reply #1 on: July 01, 2009, 05:23:21 PM »


An INFORM command called 3DSHIFT exists.  It's an expansion of the regular shift on/shift off and it gives you the Rx, Ry, Rz options for shifting.

I think that would solve your problem.

NOP
3DSHIFTON
MOVJ
MOVL
3DSHIFTOF


Either that or you could use the MULMAT instruction but you would have to MULTMAT every position you are trying to move to.

Hope this helps
Logged
TylerRobertson
Full Member
***
Offline Offline

Gender: Male
Posts: 146

www.inhousesolutions.com


WWW
« Reply #2 on: July 02, 2009, 04:25:48 PM »

I can't find the 3DSHIFT command on the inform list in the controller - is this something I would have to unlock because it's an 'expansion' ?

Thanks!
Logged

________________________________________
Robotmaster Applications Engineering
ericm115
Jr. Member
**
Offline Offline

Posts: 66


« Reply #3 on: July 02, 2009, 11:01:22 PM »

you could make this a routine that you call whenever you need to rotate the UF (in this example, UF#(3)). you could use some dedicated global "I' vars to "pass in" your rx, ry, rz  (even the UF# to rotate!) if you wanted.

that said, i just wrote this up and don't have a way to check it - i think its a reasonable starting point though. if you only needed an rz for the frame, the code would be much simpler. anyone else feel free to modify, add on to, or just correct.

The jist is that if create three points in the original UF where one is at the origin, one straight along the x axis, and one straight along the y axis, then we can think of the x point and the y point as being the "axes." If we picture them as vectors extending out from the origin point, we can do some relatively simple SIN and COS to the x and y "vectors" and change the "direction" in which they "point" in your UF. Then we can use those three points to reinitialize your UF. (but we might should "save" the original one first)

\/  \/  ----- CODE ----\/  \/


*ROTATE
'We want to rotate UF#(3) by some
' rx, ry, rz (to be defined in
' LI000-LI002 momentarily)
'
'LP000 will be a 0,0,0,0,0,0
' point in UF#(3)
'LP001 will be an x-only UF#(3)
' point (acting as an "x axis")
'LP002 will be a y-only UF#(3)
' point (acting as a "y axis")
'Initialize them to a UF#(3)
' point. It doesnt matter what
' P001 was
'Set LP000 to UF#(3)
SET LP000 P001
CNVRT LP000 LP000 UF#(3)
'Clear it out
SUB LP000 LP000
'Then set LP001 and LP002
SET LP001 LP000
SET LP002 LP000
'
'Set the x and y points
SETE LP001 (1) 100
SETE LP002 (2) 100
'
'
'************************
'Maybe we should just store
' the existing MFRAME defining
' points somewhere before we
' change it?
'Convert the points to the base
' frame before we store them so
' that they stay meaningful after
' we change the UF
CNVRT P100 LP000 BF
CNVRT P101 LP001 BF
CNVRT P102 LP002 BF
'Now we can always reverse this
' process with an
'MFRAME UF#(3) PX100 PX101 PX102
'************************
'
'
'Set the rx ry and rz in
' (1/100deg)
'5deg +rx
SET LI000 500
'7deg +ry
SET LI001 700
'2deg -rz
SET LI002 -200
'
'Shift the y "axis" by the
' desired rx
'Set the NEW "y axis" z
'Get the SIN of the angle times
' the "length" of the axis
SIN LR000 LI000
MUL LR000 100
SETE LP002 (3) LR000
'Set the NEW "y axis" y
'Get the COS of the angle times
' the "length" of the axis
COS LR000 LI000
MUL LR000 100
SETE LP002 (2) LR000
'
'Shift the x "axis" by the
' desired ry
'Set the NEW "x axis" z
SIN LR000 LI001
MUL LR000 100
SETE LP001 (3) LR000
'Set the NEW "x axis" x
COS LR000 LI001
MUL LR000 100
SETE LP001 (1) LR000
'
'Now the trickier one, the rz
'First get the lengths of the
' "new" axes
'I dont know the fast way.. just
' using Pythag. The.
GETE LD001 LP001 (1)
MUL LD001 LD001
GETE LD000 LP001 (3)
MUL LD000 LD000
ADD LD001 LD000
SQRT LD001 LD001
'LD001 holds LP001 length
GETE LD002 LP002 (2)
MUL LD002 LD002
GETE LD000 LP002 (3)
MUL LD000 LD000
ADD LD002 LD000
SQRT LD002 LD002
'LD002 holds LP002 length
'
'Now the rz shift
'Shift the x "axis" by the
' desired rz
'Set the NEW "x axis" y
SIN LR000 LI002
'Multiply by the length
MUL LR000 LD001
SETE LP001 (2) LR000
'Set the NEW "x axis" x
COS LR000 LI002
MUL LR000 LD001
SETE LP001 (1) LR000
'Shift the y "axis" by the
' desired rz
'Set the NEW "y axis" x
SIN LR000 LI002
'Multiply by the length
MUL LR000 LD002
SETE LP002 (1) LR000
'Set the NEW "y axis" y
COS LR000 LI002
MUL LR000 LD002
SETE LP002 (2) LR000
'
'Whew. Now the "axes" point in
' the correct directions
'Set the new frame
MFRAME UF#(3) LPX000 LPX001 LPX002
'Now the frame is rotated
« Last Edit: July 02, 2009, 11:40:32 PM by ericm115 » Logged
TylerRobertson
Full Member
***
Offline Offline

Gender: Male
Posts: 146

www.inhousesolutions.com


WWW
« Reply #4 on: July 15, 2009, 03:30:24 PM »

WOW - I'll dig into that in a big - thanks eric!

Just as a heads up - the 3DSHFT function only works with Robot and Base frames .. then my initial reaction was to convert points to base frame and then convert back, but I'm using a relative job with a messive amounts of points and would run out of P variables
Logged

________________________________________
Robotmaster Applications Engineering
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!