# Servo 995r problem

**URL:** <https://forum.xod.io/t/servo-995r-problem/4201>\
**Category:** Hardware Interfacing Questions\
**Created:** [July 8, 2020, 11:04am UTC](https://forum.xod.io/t/servo-995r-problem/4201 "2020-07-08T11:04:25Z")\
**Posts on this page:** 13\
**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:** [July 8, 2020, 11:04am UTC](https://forum.xod.io/t/servo-995r-problem/4201/1 "2020-07-08T11:04:25Z")

</div>

problem with holding servo position. There are 2 servo. both hold values ​​of 0.5. on command move to position 0.1 and 0.9. so that’s 0.9 turns but doesn’t always come back. either returning is not enough. what could be the problem? they are mounted on a car. whether electrical interference from the generator is possible. it is next to a servo which does not work correctly. servo 995r

---

<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:** [July 8, 2020, 1:49pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/2 "2020-07-08T13:49:35Z")

</div>

Could be a coding issue, but you did not include code…

---

<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:** [July 18, 2020, 12:35pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/3 "2020-07-18T12:35:21Z")

</div>

![1](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/e/e6916a90c565d03be6aae5160316b8255b0bacd9.png) ![2](https://canada1.discourse-cdn.com/flex027/uploads/xod/original/2X/3/37f5c5a95c46a86cf13bf73b21d49c3a23a4f636.png)

---

<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:** [July 18, 2020, 1:05pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/4 "2020-07-18T13:05:11Z")

</div>

even when the signal from svet is false, the servo drive happens to change position upward from 0.6. the left side of the code is identical but there are no problems

---

<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:** [July 18, 2020, 4:03pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/5 "2020-07-18T16:03:57Z")

</div>

You did not make the mistake of having multiple servo nodes trying to control one servo. That is a good start.

I’m having trouble seeing all the details, but the gate feeding the last if-else-COND means that the condition cannot update if vset is false. You can rule out interference by adding a watch node to the pin feeding servo-VAL to see if it is number you were expecting. If it is not the number you were expecting, you can add additional watch nodes earlier in the program to see where things are breaking. You will need to run in debug mode to see the watch values. Sometimes it is necessary to reset the board after downloading code for debug to initialize properly.

A suggestion for making your code easier to read: If two sections of code are the same, lay them out the same so it is obvious.

---

<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:** [July 19, 2020, 1:37pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/6 "2020-07-19T13:37:16Z")

</div>

if you insert an “and” node between “gate” and the last “if-else” will it help it update the data?

---

<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:** [July 19, 2020, 1:44pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/7 "2020-07-19T13:44:49Z")

</div>

if you insert an “and” node instead of a “gate”. “if-else” will it help him update the data?

---

<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:** [July 19, 2020, 5:40pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/8 "2020-07-19T17:40:32Z")

</div>

What is the purpose of the gate node in this code? Generally it is used to ignore any changes passed to it when EN is false. If you don’t want to ignore changes, then gate is probably the wrong node to use.

---

<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:** [July 19, 2020, 7:01pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/9 "2020-07-19T19:01:09Z")

</div>

can the and node replace it?

---

<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:** [July 19, 2020, 7:09pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/10 "2020-07-19T19:09:21Z")

</div>

That depends on what you are trying to do. You can replace the gate node with any node that takes Boolean inputs, but most of them probably won’t do what you want.

---

<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:** [July 19, 2020, 7:12pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/11 "2020-07-19T19:12:34Z")

</div>

“if-else” should not toggle until “svet” is active

---

<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:** [July 19, 2020, 7:41pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/12 "2020-07-19T19:41:24Z")

</div>

If that is how you want it to work, then gate is probably the proper solution. If you want it to always be true, or always be false until vset is active, then you would want a different solution.

---

<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:** [August 18, 2020, 7:41pm UTC](https://forum.xod.io/t/servo-995r-problem/4201/13 "2020-08-18T19:41:25Z")

</div>

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