Making a tool do circles with the center point moving

Options
Alexandre0609
edited May 8 in RAPID Programming
(Need help for my assignment)
i need to scan an area of a painting, to scan it i need to do a circular motion and moving across the painting

however, i am graded both on optimisation, speed and the way i am doing the tasks. Most have done it by making the tool do the circular motion then moving to another area, however i feel like that is way too slow.

I am trying to make it so the tool, while following a path, does the circular motion. I am aware this may be out of my league and that is why i am posting this:

Any Ideas/Tips on how to accomplish this?

At the moment i was thinking of getting 2 moveC's to form the circle and then using CRobT to offset the circles but its very janky, any help would be greatly appreciated!

Edit1; The circles can overlap, and can even spread farther than the workobject's area
-----------------------------------------
Alexandre
Student
Post edited by Alexandre0609 on
Tagged:

Best Answer

  • graemepaulin
    Answer ✓
    Options
    You could create the Robtargets for the robot path which will be the center of the circles, instead of executing these Robtargets in move instructions directly you use the offs function to create the circles.
    Store the path robtargets in an array, the one below only stores two, make it large enough to suit.
    The FOR loop will need the TO value changed to suit as well.
    You could make the circles smaller in the corners (or any where else) to get better coverage by varying the nRaduis variable in your code.

    MODULE mCirclePath
        PERS robtarget CenterPoint:=[[2081,0,2265],[0.5,0,0.866025,0],[0,-1,0,0],[9E+9,9E+9,9E+9,9E+9,9E+9,9E+9]];
        PERS robtarget CenterPointS{2}:=[[[2080,0,2265],[0.5,0,0.866025,0],[0,-1,0,0],[9E+9,9E+9,9E+9,9E+9,9E+9,9E+9]],[[2081,0,2265],[0.5,0,0.866025,0],[0,-1,0,0],[9E+9,9E+9,9E+9,9E+9,9E+9,9E+9]]];
        PERS num nRaduis:=100;
        
        PROC main()
            FOR i FROM 1 TO 2 DO
                CenterPoint:=CenterPointS{i};
                rCircle;
            ENDFOR
        ENDPROC
        
        PROC rCircle()
            MoveJ offs(CenterPoint,nRaduis,0,0), v1000, z0, tool0;
            MoveC offs(CenterPoint,0,nRaduis,0),offs(CenterPoint,-nRaduis,0,0), v1000, z0, tool0;
            MoveC offs(CenterPoint,0,-nRaduis,0),offs(CenterPoint,nRaduis,0,0), v1000, z0, tool0;
        ENDPROC
    ENDMODULE

Answers

  • graemepaulin
    Options
    Do you need to do complete circles that touch but do not overlap, or do you need to cover the whole area with the scan?
  • Alexandre0609
    Options
    It doesnt matter, as long as the task is completed, however i do believe overlapping is the most optimal way to ensure full coverage

  • PFollansbee
    Options
    Unfortunately, your goals aren't entirely clear. Does it need to be circles or has that just been decided as the method based on other students? Do the circles need to be executed by the robot? Is the goal to actually scan it or have a motion path that covers a surface? How big is the tool? Do you only have one camera?

    Basically, if you are trying to cover a surface, you need to consider your speed and area covered. Any double coverage (such as circles overlapping already completed areas) is wasted motion and time.

    Some alternative tactics to consider.

    Concentric circles from the center.
    Spiral approximation from the center. (Create a division function that allows you to divide a parametric spiral motion into MoveC targets with a user enterable tolerance to determine the number of divisions)
    Scan lines.
    Offset scan lines to limit acceleration losses when changing direction. (throw a move C at the end to sweep the circle)

    An external tool that utilizes a slip ring would also be clever. Spin it up and perform scan lines like a fly cutter (would need counterweight). If you can have multiple devices, treat it like a shell mill and go super fast. In both cases, there will be small triangles at the edges of the rotation that will not be captured and lots of overlap, but you won't be limited by the speed of the robot that has to move it's entire mass to create a circle.

    Keeping to exactly what you have said, performing circles while you move will not gain you efficiency. As your center point you are rotating around moves along the path, you will either be adding that speed to your tool speed (rotating with the direction of travel) or taking it away (rotating away from the direction of travel). This can result in your tool making loop de loop.

    If you must persist (I'm not dissuading you because it is interesting), you can use a parametric equation of the form (2D in this case).

    x = rcost(wt) + v_x(t), y = rsin(wt) + v_y(t)
    where
    r = radius of circle
    w = angular frequency
    v(x,y), linear velocity in x,y

    Taking this guy, you can create a function called like MoveSpiral or something like that. I would have its definition be very similar to MoveL for consistency and readability, maybe with an added argument of spiral_data defined in a record to give radius, angular velocity, and maybe a normal vector to allow for determination of the spiral in 3D space.

    Within that function establish a t stepover size that you like and solve for the X,Y,Z positions and go to them with MoveL's. The motion will be jerky if set to fine with a coarse stepover, but can be smoothed by adjusting stepover and zone. Hopefully that helps.
  • mandolas
    mandolas
    edited May 20
    Options
    Hi...

    As peers have already pointed out, your task is somewhat vague. But if it's just something extremely simple, it could be like this...

    1 - Create a stationary tool (toolE) and a movable object (wobjM) and a reference stationary tool as the center point of the circle (toolR)....
    PERS tooldata toolE:=[FALSE,[[696.07,33.61,1182.52],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];
    PERS wobjdata wobjM:=[TRUE,TRUE,"",[[696.07,33.61,1182.52],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
    
    PERS tooldata toolR:=[FALSE,[[696.07,33.61,1182.52],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];

    2 - Create the starting point of the circle, using the same position as the reference tool, another position for the rotation movements....
    PERS robtarget P_0:=[[696.07,33.61,1182.52],[0.020359,-0.0363037,-0.998258,0.0418107],[0,-1,0,0],[9E+9,9E+9,9E+9,9E+9,9E+9,9E+9]];
    VAR robtarget P_1;

    3 - Build your logic and test...

    Here's an example...
    MODULE Module1
        PERS tooldata toolE:=[FALSE,[[696.07,33.61,1182.52],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];
        PERS wobjdata wobjM:=[TRUE,TRUE,"",[[696.07,33.61,1182.52],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
    
        PERS tooldata toolR:=[FALSE,[[696.07,33.61,1182.52],[1,0,0,0]],[0.001,[0,0,0.001],[1,0,0,0],0,0,0]];
    
        PERS robtarget P_0:=[[696.07,33.61,1182.52],[0.020359,-0.0363037,-0.998258,0.0418107],[0,-1,0,0],[9E+9,9E+9,9E+9,9E+9,9E+9,9E+9]];
        VAR robtarget P_1;
    
    
        PROC main()
            VAR num r:=300;
    
    
            MoveJ P_0,v300,fine,tool0\WObj:=wobj0;
    
            toolE:=toolR;
    
            ! r = radius of circle ...
            Add toolE.tframe.trans.x,r;
    
            WHILE TRUE DO
                P_1:=RelTool(CalcRobT(CalcJointT(Offs(P_0,0,0,0),tool0\WObj:=wobj0),toolE\WObj:=wobjM),0,0,0\Rz:=0);
    
                MoveL P_1,v1000,fine,toolE\WObj:=wobjM;
    
                MoveL RelTool(P_1,0,0,0\Rz:=180),v1000,fine,toolE\WObj:=wobjM;
    
                ConfL\Off;
                MoveL RelTool(P_1,0,0,0\Rz:=-360),v1000,fine,toolE\WObj:=wobjM;
                ConfL\On;
    
                MoveJ P_0,v1000,fine,tool0\WObj:=wobj0;
            ENDWHILE
        ENDPROC
    ENDMODULE
    good job.