# Wrist 3 - wind up the cables

**URL:** <https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006>\
**Category:** URScript\
**Created:** [November 15, 2022, 12:17pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006 "2022-11-15T12:17:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![artur.falkenstern](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@artur.falkenstern](https://forum.universal-robots.com/u/artur.falkenstern)\
**Post date:** [November 15, 2022, 12:17pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006/1 "2022-11-15T12:17:49Z")

</div>

Hello,

i´m using the palletizing function for a picking task. In some cases the wrist 3 wind up the cables, because the way to the next picking position is shorter. How can it be prevented?

Palletizing function:

$ 1 “Roboterprogramm”  
$ 2 “Pallet\_1”  
def Pallet\_1\_trans(pose):  
return p[pose[0], pose[1], pose[2], 0, 0, 0]  
end  
def Pallet\_1\_rot(pose):  
return p[0, 0, 0, pose[3], pose[4], pose[5]]  
end  
def Pallet\_1\_compute\_pallet\_waypoint(T\_base\_feature\_taught, T\_feature\_referencePoint\_taught, T\_referencePoint\_approach\_taught, T\_base\_feature, T\_base\_referencePoint):  
local trans\_referencePoint\_approach\_in\_feature\_taught = pose\_sub(Pallet\_1\_trans(pose\_trans(T\_feature\_referencePoint\_taught, T\_referencePoint\_approach\_taught)), Pallet\_1\_trans(T\_feature\_referencePoint\_taught))  
local rot\_referencePoint\_approach\_in\_feature\_taught = pose\_trans(Pallet\_1\_rot(T\_feature\_referencePoint\_taught), pose\_trans(Pallet\_1\_rot(T\_referencePoint\_approach\_taught), pose\_inv(Pallet\_1\_rot(T\_feature\_referencePoint\_taught))))  
T\_feature\_referencePoint = pose\_trans(pose\_inv(T\_base\_feature), T\_base\_referencePoint)  
rot\_referencePoint\_approach = pose\_trans(pose\_inv(Pallet\_1\_rot(T\_feature\_referencePoint)), pose\_trans(rot\_referencePoint\_approach\_in\_feature\_taught, Pallet\_1\_rot(T\_feature\_referencePoint)))  
T\_feature\_approach = pose\_trans(trans\_referencePoint\_approach\_in\_feature\_taught, pose\_trans(T\_feature\_referencePoint, rot\_referencePoint\_approach))  
T\_base\_approach = pose\_trans(T\_base\_feature, T\_feature\_approach)  
return T\_base\_approach  
end

…  
…  
…  
if (Pallet\_1\_cnt \< 193):  
Pallet\_1\_lno = 1  
Pallet\_1\_lct = Pallet\_1\_cnt  
global CornerItem\_1=pose\_trans(p[0.0,0.0,0.0,0.0,0.0,0.0], pose\_trans(p[-.000000000000, -.000000000000, -.000000000000, .000000000000, .000000000000, .000000000000], p[.534333881170, .036306233589, .023011090386, 2.226175968418, -2.216685620206, -.000015293369]))  
global CornerItem\_2=pose\_trans(p[0.0,0.0,0.0,0.0,0.0,0.0], pose\_trans(p[-.000000000000, -.000000000000, -.000000000000, .000000000000, .000000000000, .000000000000], p[.534090521706, .240272692895, .022798562188, 2.226601946160, -2.214743300707, -.000178770249]))  
global CornerItem\_3=pose\_trans(p[0.0,0.0,0.0,0.0,0.0,0.0], pose\_trans(p[-.000000000000, -.000000000000, -.000000000000, .000000000000, .000000000000, .000000000000], p[.257241769930, .241586239236, .022956831482, 2.225939099323, -2.215246453788, -.000121588498]))  
global CornerItem\_4=pose\_trans(p[0.0,0.0,0.0,0.0,0.0,0.0], pose\_trans(p[-.000000000000, -.000000000000, -.000000000000, .000000000000, .000000000000, .000000000000], p[.257259763612, .038083660152, .022970321133, 2.226090811413, -2.215097743479, .000053760646]))

```
Pallet_1_cnt_x = (Pallet_1_lct - 1) % 12
Pallet_1_cnt_y = floor((Pallet_1_lct - 1) / 12)
referencePoint = interpolate_pose(interpolate_pose(CornerItem_1, CornerItem_2, Pallet_1_cnt_x/11), interpolate_pose(CornerItem_4, CornerItem_3,Pallet_1_cnt_x/11), Pallet_1_cnt_y/15)
direction = p[0,0,1,0,0,0]
referencePoint = pose_add (referencePoint,p[0.0*direction[0],0.0*direction[1],0.0*direction[2],0,0,0])

```

end

Repeated movement:

$ 25 “Erzeugte Bewegungen” “noBreak”  
$ 26 “FahreAchse” “noBreak”  
$ 27 “Approach\_1\_j≔get\_inverse\_kin(pose\_trans(referencePoint,p[0,0,-(ToolLength+OverToolPickPar-75)/1000,0,0,0]))”  
global Approach\_1\_j= get\_inverse\_kin ( pose\_trans (referencePoint,p[0,0,-(ToolLength+OverToolPickPar-75)/1000,0,0,0]))  
$ 28 “Approach\_1\_j” “noBreak”  
movej(Approach\_1\_j, a=6.98, v=3.14)  
…  
…  
…  
global Approach\_3\_j= get\_inverse\_kin ( pose\_trans (get\_actual\_tcp\_pose(),p[0,0,-(ToolLength)/1000,0,0,0]))  
$ 49 “Approach\_3\_j” “noBreak”  
movej(Approach\_3\_j, a=1.39, v=1.04)

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [November 15, 2022, 1:56pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006/2 "2022-11-15T13:56:06Z")

</div>

In a MoveJ, you can check a box that says “Use Joint Angles.” This should stop the robot from taking the shortest path and instead favor getting the exact same joint angle.

---

<div class="post-metadata">

**Author:** ![artur.falkenstern](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@artur.falkenstern](https://forum.universal-robots.com/u/artur.falkenstern)\
**Post date:** [November 15, 2022, 2:15pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006/3 "2022-11-15T14:15:34Z")

</div>

Still the same problem 😕

---

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [November 15, 2022, 2:32pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006/4 "2022-11-15T14:32:12Z")

</div>

I’ve heard people giving the same sentiment before. It probably comes from using the Palletizing thing. Seen a lot of people post with issues using it. I have an application where I spin only wrist 3 all the way from -360 to +360 as it spins an object through a scanner. So I know this is the intended behavior of MoveJs in general. Any chance you can remove this section of code from the Palletizing template, at least just as a temporary test to see if it does what you expect OUTSIDE of the palletizing?

---

<div class="post-metadata">

**Author:** ![c.lichtmannegger](https://avatars.discourse-cdn.com/v4/letter/c/f19dbf/32.png) [@c.lichtmannegger](https://forum.universal-robots.com/u/c.lichtmannegger)\
**Post date:** [December 6, 2022, 4:11pm UTC](https://forum.universal-robots.com/t/wrist-3-wind-up-the-cables/25006/5 "2022-12-06T16:11:05Z")

</div>

Redo your palletizing pattern with the correct gripper set active and make sure, that your wrists are at the correct poisition as well.

The palletizing assistant has a problem:

If you teached a point after the palettizing and turn it 360° at the same position and then check the path to the teached position in the palettizing assistant with the button “go to this position” it will not go to the position with the teached wrist angle, but with the shortets way / wrist twist.
