Designing an automatic chess board - Part 1

Designing an automatic chess board - Part 1
Photo by Amos K / Unsplash

At the start of the year, I found myself thinking about what kind of project would be worth committing to—something challenging, educational, and fun to build. After brainstorming multiple ideas and after much deliberation, I decided; the project that gets to take resource out of me to be automatic chess board. It'd be fun to play physical chess with computer or people sitting at the other side of the world. It'd be fun to see pieces move magically by themselves like in Harry Potter.

This article is the part one of build log and discusses the design exploration, architecture and project breakdown for an automatic chess board.

Defining the Requirements

The overall requirements for the projects are simple. I want a chess board where we play the pieces on the one side, the pieces for the other side move by themselves. Our movement is recognized by the computer, analyzed and it plays the next move.

It should also have a manual mode where other user is able to play a move online and it gets reflected on the board here.

The product should look like a finished product, standalone without requirement of external computer, Wi-Fi and such. Some features might need Wi-Fi like online play but the minimal version should not. At most, a USB C based power cable would be allowed. The board should be self contained, should not have camera, robotic arm etc sticking out and should not need a mobile app, it could be needed for some additional features but should not be a compulsory requirement.

Additionally, a stretch goal for the project would be doing chess puzzles and non standard chess games where rules are different and initial positions might be unknown.

And at least, project should also be economical. Definition for this is not strict but sub $1000 is must, ideally sub $500.

Breaking down the project

Moving on to the architecture of the project, the project requirement can be broadly divided into 3 major sub systems.

  1. Piece motion i.e. how the computer moves its pieces
  2. Piece Detection i.e. how the computer identifies my moves that is which piece has been moved and where
  3. Chess Engine and software integration i.e. how does the system calculate it's next move, the UI frontend etc.

Market Research

Chess as a game has existed for 1500 years. Automation has existed atleast for 200 years. Given that humans love to make interesting things, it's almost a fact that someone has built this earlier. Let's start by understanding how others are tackling this project.

Commercially, there are 2 categories of products. First, which recognizes your moves and shows their move using indicators like LED or on app which then would be played by you. Second, which plays their move using internal mechanisms. While there are a ton of first category boards, I could find only 2 major boards in the second category; Square off (now miko) Grand and Chessnut Move. To complete the list, there is also senserobot.

Apart from commercial products, there are multiple DIY projects doing the same on instructables, hacksterio, hackaday and personal blogs.

Mechanisms for movement

The first piece of the puzzle, how do the pieces move by themselves. This in itself is a big challenge but doing this eloquently, reliably and cost effectively pose another set of engineering challenges. As is usually the case with engineering, there are multiple designs to consider, trade offs to make and calculations to run. Let's list them down and then elaborate and compare them.

  1. Robotic Arm
  2. Robotic Pieces
  3. Subsurface XY Gantry
  4. Electromagnetic array

Robotic Arm

While technically feasible, this approach conflicts with the goal of a fully self-contained board and is therefore excluded from further consideration. I'd like everything to be self contained in the board and pieces. I'd like to avoid anything sticking out of the board. If I do decide to go with this approach later, all we need is a off the shelf robotic arm or build one of our own. Either way it is a no for this approach for now.

Commercially, SenseRobot Chess and Cynus by Manya does take this approach.

Robotic Pieces

If designed well, we can also put motors and wheels on the pieces themselves. This is what ChessNut Move does. While possible, the mechanism itself is quite complicated for it to be a short term DIY project. Also, the pieces would now need a battery and charging which is more hassle than I'm willing to handle for current scheme. Also, personally for me, the motion doesn't seem

Subsurface XY Gantry

Next idea comes by first embedding a magnet in each piece and then to have a robotic gantry below the surface and use electromagnet to drag the pieces to their position. This method is commercially being used by Square off Grand. Apart from this, this method is quite common in the DIY community. This is a good option to consider. The slight disadvantages of the method though is there is mechanical motion involved with motors which would be susceptible to damages when subjected to vibrations.

Electromagnetic Grid

The idea here would be to have magnet embedded within a piece again but instead of a mechanical motion, we'd have electromagnetic grid on the board and we turn on and off those to attract the pieces together. If we play with magnetic strength, we should be able to move the pieces on the grid. Now, this idea in concept should work but when we run the calculations, it seems to be on the border of possibility. Reason being, electromagnetic strengths are very weak and getting anything out of it needs high current and wire loops. But if achievable, it is an eloquent solution. Specially, if we are able to design these coils on the PCB, the manual labor for assembly also comes down significantly. Of course the trade off comes to design and engineering costs.

Commercially or DIY wise, I couldn't find a board which uses this concept, that may be for a good reason and it might not even be possible. Although, some project do explore the motion and make motors out of the same. This gives me some hope. I'd still like to give it a try.

Conclusion

Primarily, I'll be investigating the electromagnetic grid feasibility, do some prototypes and analyze the engineering challenges. If it doesn't work out, my backup method will be subsurface XY gantry.

Ideas for piece detection

The next challenge is for the board to detect which piece has been moved by the player and what is the new position.

Computer Vision

Similar to robotic arm during motion phase, certainly doable but not the approach I'd like to take. Having a camera sticking on the top is not desirable.

Position Change and Board State Machine

This method essentially consists of placing the pieces at a known starting position. Each square has a sensor, either magnetic switch or light based to detect only if a piece is present or absent on that square. Then by tracking which squares are turning off and which are turning on, we can deduce a piece from square X1Y1 has moved to X2Y2. After this move, computer can check what was the original piece at X1Y1 and whether the move was legal.

While being simple, there are 3 shortcomings of this system.

  1. The initial position of the board has to be known. The squares by themselves can't detect which piece is kept there, only if a piece is kept there and it relies on initial position for the rest. This also means non standard games and chess puzzles are not possible with this approach unless it is accompanied by an app.
  2. The board doesn't know by itself regarding piece promotion. Which piece has been moved to that position.
  3. If the player cheats or moves two pieces at once, there is no way to deduce that.

NFC based ID detection

The next idea would be to have NFC sticker on each piece and NFC reader beneath each square. The reader can detect the NFC sticker and thus which piece is kept on which square.

In theory, this could work but there are 3 major challenges.

  1. Cost, having one reader per block would be around $3 * 64 i.e. $150
  2. Antenna design, designing wave shaping antenna such that nearby readers are not triggered during movement will be difficult
  3. Antenna would need to work in EMI noise environment of switching coils

Board positioning

This would be something on the lines of co-ordinate tracking of the piece by some form of RF triangulation or microphone triangulation. It'd need a circuit and a battery on each piece and some detectors on board edges to find relative position of the piece.

I don't like the idea of putting a battery in each piece. This would bring maintenance concerns and the engineering behind this triangulation and filtering would be challenging for me considering the timeline. I'd explore this as a separate project.

Magnetic Signature Identification

Idea behind this is to put different strength of magnet in each kind of piece and then each square has a hall effect sensor which measures the magnetic field strength around that square. By isolating the magnetic field strength, we can classify the piece.

Challenge on this would be, magnetic strength is a very strong function of distance. So, a off centered strong piece could be identical to a centered weak piece which would be difficult to isolate.

Despite its challenges, the method is interesting enough to atleast simulate. The cost would be lower with just one sensor per square and engineering post simulation would be easier.

Electrical Identification

If we can make electrical contact between the pieces and the squares, we can make communication between the two. Something simplistic like measuring resistance between the terminal of piece or RC oscillations should be sufficient to identify the piece. The challenge though is making this contact while sliding the piece and making this contact reliably irrespective of how of orientation of how user places their piece.

Conclusion

For this, I'd start by exploring Magnetic Signature Identification. Based on if it works or not, my backup option would be electrical identification or at minimum position change and board state machine.

Other Considerations

Apart from the feasibility of these approaches, there are questions of geometry of the board and pieces, how would the knight move, construction methodology, manufacturability, cost, chess engine integration, UI integration, chess.com/lichess integration and such.

We'd keep these in back of our mind during the prototype and engineering stage and later do a formal study on these.

What's next?

Next phase for the project would be design calculations, simulations, engineering feasibility study. I'd run the numbers and simulations to figure out what could be worth exploring, what's the confidence range on the same and what are the dead ends. In the next 2 month, my target would be to complete this stage and move to engineering prototype of individual subsystem.

I plan to explore FEM for electromagnetic simulation, KiCAD for schematic and board design, some magnetic simulators by TI in the coming month.

I'd try my best to complete the project this year. Although as with many of long term endeavors, chances are I might abandon the project before I complete it. But even a partially completed project is a good learning opportunity. Hopefully, the journey matters more even if the destination is not reached.


Got feedback? Would love to hear them. Shoot them out at rishabhrkaushik@gmail.com