Working Principle

Basic Mechanics


Maintaining an Upright Position:

Ball-E’s motors and battery make up most of its overall weight. They are located in the lower hemisphere, thereby lowering the effective center of gravity of the sphere, allowing Ball-E to remain upright. This is critical to prevent the interior components of Ball-E from wobbling or flipping, which would hamper the proper functioning of the camera and subsequent controls.

Forward Motion:

Ball-E rotates by 2 DC Motors that provide 2.35 Nm of torque each, that are connected to the external sphere, rotating the sphere at once. Based on the final weight of the completed prototype, Ball-E weighs around 3 kg. Assuming that coefficient of static friction is 1, the static friction experienced by Ball-E is 29.4 N. Based on a diameter of 25 cm, the required torque is 3.68 Nm. Based on our calculations, the 2 DC Motors can produce sufficient torque (4.7 Nm) to move the ball from rest.

Change of Direction:

Ball-E contains 2 Nema Stepper Motors with angular division of 1.9 degrees, that are connected to an external 600g masses. At the upright position, the two weights are exactly on the same vertical line as Ball-E’s centre of gravity. However, by using the Stepper Motors to precisely control of the amount of tilt of the masses, Ball-E is able to alter its centre of gravity and tilt in the required angle, enabling it to move along a curved path. The greater the angle of tilt, the sharper the curved path made by Ball-E.


Software


 

Arduino Code for Joystick Control:

The Arduino code will convert the joystick values into meaningful directional commands. For example, if the joystick is pushed forward, backward, left, or right, the arduiono is able interpret those values, determine the desired motion and adjust the output of the various motors accordingly. This allows the user to adjust the desired speed of the ball and its direction of motion. The loop function will continuously read the joystick input, process the commands, adjust the DC motor speeds, and activate stepper motors for directional changes as required. Overall, the Arduino code acts as the brain of the ball, constantly interpreting user inputs from the joystick and producing the desired output.

Computer Vision:

The AI algorithm was trained on recognising and keeping track of moving objects. Through a mounted camera within Ball-E, its specific task was to follow a shoe and reposition Ball-E to follow the shoe.

The process of how the computer vision works is as follows:

  1. Object Detection Training: The first step is to detect the shoe within the camera’s field of view.  In this case, the algorithm will be trained to recognize the shoe as the target object by feeding it 1200 labelled images of the shoe.
  2. Camera Input and Image Processing: The robot’s camera captures the live video feed of its surroundings, including the shoe if it’s visible in the frame. The captured video frames are processed by the Jetson Nano, which analyzes the color distribution and features to identify the shoe within the frame.
  3. Object Tracking: Once the shoe is detected in the first frame, the tracking algorithm comes into play, creating a bounding box around the shoe and tracking its movement across subsequent frames in the video.
  4. Motion Control: Based on the position of the shoe within the video frame and its movement direction, the robot adjusts its movement thorugh appropriate commands sent to its motors to keep the shoe in the center of the frame.
  5. Feedback Loop: The process becomes a feedback loop where the camera continuously captures video, identifies the shoe, tracks its movement, and the robot adjusts its motion to keep following the shoe.