If you have a good sense of balance, you can ride a unicycle or get on TV doing tricks with ladders. We don’t know if [Hanna Yatco] has a good sense of balance or not, but we do know her Arduino does. Her build uses the ubiquitous HC-SR04 SONAR sensor and a servo.
This is a great use for a servo since a standard servo motor without modifications only moves through part of a circle, and that’s all that’s needed for this project. A PID algorithm measures the distance to the ball and raises or lowers a beam to try to get the ball to the center.
Servos like this usually operate in radio control vehicles and they are very easy to drive. A pot coupled to the shaft generates a pulse that the servo internally compares to a pulse from the microcontroller. If the pulse is wider than the reference pulse, the motor drives in one direction. If the pulse is narrower than the reference, the motor operates in the other direction. Just how much it drives depends on how much difference there is between the two pulses. When the pulses match, the servo motor stops moving. This pulse arrangement is very simple to drive from a logic output on an Arduino or other microcontrollers.
The build details are a bit sparse, but you can see in the video the general layout, and she links to a similar project that inspired this one if you are looking for more details.
You can do the same trick in two dimensions if you prefer. Or perhaps you’d like to try using a time of flight sensor, instead.
Nice starter project, but it needs some work to get rid of the overshoot that causes the osculations. See https://www.youtube.com/watch?v=j4OmVLc_oDw
Okay, I hate to be “that guy” but I can’t resist this one:
Osculation
Noun
The action of kissing
A kiss
Funny, but I think we all knew precisely what [Dan] meant.
It keeps happening so it is plural, more than one osculation event, therefore osculations.
There is a term for people like you, “idiot”, and you are also a liar because you do not hate to be “that guy”, you enjoy it, well you did before I pointed out that “that guy is a self inflicted euphemism for “idiot”.
*ahem*
I love to be “that guy”, but
Oscillation, noun, number of ‘u’s present: 0.
I actually learned the word osculating in multivariable calc. You could say the sonar sensor and the ball osculate in the beginning of the video (when they touch), but we all understand what you meant.
Words are neat!
oscillation
I’m pretty sure anyone that programs control loops doesn’t have any problems stopping Osculations.
Unless they are very fat and like jumping up and down. ;-)
When the ball comes too near the senso the program could try to lower the arm to unblock the sensor
I prefer the ‘ol ping pong ball-in-a-clear tube controller. A 12v blower at the bottom of the tube and an ultrasonic sensor at the top. Use your PID and other control algorithms to hold the ball at a set-point. Very challenging and visually interesting.
I didn’t say this!
wat?
Re siluxmedia: Most ultrasonic sensors have a blind spot in front of them where the sensor reports that an object is farther away than it really is, I was using an ultrasonic sensor for a LEGO NXT that had a blind spot about 5 cm in front of it where it reported that a ping-pong ball was 20 cm away, and it was one of the better sensors in the entire class IIRC.
Then there should be a mechanical stop to prevent the ball from getting that close.
Nice. Now make one that can beat the “Shoot the Moon” game. That game has tortured me at various points throughout my life and would love to see a robot own it.
/me waits for the breakbeat remix with Kraftwerk music version video.
I jest, but the PID needs some work.
Looks like D gain is a little high… But way cool!!!