Permanently Displacing a Work Object using the DefAccFrame Function

RobertRobotStudio
RobertRobotStudio Liverpool
edited November 2019 in RAPID Programming
Hello,

I trying to understand how to use the DefAccFrame function, hopefully somebody can help🤞

I am trying to permanently modify a work object after the piece of equipment it is relative to has been moved. Using the DefAccFrame function, with 3 pre-shift positions (equipment in the original position) and 3 post-shift positions (equipment in new position), DefAccFrame has calculated a displacement frame---at this point is where I am getting stuck. I am not quite sure how to use this displacement frame to permanently displace the original work object. I assume if I added this displacement frame values into the object frame, it would get me what I wanted, but I would like to shift the user frame.

  ! Original work object
  PERS wobjdata w_original:=[FALSE,TRUE,"",[[2115.23,1499.37,261.151],[0.705378,-0.00116034,0.000807719,-0.70883]],[[0,0,0],[1,0,0,0]]];
 
   ! Displacement frame
    PERS pose poseCalcDefAccFrame:=[[-9.92334,-3.03179,2.10921],[1,0.000215442,0.000502461,0.000809608]];
   
    poseCalcDefAccFrame:=DefAccFrame(pPreShift,pPostShift,nNumOfDefAccRTsUsed,maxerr,meanerr);

Originally, I tried adding the x,y,z values together, but I am not sure if the displacement frame is in work object coordinate system, or the base of the robot?

Thanks in advance,

Robert.

Comments

  • EricH
    EricH Germany
    Think about it in this way: you don't know the workobj frame of your new points, but you know that the new points are the same points physically as the old points. So what the displacement frame is: it is a workobj frame that expresses the new points in the old points frame or vice versa.
  • Hello Eric,

    Thanks for commenting,

    Sorry I don't think I fully understand. When you say " but you know that the new points are the same points physically as the old points", do you mean the new points are in the same place relative to where the new workobj needs to be? Because the new points I have are physically in a different place, than the old (corners of the equipment in it's new position). Is the displacement frame in the coordinate system of the original wobj? I did try the same exercise with the pre and post positions relative to the base of the robot, and I got the same result:
    PERS pose poseCalcDefAccFrame:=[[-9.92334,-3.03179,2.10921],[1,0.000215442,0.000502461,0.000809608]];

    The original way I tried the pre and post were relative to the original wobj, not sure if that is where I am going wrong?

    Thanks 
    Robert
  • EricH
    EricH Germany
    Your 1. Question: The new points are on a movable box for example, but that box was now moved to another position. Physically you have the same points on the box. Now only the workobject frame has to be changed. Keep in mind, this is not the only use case.
    Your 2. Question: It looks like the displacement frame is from points with nearly same frame coords. Low values mean there is a low displacement. So try to use it in the object frame of the workobj or if you had them in world coords make a workobj with the displacement frame as user frame.

    In this example
    dFrame := DefAccFrame (pBox_old, pBox_new, 5, max_err, mean_err);
    the points in old and new are in the same workobj frame. dFrame is calculated to express the old points in the new points frame. Using dFrame as object frame in the workobject of the new points will bring the old points to the same position of the new points and they are both equal (or nearly, depends on the error).
  • Hello Eric,

    Thanks for clarifying that. Is there a way to add the displacement to the the user frame, when the points are relative to the work object? Or in future, when carrying out this task, would you suggest making the points relative to wobj0?---new & old.

    I also tried using DefDFrame, the only way I could get what looked like a shifted work object, was by using the original positions relative to wobj0 and the new positions to the original work object, I wasn't sure how accurate this was though.

    Thanks again,
    Robert
  • Another thing, I am still a little confused by getting the same displacement frame, when using both the work object of the box and wobj0? Is the displacement always expressed in the coordinate system of wob0? If thats the case I can just add the displacement to the user frame.

    Robert
  • EricH
    EricH Germany
    edited November 2019
    Is there a way to add the displacement to the the user frame, when the points are relative to the work object?
    Of course you can add the displacement to the user frame. Therefore you need to calculate properly with PoseMult().
    would you suggest making the points relative to wobj0?
    If you had good reasons to make those points in a wobj frame, then it's better to stay with that.
    I personally don't often use DefAccFrame(). I redefine the workobject with the 3-point method without a displacement frame, but sometimes it's difficult to find a good point for a workobject. That's the time when this function could help out.
    Another thing, I am still a little confused by getting the same displacement frame, when using both the work object of the box and wobj0? Is the displacement always expressed in the coordinate system of wob0?
    Can you show the point values in your custom wobj and in wobj0? Do you use the same tool? It's difficult to help without some code.

    The displacement is expressed in the frame of the new points. So it's not always in wobj0.