Itβs from the YouTuber James Bruton, and he says it will make your robots more organic! For example, when using the Arduino servo library, which can control up to 12 servos using one timer (on the Arduino Due you can control up to 60, apparently)β¦
James writes:
βThere are lots of great animatronic and robotics props and projects out there, and itβs easy to make r/c servos and other actuators move using the Arduino servo library. This means that the servos stops and start very suddenly, moving as fast as they can between positions. In this video Iβm going to show you two lines of very simple code to make things smoother.β
To demo it, he creates β via 3D-printing and an Arduino Uno β an animatronic device with two big, cute eyeballs, each on their own pivot (moving left and right only). The eyelids share the same pivot point and there are three servos in totalβ¦.
Basically, he takes 5% of the new value read from a switch and 95% of the previous value read, slowly decelerating movementβ¦
CAD and code for his servo motion smoothing demo can be found on GitHub.
And you can see it in action in the video below. Very impressive it is, too.