Close

SOFTWARE & PROGRAMMING

A project log for MatAir - A Robotic Spherical Chessboard

A spherical chessboard where a robotic arm plays moves from an online game.

nasserNasser 05/10/2025 at 17:070 Comments

With the mechanical and electronic parts assembled, we moved on to programming to connect the motors, servos, sensors, and user inputs.

We defined the main behaviors the system needed:

We wrote the program for an ESP32 using the Arduino framework. Since networking code ran in the background, all motion routines had to be completely non-blocking.

We used multiple state machines to control the cart, gripper, capture system, board rotation, manual controller, and screen.

We started with a simple test program for the controller. Using the two buttons, we sent signals to the actuators to confirm the mechanical and electrical systems worked

After that, we wrote a second program to control the actuators via serial commands from a computer. We used this to figure out the right angles and positions for each motor to reach every square on the board and the capture slots.

We used the Nextion Editor to build the touchscreen interface. It allowed us to:

Here are some screenshots:

The final motion control codebase was over 2000 lines long. It included:

Discussions