r/arduino • u/ALMA_x11 • Oct 22 '26
Microcontroller Driven SR04 Actuator (PID)
My youtube channel is ALMA Industries
This is a short demo of an actuator I put together (on my channel, video is titled CH003 FN1: ACTUATOR). The actuator is first sketched out, 3D printed in pieces, assembled together, and controlled via PID running on a microcontroller. Ultrasonic distance sensor is included in the close-loop feedback system to prevent the actuator from running into the ceiling (shown in the second half of the clip, and discussed more in the full video).
There are a few modes. The first is 'don't touch the ceiling' (Ultrasonic Distance Sensor to keep a distance from the wall, hand, etc). The second is to have the actuator distance sensor follow a second distance sensor...so when one goes up the other follows going up, and when one down the other down.
Comments, questions, or new ideas are welcome.
3
u/Civil_Firefighter832 Oct 22 '26
Nice closed-loop demo. Question on the SR04 in the loop: it updates at maybe 20-30 Hz with real multipath noise off angled surfaces, so are you filtering it (median of 3-5 pings or a low-pass) before the PID sees it? And how do you handle its blind zone below about 2 cm - does the controller saturate if the target gets that close? A slew-rate limit on the setpoint is a cheap way to kill overshoot if you're not already doing it. The follow mode with two sensors is a neat idea; cross-mounting them at slight angles would tell you whether the echoes interfere.