July 18, 2019, 04:13:06 PM

# Finding rotation around Z axis

### Author Topic:  Finding rotation around Z axis  (Read 253 times)

0 Members and 1 Guest are viewing this topic.

July 11, 2019, 09:39:09 PM

#### TitusLepic

##### Finding rotation around Z axis
I need a way to find a taught position's rotation about the Z axis. After doing some reading on transformation matrices, euler angles, gimble lock, and all that sort of thing, I think my best option is to hope that somebody smarter than me has figured out a good way to convert the WPR values into the actual rotation about the Z axis...

Today at 04:13:06 PM

Guest
##### Re:  Finding rotation around Z axis

July 11, 2019, 10:45:05 PM

#### HawkME

Global Moderator
##### Re: Finding rotation around Z axis
Do you need to do this in the program or would an offline calculator work?

Do you need a general mathematical solution or is it just in a certain range of orientations? In some orientations it will match the r angle from LPOS. If your situation matches this then that would be an easy way.

July 12, 2019, 02:33:14 PM

#### Nation

Global Moderator
##### Re: Finding rotation around Z axis
Interesting.

Personally, I would convert the point to a rotation matrix, then derive the rotation from the x or y rotation vectors. You would have to add special cases to the math in the event that one of those is lined up with the base Z vector.

Online, you could do this in Karel, and maybe (heavy maybe) in tp. Offline would be pretty simple.
Check out the position converter I wrote here!

July 12, 2019, 04:48:31 PM

#### TitusLepic

##### Re: Finding rotation around Z axis
I need a general online solution. I'm going to be very close to tool Z being aligned with User X in a lot of these situations so using the R from LPOS won't work.

My application is cutting slots (and in the future, rectangles) into a workpiece with a router. I'd like the operator to only have to teach the center point of the slot and have the robot do the rest programmatically. This is motion I want the robot to take:

L {LPOS} 100mm/s FINE Offset {slot_length/2*sin(zRot),slot_length/2*cos(zRot),0,0,0,0) Tool_Offset {0,0,plunge_depth,0,0,0}
L {LPOS} 100mm/s FINE Offset {-slot_length/2*sin(zRot),-slot_length/2*cos(zRot),0,0,0,0) Tool_Offset {0,0,plunge_depth,0,0,0}
L {LPOS} 100mm/s FINE

If there's a better/easier way than trying to figure out zRot I'm all ears.
« Last Edit: July 12, 2019, 06:07:54 PM by TitusLepic »

July 13, 2019, 01:44:32 AM

#### HawkME

Global Moderator
##### Re: Finding rotation around Z axis
I think I've got your solution.

Make the moves all tool offsets from the starting point. Then your slot, rectangle, or any shape you program is always relative to the tool orientation, without you needing to do any complex math.

July 15, 2019, 03:33:09 PM

#### TitusLepic

##### Re: Finding rotation around Z axis
I thought about that, the problem with that method is that I can't control the rotation about tool Z when the operator teaches the point, and I need the slot to be parallel to the user XY plane. The tool offset method will only work if the tool X axis is parallel to user XY.

July 15, 2019, 05:14:50 PM

#### HawkME

Global Moderator
##### Re: Finding rotation around Z axis
You could train them to correctly orient the tool.  Maybe even have an arrow pointing or pictures in an instruction manual.

If they need a diagonal slot or routing on a slanted surface then tool offsets would cover that situation.

If you only want orthagonal then I would suggest creating points with preset orientations for the different faces. Then they could select the from a starting orientation and jog x,y,z to the starting point.

Today at 04:13:06 PM

Guest

### Similar Topics

###### Finding axis angles with INVERSE

Started by just_learning_KRL on KUKA Robot Forum

0 Replies
628 Views
June 29, 2018, 08:44:51 PM
by just_learning_KRL
###### AUX AXIS ROTATION

Started by AUTOMANITION on Fanuc Robot Forum

6 Replies
714 Views
November 14, 2018, 02:52:49 PM
by AUTOMANITION
###### Help with Axis 6 orientation/rotation

Started by mgshall on ABB Robot Forum

2 Replies
3418 Views
September 25, 2014, 05:42:50 PM
by Albert
###### Endless external axis rotation

Started by Acapulka on KUKA Robot Forum

6 Replies
1786 Views
October 06, 2017, 09:38:43 AM
by manhunt