Hackster is hosting Hackster Holidays, Ep. 1: Welcome & Giveaway Drawing. Watch now!Tune in to Hackster Holidays, Ep. 1 now!

Koshiro Robot Creator's STMicro STM32-Powered Board Turns Hobby Servos Into Smart Servos

Cheap hobby servos get PID control and low-pass filtering in this cost-conscious upgrade project.

Gareth Halfacree
9 days ago β€’ Robotics / HW101

Pseudonymous roboticists "Koshiro Robot Creator," hereafter simply "Koshiro," has built a smart servo driver based on an STMicroelectronics STM32 microcontroller β€” and designed to turn low-cost hobby servo into a smart device without breaking the bank.

"By replacing the driver of an RC servo like the SG90, you can easily an inexpensively upgrade it to a smart servo," Koshiro explains. "So what can it do? Typically, RC servos perform on simple proportional control, but with an [STMicro] STM32 microcontroller we've added PID control and low-pass filtering to achieve smooth, vibration-free movement."

Make a low-cost hobby servo feel like something from the top shelf, with this clever controller add-on. (πŸ“·: Koshiro Robot Creator)

Proportional integral derivative (PID) control works in the opposite way to a simple, non-smart output: rather than sending a fixed signal and hoping you get the result you're after, a PID controller targets something in particular β€” in this case, the position or movement of a servo motor β€” and adjusts the output in order to achieve that goal. Low-pass filtering, meanwhile, remove high-frequency signals that could lead to a jittery servo.

"Moreover," Koshiro continues, "it supports I2C communication, allowing you to read the current angle, speed output, and more from the servo motor. You can also set the maximum torque and adjust the gains of the low-pass filter and PID controller."

Koshiro goes into considerable detail on the design, and demonstrates its use connected to a Raspberry Pi 5 single-board computer, in the video embedded above and on their YouTube channel; example Python programs, the STM32 code, and Gerber files for the PCB are available on GitHub under the permissive MIT license.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles