To download code and more info:
[ Ссылка ]
I used Arduino as a PID controller to balance a small ball on a 4-bar mechanism.
An ultrasonic sensor detects the position of the ball.
A PID code is used to compute the angle of the servo motor based on the position of the ball.
I used Matlab to plot the position of the ball vs time.
Parts used:
- Arduino Uno
- Ping))) ultrasonic sensor
- 20 Kg.cm Digital Servo Motor
- 5 V DC power supply
![](https://i.ytimg.com/vi/y5Hmr-rR-yk/mqdefault.jpg)