Wednesday, May 13, 2015

Final Project: Final Product and Future Improvements

Final Product Description:
Our final mat has a two part design one being the spinner and the other being the mat itself. The spinner is used as a visual cue to the children that can accompany a verbal cue from the teacher. The spinner is large enough to be visible, but small enough to be portable so it can be removed from the children's level if necessary. Also, the spinner can be spun by a child or simply moved by the teacher as Sonja does in the demonstration video. The mat has two red and blue sides corresponding to the red and blue of the spinner. Each side is touch sensitive and will light up as the child sits down on the mat then turn off for the remainder of the lesson. In this way, the mats entice the children to sit on them while avoiding becoming a distraction during the lesson.

Highlighted Steps:
  • 1st CSC visit
    • We went to the CSC to observe the children and listen to the teacher talk about the needs of the classroom and aspects of working with children that we may have not thought of
  • Brainstorming 
    • Sonja and I drew up as many ideas and approaches that we could think of for the design. We considered light, weight and touch sensors before settling on the buttons. We also had grand ideas about creating a wireless system with the spinner that corresponded to the colors.
  • 2nd CSC visit and meeting with Teacher
    • We met with the teacher to go over our idea and take some measurements such as the maximum size of the mats and the average weight and size of a child of that age group.
  • Mock-up
    • We created a foam core model of our design in order to think about the logistics of construction and decide what materials we needed.
  • Code Work
    • we wrote a code for the buttons and lights that would make the light tags light up when the child sat then turn off for the remainder of the class.
  • Building
    • After gathering all our materials we started assembling our mat. There were a lot of logistical problems that we had to work out that were not considered when initially thinking about our design. We made sure that the final mat was clean cut, neat, easily accessible for repair and child friendly.
  • Presentation and Demo! 
    • Sonja and I demonstrated our product to the class and a few guest visitors. 
Final Demo Video:
Here is the demo! The lights are not very bright, but hopefully you can see them light up.

Photo of our Mat:



Photos of Us with our Mat:





Further Improvements:

  • Compress the components to make the mat thinner and easily manageable for children to move around themselves. 
  • Also make the mate lighter, as of right now it is a little too heavy. 
  • Make the lights more flush to the mat itself to make sure that the children cannot pick at them
  • Use Brighter lights
  • Make the mat sealable so that it is accessible for repair, but not easily opened by the children.
  • Match the Colors of the mat and the spinner.
  • Make sure absolutely no wires are exposed. 


Reflection: 
Working on this project as our capstone for the course was great way to end the semester. I think it really helped to solidify and integrate all of the knowledge that we have gained over the past semester in a variety of areas. Although at times this class, and the final project, were extremely frustrating the reward for successfully addressing a problem outweighed the pain of the struggle. I am quite happy with our final project, even though I realize that it is not yet usable in a real classroom. I think that our work on this project could potentially inform the students after us and help them to create a better version than we did. The idea that next years students could work on our project emphasizes to me that engineering is all about works in progress.

Final Project: The Building Process

The Goal: 
Create a mat that follow our design while also being safe and usable for the children in the classroom environment.

The Spinner:
Although we decided against our original plan to use the spinner to wirelessly decide the color the mat would be sensitive to, we wanted to keep the spinner as part of the design in order to provide a concrete visual reminder to accompany the verbal cue given by the teacher. This way there would be reminders from multiple sensations which the teacher said was best for the children's learning.

Also in our initial design we were going to use the traditional carnival wheel style of spinner with pegs and a rubber wedge that would pass along the pegs and choose a color. After thinking it over, we decided to simplify the design by creating a spinner without pegs that just used gravity to slow. If the delrin caused it to spin for too long then we could add a piece of foam or carpet like spot to create more friction to slow it down. Below I have included the solid works parts for the spinner and the test piece I made.








In order to create the red and blue sections of the spinner we originally thought that spray painting them would be best, but then we realized that making stickers in the shape that we wanted would be better. It just so happened that they was vinyl sticker rolls in the classroom already so we didn't need to buy anything! I created a stencil then cut out the vinyl and stuck directly onto the delrin. The final product  and stencil is shown below.



The Mat:
Trying to figure out what material to make the base of the mat out of was pretty challenging. at first we thought delrin would be good but we were worried it would be difficult to make a really strong box with delrin and that it would be too heavy. Then we thought maybe thin wood would work, but that wasn't good because if it splintered then it could be a safety hazard. We finally decided that the bottom of a bin that we cut the top off of. Then we made a smaller delrin box that would contain the bread board, the battery pack and the arduino. We made small holes in the top of the box to rest the button sensors and we ended up cutting out access squares to get to our bread boards to adjust the wires. For easy access we hinged the arduino box to the bin. We used the top of the plastic bin to stabilize the red and blue mat sections so that sitting in just one section would make the button compress. We then hinged the mat and plastic combo to the edge to open up for easy access. I added Popsicle sticks to the edge to give it a little more height to make the angle less steep.

The wiring proved to be pretty frustrating. It got pretty complicated and sometimes a connection would become loose our disconnect entirely. Also, we made the wires too short to lift up the delrin box we made so that made things frustrating to fix. Otherwise, the soldering went fairly well

Below I have included pictures of the solid works parts and the various stages of construction as well as several views of the wiring and soldering components of the process.







Reflection: 
I found the process of physically building our mat very liberating. Seeing our idea go from hurried sketches on a paper to a physical and usable object was one of my favorite aspects of this project. As always there were some unforeseen problems and bumps along the way. Some examples include making the wires longer so that we could have lifted the internal box without disconnecting the wires. Another was making sure that the screws in the hinges didn't interfere with the motion of the lid. This required a lot of guidance from Larry since he showed us how to grind down screws as well as do all the other things we needed to do. This process also emphasizes in my mind the necessity of prototyping and creating test pieces before the final product.

Final Project: Code Work

The Goal:
To write a code that would function well with our final idea and meet the needs of our design logistically.

Reference Codes:
The first thing that we did was look back at old codes we have done in the class in order to see if there was anything we could implement into this code. The SOS code that I have included below reminded us how to make a function within the code itself. This function technique can be seen in our later codes.


Initial Code:
This was our first try at the code for this project. First we create the appropriate integers (buttonState1, 2...) and set them equal to zero to make it start counting at zero, Next we declare the LED lights as outputs since they are receiving input to make them light up and we declare the buttons a inputs since they are getting pushed. Then we begin the loop by making the arduino read the state of the buttons. After this, we create a set of if statements that basically say if the two buttons on one side are both on then the light will turn on for 2 seconds then off for 1 second and if this this condition is not true then the LED should be "LOW" meaning it is off. If this code were to be actually implemented we would extend the second delay to ensure the mat stays off throughout the rest of the lesson so it is not a distraction. The same if statement is then made for the other side.


Final Code:
We modified the code slightly for our final by adding internal functions like those in the SOS code. Most of the code is the same except for the introduction of the functions "short1," "short2," "long1," and "long2."



Further Improvements: 

  1. As I stated above, if this code were to be actually implemented then the refractory period after the light initially comes on would span the entirty of the lesson so it would not become a distraction to the kids.
  2. Another thing we could do would be to alter the code so that when one side was pressed then the other side would be inhibited completely. As of right now if both sides are pressed then one side will light up followed by the other side. The two would alternate back and forth until they were no longer pressed. Since in reality the refractory period would be much longer, it stops becoming an issue. 
  3. It would also be interesting to make the code so that only one button on the side needed to be pressed to make the code execute. We didn't feel that for our purposes this was necessary because anywhere pressure was applied both buttons on that side would be pressed since the mats were backed by stiffer plastic and since the buttons themselves are very sensitive. 


Reflection:
After the complex coding needed for the sciborg, this code seemed much simpler, however there were still small nuances in the coding language that tripped us up at times like the use of &&.

Friday, May 1, 2015

Arduino Day 5: Brightness Sensor

The Assignment: 
Our challenge was to get the sciborg to follow a white line using a brightness sensor first using bang bang control and then using proportional control.

Bang Bang:
The line following code proved to be very difficult to write. Our initial thought was to have the sciborg know the values for light and for dark so that if it detected dark then it would execute one part of the code and if it saw light then it would execute another. We thought that if it was on a light (white) section then the sciborg would travel forward and if it detected dark, then we wanted the sciborg to "sweep" the area by turning one way for a little bit then another way for a little bit, but then the sciborg would stop the "sweep" if it detected white and then it would move forward. In our initial code the sciborg was very jerky and would not follow the white line if it turned.

Our final code shown below allowed the sciborg to complete the course in about 3 minutes.

The idea behind this code was to make the sciborg "sweep" left and right in order to find the line. We set the value that the sciborg traveled straight on as edge of the line, rather than the line itself because it is very difficult to get the sciborg to detect the white line for long enough to move effectively.


Proportional:
This code was also very difficult to write. We had a lot of trouble getting the sciborg to travel forward and sometimes it would just turn in a circle not even behaving as if it sensed the line at all. Kat helped us try to fix it, but she couldn't figure out why it wasn't working either. We played around with the gain, the speed, and with the range of sensor values but nothing made it travel the entire way down. We did get one code to travel almost all the way down the path. It got stuck on the very last part, but otherwise it was successful. I have included that code and the video below.



Reflection:
The thing which this exercise reminded me over and over again is that what we think the code is doing is often very different from what it is actually doing. Also, when it comes to sensors, it is very difficult to set limits on the numbers the sensors read definitively to make an effective code. For example, when the although the lights were always on in the room while we ran the sciborg it made a slight difference whether or not there was ambient light from outside. Also, the distance of the sensor from the ground played a huge role in the accuracy of our code. All these little real world variations made coding difficult.

It also makes me wonder about the difficulties in creating an actual product using sensors that must operate under many variant conditions. This is actually a problem which my neuroscience professor has talked about before. For example, as humans we take for granted that we are able to tell whether something is dark or light based on comparisons our brain makes without our knowledge. A computer system, for all its complexity, does not have the same ability to integrate information as the human brain. The arduinos we are using have a similar problem. They read a single number without comparing it to the surroundings and adjusting it.

Final Project: Mock Up

The Assignment:
We were challenged to create a physical mock up of our design in order to begin to think in detail of the materials we will need and the way we will go about constructing it.

Our Mock Up:

As you can see from our mock up, we planned to have a stiff bottom material which the sensors and the arduino board would be fastened to. The next layer would have another stiffer material capable of pushing on the sensors. The red and blue side would be separated to prevent interaction with the wrong sensors. Above that would be the red and blue pads and the two corresponding lights. The spinning wheel would have had a sensor on the same prong that housed the rubber piece that would slow the wheel when it hits the pins in order to land on a color. The sensor would have picked up the color then communicated to the mat to decide which color to be sensitive.

Revisions to Our Idea:
Due to time and resource restraints we were forced to simplify our idea. We will no longer require that the wheel communicate with the mat board. Instead the mat will be independent. The teacher will instruct the students to sit on a particular section. The students will then sit on that section and cause the button to light up for a certain amount of time then turn off. If they change sides then the other side will be activated in the same way. Also while one side's light is on, the other side cannot be activated as to prevent kids from going back and forth to make the light turn on.

Physical Design Revisions:
We decided to use a plastic bin for the stiffer component of our design. The plan is to cut the top part of the bin and use the new shallow tray as the base of our mat. The lib can be cut as well to make up the second stiff layer.

Materials List:
*indicates we already have this in the We-Lab.
  • yoga mats (1 red, 1 blue)
  • plastic bin and plastic lid *
  • arduino board*
  • 2 LED light tags
  • small button sensors*
  • strips of fabric


Reflection:
I found the mock up exercise very helpful because it helped us visualize our idea and work out any logistical problems that we otherwise would have missed. It also helped Sonja and I get on the same page concerning our idea to make sure that we both have a clear idea of what the plan is.

Thursday, April 23, 2015

Final Project: 1st Classroom Visit

The goal:
My goal for the visit was to see if our idea would work well in a real classroom and to get some feedback from the teacher.

Storyboard:
I presented the teacher with this story board in to help explain our idea.

Her suggestions:

  1. The mat doesn't need to detect if the child is still sitting on the mat, they only need to get the kids to the mat in the first place.
  2. Red and blue and black and white would be the best colors because those are some of the first colors they can distinguish.
  3. The mats should be no wider than 16.5 in in diameter, but they could be longer lengthwise if they are oval shaped.
  4. Make sure that the wheel is not too distracting to the children, and that the teacher has the option to calmly change the color.
  5. Make sure they are easy to stack and distribute.



Thursday, April 16, 2015

Final Project: Brainstorming

The Need:
The problem which our projects seeks to address is that the children often have trouble getting settled onto their mats during group time when they are supposed to be paying attention to the teacher. Another additional problem related to the mats is that the kids sometimes have trouble staying on the mat once they get settled because they want to squirm around. The teacher expressed a greater interest in getting the children to settle on their mats initially.

Initial Idea:
Our initial thought was to have a mat with four different sections, each with one of the 4 colors red, blue, yellow, or green. The teacher would have a switch which would control which part of the mat the children needed to sit on in case the children are getting restless.

Possible Problems:

  1. Four Sections could be too large for the size of the classroom
  2. If they were connected to a wire that the teacher controlled then there would be a lot of wires from 16 mats. The wires could become a hazard and a distraction to the children as well as being cumbersome to put away and get back out.
  3. A switch wouldn't be visible enough to the children; they need reinforcement from many different senses

Edited Idea:
Having considered the possible flaws of our initial design we decided that the new design would only have two colored sections in order to save space. We would also like to look into a wireless approach to controlling the mats. We also decided to create a spinning mechanism that could be spun like a carnival wheel to create a fun way for the kids to choose which color they get to sit on. The teacher would also be able to more discretely adjust the spinner without making it super exciting or distracting so that she could refocus the children during group time.

Types of Sensors:


We considered many different kinds of sensors before landing on a final preference of the weight or Button touch sensor.

  • Touch Sensor: The touch sensor is the same one that we used on our sciborg. If we were to use these in our design we would need several to be under the mat on a hard surface in order to pick up whether or not the child was on the mat. Our concerns with this approach is how comfortable the mats would be and  making sure that all parts of the section would set off the sensor. We could possibly have a layer of wood, then the sensor, then a layer of stiffer material, then the mats.
  • Light Sensor: The light sensor would sense whether or not the child was blocking the light in order to figure out if they are on their mats or not. A problem with this is that the light sensor would have to be poking through the mat which would be uncomfortable and possible encourage the children to pick at it.
  • Weight Sensor: We aren't sure if this is within our budget, but a weight sensor that is able to detect the weight of the child rather than just telling whether or not the button is pressed in or not, would be very useful. This way the child could be on any part of the mat and the child wouldn't be able to trick the sensor like the light sensor or possibly the button sensor.
  • Color Sensor: The color sensor would be used on the spinner to see which color the arrow landed on.
  • Light and Dark Sensor: The light and dark sensor could also be used to pick up the color differences between red and blue.
Moving Forward:
Our next step in this process is to go to the classroom to observe group time and run the idea behind the teacher to see if she has any concerns and to help us answer some lingering questions we have. 





Tuesday, April 14, 2015

MATLAB Day 2:Thermal Systems

The Assignment:
In class today we explored MATLAB further by altering mathematical models of thermal systems. The selected exercises are shown below.

Question 1: How does the cooling behavior change if we vary the parameters Rth and C?
Before increasing anything the graph looked like this with values of C=1000 and Rth=0.85...

If we increased C then the resulting graph looks like this...

If we increase Rth then the resulting graph looks like this...

If both C and Rth are increased then the graph looks like this


If we decrease C then the resulting graph looks like this...

If we decrease Rth then the resulting graph looks like this...

If both C and Rth are decreased then the resulting graph looks like this...

Based on the way the graphs above behaved Rth and C seem to make the slope more positive and more linear when increased. This makes sense intuitively because C is capacitance or the amount of heat it can hold, Rth is the thermal resistance so if the resistance is increased then the heat does not escape as easily. In both cases the heat is retained longer. When either C of Rth are decreased the function decays even more exponentially. Mathematically the expression...
Which can be rearranged to include Rth and C as shown below shows that these observations are grounded in the mathematical properties of the function...

Question 2: Calculate the value for P if we want our coffee to heat up to the Starbucks ideal 84 C.
Using the equation given in the text we were able to find P by setting dT equal to zero since as the function approaches the temperature we want, in this case 84 C (357 K) dT will approach zero. We can then simplify the expression and plug in the correct numbers.
The Code which implements this power value and the resulting graph are shown below...


Page 9: Bang-Bang and Proportional Control of Thermal Systems

1. Modify the program to stimulate a temperature controller using bang-bang control to reach the temperature. Why is bang-bang control appropriate for many thermal systems? Why might it be insufficient?

The original heatsim program is shown below...

In order to create a bang bang control system we altered the code so that if the temperature reahced the target then the power would turn off completely. If the the temperature was lower than the target then the power would turn completely on. The altered code and the resulting graph are shown below...

As you can see from the graph, once the temperature reaches the target then the power will turn on and off completely to make it oscillate sharply around the target. Bang bang control like this is common in heating systems because it allows the heater to reach the target quickly. With proportional control the temperature can never mathematically reach the target, and it takes much longer to get to a close approximation. 

2. Create a program that uses proportional control to reach and maintain the desired temperature. How does this approach compare to bang-bang control?

Our proportional control program actually reached the target faster than the bang bang control program, but that was only because the power used in the proportional program was much higher and most likely unrealistic for a real device. When we ran the program with the same power as the bang bang control it never even got close to the target within the time window, Mathematically the temperature can never reach the target because there is an asymptote. Our code and graph are shown below...



3. Modify both programs to add a sensor delay to both programs. What is the impact of this "sensor delay" on each system? What other delay(s) might you expect in your thermodynamic system, apart from sensor delays?

Shown below is the modified proportional delay program to include a sensor delay of 5 seconds. This forces the temperature to actually surpass the target temperature because by the time the program senses that the temperature has exceeded the target, the temperature has continued to rise for 5 seconds. After this the program will respond causing it to pull the temperature back down. In this way it will continue to oscillate with an increasingly subtle curve towards infinity,

The modified heatsim_banbang program to include a delay shown below changes the program by increasing the amount of time that passes before the heater is turned back on all the way to reach the target. This would prevent the heater from turning on and off too quickly preventing mechanical malfunctions that could occur as a result.

As for other forms of delays. I would say that there could be an action delay which rather than delaying how often the sensor reads the information, delaying the response to that reading. In this way the sensor would constantly be reading but the action for a given kind of stimuli would not occur until 5 seconds after the stimuli occurred if the delay was 5 seconds.

Reflection:
This set of problems really helped to ground the concept of bang bang and proportional control for me since I now have graphical/visual references for their effects. Moving forward this knowledge will be very helpful when trying to incorporate bang bang and proportional control into my final project.