# Freedrive\_mode() with restrict movement in XYZ

**URL:** <https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806>\
**Category:** URScript\
**Created:** [September 13, 2022, 10:56am UTC](https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806 "2022-09-13T10:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthias.bayerer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@matthias.bayerer](https://forum.universal-robots.com/u/matthias.bayerer)\
**Post date:** [September 13, 2022, 10:56am UTC](https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806/1 "2022-09-13T10:56:30Z")

</div>

Hello together,

right now I am using the scriptcode “freedrive\_mode()” and "end\_freedrive\_mode().  
In the latest polyscope version (5.12.2) there´s the possibility to restrict the movement with the little window on the right bottom side of the teachpendant while pressing the Freedrive-Button on the backside.

Is it possible to restrict the movement of the freedrive while using the scriptfunction “freedrive\_mode()” during the program?  
Like maybe setting some parameters in the code?

Thank you all in advance!

Matthias

---

<div class="post-metadata">

**Author:** ![ladislav.hoferek](https://avatars.discourse-cdn.com/v4/letter/l/7ab992/32.png) [@ladislav.hoferek](https://forum.universal-robots.com/u/ladislav.hoferek)\
**Post date:** [September 13, 2022, 4:41pm UTC](https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806/2 "2022-09-13T16:41:13Z")

</div>

Hey,

Would it be Possible to Perhaps use Force Mode dont set lets say x, and set y and z to 0… on TCP  
That should keep the x and zero force on the other axis(y,z). I Used a whyle ago like that.  
Since you also control RX,RY and RZ, you can block or zero rotation Force with that aswell.

---

<div class="post-metadata">

**Author:** ![Ebbe](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.universal-robots.com/ebbe/32/1413_2.png) [@Ebbe](https://forum.universal-robots.com/u/Ebbe)\
**Post date:** [September 14, 2022, 6:43am UTC](https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806/3 "2022-09-14T06:43:40Z")

</div>

Hi @matthias.bayerer,

Welcome the UR forum. In the script manual you can find the following information:  
_freedrive\_mode (freeAxes=[1, 1, 1, 1, 1, 1], feature=p[0, 0,0, 0, 0, 0])_  
You can utilize the _freeAxes_ to and the orientationpart of _feature_ to specify the behavior.

Ebbe

---

<div class="post-metadata">

**Author:** ![matthias.bayerer](https://avatars.discourse-cdn.com/v4/letter/m/9f8e36/32.png) [@matthias.bayerer](https://forum.universal-robots.com/u/matthias.bayerer)\
**Post date:** [September 14, 2022, 7:27am UTC](https://forum.universal-robots.com/t/freedrive-mode-with-restrict-movement-in-xyz/23806/4 "2022-09-14T07:27:30Z")

</div>

Hello Ebbe,

thank you very much for your Solution, this was exactly what i was looking for.  
I didn´t noticed that there was a new Scriptmanuel with the 5.12 Update.

Best regards  
Matthias
