I’m new to electronics, so apologies if this is a rather basic question.
I’m working on an application in which I’m powering an Arduino Mega and 20 servo motors from a battery pack. The servos are supplied with power directly from the battery, the Arduino via the internal voltage regulator.
The servos have an operating voltage range between 4.8 and 7.2. I’d like to be able control this voltage directly via the Arduino in order to dynamically alter the torque characteristics of the servos. I've validated the concept using a bench power supply with variable voltage and this gives me the results I’m looking for. The desired output voltage will never exceed the voltage of the battery, so it’s just a reduction I need.
I’ve looked at buck converters, but unfortunately the current requirements of this application are pretty high (~10-15 amps), and I couldn't find anything suitable. Also there doesn’t seem to be a way to control the voltage via the Arduino. Finally the buck converters seem to require the source voltage to be a few volts higher than the desired output. Since my battery will be 7.2 volts max (and ideally 6v) this would cut out most of the usable range.
Just to clarify, I'm trying to get a variable voltage to the servos that I can control programatically during operation via the Arduino. Wouldn't introducing multiple batteries just give me multiple fixed voltage points? Or have I misunderstood something?
Finally the buck converters seem to require the source voltage to be a few volts higher than the desired output. Since my battery will be 7.2 volts max (and ideally 6v) this would cut out most of the usable range.
If you use a buck-boost converter (or several of them) that isn't a problem. A buck boost converter works either way around, low to high, high to low voltage and the transition as the battery discharges is seamless.
If you can't find a single one to supply enough current then use several.
As for a control input to the converter, I don't know, I feel sure I could make one but have never done it so can't give you a quick answer.
If it were me I'd be looking at fixed voltage supply and PWM to control the torque, but then I have not used servos much so I am not the best person to advise you.
If you use a buck-boost converter (or several of them) that isn't a problem. A buck boost converter works either way around, low to high, high to low voltage and the transition as the battery discharges is seamless.
I didn’t know about buck boost converters, so this was really helpful. After a little searching I found a device that can handle 7-10 amps, so presumably if I just pair a couple up in parallel, as you suggest, and connect the outputs I’ll have what I need. Will it be a problem that they won’t all be calibrated to the same EXACT voltage?
Assuming this works, the only remaining problem is how to bypass the potentiometer to set the voltage programatically. I did a bit of searching, and it appears that this question gets asked fairly regularly. The solutions involve using a digital potentiometer or some kind of Op-amp based solution. The latter is a bit over my head, and I couldn’t find any working implementation that I could use as a template. I don’t suppose anyone knows of any good examples for beginners, or could shed any further light? I'll start looking at the digital potentiometer option as a starting point.
If it were me I'd be looking at fixed voltage supply and PWM to control the torque
To the best of my knowledge the RC servos that I’m using take a PWM signal to set the position. The speed, torque etc are determined by the circuitry inside the servo. Whilst I can control the speed, to an extent, by varying the interval I update its position, I don’t think I can do much about the torque other than by changing the voltage.
Thanks for all the help so far. It's good to know that I'm on the right track, and now at least having something tangible that I can Google/experiment with!
If you want to connect outputs in parallel, do so thru a series diode so the converter outputs are not fighting each other.
Look for a schottky diode rated for the current you wish, that will give you the lowest voltage loss.
You could also do the same with a MOSFET. Look up perfect diode, ideal diode
If I just pair a couple up in parallel, as you suggest, and connect the outputs I'll have what I need. Will it be a problem that they won't all be calibrated to the same EXACT voltage?
Not withstanding what CrossRoads has said above I would go for NOT connecting them in parallel, I would connect some stepper motors to one and some to the other. Don't forget to join the grounds. So, to be more explicit, connect all the -ve outputs together and to ground, don't connect the +ve outputs. Divide the servos equally between however many converters you have.
Whilst I can control the speed, to an extent, by varying the interval I update its position, I don't think I can do much about the torque other than by changing the voltage.
I don't know the answer. I do know there are people on here who can help with that so if any of them are reading this please help. You could experiment of course. Why do you need to control the torque?
@CrossRoads Thanks for the really helpful response, and for taking the time to provide the useful links.
If you want to connect outputs in parallel, do so thru a series diode so the converter outputs are not fighting each other.
This makes sense. I’ll start with the Schottky diodes, as the forward voltage drop should be acceptable.
One quick question though (and apologies if this is a bit of a tangent). I now understand that the addition of the diode will stop current from the higher voltage converter from flowing back into the the lower voltage converter and causing issues. But I’m still not sure how this affects the output voltage and the load balancing between the converters.
For example, suppose converter A outputs 5 volts and converter B outputs 4 volts. From what I understand, the higher voltage converter (A) will effectively take all of the load and output at 5v until it is pulling too much current. If the current draw causes the voltage to drops below the second converter, then the output will be 4v and the load is shared between the converters. Does this make sense? And if this is correct, is there any way to predict the ratio of current converter A will provide vs converter B?
@ PerryBebbington. Thanks again for the suggestions.
‘Not withstanding what CrossRoads has said above I would go for NOT connecting them in parallel’
Could I ask your reasons for this? I’m using a Arduino Mega sensor shield with a single input to power all the output pins. Therefore, it would be more convenient if I could connect the converters in parallel and attach the outputs directly to the sensor shield. I could hack it in order to do as you suggest though, and completely isolate each bank of four outputs. This would also have the advantage of putting less total current through the shield (I was really worried about this, but it seem to be able to handle it ok).
You could experiment of course. Why do you need to control the torque?’
It is essentially for a machine learning experiment. It doesn’t really matter so much if I’m able to control the torque in the best way, but if I can control it in some way then I have another dimension to test the adaptive capabilities of the system. I think if I’m able to adjust the output voltage to the servos, this will be close enough for me.
Yes, it avoids the problem you describe in reply #7, your concern and description are correct. If you do put them in parallel with diodes then adjust the voltages to be as close as you can get them before connecting them in parallel to minimise the effect.
It means it does not matter if the voltages are slightly different. However, I realise that there might be other practical concerns that mean this is not possible.
I'm using a Arduino Mega sensor shield with a single input to power all the output pins. Therefore, it would be more convenient if I could connect the converters in parallel and attach the outputs directly to the sensor shield. I could hack it in order to do as you suggest though, and completely isolate each bank of four outputs. This would also have the advantage of putting less total current through the shield (I was really worried about this, but it seem to be able to handle it ok).
This doesn't make sense. You refer to a sensor shield. In your original post you said 20 servo motors, nothing about sensors. 20 servo motors will require considerable current, which is what we have been talking about, now you are talking about some unspecified sensors, which probably don't take much current. You also don't power servo motors from Mega output pins, you use the Mega output pins to control the motors. I would think you have some kind of servo motor driver or at least some MOSFETs to drive the motors. Unless you have a single driver board for all 20 motors I assume you have at least 2 boards, which can each have a separate power supply.
Please can you clarify the above, perhaps with a schematic? Hand drawn and photographed is fine. How to post an image
I’m confused too . If the “ torque” is too low the motor is kept stalled , which will burn it out in a short time . . If the “torque” is higher than that required to move the load , then it moves . So if you increase the “torque” even more , it can only accelerate the load up to the max speed if the servo , limited by friction, motor magnetic design or the control electronics limiting it . Holding the motor back by not supplying enough power for it to run close to its design speed will probably also over heat it .
I dont think you are controlling torque or can , do you mean speed ?
Why anyway , what is the project to do ?
This doesn't make sense. You refer to a sensor shield. In your original post you said 20 servo motors, nothing about sensors
Sorry for the confusion, I’ll try to explain.
The servos I’m using are cheap RC car/aircraft servos (MG996R). They have a three pin connector - power, signal (pwm) and ground. Unlike a typical motor, the power is supplied directly via the battery, and not via the Arudino at all, whilst the signal is supplied by one of the Arduino’s PWM pins. The signal determines the servos position (0-130 degrees). The sensor shield I’m using is just a convenient way of connecting everything, as it provides the three pin connectors that I can directly attach the servos to. I’ve attached a specification for the board, and hopefully this will make everything clearer.
I dont think you are controlling torque or can , do you mean speed ?
Why anyway , what is the project to do ?
I'll try to explain.
The servo motors power the limbs and head joints of a hexapod robot. The robot has been running successfully in various iterations for a few years now, but the servos are always running on a knife edge since obviously I’m not using them for their intended purpose . Even within their operating voltage range (4.8-7.2v), if the voltage is too low the robot isn’t able to lift itself off the ground and the servos stall (and eventually burn out). If it is too high, the servos tend to overheat quickly (and burn out). If it’s just right (around 5.5-6v), the robot is quite reliable but certain stances/gaits cause the limbs to get stuck in a position that temporarily require more power to escape from. For example, if the robot’s legs are all outstretched, it needs more power to lift its own weight. I thought it would make an interesting experiment to provide the robot with adaptive capability, so that the voltage can temporarily be increased to give the servos brief spurts of additional power when needed. Hope that makes sense.
How to post an image
My guess would be that your proposed sensor shield would struggle to handle the current drawn by motors. Do you know for a fact that it can?
Earlier versions of the robot have been running 18 servos off the board without any incident (back then I didn’t have any understanding that pulling large amount of current across a thin copper track could cause any problems). If all the servos are stalled, there is the potential to pull around 40 amps, or as close to this as the batteries can supply. However, in practices this doesn’t happen and I’ve fitted a 15 amp blade fuse between the batteries the Arduino sensor shield to limit the current that can be pulled. It has only blown on a few occasions.
In the most recent version of the robot, I’m planning to add two more servos and I may need to up the limit of the fuse. Therefore I was wondering whether it would be prudent to take the opportunity to hack the expansion board to supply each bank of 4 outputs separately.
Since it sounds like using several buck boost converters is a reasonable way to go, I’ll either use diodes to protect current from flowing back if I connect them in parallel, or dedicate each converter to its own group of servos. This approach will give me the ampage I need.
The challenge now is to bypass the potentiometers on the controllers to somehow to allow the voltage to be controlled digitally via the Arduino. It looks as though this can be done via a digital potentiometer (if I can find one of the right spec) or an OP Amp (if I can understand how this works).
I’ve ordered a few converters to experiment with, and I’ll let you know how I get on. Thanks for all the help so far!
scuttlebug2:
The servos have an operating voltage range between 4.8 and 7.2. I’d like to be able control this voltage directly via the Arduino in order to dynamically alter the torque characteristics of the servos.
I think you are likely to have fundamental problems. If you stress a servo to its torque limit for prolonged
periods it will usually cook itself.
So assuming that controlling the torque limit is useful strongly implies you will be doing this.
Standard hobby servos in particular are not designed to run at stall torque except very fleetingly,
and are easy to burn out if held stalled.
I think you are likely to have fundamental problems. If you stress a servo to its torque limit for prolonged
periods it will usually cook itself.
You could well be right, and I'm prepared that I may well lose a few trying this out. :). Then again, I've been totally abusing these servos in a hexapod robot for a while and, generally, they've held up pretty well. I'm actually trying to avoid a stall situation you describe by matching the power available to the servos with the robot's situation. For example, a quick blast of power would be useful when the robot is trying to raise its body of the ground, especially when its legs are fully outstretched.
Of course, I could just run the servos permanently at the upper extreme end of their specified voltage range, but I've found that in doing this they use a lot more power, get much hotter, and ultimately are much more prone to burnout in non-stalled situations.
All that said, I'm having problems finding a digital potentiometer that can handle the voltage I need to replace the mechanical pot on the buck boost controllers (10 v +), so this project might be on hold for a while.