Rotating part on calculated Axis position

  • Hello All.


    I am Working with a Fanuc R2000ib/150U with R30iA Controller.


    I have a unique problem where I would like to square up a part based off of distance sensor data. I have tried to draw my scenario in paint so you can see what I am trying to do. so I have been able to calculate the required angle offset to square the part to the sensors, using trig. The problem is I would like to now make the angle correction by rotating around the "Ideal Axis of rotation" as marked on my drawing, instead of based on the current TCP point. The TCP point is way off to the left and further back then the ideal position. I can easily calculate the XYZ position of the "Ideal Axis of rotation" inside user frame 2. But how would I go about rotating around that point? I need to calculate this live, because the sensors can move and also the part size varies.


    any help is much appreciated. thanks.




  • Calculating the general case needs matrix functions.

    If the user frame and tcp axis are aligned in the measuring position it is easier.

    Calculate the position of flange (tool frame zero) in uframe, set the new tool frame to the coordinates of ideal axis for rotation.

    If only z axis (uframe, tool frame) are aligned, you have to transform the coordinates in the x-y plane using some sin, cos, tan functions, then you need those functions in TP (AFAIK this is an option) or Karel (on newer robots also an option).

  • Thanks hermann for the reply.


    I do have the matrix program.

    I also happen to have Karel.

    unfortunately the user frame and TCP are not aligned at all.

    I am not sure how I would go about calculating this kind of problem.



    I've also heard of an option called remote TCP, would this option allow me to set the TCP like a user frame, if I understand it correctly this option would simplify the issue a lot.


    If I understood how to calculate this, I would, rather than getting the option.

  • Another idea: calculate a temporary user frame that is aligned to the 'ideal axis', switch to it, read the actual position, turn the user frame around the measured angle, switch to this user frame and move to the position red earlier.

    And by the way with the alignment of the tool and user frame I only mean the directions, so that the 'ideal rotation axis' is parallel to one of the tool frame axis.

  • thanks Nation and hermann for the replies.


    I did get it working, and it is beautiful! :smiling_face:


    I used hermann's idea about creating a temporary user frame and moving the origin to the "ideal rotation point" using the matrix program, then I went PR[1]= LPOS, then using the matrix program I spun the UFrame and moved it toward the sensors the average amount based on the sensor distance, then I simply moved to PR[1] and the correction is made perfectly.


    thanks again.

Advertising from our partners