Coming from software I’ve always wondered what it was that made robots so expensive. It always seemed like it shouldn’t be hard to write a program that says “turn a servo 30 degrees clockwise” or “rotate this thing at 100RPM” and that there should exist some standard way to do this accurately.
Unfortunately it’s not that simple and the hardware components cause a dramatic increase in cost.
One major cost in robotics is precision movement.
RC Servos are the main movement mechanism used in hobby robotics and the first entry point I had trying to build a steering mechanism for an off-the-shelf driving platform. One big problem I had (and have with cheap RC car kits) is that your steering angles are just not accurate. Now if your goal is autonomous vehicles then you can use software to compensate, especially at higher speeds (small angle adjustments translate into relatively large trajectory changes) but a huge problem is driving at slow speed. I’m not interested in autonomous racing, personally, so my RC car drives around my living room at slow speeds. And slow driving kinda sucks with RC servos.
Here’s some idea as to why: when you first start working with servos you realize that you tell them to go to some position and they get there with +/- a degree or two of error. This is because the internal circuitry uses a potentiometer to ascertain whether the position was correctly reached and potentiometers can be wrong or your control loop can decide “eh close enough” and stop trying.
A worse case: the potentiometer gets bouncy readings and your servo is ping-ponging between positions at a very small scale. This is called servo buzz and is commonly accepted among hobbyists as something that happens. It’s “only problematic if it’s drawing too much power” and “reduces servo life but over a long time so whatever” according to hobbyists.
- I don’t like the noise.
- It’s busted one of my servos already.
- This inaccurate positioning is really not helping my personal project.
Servos are what, like $2-50 a piece? (Protip: ServoCity is really great for a large selection of servos vs Polulu and Adafruit.) I thought “surely there must be a better way.”
Turns out there are a few ways to get improved positional and small-movement performance.
- Digital Servos: Unlike analog servos which operate at the PWM frequency (usually ~50Hz) digital servos contain a built-in microcontroller that takes the PWM input and converts it into a higher frequency output for the actual servo (say ~300Hz). This reduces deadband (slow response/torque in servos). We use analog servos because they’re more cost and power efficient, but in cases where you need control digital servos are the way to go.
- Coreless / Brushless Servos: Unlike your typical servo which uses a brushed motor, these are capable of faster acceleration and deceleration. Coreless servos achieve this by lowering the weight of internal components (no armature vs cored servo), and brushless servos achieve it by adding a small brushless motor to the servo which just has more torque and power vs your standard servo motor.
That said, to get precise control you really need your controller to get some feedback from the servo itself.
Analog Feedback Servos
Your typical RC servo knows its position based on its internal sensor and is a closed system with respect to whatever you’re using to drive the servo. Thus if the sensor is broken, your program will always behave incorrectly because it assumes the sensor / your servo is functioning properly and not wrong.
Enter analog feedback servos. They give some feedback to your microcontroller about whether the servo did what you told it to. Instead of fire-and-forget, you can now get an ACK.
Note that the system can still be broken. The servo could send erroneous signals (basically a false ACK) and your system would still be busted. But by getting realtime feedback about what your servo is doing you can make the thing more robust.
More robust seemed to come at high cost (you need to write code to deal with the feedback, and you need to connect the analog feedback pin to something to translate it to something you can read digitally). Too much work still without solving some problems.
Robot servos have built-in microcontrollers to get very accurate positioning and more than a single sensor: they have sensors to track speed, position, temperature, voltage, and load. More sensors = more cost. They also tend to have more power (higher torque) which means more/better gears and motors (both cored / coreless).
They put a microcontroller abstraction between you and the physical servo, so instead of your device / servo driver board communicating directly how to move the servo using PWM, you end up communicating with robot servos through a data link, typically TTL serial (using a UART - universally async receiver and transmitter, serially so 1 bit at a time, at a certain rate usually 115200bps).
So, like in software and all other things, you can pay more money to have people provide complexity lower in the stack.
Traditionally robot servos are very expensive but they’re getting cheap enough for hobby use now. A very popular hobby robot servo is the Dynamixel AX-12.
Before you go and buy a few of these, remember that just like servos can use a servo driver board to provide power and PWM signals in a standardized / easy way, robot servos need boards for power (generally 12V+) and control (a board with TTL) as well.
Absolute Encoder vs Potentiometer
Now, you’ll notice that the implementation of the popular Dynamixel AX-12 also uses a potentiometer, much like many RC servos. Yes, it’s a higher quality one but it’s suceptible to all the same problems.
Dynamixel has another line of affordable robot servos, the MX line, which uses optical position encoders. This makes it less susceptible to noise, dirt, and temperature.
For my purposes the less-robust AX-12 is more cost effective but if I were building something that were going outside a lot or for very heavy use I might opt to choose one of the MX servos.
Robot Cost & Degrees of Freedom
One of my friends was on battlebots and in passing mentioned the extraordinary cost of a battlebots robot. These robots have to have agility, robustness to vibration, temperature, and debris, and raw power for destroying other robots. Also: if you can’t find the enemy robot, you can’t kill the enemy robot, so you better be sure your controls are accurate enough so that you can make the robot do what you want it to. Of course battlebots is a bit exceptional in that teams care far more about power than precision (you’re not building a dish-washing robot) so they tend to skew their dollars toward high voltage power supplies, custom welded parts, and motors that tear it up.
I’m on the other side of the market, dreaming about high-precision machines, so I played around with ordering robot servos and it helped me understand why robots are so expensive. Some robot servos are $500+ offering tremendous torque and resilience to inaccuracy. The connectors for these servos and the power supplies factor in another $100 at least (to power maybe 2-5 of them). Depending on how many degrees of freedom your robot needs, you can see how movement alone would be pretty costly. Each servo is not a simple motor; robot parts each have their own brain and everything is linked together with some high speed interconnect.
TL;DR robots cost money and I drooled over robot parts last night.