Skip to content

Introduction

Eng. Lenny Ng'ang'a edited this page Jul 22, 2020 · 6 revisions

This is a simple 1-Axis Ball Balancer. A spherical Object (preferably a ping-pong ball) is placed on a beam attached to a servo on one end and an ultrasonic sensor on the other end. The objective is to always make sure the ball is at the center of the beam. The original inspiration for this project came from Electronoobs YouTube Channel, especially the series about PID Controllers.

This project is meant to take you through my journey as I learn about PID Controllers and implement them in a project. I will try to document every single step right from research stage to my thought-process and eventually optimizing the project. (making it run more efficiently)

Before getting into all the complex controls and stuff, the first thing I did-after building the mechanical contraption-was write software that checks the overall function of all the included sensors and actuators Simply put it, I wrote an Arduino program that reads the Ultrasonic Sensor to check that it is working as it should; the program also moves the servo up and down between 30 and 130 degrees to ensure the arm/lever/beam was moving up and down freely and thus allowing the ping-pong ball to roll along the lever freely. Code : Demo_Code/Basic_Test/Basic_Test.ino

Basic Test Results

After uploading the code to the Arduino, everything seemed to be working fine. But when I opened the serial monitor, I noticed a HUGE problem. As expected, any kind of project usually has some technical issues/glitches/bugs. The following are the immediate problems I discovered:

  • The Ultrasonic Sensor was recording inconsistent readings - I reasoned that maybe the ping-pong ball was too small such that the ultrasonic waves were being reflected irregularly on the ball's surface
  • The lever/arm 'struggled' at times to move (oscillate) - I clearly observed that the mechanism I used to attach the Servo to the Arm was the cause.
  • The Servo was 'jerky' i.e the servo's movement was not smooth at all! - Maybe the power supply is 'dirty'?

After some time of thinking, I came up with the following proposed changes/modifications to improve the system's performance:

  • Use a bigger spherical object - since I didn't have any other ping-pong balls, I thought of using household items such as potatoes, onions & tomatoes. This would hypothetically solve my first problem since the ultrasonic waves would have a larger surface to reflect on.
  • Changing the mechanism that attaches the Servo and the Arm/Lever/Beam - This was the only solution that would work for the second issue; Furthermore, I made the linkage stronger so as to enable the contraption withstand heavier spherical objects such as onions.
  • Using a 'clean' 5V power supply would, in my opinion, be the solution to the jerky movement of the servo.
  • At this point, I am also considering revisiting the code; maybe some of these problems are software-related!?

This Project Has Been Postponed Until Further Notice!

I couldn't get the Ultrasonic Sensor to work as it should and therefore the project cannot proceed. Until I get my hands on a better proximity sensor (or a better way of implementing feedback), this project is PAUSED

Clone this wiki locally