# SERVO AND FADE . fast start . slow return

**URL:** <https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461>\
**Category:** Uncategorized\
**Created:** [February 9, 2020, 5:44pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461 "2020-02-09T17:44:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rostovcev379](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rostovcev379](https://forum.xod.io/u/rostovcev379)\
**Post date:** [February 9, 2020, 5:44pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/1 "2020-02-09T17:44:48Z")

</div>

Hello. friends tell me how to make the servo respond immediately to changes in the value from the potentiometer from 0 to 1 upward, but if the potentiometer in position 0 the servo drive returns smoothly at a given speed

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [February 9, 2020, 6:11pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/2 "2020-02-09T18:11:00Z")

</div>

Here is my 1st attempt (one pulse-on-true & one pulse-on-false):

 ![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/9/92e1dd80d02b69c07529c5fe031e17b7fb827ff4.png)  
But I quickly realized that changing POT while rotate-slow was still moving servo could have rotate & rotate-slow both trying to move servo at the same time. Since rotate-slow uses MUTEX to lock the servo, we could change rotate to rotate-slow with a fast rate & share MUTEX with both, but it is probably easier just to use one rotate-slow node & change the rate:

![image](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/8/8f2cdc87e678d40b9e7f4e6315b5b58935af1ffb.png)

If current value is greater than POT, use a slow RATE; otherwise, use a fast rate. You can adjust both rates to suite your program in the if-else node.

---

<div class="post-metadata">

**Author:** ![rostovcev379](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rostovcev379](https://forum.xod.io/u/rostovcev379)\
**Post date:** [February 9, 2020, 6:23pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/3 "2020-02-09T18:23:12Z")

</div>

Thanks for the quick response. I will definitely try

---

<div class="post-metadata">

**Author:** ![rostovcev379](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rostovcev379](https://forum.xod.io/u/rostovcev379)\
**Post date:** [February 12, 2020, 8:56am UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/4 "2020-02-12T08:56:31Z")

</div>

tried the sketch. it loads without problems but I can’t understand why it doesn’t work

---

<div class="post-metadata">

**Author:** ![cesars](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@cesars](https://forum.xod.io/u/cesars)\
**Post date:** [February 12, 2020, 12:35pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/5 "2020-02-12T12:35:17Z")

</div>

Did you change port D0 for another value? D0 and D1 are used for debug therefore if active debug or has connected to the pc will not work

position-value is not updating UPD

---

<div class="post-metadata">

**Author:** ![gweimer](https://avatars.discourse-cdn.com/v4/letter/g/a9adbd/32.png) [@gweimer](https://forum.xod.io/u/gweimer)\
**Post date:** [February 12, 2020, 5:47pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/6 "2020-02-12T17:47:59Z")

</div>

Looks like a couple issues. As cesars noted, position-value-UPD should be set to loop (or pot-DONE could be linked to it).

rotate-slow-DO will also need to get a pulse. This could also come from pot-DONE, but it would probably be better to have pot-VAL link to a pulse-on-change, then to rotate-slow-DO.

---

<div class="post-metadata">

**Author:** ![rostovcev379](https://avatars.discourse-cdn.com/v4/letter/r/e495f1/32.png) [@rostovcev379](https://forum.xod.io/u/rostovcev379)\
**Post date:** [February 12, 2020, 10:44pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/7 "2020-02-12T22:44:27Z")

</div>

![20200213_013906](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/5/534efaf8937ca1363944863146f78115945d72ba.jpeg) everything worked. position value upd in the loop. and pulse done from potentiometer to D0

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/1X/eb7348baa04192c2ef932d1db54d44f09f8a7888.png) [@system](https://forum.xod.io/u/system)\
**Post date:** [February 14, 2020, 10:44pm UTC](https://forum.xod.io/t/servo-and-fade-fast-start-slow-return/3461/8 "2020-02-14T22:44:31Z")

</div>

Closed on February 14, 2020, 10:44pm UTC

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
