Pause servo movements?

I’m using Python coding for my ssc-32 board to run a pair of robotic arms. I’m using input taken from my Logitech controller and then outputting to the board to run the servos. Now, my issue is I have the up button set to the shoulder’s max elevation (P2300) and down set to the minimum (P700), when I release either button the only way I have found to stop the movement is by issuing a P0 command which obviously makes it susceptible to fall due to gravity. My question is, is there a command to stop the servo or have it hold it’s position without falling? I have tried using QP to find the current pulsewidth but this only gives me either blank or “F” in response. Any ideas?

Did you look into a better USB to serial cable? Was wondering, it should make a big difference in getting the two way communication going. The proper way to do it is query the position, and then command the channel to the read position.

Another method would be interpolation… If you have the start and end positions, and the time the move will take, you simply do some math to determine the interpolated position at any point in time. 8)

You may want to try the “stop” command below with the servo. For terrain adaption testing I had a servo move at a given speed, and when ground contact was detected, the stop command was used to stop the servo at its current position, which the servo then holds. Also the servo’s stopped position is remembered by the ssc-32, which can be queried as needed.

lynxmotion.com/images/html/b … miscregcom

Thanks for the responses, I actually figured it out earlier today. I had originally attempted using commands such as “Stop16” to no avail, I was going insane. I then used the “T” command after my pulseout to slow it down a little and give me time to use the “stop”, however still no good. I then imported the “time” module as well and more-or-less threw a delay in by time.sleep(0.05) to let it accept new again. After I put the sleep in I was able to adjust the “T” value and stop with “Stop#”.

As it stands now I have when one button is pushed/joystick is moved, the value passed is one so “#1-16 P# T#” and then when I release it the value becomes zero which passes “Stop#” and it works great holding the position with no jitter. Also works with my verbal “Stop” command when using my voice recognition to command the robot as well; though the verbal stop is global and fires off “Stop#1-16” at once.

Thank you for the time spent on the phone the other day though, I appreciate it!

I forgot to mention the stop command. It was added in V2. Sorry. Glad you got it going. :smiley:

Not a problem at all! I had tried the “stop” command before I called and it didn’t work until I put the timing in anyway haha so no worries, I appreciate the assistance.