Week 3: September 11 17 - ngetachew/Portfolio GitHub Wiki
On Monday, I worked on the PiJuice Battery with Mr.Fabre. We were looking for a way to make the board safely shutdown when power was disconnected, or in other words, unplugged. This is because when he have projects running during showcases, unplugging it would only cause the board to change power sources, and the Pi would continue running. Although this battery system was new, there was plenty of documentation available on GitHub, and thankfully, PiJuice has easy-to-use event handlers in its GUI. I was able to link the "no power" event to a python script I wrote named Shutdown.py(available on GitHub in the PiJuice repository). This script would blink 2 LED’s to signify the start of the shutdown sequence, then wait 8 seconds, then safely shutdown the pi.
For the remainder of this week, I worked on the Perpetual Motion machine. The first problem was the hardware. The hookups were not well documented, so it took us a few days to connect everything in the correct ports. Next was the software. The problem was that the RpiMIB and Stepper files were updated to use camel case instead of underscores, which caused a lot of syntax errors. After that was working, we spent two days trying to fix quirks and bugs in the code. The biggest of these problems was an error in the Cyprus board that caused it to send PWM signals to different pins than we were writing to. We resolved this by using the logic analyzer to figure out which signals were going to each pin. The PWM signals also caused problems with the servo gate, but we fixed that by changing the frequency.
Our most recent addition to the software was the utilization of the sensors. We created a new button that moved the ramp from the bottom to the top based on the sensor readings. The problem we encountered was that the ball wasn’t properly triggering the top motion sensor, so the the stepper motor kept running past its limit. Unfortunately, this is a hardware issue, so it is out of our hands.
