Award
Congratulations Rich, for answering the question and has received an EZ-Credit award! Share what you have learned and create a tutorial to help others by clicking here.

Limiting Servo Speed After Network Connection

Assistance Requested

Help Steve G with their question and receive $10 of EZ-Credit to get more robots and parts from our store. The following information was provided about their previous efforts searching tutorials for a resolution.

Steve G claims to have checked these sources:
 
#1

I have an annoying little problem I hope someone can help me with. So, when I power up my EZ-B4 the servos connected to it briefly pulse. Not a problem and expected. All my connected servos have limited speeds and set min/max movement positions. But, after the V4 and my PC connect and I move a servo, any servo, with my controller for the first time, each servo I trigger turns at maximum speed and on the second command I send the servos, they move at their correct set speeds and possitions.

Please tell me if there is a way to stop this from happening and get the servos to turn at the speeds I have set. If this carries on its going to cause damage to components and body parts (not mine). *stress*

I remember seeing a thread talking about something similar but can't find it now, and not sure if it was fully relevant to the issues I'm facing.

Of course I would be greatful for any help to resolve this.

Cheers.

I have found a few conversations, tutorials and activities that may help with your question. Take a look at these links. I've sorted them by what I believe to be most relevant but that is not always the case as I'm still learning.


Also, consider reviewing the Learn section for informative lessons and activities. Check it out!


#2

You want an init script which will move all servos to a safe position (usually centre of it's range). Once moved to a position you can set the servo speed.

#3

@Rich.

Cheers for your reply. I think I found the thread I was on about. It's a year old and possibly related to the EZ-B3 but can you confirm if this would work?

Code:



# Clear the servo speed for initialization
ServoSpeed(d0, 0)
ServoSpeed(d1, 0)
ServoSpeed(d2, 0)

# Move the servos into desired initialization positions
Servo(d0, 50)
Servo(d1, 30)
Servo(d2, 45)

# Set the servo speed for these servos which will be used from now on
ServoSpeed(d0, 4)
ServoSpeed(d1, 3)
ServoSpeed(d2, 4)



If so, I asume this goes into the event EZ script editor of the connection config menu?

#4

Yep, that looks like it would work. Not sure if the first ServoSpeed() commands would be needed but I guess if you load the project after a different one you would want to reset them so it's not a bad thing to have them there.

Yes, in the connection config for the script to run on connection or as a separate script which is triggered via a ControlCommand() in the connection config script.

#5

Brilliant. Thanks for the confirmation and your help Rich. Yet again you have saved the day (and my bot). Grin

Cheers.
Steve.

#6

The manual for the servospeed() explains this also Smile if you want more to read about the subject

#7

At least the Roli sample project also has this in the init script (although the camera servos are missing from the list, so I added them in mine).

Alan

#8

Just while I can, is there a way to stop the servo jitter apon plugging it in? I just wonder because, for say, the servos were used for something delicate, you wouldn't want the servos jumping around on start. You could add relays to the signal wire that must be enabled before the servos can move, right?

#9

TechnoPro, for additional cost you can purchase digital servos instead and sacrifice the physical range. We will be offering full range digital servos made specifically for ezrobot in our store in the new year.

#10

@Djsures.

Ah thanks for that. I completely overlooked this bit *sleep*. Just a thought, but do you think it would be a good idea to copy this lil message over to the speed heading in the EZ Builder manual too? Winky