Mechanical advantage is one of the key principles of mechanical engineering and is what allows us to lift heavy loads or move instruments with incredible precision. The simplest example of mechanical advantage is a lever and fulcrum. Archimedes said "give me a lever long enough and a fulcrum on which to place it, and I shall move the world." Gearboxes work in a similar way to alter the relationship between speed and torque in a rotating shaft. Harmonic drives are special gearboxes with numerous benefits over traditional gearboxes, but they're expensive. That's why YouTuber 3DprintedLife designed a 3D-printable harmonic drive that costs less than $20 to build.
Harmonic drives are ideal for robots, because they dramatically increase torque and operate with very little backlash. Backlash is the "slop" is a drive mechanism, like a leadscrew or gearset, which reduces the repeatability and overall precision of a machine or robot. A harmonic drive achieves these feats with only three components: a wave generator, a flexspline, and a circular spine. The wave generator connects to the motor's output shaft and has an elliptical shape. The flexspline has outer teeth and is flexible, so it conforms to the shape of the wave generator. The circular spline contains a couple more teeth than the flexspline, but is rigid.
As the wave generator spins, it causes two points of the splines to mesh. But, because of the unique shape, the circular spline only advances by one tooth for every half rotation of the wave generator. So it gears down the output by a huge ratio. It looks like the flexspline is slipping, but really is rolling very slowly around the circular spline. And, because two opposing sections of the spline are always in contact, there is no backlash between teeth. Those factors are very desirable for robots that don't need to move at a high speed, but which need a lot of torque and precision.
While harmonic drives have few parts and those parts aren't expensive, they are still uncommon and usually only used for specialty applications. That makes them pricey. But 3DprintedLife was able to build his own using a standard 3D printer and a few pieces of off-the-shelf hardware. Most harmonic drives gearboxes are driven by brushless DC (BLDC) electric motors, but this one is driven by a stepper motor. 3DprintedLife chose that because stepper motors offer a lot of torque at a low price. When integrated into a robot, the use of a stepper could also eliminate the need for encoders.
3DPrintedLife went through several iterations before finding a design that performed well and that was durable. His final version is able to exert more than 10NM of torque through a 200mm long arm. After hundreds of cycles, it was still working well. Best of all, this DIY harmonic drive has very little backlash, despite being 3D-printed. If you want to build your own, 3DPrintedLife has shared the files on GitHub.