Asked
Resolved Resolved by Athena AI!

Servos Go Beyond Global Max/Min When Release Button Is Pressed

I am having a couple related problems. I set the initialization servo max/mins which are working correctly. However, sometimes (not every time though), when I click release, the servos go past the limits. Other times they release to the correct min position.

Second, I have noticed that the arduinos keep sending the position signal even after disconnecting the board. Even when I close ARC completely and reboot the arduino, and power on the robot, the servos are still sending a position signal that was last sent when ARC was still open. It seems that hitting the release button each time fixes this. Does this mean I need to program in release at the end of every servo position control? Once I do click release, I encounter the first problem I discussed above.


Related Hardware Arduino Due/Mega

ARC Pro

Upgrade to ARC Pro

Don't limit your robot's potential – subscribe to ARC Pro and transform it into a dynamic, intelligent machine.

#9   — Edited

elektrophunktronic, I don't put my int script in the connection control. I have a separate stand alone int script in an ez script that sits on the ARC desktop. I have a shortcut on Windows desktop that will both start ARC and run this INT script after ARC starts up. Like my previous post said, I set my min, max in that int script. Once set the servo won't go past that no matter what I do or set in a servo control. Just like DJ mentioned.  I'm sure that placing it in the connection control works just as well. I just don't do it like that.  Is it possible that you have a second script or command in a servo script that might be resetting these min, max values? I've done that by mistake before as I was writing different scripts for my robot to move. Also I need to validate DJ's comment that your int script may not be completely finishing. Not that DJ needs my validation. Lol. As I write a  a script, that happens to me a lot if I've made a mistake in the coding. Like DJ mentioned, run it while you're in editing mode and it will tell you what's wrong. I think there's a box at the top of the script editing window that actavates this feature. Can't confirm that right now.

#10  

Thanks everyone. I can confirm that the code compiles correctly. I have it working for most servos except for a couple on the same arudino, so it may be possible that it is a wiring issue. For reference I am using JX 180 PDI-HV2060MG servos inside an INMOOV. I am using the inmoov 'nervo board' which I didn't do the best job of soldering. I ordered a standard servo shield for the MEGA and will try again and see if the issue persists.

However, for the Servos that ARE correctly obeying the max/min settings within ARC, I am having issues, related to servo functionality that we were discussing earlier, DJ:

When I shut down ARC or disconnect from the Arduino, the servos instantly jump well past the max/min settings. Is there something inside ARC I can do to avoid this? With these particular servos inside the inmoov, if they go past the global max/min they will cause damage to the inmoov. Curious if other people have run into this issue.

PRO
Synthiam
#11  

when closing ARC with a connection, the servos will be "Released." Some servos behave strangely when a PWM signal is stopped and floating. You could modify the Arduino source code and comment out the release commands. That will prevent the servos from being released, but they will hold the position forever, which may be what you want.

#13  

UPDATE - So I think I figured it out. When specifing the max/min I did not specify the connection channel. I had:

SetServoMin(D9, 47) SetServoMax(D9, 101)

Instead of: SetServoMin(1.D9, 47) SetServoMax(1.D9, 101)

I assumed that if the max/min was set inside the main channel-specific connection script that I did not need to specify the connection ( due to it already being under the relevant channel).  Futher confusing me is that I did not need to include the 1.D9 when calibrating the first arduino. I assume this is because it was on channel 0 which is the default.

Thanks everyone!