Asked — Edited

2 Servo Speeds, Same Servo, Same Script

OK guys new question...

Is it possible to have the same servo perform 2 different speeds in the same script, yes dynamixels.

I need to run the arm up command just lower than full speed (8).

However when arm is going down with it having its own weight it really races to the ground.

I tried to set servo speed before each movement up/down but it did not work. Im sure Im doing something wrong but again appreciate the help.


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

#1  

At least with regular servos, servo speed is weird. You need to set it after a movement, which of course, in a situation like this is not helpful.

I think the best solution is to do a small movement, set the speed, then do the larger movement.

Alan

PRO
Synthiam
#2  

Incorrect - you only need to set the servospeed AFTER initializing the port as documentation...

[feature] ServoSpeed (servoPort, speed) Set the speed of servo or PWM. This is the speed to move between positions. The servo speed is a number between 0 (fastest) and 10 (slowest) *Note: To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot. *Note: Once the ServoSpeed() has been initialized the first time, specify the ServoSpeed() before specifying the Servo() position. Example: ServoSpeed(D14, 25) [/feature]

You can set the servo speed for going down, but again as you mentioned, the weight of the arm may still force the gears.

So you could do this...


# Move servo up fast
ServoSpeed(v5, 0)
Servo(v5, 100)

# pause for 10 seconds
sleep(10 * 1000)

# Move servo down slow
ServoSpeed(v5, 5)
Servo(v5, 1)

#3  

Quote:

To initialize the ServoSpeed() at first use, set a Servo() position before using the ServoSpeed() command. If there is no previous position (such as during power-on), the software assumes the position is 0 and will cause issues with your robot.

This is what I was referring too, although I believe you may have updated this documentation since the last time I looked at it, since it is much clearer now and actually makes sense:)

Alan

#4  

DJ I swear that's what I tried, will try again.

#5  
 # Right elbow up/down

:right elbow
ServoSpeed( v5, 10 )
Servo( v5, 51 )       #Arm UP
sleep(3000)
ServoSpeed (v5, 4 )
Servo(v5, 0)          #Arm DOWN
Sleep(3000)

Goto (right elbow)

Start 3: :right elbow 4: ServoSpeed( v5, 10 ) 5: Servo( v5, 51 ) 6: sleep(3000) 7: ServoSpeed (v5, 4 ) > Error on line 7: Missing String Quotes or Invalid Expression at index 0: ServoSpeed (v Done (00:00:03.0110043)

#6  

Get rid of the space between ServoSpeed and the opening brace... so...


ServoSpeed(v5,4)
#not
ServoSpeed (v5,4)