BaBot began as a high school project in 2018, initially using a computer and overhead camera for ball tracking. After several iterations, including a Raspberry Pi version with a camera beneath a transparent plate, I developed a more efficient design. The current version utilizes IR sensors and an ATmega32U4 microcontroller, resulting in a more compact, affordable, and user-friendly robot.
Step 1: Order Your PCBsTo make things easier and more reliable, I highly recommend ordering the PCBs pre-assembled, especially since they contain a number of SMD components.
π You can order the assembled PCBs directly from PCBWay.
Alternatively, if you'd like the most seamless experience, you can purchase the complete BaBot kit (with all components included) from ba-bot.com. That way, you skip the hassle of sourcing individual parts and can focus entirely on building and enjoying your robot.
Step 2: Print the 3D printed parts
Step 2: Print the 3D printed partsAll the structural parts of BaBot can be 3D printed. Make sure to use a printer that offers high precision, particularly for the parts that interface directly with the servos. All the parts can be found on Thingiverse.
Step 3: Assemble the Arms and ServosOnce your 3D printed parts are ready, start by assembling the three arms and attaching them to the MG90S servos.
Step 4: Assemble the BaseNext, mount the servo arms onto the base. This structure serves as the foundation of BaBot, supporting the electronics and handling the balancing mechanism.
Step 5: Mount the Top PlateNow attach the top acrylic plate to the second PCB.
Step 6: Upload the CodeUse the Arduino IDE to upload the firmware to the ATmega32U4 microcontroller on the PCB. The code is open-source and available on the GitHub page. The code is already commented to help you understand how it works, and more detailed explanations will be added to ba-bot.com once the project is fully finalized.
How It Works ?When you place a ball on BaBot's transparent plate, a sequence of events unfolds:β
- Infrared Detection: Beneath the plate lies a secondary printed circuit board embedded with numerous infrared (IR) LEDs and IR phototransistors. These IR LEDs emit light upward, which reflects off the bottom of the ball and is captured by the phototransistors. This setup allows BaBot to accurately determine the ball's position on the plate in real-time.β
- Infrared Detection: Beneath the plate lies a secondary printed circuit board embedded with numerous infrared (IR) LEDs and IR phototransistors. These IR LEDs emit light upward, which reflects off the bottom of the ball and is captured by the phototransistors. This setup allows BaBot to accurately determine the ball's position on the plate in real-time.β
- Data Processing: The position data collected by the secondary PCB is transmitted to the main PCB, which houses an ATmega32U4 microcontroller, similar to the one found in the Arduino Leonardo. This microcontroller processes the data using a PID (Proportional-Integral-Derivative) algorithm. The PID algorithm calculates the difference between the ball's current position and the desired target position (typically the center of the plate).β
- Data Processing: The position data collected by the secondary PCB is transmitted to the main PCB, which houses an ATmega32U4 microcontroller, similar to the one found in the Arduino Leonardo. This microcontroller processes the data using a PID (Proportional-Integral-Derivative) algorithm. The PID algorithm calculates the difference between the ball's current position and the desired target position (typically the center of the plate).β
- Calculating Plate Tilt: To correct the ball's position, BaBot must tilt the plate appropriately. This involves solving inverse kinematics equations to determine the precise angles needed for each of the three servo motors to achieve the desired tilt.β
- Calculating Plate Tilt: To correct the ball's position, BaBot must tilt the plate appropriately. This involves solving inverse kinematics equations to determine the precise angles needed for each of the three servo motors to achieve the desired tilt.β
- Actuating Movement: The calculated angles are sent to the servo motors, each connected to articulated arms ending in metallic balls. These balls serve as joints and are magnetically attached to the underside of the plate, allowing smooth and responsive movement.β
- Actuating Movement: The calculated angles are sent to the servo motors, each connected to articulated arms ending in metallic balls. These balls serve as joints and are magnetically attached to the underside of the plate, allowing smooth and responsive movement.
- Continuous Feedback Loop: After adjusting the plate's orientation, the system re-measures the ball's position, and the process repeats. This feedback loop operates approximately 30 times per second, ensuring the ball remains balanced on the plate.β
- Continuous Feedback Loop: After adjusting the plate's orientation, the system re-measures the ball's position, and the process repeats. This feedback loop operates approximately 30 times per second, ensuring the ball remains balanced on the plate.β
This seamless integration of sensors, control algorithms, and mechanical components enables BaBot to perform real-time ball balancing, offering an engaging demonstration of robotics and control systems in action.
BaBot offers a hands-on experience in building and understanding a real-time control system. Its open-source design encourages experimentation and learning, making it an excellent project for both beginners and experienced makers.β
For those interested in exploring BaBot further or obtaining a kit, more information is available at ba-bot.comβ
Whether you're a teacher seeking an engaging classroom project, a student eager to delve into robotics, or simply someone who appreciates innovative gadgets, BaBot is designed to captivate and educate.β
No prior experience is necessary, just a curious mind and the enthusiasm to build something remarkable.β
Comments