Recreating welding weave sine

  • Hello,

    I have a Fanuc robot with RJ2 controller, and with HandlingTool. I want to use it for a welding project, and I suppose I can't have the weave program on it, only if I recreate it.

    I've bee thinking on the logic for this program, but I'm a beginner in Fanuc programming.

    Can somebody recommend a documentation or tutorial for doing complex math with positions in TP program?

    I need to make position operations (calculate the distance between 2 points) and to generate points between 2 points. Than generate move commands between these points.

    Basically this is the logic how I want to make the weave pattern.

  • aroldino

    Changed the title of the thread from “Recreating welding weavw sine” to “Recreating welding weave sine”.
  • hello,


    I'm forwarding with this project.

    I think I'm almost done, but I have a problem.

    My code is weaving, but not in the right coordinate system, and I really don't know how to solve this.


    I attach the code.

    I use a TP program and a Karel program


    Pre-conditions to run the KAREL code:


    Save some data to:

    R[1] - we can call it half frequency (the distance between passes trough the X axis of the path)

    R[2] - amplitude


    PR[2] - starting point

    PR[3] - end point (this should be only an X offset in the TOOL coordinate system, for testing, I'm not sure if it works with 2D displacement yet)


    I run the KAREL code, and the robot makes a weaving motion, but I want it to make it in TOOL coordinate system, not in WORLD system.

    I tried with OFFSET PR[] in the TP program, but no luck.


    Any suggestion for optimising things is welcome.

  • My code generates coordinates like X: 67 Y:-35 Z; 0 W:0 P: 0 R: 0

    So theoretically I just need to move incrementally in TOOL Coordinate System.


    I tried to use tool offset PR , but I think I didn't define correctly the offset PR.

    See attached picture


    For example let's say that the tool is at 200 mm from the faceplate in Z direction.

    If I only input 200 in Z, it handles like a WORLD coordinate and gives error that it can not reach the position.

    I don;t know how to define PR for tool offset correctly.

  • Tool offset PR is how far you want to move from the base position. For example if you want to move 20mm in tool x, then x=20, and all others =0.


    The picture above would move 200mm in tool z from the move position.

  • OK,


    Thanks for clearing me the tool offset register concept

    Now it moves in the right plane, but I have trouble with the calculated values.

    I think the calculations are giving wrong results, because I calculate with WORLD coordinates. I need to calculate in TOOL coordinates.

    But the problem is that when I record a position in PR, it writes WORLD coordinates.


    How can I make that PR contain a position relative to TOOL system, not WORLD system?

  • The base position must always be in World (actually user) coordinates. Only the offset can be in tool coordinates.


    So in this line of code. PR[1] is in world and PR[2] is in tool.


    Code
    :L PR[1] 1000mm/sec FINE Tool Offset, PR[2]


    If you want you can set PR[1]=LPOS. That sets it equal to the current robot position. Then the move will just be an incremental move in tool coordinates.

  • :smiling_face: party !!


    I've succeed to re-create the weave algorithm, at least the zig-zag pattern for straight path. I think I won't need the circle pattern, I'm totally happy with the zig-zag pattern for now. Next mission will be to think on how to implement it on arc path.

    I created the algorithm to be able to interpolate the pitch angle between the start and end point, to be able to use weaving from an open point to a closed corner point, where end point needs to be at a different orientation.


    I can share it if somebody wants it.


    In the next step I would like to use it in TP program like as follows:


    - User defines first line segment of weld by defining start ana end point

    - Start WELD (simple RO[]=TRUE)

    - Call WEAVE(P[1], P[2])

    - END WELD (RO[]=FALSE

    - Define next line segment of weld by defining next start and next end point

    - Start WELD (simple RO[]=TRUE)

    - Call WEAVE(P[1], P[2])

    - END WELD (RO[]=FALSE

    - .....


    My question is, if I can achieve this kind of TP program.

    Can I record just P[] positions, without moving command and without using PR? If I could record P[], it would be saved in TP, and no risk of accidental overwrite PR-s by other programs.


    Any other suggestion how to set up TP program will be welcomed.

  • Glad you got the weave figured out!


    You can record P positions without moving to them.


    1. Create a motion command, (J P[1] ...)

    2. Touch up position if needed

    3. Either remark it or jump over the motion commands.


    Example:


    Jmp lbl 1

    J P[1]...

    J P[2]...

    Lbl 1


    Now you have recorded points that won't execute and can't accidentally be overwritten.


    Then you could just move to your karel calculated PR in a loop until done.

  • I suppose I can't create a new motion command type with POSITION, which I can record, to use it like:


    Code
    1: J P[1] 100% FINE
    2: Weave P[2]

Advertising from our partners