Thursday, February 6, 2014

Workshop 5: Project Design

Workshop Contents

I. Finding Ideas

II. Choosing an Idea
III. Changes and Flexibility
IV. Implementation
V. Finishing the Project
VI. Demo - The Idea/Development Process
VII. Demo - Code
VIII. Demo - The Circuit

I. Finding Ideas


Ideas are the easiest part of the project design process- it's just a matter of having an open mind and looking in the right places. Ideas can be plentiful if they are allowed to be formed without restriction or caution. They can be big or small - an idea doesn't have to change the world, and little ideas are far easier and more realistic. Ideas don't have to be perfect either - there is no such thing as a perfect idea, but it is very possible to find several great ideas. Ideas also don't have to be good - in the brainstorming process there can be a lot of garbage ideas that come up, but for every handful of these ideas there is always a few strong ideas hidden in the mix. When brainstorming ideas, keep and open mind and record as many random ideas that pop into your head.


Ideas can come from virtually anywhere, but here are some good places to look:

        - Problems that need fixing
        - Things that could be better
        - Cool Stuff
        - Anything around the house
        - School, work, etc.
        - Activities 
        - Routine Tasks
        - Hobbies
        - What you and other people complain about
        - "It would be really helpful/cool/fun/interesting if...."
        - Combining things, speeding things up, improving, automating, etc.



II. Choosing an Idea

Once a list of ideas has been formed, it is time to narrow those ideas down into a handful of the best ideas. Ask yourself - "what ideas are applicable to what I want to do?" In the case of the Open Design Competition, the key questions to ask have to do with how a micro controller/electrical/programmable solution can be applied to the idea. There will be ideas on the list where this route makes no sense at all, but there will be others where this route would provide the perfect solution to the task at hand. These are the ideas that should be moved on with.


Besides the applications of the idea, consider the constraints of the idea - how easy will it be to implement? Will it be expensive? Am I capable of doing this? Is it interesting and do I want to do this?

At this point, there are probably a couple of ideas on your list that are easy favorites - ones that are intuitively great options that would be fun, exciting, and fulfilling to pursue. Choose a favorite and move on to the next step....

III. Changes and Flexibility


...but don't be afraid to let go of that idea. One of the biggest difficulties in project development is adjusting to changes and complications during the project process. Ideas can become unexpectedly difficult, complicated, impossible or uninteresting very quickly at any moment, so it's important to have a backup plan or two. This isn't guaranteed to happen, but it's a risk that is always taken in the project design process - sometimes things just don't work. 

IV. Implementation


Start moving into the idea by organizing what it will take to realize the idea - lay out basic block diagrams of how a project should come together - what parts of the project are necessary, what sort of sequence happens, what is important for the project, etc. Start large, with block diagrams, and slowly work smaller and smaller until you have the full technical details mapped out. Move into pseudo-code explaining functionality and mechanical drawing illustrating actions and go from there, developing the technical aspects of the project.


Before getting too far into everything, make sure everything is going to work. List the requirements and restrictions of the project from as many angles as possible and map out the full technical picture of the project - will everything work as intended? Will it all work together correctly? Are there any risky portions that need to be focused on?

As mentioned before, at this point it's likely that there will be some design changes that need to be made. These can be managed (usually) but they must be properly considered and once a change is made make sure to check that the rest of the system will integrate with that new part correctly and as intended. Changes can have major ripple effects that change a project overnight.

Implementing Code

To implement the code, start by writing it in pseudo-code - a purely logical representation of how the code works - detailing the values needed, the variables, and the loops without actually typing code. Once these are organized and understood it will be much easier to write the code. As code is written, when and if errors or difficulties come up make sure to use the internet to find these solutions - there are a ton of resources for programming difficulties, especially in Arduino, so it's valuable to pull from these as much as possible. Google errors and use the internet to diagnose problems and find solutions. Test your code in small chunks to find errors in controlled sections of code, not in the whole program itself for easier debugging.

Implementing Circuits

When implementing circuits, make sure to sketch everything out carefully and do your math before buying components - ensure that everything should work correctly first. As you get components and implement them, carefully test each section as best you can to ensure that component damage is limited or even eliminated - it's better to fry an LED than your entire microcontroller. Slowly integrate sections together and be mindful of potential risks in the circuit, like high current that might adversely affect your project.

Implementing Mechanical Designs
Finally, make sure to check the forces and mechanical limits involved with the mechanical design. Consider part durability and materials to make sure everything should work as intended without damage and that the system will not have issues in the future.


V. Finishing the Project


Once these three main areas are put together, it will be time to integrate them. Like as mentioned before, slowly integrate each section and test as often as possible to eliminate risk and catch as many issues as possible early on. 


When debugging/finding issues, be smart about it - go slow, confirm assumptions, limits, and constraints, and carefully dissect the problem, isolating the problem, it's cause, it's fix, and the ultimate solution. Take your time, be careful with debugging, and make sure not to randomly try things you do not understand - make a conscious effort to understand the problems and the solutions necessary.

As the project reaches completion, there will probably be more work to be done. Design's don't come out exactly as intended, and there might be additional work needed to improve the project further once you've finally seen it in action.

VI. Demo - The Idea and Project Development Process



To implement this project design theory, I went through these steps to design a manual car transmission. The first thing I did was sketch out what the system needed to look like from the car's perspective - the engine, the gear box, the clutch, and the dashboard dials. I then likened these components to electrical components I could used in my kit to develop a rough technical layout of the project. Finally, I asked myself how feasible this would all be, and developed a game plan for it all. 

VII. Demo - The Circuit

To implement the circuit, I first chose the components - a DC motor (engine), a Servo motor (gear box), LEDs (dashboard content), and a button (clutch/shift action). I made short test programs for each component and slowly integrated them into a complete system. Along the way I found that my DC motor wouldn't work as I intended to, so I had to scrap it and find a different solution, updating the rest of my project as a result. 


The final circuit is shown here:




VIII. Demo - The Code


As the hardware came together I wrote pseudo-code to organize the functionality of the program and then began writing the actual code and testing it incrementally. As the code came together, I organized it with the code used to test the hardware and formed the final program:


#include <Servo.h>

Servo servo1;
int pos = 0;

void setup()
{
     Serial.begin(9600);     //  setup serial
     pinMode(2, OUTPUT);
     pinMode(3, OUTPUT);
     servo1.attach(10);
     servo1.write(0);
}

void loop()
{
  digitalWrite(2,HIGH);
  digitalWrite(3,LOW);
  for (int i = 0; i < 7000; i++)
  {
    delay(1);
    if (digitalRead(9) == 1)
    {
      delay(300);
      pos = pos - 36;
      if (pos < 0) {pos = 0;}
      servo1.write(pos);
      i = 7001;
    }
  }
  digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  for (int i = 0; i < 7000; i++)
  {
    delay(1);
    if (digitalRead(9) == 1)
    {
      delay(300);
      pos = pos + 36;
      if (pos > 180) {pos = 180;}
      servo1.write(pos);
      i = 7001;
    }
  }
}


The final project works like this: The servo indicates what gear the car is in and the LEDs indicate what the status of that gear in regards to shifting. If only the green light is on, then pressing the shift button will down-shift the car. If the green and red lights are on, then pressing the button will up-shift the car. 

Sparkfun Promotion!

For the rest of the semester, Sparkfun orders over $40 that use the promotional code EDECSU2014 will automatically received a 10% discount. Check them out - there isn't a better resource available for hobby electronics!

https://www.sparkfun.com/

Tuesday, February 4, 2014

Code For Workshop 5 Demo - Manual Transmission

#include <Servo.h>

Servo servo1;
int pos = 0;

void setup()
{
     Serial.begin(9600);     //  setup serial
     pinMode(2, OUTPUT);
     pinMode(3, OUTPUT);
     servo1.attach(10);
     servo1.write(0);
}

void loop()
{
  digitalWrite(2,HIGH);
  digitalWrite(3,LOW);
  for (int i = 0; i < 7000; i++)
  {
    delay(1);
    if (digitalRead(9) == 1)
    {
      delay(300);
      pos = pos - 36;
      if (pos < 0) {pos = 0;}
      servo1.write(pos);
      i = 7001;
    }
  }
  digitalWrite(2,HIGH);
  digitalWrite(3,HIGH);
  for (int i = 0; i < 7000; i++)
  {
    delay(1);
    if (digitalRead(9) == 1)
    {
      delay(300);
      pos = pos + 36;
      if (pos > 180) {pos = 180;}
      servo1.write(pos);
      i = 7001;
    }
  }
}

Thursday, January 23, 2014

Winter Design Competition and Arduino Workshop 5 February 4th! Free Pizza!

The fifth and final ODC Arduino Workshop and the Winter Design Competition will be held Tuesday, February 4th at 6p-9p in Engineering 120.

First, participants of the Winter Design Competition will demo their projects! It's easy to participate if you weren't planning to already (more information here: http://csuieeedesign.blogspot.com/2013/12/ieee-winter-design-competition.html). Participants will show off their projects and be judged by IEEE student officers using the official ODC rubric that will be used in the final competition in March. First prize is a Raspberry Pi and second prize is a $20 gift credit to Sparkfun!

Following the competition, the workshop will be all about project design - how to come up with ideas, planning, prototyping, and completing effective, functional working projects for fun and for the competition in March! The presentation will be followed with a final demo project that will move through the entire process of project development. Even if you don't have an Open Design Arduino Kit this is a highly valuable workshop for anyone involved in the competition or interested in making projects in your free time.

We will have free pizza so come see some great small projects, learn all about project design, and start getting ready for the Open Design Competition in March!


Monday, January 6, 2014

Introduction to Analog Design (Workshop 3) - Detailed Guide

Guide Contents

I. Temperature Sensors
II. Transistors
III. DC Motor
IV. Demo Part 1: Assembling the Circuit
V. Demo Part 2: The Code

I. Temperature Sensors

A temperature sensor is made of a small, special resistor that changes its voltage drop based on the temperature of the sensor. It has three pins - HIGH, GND, and signal. A voltage is applied to the sensor to make it operational, and based on the temperature an analog value will be displayed at the signal pin. The Arduino's temperature library will convert that value to a digital value in Celsius that can be converted to Fahrenheit. 


II. Transistors

Arduino can only supply enough current to run sensors and small servo motors from its digital and analog pins. This isn't enough current to drive DC motors and other larger loads, so a DC amplifier is needed. A transistor acts as this DC amplifier in our workshop (transistors can be used in many other applications. This is just one use.) 

For this workshop we will be using an NPN BJT. The BJT has three terminals - a collector (positive voltage), an emitter (negative voltage or ground), and a base. The base is like a switch - put a voltage into this terminal from the Arduino and current will flow from the collector to the emitter.

Every BJT transistor has a Beta value, usually between 5 and 100. It equals the current amplification of the transistor. 




Tuesday, December 31, 2013

Introduction to Motor Control (Workshop 4) - Detailed Guide

Guide Contents

I. DC Motors
II. Servo Motors
III. Stepper Motors
IV. Demo Part 1: Assembling the Circuit
V. Demo Part 2: The Code

I. DC Motors

DC Motors come in two variants - brushed and brush-less. Most DC motors are brushed, especially small motors. They use graphite brushes, magnets, and coils of wire to create motion when a voltage is applied. Brushed motors are good when positional actuary is not important. Brush-less motors do not have graphite brushes and use sensors or a separate motor driver. They have less friction but are more complex to use. (See Workshop Guide 3 for a demo involving a DC motor.)





II. Servo Motors

Servo Motors use a small DC motor, a potentiometer, and a gear train. The gear reduction applied to the DC motor increases the output torque, making the motor easy to use. Servos specialize in high positional accuracy.




Tuesday, December 10, 2013

IEEE Winter Design Competition!

Don't have anything to do over the four long weeks of winter break? Enter the Winter Design Competition!

The Winter Design Competition is almost exactly like the Open Design Competition except for a few small differences:

       - It runs from now until January 28th (The tentative date of the ODC Workshop 5).
       - It has a prompt.
       - No need to sign up.

The prompt of the competition is simple - make something that can teach someone math. It doesn't matter what shape, size, or method it takes, just make it teach math and that's it!

The project will be judged by our officers using the official rubric for the final Open Design Competition and there will be prizes for the winner and runner up! (Official rubric attached in a forthcoming email.)

First Prize: A Raspberry Pi (literally a computer the size of a credit card) and 20 bonus points towards your final Open Design Competition score in March!

Second Prize: A $20 Gift Card to Sparkfun and 10 points towards the Open Design Competition!

This is a great opportunity to stay fresh over break and sharpen your design skills for the competition. Not only that, but you might win an awesome prize and get a leg up on the competition in March!

Good luck!

Cameron