servo.connect(); //connect servoservo.setSpeed(20); //send servo to a certain speeddelay_ms(# of miliseconds calculated to get to that angle at that speed) // go for as long as it will take at that speed to get to desired angleservo.disconnect(); //stop servo.

It's actually working very nicely, as that is a method and I have more code that does the calcuations for me, so that I just pass in speed and angle.

My concern/question is, I am assuming that as my battery discharges, I will get less voltage to my servo's, which will slow down the servos, and screw up my calculations, hence getting me the wrong angle.

Is there a different way to do this?

Maybe I need a voltage regulator to my servo's, which I am not currently using?

My assumption is that with the modified servo, I lose all feedback capability, so this has to be done programatically.

I would be curious to here peoples opinions on this.

The other thing I was thinking, but not quite sure this could be done, is have something, I don't know what, but something that could read the voltage going into the servo's real time, and feed that into my mcu, and then figure out how that plays into my calculations.

In a word 'No'. Servos are normally instructed to move from position A to position B - their on board controller then tends to ramp up the acceleration and deceleration to get there quickly. By 'modifying' the servo it no longer knows what position it is currently at. So larger changes in position (ie the difference in setSpeed command) will tend to make it turn faster and, since it never thinks it actually gets there, it carries on moving. So the actual speed is often linked to the difference between the previous setSpeed and the new setSpeed. BUT - all servo models work very differently - some have a very flat response ie they are either at rest or they are at full speed. Others are more responsive. It will also vary from one servo to another of the same make/model.

A previous poster mentioned an Encoder. No this is not a transistor - its like a complicated potentiometer - that is used to work out how many degrees the shaft has rotated. Bit like the thing you cut out when you modified the servo !!

Quote

they only travel in one direction right?

. No - if you use the example code generated from WebbotStudio it will turn your servo oner way and then the other way over about a 10 second cycle time.

In a word 'No'. Servos are normally instructed to move from position A to position B - their on board controller then tends to ramp up the acceleration and deceleration to get there quickly. By 'modifying' the servo it no longer knows what position it is currently at. So larger changes in position (ie the difference in setSpeed command) will tend to make it turn faster and, since it never thinks it actually gets there, it carries on moving. So the actual speed is often linked to the difference between the previous setSpeed and the new setSpeed. BUT - all servo models work very differently - some have a very flat response ie they are either at rest or they are at full speed. Others are more responsive. It will also vary from one servo to another of the same make/model.

A previous poster mentioned an Encoder. No this is not a transistor - its like a complicated potentiometer - that is used to work out how many degrees the shaft has rotated. Bit like the thing you cut out when you modified the servo !!

Quote

they only travel in one direction right?

. No - if you use the example code generated from WebbotStudio it will turn your servo oner way and then the other way over about a 10 second cycle time.

Webbot, thanks.

Since I had no unmodified servo's here, I ran out to radio shack and picked up a parrallax standard servo, and did plug it in using your sample code just before reading this, that is exactly what I found. Interestingly, it seems to go pretty fast for a second or so, seems like to get to a certain position, than very slowly goes back and forth according to your code.

I then was able to get it to go to certain positions in each direction, but as you noted, the speed is consistent and SLOW, at least for this servo.

After reading about encoders, I am not sure that based on price alone, they are something I really want to pursue.

The modified servo (now a motor) is working exactly as I want with the Webbot lib, I am able to very nicely modify speed, and get to a very precise position.

If I could assure the voltage would not drop, and could remain very steady, I would think that would be a viable solution.

My concern is that as the battery discharges, I am quite sure that will mess up everything, or even if the battery is freshly charged, although that could probably be handled nicely with a voltage regulator.

Are there any sensor's that can act like a voltmeter that anyone has used?

Voltage regulators are also troublesome. An innocent looking servo can consume 1 Amp if you put it under load. Which is the Axon(s) and $50 have an unregulated supply (ie straight from the battery) for servos. The 74'05 regulator on the $50 can only supply 1 Amp max - so you may kill it with just one servo.

Perhaps you could go back to the drawing board and state what you are trying to 'achieve' (rather than saying what hardware you've done/got). Folk may then be able to recommend a better solution to achieve your goal.

Voltage regulators are also troublesome. An innocent looking servo can consume 1 Amp if you put it under load. Which is the Axon(s) and $50 have an unregulated supply (ie straight from the battery) for servos. The 74'05 regulator on the $50 can only supply 1 Amp max - so you may kill it with just one servo.

Perhaps you could go back to the drawing board and state what you are trying to 'achieve' (rather than saying what hardware you've done/got). Folk may then be able to recommend a better solution to achieve your goal.

Makes sense.

I am trying to create a robot that has several (up to 5) DOF, on several "limbs", not biped limbs, but limbs to be able to do various things like moving, rotating, grabbing, etc..

Any of the DOF's would be required to be able to go to a very specific angle, with very little margin for error on the angle, at very different speeds.

At the moment, I don't plan on using many sensors, more of a mechanical robot than anything. I may add sensors down the road.

You need to consider the 'load' that the servos/motors will be under. There is a tutorial on this site regarding 'limbs' and the physics/maths involved - don't expect a small Hitec servo to be able to lift anything heavy.

You need to consider the 'load' that the servos/motors will be under. There is a tutorial on this site regarding 'limbs' and the physics/maths involved - don't expect a small Hitec servo to be able to lift anything heavy.

Thanks, yeah, I have been reading those tutorials and I definitely get that sense.

When servo gets loaded, it tends to "jitter", stepper motors - do not, have You considered them? Using steppers will involve building some control and feedback electronics.

I am actually considering steppers. I have read Webbot's and Admin's tutorial on them and they seem very intriguing.

Thanks!

Steppers are kinda like a motor+encoder ie you tell them when to move to the next 'click' and hence knowing the clicks you know the position. BUT if your motors aren't up to the job/load then you can ask them to move to the next click but they may fail to do so if they can't move the current load. ie they are also subject to slip. Encoders measuring the drive shaft are the only 100% way to know the 'actual' movement. Again - its down to cost/accuracy/load

For what you seem to have in mind, I would look into digital servos as an option, rather than regular hobby servos. In particular, Robotis makes the Dynamixel line of servos. Another manufacturer of similar servos is Kondo. In fact, such servos are used for the bot that comes to my mind from your description. The Robotis servos are far more common the US, though. Webbotlib supports the Dynamixel AX servos, and could easily support the newer MX servos.

These come with a premium of price... but once you start using them, it's hard to accept using hobby servos again

The Dynamixel servos IMHO are brilliant. Great torque, you can even modify them into continuous rotation via software and back again, and you can control them all (well up to to about 250 of them!) via a single serial port. But as Gertlex says - they don't come cheap.

The Dynamixel servos IMHO are brilliant. Great torque, you can even modify them into continuous rotation via software and back again, and you can control them all (well up to to about 250 of them!) via a single serial port. But as Gertlex says - they don't come cheap.

Guys, thanks! I am going to look into those some more.

Maybe I can carefully combine them with some cheaper servo's to lower the price but get me the functipnality I need.

That is pretty fascinating that you can use software to modify them and back again.

Just out of curiosity, how can you control so many with a serial port? I am assuming you would need to make/buy some type of servo controller?

That is pretty fascinating that you can use software to modify them and back again.Just out of curiosity, how can you control so many with a serial port? I am assuming you would need to make/buy some type of servo controller?

Nope, you need to add like a 15cent chip to control the serial line but then each servo has its own unique ID. All the servos are on the same serial line and only listen to commands sent with their own ID. Bit like asking 'how do Parcel Force deliver to so many houses with just one truck - answer: each communication instruction (parcel) has the zip code of the recipient'...