Discussion

Left ArrowBack to discussions page
ctigerctiger Posts: 24 Apprentice
edited April 8 in Programming
Hi pros,

I would like to know how does the UR 10 or UR in general read the script coding? Does the UR execute the script and perform its operation and goes to the next line?

The problem I am facing with palletizing is that every time the UR pick up the parts from the CNC lathe, the end effector needs to orientate the part in 180° and -180° (my reference point might be wrong here, just giving an example) and placed in a box. It is shown below that I need to achieve that placement.

 

I read the script function and I could not find anything regarding about the palletizing function, is the palletization function hard coded?

If palletization function is hard coded, would that mean before the palletization line, I would have a script which orientate the end effector and go down to the next program line into palletization mode? Would this behavior be accepted in UR? I have search up script command and read up the script manual, the manual did not explain how the function return a value or how does the information pass down to the next line.

Any advice are greatly appreciated.

Thanks








Tagged:

Best Answers

Comments

  • ctigerctiger Posts: 24 Apprentice
    edited April 11
    Ok by reading these 2 links https://s3-eu-west-1.amazonaws.com/ur-support-site/50482/scriptManual.pdf and https://s3-eu-west-1.amazonaws.com/ur-support-site/29983/Script command Examples.pdf somehow get a jizz of it, how do I change the pallet approach orientation when my script is called? I put my script above approach line and after it execute the script line, it goes back to the original orientation. Is switch case function within the Polyscope GUI that can be used to alter the orientation?
  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @ctiger, yes every line in the script will be executed and move on with the next line of the program.

    In your case, I would probably simply use a count and a if statement for the approach sequence. Every odd numbers would be placed with 0deg orientation and every even numbers would be placed with 180deg orientation.

    Can you share you program so that we can have a look at what you're trying to achieve?
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • ctigerctiger Posts: 24 Apprentice

       Robot Program
         MoveJ
           home
         MoveL
           Waypoint_15
           Waypoint_16
           Waypoint_17
         MoveJ
           Waypoint_1
           Gripper Close (1)
         Set DO[0]=On
         Set DO[0]=Off
         MoveL
           Waypoint_2
         MoveL
           Waypoint_3
         MoveJ
           Waypoint_4
           Waypoint_12
           Waypoint_13
         MoveL
           Pressing_button
           Release_button
         MoveJ
           Waypoint_7
           Waypoint_8
           Waypoint_9
           Waypoint_10
           Waypoint_11
           Waypoint_14
         Pallet
           Pattern: Square
             Corner1_1
             Corner2_1
             Corner3_1
             Corner4_1
           PalletSequence
             If (cnt_1%2) == 0
                 Approach_1
                 PatternPoint_1
            Gripper Move50%
                 Exit_1
             Else(cnt_1%2) == 0
                 Approach_2
                 PatternPoint_1
            Gripper Move50%
                 Exit_1
         MoveJ
           Waypoint_18
           Waypoint_19

    The last part palletsequence, I change both approach to 0deg and 180deg. I also changed the patternpoint but when it does either odd counter or even counter on the approach line the wrist3 will rotate and goes to the next line patternpoint and it rotate back. Do I have to rename the function so that it will rotate differently?

    I also notice that it will not move to the next column or not executing the PalletSequence.


    Any suggestion or advice are greatly app

    I will keep trying different position to observe the movement.


  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @ctiger, would you share the .urp file?
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • ctigerctiger Posts: 24 Apprentice
    I have edited the approach position and rename patternpoint.

    Thanks in advance.
  • ctigerctiger Posts: 24 Apprentice

       Robot Program
         MoveJ
           home
         MoveL
           Waypoint_15
           Waypoint_16
           Waypoint_17
         MoveJ
           Waypoint_1
           Gripper Close (1)
         Set DO[0]=On
         Set DO[0]=Off
         MoveL
           Waypoint_2
         MoveL
           Waypoint_3
         MoveJ
           Waypoint_4
           Waypoint_12
           Waypoint_13
         MoveL
           Pressing_button
           Release_button
         MoveJ
           Waypoint_7
           Waypoint_8
           Waypoint_9
           Waypoint_10
           Waypoint_11
           Waypoint_14
         Pallet
           Pattern: Square
             Corner1_1
             Corner2_1
             Corner3_1
             Corner4_1
           PalletSequence
             If (cnt_1%2) == 0
                 Approach_1
                 PatternPoint_1
            Gripper Move50%
                 Exit_1
             Else(cnt_1%2) == 0
                 Approach_2
                 PatternPoint_1
            Gripper Move50%
                 Exit_1
         MoveJ
           Waypoint_18
           Waypoint_19

    The last part palletsequence, I change both approach to 0deg and 180deg. I also changed the patternpoint but when it does either odd counter or even counter on the approach line the wrist3 will rotate and goes to the next line patternpoint and it rotate back. Do I have to rename the function so that it will rotate differently?

    I also notice that it will not move to the next column or not executing the PalletSequence.


    Any suggestion or advice are greatly appreciated.

    I will keep trying different position to observe the movement.


  • ctigerctiger Posts: 24 Apprentice
    edited April 15
    @Nicholas_Francoeur thank you for the modified program. These are the behavior I have noticed after changing the program. I have changed the anchor point to the approach point, when I start the cycle, the odd will change wrist_3 to 180deg, and even is 0. But when it comes to the patternpoint for both odd and even counter, it keeps going to the first corner and not the next column. I can't seem to get the approach to place to the next column or row.

    Thanks in advance.
  • ctigerctiger Posts: 24 Apprentice
    Hi @Nicholas_Francoeur,

    Not sure what I have done wrong. I bring out the if statement from the palletsequence tree, and tried running the program, I still having the issue of not going into the next column under the approach line. After the approach line it goes back to corner 1 instead of working towards corner 2. I am currently using PolyScope 5.1, would that be the issue? I have tried running the pallet_180deg.urp program and the behavior is the same as what I am facing. 

    Thanks in advance.


  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @ctiger, Can you try reteaching you corner waypoints? Have them above your wooden box. Then have the approach point below them.
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • ctigerctiger Posts: 24 Apprentice
    edited April 15

    I made the mistake of not changing the move to relative waypoints, I will try again.

    Thank you
  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @ctiger, let us know how it goes!
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • ctigerctiger Posts: 24 Apprentice

    Relative waypoint behavior is something I do not comprehend. I tried setting from corner 1 and to approach, during the operation for 'even' it works fine. But when comes to 'odd' operation it will continue as 'even' orientation, even though I change wrist 3 to 180deg. I noticed when the UR is doing palletization towards corner 2, wrist 3 tend to turn slightly before patternpoint.

    Not sure why the wrist 3 turn slightly towards corner 2 but I suspect is due to the referencing to the corner.


  • Nicholas_FrancoeurNicholas_Francoeur Posts: 93 Handy
    @ctiger, have a look at the UR software manual here.

    A relative waypoint would be:

    A waypoint with the position given relative to the robot arm’s previous position, such as “two centimeters to the left”. The relative position is defined as the difference between the two given positions (left to right). Note: repeated relative positions can move the robot arm out of its workspace. The distance here is the Cartesian distance between the TCP in the two positions. The angle states how much the TCP orientation changes between the two positions. More precisely, the length of the rotation vector describing the change in orientation. 

    In your case for the IF statement:

         If count%2≟0
           MoveJ
             Waypoint_1                  - Relative waypoint with start point at your pallet approach point and end point which would be your 0 degree placed pose
             Gripper Move10mm (1)
             Wait: 1.0
             Exit_1                             - Relative waypoint with start point at 0 degree placed pose and end point which would be 100mm for example
         Else
           MoveJ
             Waypoint_2                  - Relative waypoint with start point at your pallet approach point and end point which would be your 180 degree placed pose
             Gripper Move10mm (1)
             Wait: 1.0
             Exit_2                             - Relative waypoint with start point at 180 degree placed pose and end point which would be 100mm for example

    Hope that helps!
    Nicholas Francoeur
    Co-Founder | Vanguard Robotics
    e:   [email protected]
    w:  vanguard-robotics.com
  • ctigerctiger Posts: 24 Apprentice
    edited April 22

    Thank you for the example, I tried setting the relative waypoint which you have mentioned start point same as the approach. The 180 degree for the waypoint_2 will rotate and go downward at the same time, so I added another waypoint, waypoint for the wrist_3 to rotate and the other waypoint to go downward.
    It works fine until it goes to sixth iteration, I noticed that before arriving at approach point, wrist_3 will rotate slightly and the 180 degree is offset.

    How do I stop the rotation for wrist_3 while moving towards the approach point?

    Thanks in advance.

  • ctigerctiger Posts: 24 Apprentice
    I got it, it is due to the interpolation of the corners which causes wrist_3 to rotate slight towards approach point.

    Once again thank you @Nicholas_Francoeur

Sign In or Register to comment.
Left ArrowBack to discussions page