Week 6
In this week of E155 I learned to gain a kind of joy from reading the MCU reference manual. Upon first starting to think about the lab, I thought of various different ways to use the encoder signals to measure the speed. I realized that the main task boiled down to using the encoder signals to track the distance the motor traveled, and using a timer to create time intervals to check the distance to get a speed. I spent a majority of the time on the lab reading through the reference manual, especially in the advanced timer (timer 1) section. I ended up using the advanced timer in encoder mode, but some other options I considered were using timers in input captur mode to track the time between each signal or using a timer with the input exclusive, turned on to track the offset in time between the signals, or using the external interrupts in the MCU to create interrupts on the encoder signals. I ended up choosing the encoder mode method because this mode converted the timers counter value basically into a position for the motor if configured correctly. The counter also counted on bothing falling and rising edges of both signals, so there were four counts for every 1 encoder pulse. This meant the positional resolution on the motor was four times higher than tracking position by every encoder pulse. I also feel like another benefit of this method was being able to use another timer to track timer, and only access this position value on interrupts. This means that while the motor is running, the position timer will count and track the position regardless of what the cpu is doing, such as calculating a new speed or displaying it. The second timer will create an interrupt every 0.25 seconds, and thus the position can be read as close to 0.25 seconds as possible. Thus the distance tracking, time tracking, and speed calculations/handling can be done more simultaneously, which increases the accuracy of the two time dependent tasks.
In class we reviewed/learned about SPI and UART. It was nice to get back into these topics, and starting to think about them caused excitement within me for getting to learn how to use them in the upcoming labs. I also started thinking about my final project with my partner more this week, and I am already very excited with our idea. We plan to make a chess board that lights up the squares a piece can move to if you pick it up. There are other functionalities like making the board light up squares with a capturable piece red, and if we find early success maybe even something like a game tracker, where the board tracks the game and can say who won and lost. A cool very big stretch idea Prof. Brake had was to somehow find an embedded chess computer and then interface the board with it so that one could play the chess computer by making moves and then having the board light up the computers desired move. This is probably out of the scope of our final project, but would be a cool idea to return to in the future.