Tuesday, February 28, 2017

Spring 2017 Week 5

This week, I was able to meet up with the software/mobile application team in order to ask them for help with the code. As expected, instead of putting all the functions into a while loop that also contains the pathing, Tim and Johnny on the software/mobile application team suggested that I try a different method. Fortunately, they were kind enough to help me with that, and came up with the idea of using stack arrays instead. 

Therefore, I was able to learn both something new and useful because I was able to get the pathing code working as it did before, but this time by using stack arrays and without blocking other code. I would post the code onto here, but it would be extremely long because it involves a lot of nested functions in order to accommodate all 12 paths that are possible on the track. However, the code works by creating a stack array based on the path assigned to the pod car only if the stack array is empty and a path is given. Then the pod car would switch (or not switch) based on the values in the stack array (0's and 1's) and pop off the end value of the stack array every time the pod car detects a magnet. 

Now that we finally have a method of pathing without blocking all other code, we are ready to integrate all our functions together. Hopefully, there will be little to no issues during integration even though it is very unlikely.

Tuesday, February 21, 2017

Spring 2017 Week 4

This week has involved more coding on my part in regards to pathing. As mentioned last week, problems in integrating pathing with the rest of the code would most likely arise. Unfortunately, I was correct. I found that because I used a while loop in order to "hold on" to an array or to make sure the code stays on the array that we assign it, every other function does not run until the while loop has ran its course.

However, a solution may be to put the rest of the code that needs to run simultaneously into the while loop. This may sound very excessive, but this simply moves a majority of the code into the while loop. In addition, break commands can be used to break out of the while loop in cases where it is needed. For example, if the pod car is sent another path while in the middle of another path, the code would break out of the while loop and restart with the new path.

I am sure there is a better solution to this issue, but this is the only one that I could think of currently. In addition, I must consult with the software team to make sure that this would not cause any problems with their phone application. Depending on their answer, I can either advance with the solution I thought of or simply continue working on a different solution. Perhaps, I may be able to ask for help from Dr. Furman or the software team if it comes down to it.

Wednesday, February 15, 2017

Spring 2017 Week 3

This week, I worked more on the pathing code. Last week, I was able to get the code to switch the servo based on an array, but the code was very simple and all it did was get the servo to switch based on an array that it was assigned. Therefore, the code was not sufficient enough for pathing because it would simply switch the servo back and forth regardless of whether or not the hall effect sensor detects a magnet. Fortunately, I was able to make significant progress with the code this week. The code is now capable of taking any array or path and switch the servos based on whether or not the hall effect sensor detects a magnet.

As such, the next thing to worry about is getting this piece of code to work with all the other functioning code. Although I am positive that there will be some complications when trying to integrate the pathing code, I hope it is minimal.

Tuesday, February 7, 2017

Spring 2017 Week 2

In the last two weeks, I had met up with Luis, Chris, and the Software team in order to discuss what needs to be done this semester. Issues that may arise along the semester were also addressed. For example, it seems the positioning team is slightly behind so the vehicle controls and software must plan ahead in the case that the positioning team is unable to finish their work by Maker's Faire. 

For the most part, I will be assisting Luis and Chris with the code with regards to pathing and motor control. So far, I have been testing a psuedo code for pathing that utilizes arrays. Each path is assigned an array of 1's and 0's, which tells the pod car whether or not to switch when the "smart" sensor on the right side detects a magnet. 

Although my team and I only have to worry about writing the code for pathing and motor control, we must still finish in a timely fashion such that there will be enough time to resolve any issues that may arise.