Tuesday, March 21, 2017

Week 7

This past week, I began to test with my team both the bench model that we have had with us all project year long and also with the model mounted on the podcar. With the deadline coming up, our team decided to meet up over the weekend at the shop to work on the project and test out our system on the provisional track while the track team builds the rest of the track. This past Sunday proved to demonstrate to us that there is a lot of fixing that must be done not only to our system but with other team's work as well. The track has some details that need attention in order for our system to run smoothly without having to worry that the podcar will get stuck on the track or will fall off.

In addition, Tim from the mobile app team and I have been in constant contact with regards to implementing his system into our system so that he can control all of the podcar's features. On Sunday, I was amazed to see that he was able to control the speed of the motors as well as control the indicator depending on what color the LED should be lighted as. I still have yet to see that the kill switch works as it is supposed to as well as stopping the podcar if there is an obstacle in front of it. Not much as been done to the code at this point since the app team is making modifications to the code so that they are able to control the system from their computer through the use of Xbees. At this point, I am just hoping for the best and hoping that our project is satisfactory enough to have something to show for at Paseo two weeks from this coming Saturday. We will see what happens in the next coming week which means a whole lot of debugging, fixing, testing, and making fast changes to our design.

Tuesday, March 14, 2017

Week 6

This past week, our team had our first presentation. We felt like we did well on it and hope that our confidence is reflected from the feedback that Eric will give us. Besides the presentation, my team went back to work on the project since the deadline to finish the project is coming up. Chris was tasked with building the rest of the prototype boards and any 3D printing so that we can have these done when testing on the track is ready to begin. Steven and I needed to get the encoders working so that we can set a speed appropriately instead of trial and error. We also needed to start integrating pathing and the controls systems together so that we can start integrating the app team's work.

I was not able to get anywhere with the encoders. I am getting encoder counts but I am not sure what to do with these counts. I know that to find the speed in rpm, we need to the find the difference in the encoder counts in a set time interval and divide that difference by that time interval. The formula for speed is the basic distance over time formula. At this point, I will have to seek help from my teammates and maybe seek the help from Dr. Furman since he does have experience with encoders. This encoder work has left me stumped and frustrated but I am hoping that I will get the help I need to measure a speed from the encoders.

Besides the encoders, I decided to start the process of integration since my work got halted with the encoders. I wanted to at least get the hall effect sensor that will switch the lever arm when it detects a "dumb" magnet to work since the podcars will be in motion at all times without any destination set until a station number is sent to a particular podcar. Since the podcars will be moving around the track, the app team requested that we set four checkpoints on the outer corners of the track on the outside loop so that they know which route is the quickest to get to a station. I have incorporated four more RFID cards that will cause the podcar indicator to light the LED blue as it passes the card.

With less time to work on the project, my team and I are beginning to stress out because there is still much to do in such a short amount of time. We are just hoping that our system will work and that our effort was not wasted into getting a controls system that will actually work reliably and efficiently. With few time left to work on the project, I will continue to integrate the systems together and start testing with the other subteams as soon as our team has a part of the track built.

Tuesday, March 7, 2017

Week 5

This past week, I was tasked to build a bench model for the app team as requested since they will begin testing their work with it. We encountered some complications while building the bench model but were able to fix it. I gave the bench model to the app team last Friday and showed them how to connect the rest of the components. I built the bench model so that the orientation of the components can only fit one way without them having to doubt themselves on how the component should go on the breadboard.

Along with building the bench model, my team and I were mostly busy preparing for the presentation that we have this week and writing the paper that is also due this week. Unfortunately, these assignments have halted our progress in the project but will immediately resume our work after the presentation. We are almost ready to test but we need to integrate Steven's and my work together so that we can also test the app team's work with our work. Time is almost up and I am hoping that everything runs smoothly with little debugging needed. Unfortunately, that may not be the case but we need to put in all of our effort now more than ever to finish this project. We need to have patience and we need to help each other succeed because in the end this will all reflect on how the 1/12th scale team did overall.

In the coming week, I will be working with Steven to integrate the whole system together as well as getting readouts on the speed of the motors. We will also begin testing so that we have enough time to debug our system. Simultaneously, we will also work with the app team to integrate their work with ours.

Wednesday, March 1, 2017

Week 4

This past week turned out to be an unsuccessful week on my part. I was unable to get the encoders to work properly to return a speed based on encoder counts from both of the motors. I had to have knowledge on using interrupts to acquire the speed while other code is running. I am hoping my team can provide some support this coming week because I feel frustrated knowing that I tried and could not get an end result for my team.

I was also unable to send commands through the Xbees to simulate what I think the mobile app team will be doing with the app. I researched through different forums and examples online but I was not able to send information through an Xbee and get it to receive on the other Xbee and display it on Serial Monitor of that microcontroller from the receiving Xbee. For the mean time, I postponed any progress on the Xbees since our team will be focusing on integrating our whole system as a whole including the encoders this coming week. I also want to know how the app team will want to use the Xbees to communicate between the microcontrollers and their database on Processing. I feel that our team will be doing a lot of debugging when we start to integrate our whole system together.

In the coming week, I will be preparing for the first presentation that our team will have next week and also be working on the paper that is also due next week. I will continue to work on the encoders and get them working way before next week so that our team can start integrating, testing, and building before the start of the next week. We have four weeks left until the deadline and I am not sure how to feel about that. I am just saving that bit of hope for our team that everything will work out in the end. I will also continue to do some side research on Xbees so that when it comes to working with the app team to integrate their app, we can immediately create a function or write some code that will receive the information through the use of the Xbees and our microcontrollers. 

Wednesday, February 22, 2017

Week 3

This past week, I was tasked to fix any bugs that our code had as well as get the encoders to work so that our team can determine the speed of the motors. There were issues with getting the LED to indicate the correct status as well as breaking from a loop when the error button was pressed or the podcar had arrived at a station. I was only able to fix the kill switch issue as well as indicating the correct status but in order to break the loop in regards to the station arrival indicator, that is still a working progress. This is due to that pathing needs to be implemented so that that particular indicator will function as desired.

As for the encoders, I had to do some background research and look back at old mechatronics notes I had from when I took the class in order to gain some knowledge about interrupts. In order to use the encoders, I must use interrupts for this application so that we can calculate the speed. Unfortunately, I have not been able to get the encoders to display a value that resembles a proper speed for the motors. In the coming week, I am aiming to get the encoders to work properly and have them ready by the time our team starts to build the systems for the podcars.

Also as requested from Chris, I was able to remake a wiring schematic of our system since we are using new components and a different microcontroller. Chris requested the schematic since he wanted to create a prototype of the final product that will be mounted on the podcar. The last task assigned to me was to do some research and testing with the Xbees since these devices will be the main source of communication between our microcontrollers and the system that the mobile app team created. I have some knowledge of how Xbees function and I have been able to successfully turn on an LED based on what values the microcontroller receives through the Serial Monitor in the Arduino IDE.

In the coming week, I will be aiming to finish any encoder related work as well as applying user input so that commands or values can be sent through Xbee to control our system as will be done through the app created by the mobile app team. I will also be working closely with my teammates to integrate the system altogether so that we can begin testing in about a week or so. Presentations are also coming up so we need to prepare for that too. Deadlines are coming and I feel indifferent than what I had mentioned in past blog posts.

Tuesday, February 14, 2017

Week 2

During the past week, I have been working on building code for our controls system as my other teammates are also doing. I was in charge of making all of the individual system components work while my teammates focused on pathing and routing. I was able to successfully create the functions that the mobile app team requested from our team. There are some functions that still need to be created which deal with the encoders and the pathing algorithm we have for our controls system.

I was also able to run the motors at the target speed we had specified throughout the project year which was 0.82 ft/sec or 0.25 m/sec. There is a library that allows a user to set the PWM duty cycle using fast PWM pins, instantly changing the PWM duty cycle of an electronic component capable of PWM. The library used was the Timer3 library instead of the Timer1 library which was originally used for the Arduino Uno. Since our team is using the Arduino Mega, another Timer library that is compatible with the Mega had to be used. At the bottom of this post is part of the code that basically runs the motors and stops the motors under certain conditions. The RGB LED has also been incorporated as an indicator of the podcar status.

In the coming week, I will be working with my team to integrate all of our work together so that we can begin testing and debugging soon. We will also begin to build our system at the end of the month which is the anticipated approximate time when all of the small scale subteams will be ready to start testing everything on the track. I am looking forward to seeing our project be a success when it is up and running on the track.


**********************************************************************************
// Function that controls the functions of the system
void controls()
{
     // Changed distance from 30 cm to 15 cm due to pole obstacle
   // LED is Red when statement is true
   if (distance <= 15)
   {
    setStateLED(1);
    setSpeedOfMotors(0);
   }

   // LED is blinking red if button is pressed
   else if (kill_state < 1)
   {
    // Creates a latching button
    kill_latch_state = false;
    reset_latch_state = true;

    // Continues to blink the LED red while latching button is in effect
    // Only way to stop this cycle is to reset Arduino or add another button
    while(kill_latch_state == false && reset_latch_state == true)
    {
      setStateLED(4);
      setSpeedOfMotors(0);
    }
   }

   // Checks to see if the hall effect sensor on the left of podcar read a magnet
   else if (hall_1_state == 0 || hall_2_state == 0)
   {
    setStateLED(2);
    setSpeedOfMotors(580);
   }

   // Checks to see if podcar is at a station
   else if (StationId == 1 || StationId == 2 || StationId == 3 || StationId == 4)
   {
    setStateLED(1);
    setSpeedOfMotors(0);
   }

   // LED should be green
   else
   {
    setStateLED(3);
    setSpeedOfMotors(580);
   } 
}

Tuesday, February 7, 2017

Week 1 of Spring Semester 2017

Last week marked the first week of class for the second half of the project year. With a tough past semester, I managed to get some needed rest as well as making some progress in our project. Over the winter break, I was able to build code and test it on one microcontroller to determine if our team can use one microcontroller without any issues instead of using two. I was pleased to report to my team that we can transition our whole system to using an Arduino Mega because there seemed to be no interference with any of the sensors or components and the system response was surprisingly fast. The code was also much more condense than the previous code we had for each of the microcontrollers.

During this past week, I was assigned to fix some bugs that our team was experiencing with the LED status indicators as well as breaking from a loop when an indicator turns on without any indication that it will end without resetting the microcontroller. I was successfully able to fix those bugs and our system prototype seems to work satisfactorily. I was also able to assign station numbers to the RFID tags based on some serial number that the RFID reader would read. We are still having issues trying to drive the motors and the servo in the same manner that the past year's team implemented but if in any case, we would have to drive those components a different way and just adjust the performance as we see fit when we test our system.

After this coming week, we will only have roughly about 6 weeks to have a fully functional demo of our project. This leaves little time for mistakes and postponement of the project. With our team leader assigning us roles and tasks on a weekly basis, I am confident that our team will succeed this semester and have demo that will at least make me feel good and proud of. In the coming week, I will be meeting up often and working with my team to finish the pathing and routing of our system as well as getting the motors and the servo to run either in the past year's method or create a different method. We plan to build and test no later than the end of this month so that we have a reasonable amount of time to fix any bugs in our system.