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
Could be a coding issue, but you did not include code…
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
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.
if you insert an “and” node between “gate” and the last “if-else” will it help it update the data?
if you insert an “and” node instead of a “gate”. “if-else” will it help him update the data?
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.
can the and node replace it?
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.
“if-else” should not toggle until “svet” is active
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.