VarSpeedServo Library - Define Standard Pulsewidth

Hello!

I´m new to programming of any kind and managed to teach my biped to do some basic exercices. As the robots legs are quiete heavy, it is pretty unhealthy that the servo library sends an instant move command without smooth movement at startup.

I already tried to google and whatever but I can´t find a way around the "Define Standard pulsewidth" in the Servo Library, instead I would like to send the first signal from the first command that I´m giving.

Heres a short video of what has been achieved so far:

Thank you ! :slight_smile:

HermexWorkout.ino (2.37 KB)

You can send a position command to the servo before you have attach() it. This becomes what I think you mean with the "Standard pulsewidth"

Now, the real problem is there is no way to know where the servo actually is. At Powerup you can only ASSUME that the robot is standing up, send position command for staning up, and then do the attach. If the robot was left squatting at pwoerdown ... well, it will leap up.

There is no way to ask the Servo for psoition. I think the fancy newer digital servos have this capability (including an internal slow move function) but you'd have to find a servo library that supports this.

Do you mean that the servos move quickly when the program starts or that they move quickly at the start of any servo movement ? If the former then you are probably out of luck and should do your best to leave the servos in a starting position before turning off the bot.

I've already tried to send the whole send command before attach, I found that in a post on this site but it gave me an error upon compiling. I will double check that tomorrow again.

The Robotlegs usally hang on a test stand whitch is ver close to the normal stand position so they don't have to move far. The problem was that it sometimes moves in totally odd positions on startup. That causes crossed legs with posible damage or attacks against it's builder.

I will analyse that behavior tomorrow and report more precise. It seems that the varpspeedservo library doesn't work before attach or when I don't use the metro intervaller.

Hmm strange, if you got a minute, the code is attached on the first post.

Thanks so far.

I tested a bit while implementing a simple balance routine using rc gyros. The extreme movements only occur when the Arduino has no power or during code upload. The Servos are powered from a 3S Lipo. If I'am cutting the power supply from the arduino while the external supply is still on, it tries to kick me hard.

I guess the only way around is a relay switching the ext pwr supply after boot then.