Question about servos and building robots
So I set up a crackbook page for my Robotics: Learn by building series of online courses and at the time of this writing, the page has a lot of members. Mind you, I had almost 20,000 students enrolled in my courses last time I looked. Regardless, I left membership for the crackbook page open to anybody who could prove they weren’t a robot (ah! subtle humor!) so there was a lot of people asking questions about getting started in robotics, etc…
I did throw together a video here on getting started and answering some of the frequently asked questions, but Mike wrote to me specifically asking about the bomb-squad robot I have in the header on the crackbook page:
Wanting to build something similar, Mark asked “What servo’s would you use if you were building it please, as this seems to be the hardest part.”
It’s an excellent question that leads to a lot of good discussion. So I thought I would put together this post to explain what I would do, how I would do it, and why.
First point of clarification: Mark was referring to the common “hobby servo motor” of which you can get a variety of sizes, and they were originally designed for RC aircraft and cars. They are wonderful for use in hobby robotics, but are limited in size, power and accuracy. In the case of a bomb-squad style robot, they may very well be useable. However, “servo” in robotics can mean any kind of drive mechanism that is controlled by what is called a closed-loop feedback.
A drive mechanism moves a load and the feedback system. Feedback system tells the controller what happened, and the controller causes the drive mechanism to move, based on the feedback. It’s a closed loop. In course 1 “Electricity and electronics” you learn how to build circuits to control hobby servos, or even how to build the electronics for your own servo so you can literally build a servo any size you want. In course 2 “Digital Electronics” you learn how to control hobby servos using microcontrollers like the Arduino. In course 3 “Robotic Drives & Physics” you learn the different methods of drive systems and different types of electric drive motors, and even how to hack a brushless DC motor into an AC servo motor such as those used on industrial robots and machines.
The drive mechanism can be just about anything – an electric motor, a hydraulic or pneumatic cylinder, even gravity.
The feedback can be a variety of methods and measurements: it could be feedback showing how fast something is moving or turning, using perhaps optical encoders or inductive sensors. The feedback could be positional – what position is the load in? The servo could also use a variety of feedback sensors such as resistive (like the pot in hobby servo motors), capacitive or AC resolvers. The feedback could be pressure: I made a sandwich (MMmmmMmmmMmmm….sandwich…..<drools>) of two copper strips, and some of my top-secret resistive silicone.
Use the sandwich as the fingertips on a robot hand, and the more pressure that’s applied, the more the copper plates squish the resistive silicone and get closer together, the lower the resistance measured between the plates. Alternatively, you can use straight insulating silicone and use the two copper plates as a capacitor. The closer the plates get to each other as a result of more pressure, the higher the capacitance. In either case, the feedback can be read by a controller to drive the gripper with more or less power to apply more or less force. You could then meet the robotics challenge of picking up a raw egg by applying just the right amount of pressure.
To make my top-secret conductive silicone (which is now no longer top-secret cause I’m telling you here), take standard silicone (the kind that smells like vinegar) from the hardware store and uniformly mix in a little bit of acrylic or latex paint and a whole mess of graphite powder. You can usually find graphite powder by the lock or keys section as it’s used as a dry lubricant in locks. The acrylic / latex paint is just to evenly distribute water throughout the silicone as the silicone cures by exposure to water. Normally the silicone absorbs moisture from the air and cures, but if it’s thick, or blocked on two sides by impermeable copper plates, it might not cure for like, years. 🙂 The graphite powder is resistive, so add lots of it because that’s what makes the silicone conduct electricity and gives you a resistive reading.
The controller in a servo is usually a microcomputer of some kind: a Programmable Logic Controller used in industry, a custom built computer like industrial robot controller cabinets, or as is so often the case in home robotics, an Arduino microcontroller.
So it’s important to understand that a servo is a controlled system, and while beautiful, is not always the thing you want because they add a complexity. Let’s use the bomb-squad robot as an example. That is one hefty piece of equipment! It will take a lot of power to move and it would be expen$ive and difficult to get hobby servos big enough. More problems on that in a minute, but let’s take a closer look at it:
It’s obviously radio controlled as there is no cable. Radio controlled bomb-squad robots use ULF so as not to trigger any nearby electronics (i.e., the electronic trigger on the IED they’re trying to dispose). But in a robot that large, I would seriously consider cable controlled. By that, I mean it has a wire going to a controller that I’m holding. Especially because that bomb-squad robot has cameras on it, I can look at the monitor to see everything – I can see what position the arm and gripper are in, and where I’m driving. Yes, tethers are a pain but it also dramatically simplifies things: There is no complex electronics anymore. My controller is literally a bunch of switches and pushbuttons, each of which simply move one of the motors in a specific direction.
This is precisely what I did with my series of submarine robots I built:
They had a tether going to the surface to keep things simple, and so I had a way of retrieving the robot from the bottom of the lake if something went wrong. 😀
A different scenario I realize, but the point remains the same.
Hobby servos are great for most home robotics, but are notoriously weak and inaccurate. Take for example, this beautiful little arm robot kit I got from banggood.com:
The hobby servos literally spend most of their energy just holding the robot arm up under its own weight! And while I expected it to be inaccurate (because these hobby servos are positional servos, but really only have maybe – maybe – 30 different positions they can turn to in a 180 degree turn), it was even more inaccurate than I expected. As we learn in course 3, repeatability is of great importance in robotics, and the moment you slap a hobby servo motor on an arm robot like that, the arm itself becomes a gigantic lever. This robs the servo of what little strength it has already and amplifies the positional error.
This may or may not matter to you and your project. But in the case of the bomb-squad style robot, I would actually just use DC drive motors for each axis with a gear drive that has a high enough gear ratio to lock up when the motor is not moving. Now you become the feedback and controller in the servo system, as you tell the motor which way to turn the axis and you tell it when to stop. For example, I’d use threaded rod drives (made from hardware store threaded rods) and hack some cordless drills to drive them. Just tighten up the chucks onto the threaded rod on one end and voila, a threaded rod drive with incredible strength and it will hold the load static when you remove power from the drive motor. I’d use something like windshield wiper motors or power window motors from a car to drive the wheels on the drive train.
Hobby servo motors work by a changing pulse width, and they are quite forgiving. Most hobby servos are positional servos, in contrast to a continuous rotation, speed-controlled hobby servo which is not actually a servo. Hobby servos are fairly easy to drive, but they require a pulse between 1 and 2 miliseconds long, about every 1/50th of a second or so. So the length of the pulse determines what position the servo will turn to – and they usually have ability to turn about a 180 degrees. So sending it a 1 milisecond pulse on the signal line will turn it all the way one direction (say counterclockwise) and a 2 milisecond pulse signal will turn it all the way clockwise. A 1.5 milisecond pulse will turn it about half way.
So these servos move to the position you call for and hold it there using the motor. But you have to send it a continual train of pulses because it will only move or try to hold position when it receives that pulse.
But let’s say you use a standard size hobby servo which delivers a torque of 8.5 kg*cm (120 oz*in). I spent the extra money and got the high torque version so it cost me $30. Let’s do some math and build a small mobile robot with an arm on board, similar to the bomb-squad robot, just a lot smaller. Let’s say we give it an arm 25 cm long. We mount the arm on the shaft of the hobby servo and that arm has now become a gigantic lever. The torque is 8.5 kg per centimeter. Our arm is 25 centimeters long, so we can only lift 8.5kg/25cm = 340 grams (120 oz / 10 in = 12 ounces).
But if we put something on the end of that arm, like a gripper which is also driven by a servo motor, and that whole assembly weighs 100 grams, then our payload capability has just dropped to 240 grams.
The end of arm assembly on this robot is probably pushing 200 grams. So if the root of the arm has a high-torque servo, I can still only lift maybe 140 grams!
So for a large robot project like the bomb-squad robot, sure I could use radio control – especially with the price of RC radios nowadays, for like, $50 you can get a multi-channel radio to control up to 10 servos, and it’s all plug and play. The problem is the use of hobby servos on larger robots. It’s expensive, and it honestly doesn’t work very well. There’s tricks you can pull off (which as I explain in course 3 Robotic Drives & Physics, is an important and often overlooked part of designing even industrial robots) like counterweights so that the servos can spend all of their energy on the load and not the weight of the arm and equipment itself. But if I were to build a larger robot like the bomb-squad robot and use off-the-shelf RC radio equipment, I would build my own servo drives that just responded to the standard servo pulses. That way it’s plug and play with the RC equipment and the drives can be as strong as I need them to be.
It is possible to hack some hobby servos, strip their electronics out and solder in your drive motor to the servo motor’s connections and mount the pot on the axis you’re driving. You have to be careful because your drive motor may draw more current than the original servo motor, so you can burn out the H bridge inside. But if you can pull that off, then you have a fairly easy to build, hardware-hacked servo motor drive that’s the power and size you need. Or you can simply pull out the positional potentiometer from inside the servo, mount it on your axis and hook up a larger gear drive system to the output of your servo. Just watch out you don’t get the rotation backwards between the pot and servo – otherwise it winds up in a loop trying to drive to a certain position, but the pot is reading that it’s turning it farther from the position. It’ll destroy the pot.