Build Smarter Servos with Servio

Tired of finicky servos and frustrating libraries? Then you may want to check out Servio and build your own smart servo motors.

Cameron Coward
4 months agoRobotics

Servo motors are desirable because, unlike steppers or DC motors on their own, a servo motor is a closed-loop system that knows its own position. That’s why they’re so popular for robotics projects. But servo motors can also be a headache to work with, as they generally require libraries with rather frustrating control implementations. Wouldn’t your servo-based projects be so much more pleasant if you could just send a simple text command over serial to set your servo motor to a specific position or to ask for its current position? Now you can, thanks to the Servio project.

Servio is an open-source servo design that includes firmware code and a custom controller PCB design. The most recent update shows that PCB fitting into a Hiwonder LX-15D servo motor enclosure (with a custom 3D-printed cover), but the same PCB should work for many other designs and sizes—or completely custom servo enclosures. The PCB is really small for exactly that reason. But it is also packed with useful hardware, which is what makes Servio intriguing.

That hardware starts with a microcontroller, which is an STM32H5. That’s a tad on the pricey side for a microcontroller dedicated to a single servo, but it is powerful and versatile. It drives the servo’s DC motor through a DRV8251A H-bridge that has an impressive peak current output of 4.1A (voltage is 4.5 to 50). It also has integrated current-sensing capabilities, which is a nice bonus that allows for a few different operation modes: current mode, position mode, and velocity mode. The build documentation goes into a lot of depth on this subject (particularly current-sensing), which is a good read if you’re interested in the intricacies.

The takeaway is that users can take advantage of all of that to control their Servio servo motors in a way that is much more intuitive than they’re used to, while still allowing for precision and performance. Earlier versions of Servio used a Protobuf-based communication protocol, but the most recent version has a simple text-based interface. Just connect your primary microcontroller to your Servio via serial (software serial is fine) and send a command, then get a response back with a confirmation or requested data.

For example, if you want to use the servo in the “normal” way for position control, just send the command “mode position X” (where X is the position you want). Servio will reply with a confirmation ([“OK”]) and then attempt to move to that position. Or you can ask Servio for its current position with the command “prop position” and it will return that information. There are similarly intuitive commands for all of the modes and functions.

While Servio has been in development for a few years now and seems to be performing well, it isn’t exactly polished yet. You can head over to the GitHub page to find the current files, but you’ll need some know-how to use them.

Cameron Coward
Writer for Hackster News. Proud husband and dog dad. Maker and serial hobbyist. Check out my YouTube channel: Serial Hobbyism
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles