Category: Patrick’s Status Reports

Patrick’s Status Report for 12/10

This week I was able to sort out how to run the program on the RPi on start-up, allowing it to be used in headless mode.

We tried integrating Ryan’s part and my part today and ran into issues calling his python scripts from my program. The system() command frequently causes the entire Pi to crash. Ryan is attempting to work around this with another scripting tool, while I am trying to troubleshoot the system() command. We also found a small bug in the legality check that I will correct tonight. Otherwise, everything between the hardware and the firmware is working great.

Hoping we can fix everything up for the demo on Monday.

Patrick’s Status Report for 12/3

Over Thanksgiving break, I was able to rewrite the firmware with a new library. I ended up using the bcm2835 library after finding out that it still worked on the RPi 4, as it includes both GPIO and SPI functionality.

Vikram and I tested the board with the firmware. After working through some bugs, we are very confident in both the piece detection and legality checking aspects of the project. We also observed that the legality latency is very fast.

I also implemented a function to convert the last played legal move into standard algebraic notation (the most common format of notation). Ryan and I finalized the methods for sending this notation to the website.

After this week, I am back on schedule. I am confident that we will be able to finish integration next week.

Patrick’s Status Report for 11/19

This week I wanted to test my firmware on the RPi. Unfortunately, we discovered that the library I had used to write the RPi SPI and GPIO transactions, WiringPi, is no longer supported and we could not download it onto the RPi. I had to find other libraries – spidev for the SPI transactions and pigpio for the GPIO control.

Therefore, I rewrote the firmware to utilize these libraries. The new libraries are not as straightforward to use as WiringPi was, but I am confident that I understand them now and will be able to get the firmware working all the same. I also ordered some cables for the Pi that I didn’t have, so I can test the firmware with my Pi next week while we’re on break.

The lack of progress this week sets me a bit further behind schedule. That said, I will be staying in Pittsburgh over Thanksgiving break and will have some time to dedicate to getting this back on track. This combined with the slack time we have makes me still confident that we will finish on schedule.

Patrick’s Status Report for 11/12

We had the interim demos this week, which went well. We were able to get the firmware and board working perfectly, so our sensor demo functioned exactly as planned.

Once the firmware was working on the Arduino, I translated into the c++ that will eventually run on the RPi. This was not too difficult, due to the RPi SPI interface using the WiringPi library being quite similar to Arduino. However, there were some differences that I had to be sure I understood. I also took the opportunity to slightly rearrange the sensor read order – the Arduino firmware writes the sensor data into an array column by column, while the sensors are read row by row, which was confusing and a bit inefficient. The new c++ firmware is easier to read as a result. I was also able to finish implementing the output state logic for the legality check using the GPIO functions of the WiringPi library. The large remaining concern here is that my programs still have to be tested on the RPi itself.

I plan on testing my code on the RPi next week. Again, working on firmware integration took longer than expected, so I am about a week behind schedule. I will aim to get the code functioning so that user testing and remaining hardware testing can begin the week of 11/21.

Patrick’s Status Report for 11/5

This week, we decided on our goals for the upcoming design demo on Monday. Our goal for the hardware/firmware side is to be able to read the sensors on the chess board, accurately identify the state of each square (White/Black/No piece), and represent the board graphically (with ascii).

To that end, I spent all of my time this week working with Vikram to get the firmware working and debug the board and code. There were numerous problems that we had to fix, including incorrect SPI usage, a mismatch of the rows and columns in my code, poor connections on the board and more. All in all, we have the board almost entirely working, with just one remaining issue with a piece on square being read as being on two squares. We will tackle this issue tomorrow and hope to have the sensor reading perfect by Monday.

This integration and debugging work took longer than expected, and as a result I was unable to sort out the software interface with Ryan. This goal will be pushed back to next week. I am not concerned by this delay, because it is a lower priority aspect of the project (not needed for the demo) and we have plenty of slack time scheduled.

Patrick’s Status Report for 10/29

I spent this week working on the firmware, which will control the ADC and multiplexers on the board. I learned the basics of SPI, which is used to send/receive data with the ADC. I finished writing the control logic in the legality check program, and used a useful C++ library, wiringPi, to add in the controls for the SPI and GPIO pins on the Pi.

After writing most of that firmware, I realized that I don’t have a micro SD to load the program onto the RPi. I ordered one, but it won’t be here by monday to test with the actual board, so I am translating the program into an Arduino sketch. We can use this simple sketch program to ensure that the ADC, multiplexers, and sensors on the board are functioning as expected. Translating my C++ firmware into Arduino is fairly straightforward, as the wiringPi library was made to be similar to Arduino functions.

Overall I am on schedule, and next week I should be able to start working with Ryan on how to send moves from my program to his webapp/server.

Patrick’s Status Report for 10/22

During the week of 10/9 to 10/15, almost all of my work on the project was directed to the Design Review Report. It took several hours of writing and editing, and in the end I think we created a very thorough description of our design.

I have mostly used the week of fall break to relax, but I was able to spend some time researching and thinking about what I will do to implement the board’s firmware. The firmware will run on the RPi and communicate with the ADC over SPI and control the multiplexers with gpio logic signals. I have never used SPI before, so I read up on it a bit and found a C++ library that should make using it easier. I’m writing the firmware in C++ because I am already using it for the Legality Check software. I’ll hopefully be able to write the firmware next week and test it with the assembled board over next weekend.

All in all, I am on schedule and have no concerns at the moment.

Patrick’s Status Report for 10/8

All the class time this week was spent on Design Report presentations. Outside of class, I continued to work on the legality check program. I incorporated the legal move generation from stockfish 11, and it can now generate a list of legal moves given a position, and check the legality of a new move using that list. It remembers the previous position and can be reset to it (for the case of an illegal move being played). Currently, it takes moves in ‘pure algebraic coordinate notation’ as input (e.g. a3a8, which represents a piece moving from square a3 to square a8). I started working on the function to translate the output of the sensors to this coordinate notation. Next week I should begin work on the firmware, interfacing with the sensors through the ADC and multiplexers, and finish up the translation of boards to coordinates. I have the skeleton written already for the state logic to control LEDs on the board based on whether a move was legal or illegal, but I have to incorporate the interactions with the RPi’s GPIO pins with those functions. Overall, I am on schedule and have no current concerns.

Patrick’s Status Report for 10/1

Earlier this week, I decided on using Stockfish’s legal move generation and spent time reading through the Stockfish source code and understanding the interactions of different structures and functions. I worked on incorporating their move generation into my legality check program, and will continue on this next week. Also, I decided to store moves as piece source and destination squares in the legality check to easily interface with Stockfish. The current plan is for Ryan’s database/web code to translate these to notation. This leaves me on schedule for the legality check and firmware development.

Our test batch of magnets and sensors arrived on Thursday, and I tested them with Vikram today. We tested 7 different types of magnets with the bimodal hall-effect sensor. The resulting output voltages are shown in this table.The bimodal sensor outputs 5V for a high strength magnet. As you can see in the chart, our highest strength magnet only resulted in a 3.4V output. We learned that our calculations for magnetic field strength at a small distance from the surface gauss and the height of the magnet were above the real quantities. From this, we know we have to find some stronger/larger magnets to buy if we want to distinguish between piece types. We should have an order in for those by Tuesday, and can do some preliminary tests with them inside the chess pieces next weekend.

Patrick’s Status Report for 9/24

Class time this week was entirely devoted to the proposal presentations. I’m thankful for the questions I received after the presentation, as they got us to think about areas of the project that we had overlooked and solutions we hadn’t considered. Outside of class, I created a short list of options for magnets that would fit in our chess pieces and weren’t too expensive.

I tried to find options that cover a large range of magnetic field strengths (about 2000 to 15000 surface Gauss), so that we can buy some from different ends of the range to test the sensing before committing. I worked with Vikram to narrow down this list to 3 different magnets, based on what we think will work best with the hall effect sensors he found. I have also been working on the legal move generation algorithm and notation list, and I hope to finish it next week. This puts me slightly behind schedule, as I had hoped to finish legal move generation this week. However, I have plenty of time to finish it by Wednesday and so shouldn’t have a problem getting back on schedule, with the legal move generation and legality check program done by next weekend.