Friday 31 May 2013

Importance of history

"Learn from your mistakes." Growing up, I've heard this phrase so many times, and have tried to be diligent about not repeating my mistakes. But, I think an important addendum to the popular adage is: "Learn from your mistakes, and learn from the mistakes of others". 

Origins of science was offered in my high school and I did not take it at the time in order to "focus on other topics". As I began to realize how interdisciplinary everything today is, I began to lament not having paid more attention to history. Many techniques in one research area can be applied to other research areas, yielding great results. 

Consider biology, in particular MRIs. In the past, these images were analyzed by hand. Applying signal processing and imaging techniques can automate this process, drastically improving the analysis time. I don't know if it occurred this simply, but I'd wager that some revelation like this sparked the birth of computational biology, a research topic that currently has a lot of open ground for improvement. 


On a related note, I believe there are three types of science: groundbreaking, where the discovery completely revolutionizes the way we view something; incremental, where we learn a little bit of something new; and interdisciplinary, where we take ideas in one field and apply them to another in a previously unexplored method.





Friends > Networks

Your network shouldn't be full of "people in high places you hate but can hook you up," it should be full of people who are willing to really, genuinely lend you a hand or take a risk for you. 


Make Friends At Work and With People Who Do What You Do

  • Get involved in hiring at your company
  • Attend those crappy after-work events
  • Make those crappy work events better
  • Get involved in a professional organization or society
  • Offer your help when you can give it



Stay in Touch with People, Genuinely



http://lifehacker.com/how-to-skip-the-sleaze-and-build-a-real-professional-ne-510256651

Giving up machine shop dreams

As of today I'm content with not focusing my time on developing shop skills. I still enjoy playing around with making my own objects, but I decided that CAD will be a more valuable investment of time because of the growing power of 3d printing and other forms of automatic manufacturing.

Low-cost, hobbyist robotics

"Dash Robotics was founded at UC Berkeley by four Ph.D. students with a simple mission — to make robots cheap, lightweight, and fun to use. The breakthrough came when one of the founders realized that robot joints could be mechanically engineered and constructed in a completely different way."

http://www.wired.com/business/2013/05/a-smarter-use-of-crowdfunding-for-the-cheapest-robots-in-silicon-valley-a-vcs-view/

Interpretation

Two people can read the exact same thing and come up with completely different interpretations.

To me, this reinforces the importance of collaboration - people generate ideas and are inspired by different things.


It would be cool if we could figure out why, or how, we mold our minds into what they become. Would it be possible to feed a machine the identical experiences as a human and have it arrive upon the same beliefs? The head fake, as Randy Pausch would put it, of this blog is to see if all this info can be used to reconstruct a memory/belief system that is anywhere close to what I have accumulated, in the far future. Of course, it's missing large chunks of human interaction and other learning, but I'd be curious to see if you can get a computer to learn things the same way that a human brain does if we give the computer access to ALL the senses and experiences.

Nerve signals and how to rewire your brain

"The takeaway: practicing skills over time causes those neural pathways to work better in unison via myelination. To improve your performance, you need to practice frequently, and get lots of feedback so you practice correctly."


http://lifehacker.com/the-science-of-practice-what-happens-when-you-learn-a-510255025

Hexapod documentary


"This version is 3D printed using a Stratasys Dimension 3d printer. These parts are extremely rugged and precise compared to any of the Makerbot and RepRap hobby grade 3D printers."


 "I'm interested in robot locomotion that emulates biological movement," Bunting said. "And in doing more work on robotic vision."
^exact same as me!


The
Note to self: Figure out how to generate these API documentation pages for future projects. 
http://12centdwarf.com:8080/API/

" am currently working on a CNC machine to build parts out of aluminum. I hope to begin prototyping aluminum parts in the next few months, but this is a complicated process when it comes to generating G-code to machine the parts from my complicated 3D designs."

http://engr.arizona.edu/news/story.php?id=292

"Matt has since then added several features, like foot sensors, 3D balance gestures, and the hexapod also has a 3DOF camera for doing face tracking. Awesome!" 
http://www.robotshop.com/blog/en/the-story-of-matt-bunting-and-the-hexapod-that-intel-bought-3736
The lesson here is multiple iterations!! Make something, get feedback, and improve!


Merits of IMSA and other "magnet" schools

Even small things like, giving students a day off per week to pursue their own interests, can be just what some students need at a young age. The key early on is to expose yourself to as many topics as possible, see what's interesting to you.

http://www.wired.com/wiredenterprise/2013/05/hogwarts-for-hackers/all/

Pulse jet bike

Dangerous but awesome

http://jalopnik.com/absurdly-loud-jet-bike-built-by-absurdly-loud-dudes-510494866

High speed transport

Claims to feel the same force as if you were in the car, but going much faster. Not sure how this is possible.

http://news.yahoo.com/blogs/trending-now/futuristic-high-speed-tube-travel-could-york-los-171007828.html?vp=1

Thursday 30 May 2013

Setting environment variable PATH on Windows 7


Windows 7
  1. Select Computer from the Start menu
  2. Choose System Properties from the context menu
  3. Click Advanced system settings > Advanced tab
  4. Click on Environment Variables, under System Variables, find PATH, and click on it.
  5. In the Edit windows, modify PATH by adding the location of the class to the value for PATH. If you do not have the item PATH, you may select to add a new variable and add PATH as the name and the location of the class as the value.
  6. Reopen Command prompt window, and run your java code.


http://www.java.com/en/download/help/path.xml

Wednesday 29 May 2013

Facebook Design manager's reflections


Below are the ones I find most important/fully agree with:
10) Always get the full story before making a decision.
9) It's incredibly easy to 'flip the switch' and start writing people off after a few bad experiences. Resist at all costs. You were bumbling once too. You made poor decisions. You learn and grow, and so does everybody else.
8) Sweep up the crumbs. Wipe the tables. Turn off the lights. Plug the holes that need plugging—even if it's menial, even if nobody will know you did it. Do it in service of the product, the company, and this wondrous, magical thing you are all building together.
7) Recognize you can't do everything. Close your eyes, fall backwards, and learn to trust.
6) Clearly, there is a more efficient way to do the things you do. How? Ponder that on your daily drive home.
4) Don't say anything if it's not actually contributing to the discussion. Your voice is not so melodious that it absolutely must be heard.
2) Dole out thanks and encouragement like you dole out opinions.

Gas particle logic

Mosh pit movement follows the same motion as disordered 2D particles.

http://www.guitarworld.com/physicists-music-fans-mosh-pits-follow-same-logic-gas-particles

Monday 27 May 2013

Work hard to get what you want

 If you really want it, even international borders can't stop you.

http://www.cnn.com/2013/05/24/health/lifeswork-dr-q/index.html

Social network addiction

Could the reason we are so addicted to social networks be that our every day lives aren't entertaining/fulfilling enough?

Could this be the same reason why people indulge in entertainment? Is this statement equating social networks to a form of entertainment?

How to be a good programmer

Really insightful article on improving technical skills, but also interpersonal skills. Some notable quotes that stood out to me:

PERSONAL SKILLS


Debugging is the cornerstone of being a programmer. The first meaning of the verb to debug is to remove errors, but the meaning that really matters is to see into the execution of a program by examining it. A programmer that cannot debug effectively is blind.


If there is a single key to debugging is to use the divide and conquer technique on the mystery.




The key to improving the performance of a very complicated system is to analyze it well enough to find the bottlenecks, or places where most of the resources are consumed. There is not much sense in optimizing a function that accounts for only 1% of the computation time. As a rule of thumb you should think carefully before doing anything unless you think it is going to make the system or a significant part of it at least twice as fast. There is usually a way to do this. Consider the test and quality assurance effort that your change will require. Each change brings a test burden with it, so it is much better to have a few big changes.


Sometimes you'll encounter loops, or recursive functions, that take a long time to execute and are bottlenecks in your product. Before you try to make the loop a little faster, but spend a few minutes considering if there is a way to remove it entirely. Would a different algorithm do? Could you compute that while computing something else? If you can't find away around it, then you can optimize the loop. This is simple; move stuff out. In the end, this will require not only ingenuity but also an understanding of the expense of each kind of statement and expression. Here are some suggestions:
  • Remove floating point operations.
  • Don't allocate new memory blocks unnecessarily.
  • Fold constants together.
  • Move I/O into a buffer.
  • Try not to divide.
  • Try not to do expensive typecasts.
  • Move a pointer rather than recomputing indices.

Programming ought not to be an experimental science, but most working programmers do not have the luxury of engaging in what Dijkstra means by computing science. We must work in the realm of experimentation, just as some, but not all, physicists do. If thirty years from now programming can be performed without experimentation, it will be a great accomplishment of Computer Science.


TEAM SKILLS


When not possible to take the time for some investigation, you should first establish the meaning of the estimate very clearly. Restate that meaning as the first and last part of your written estimate. Prepare a written estimate by deconstructing the task into progressively smaller subtasks until each small task is no more than a day; ideally at most in length. The most important thing is not to leave anything out. For instance, documentation, testing, time for planning, time for communicating with other groups, and vacation time are all very important. If you spend part of each day dealing with knuckleheads, put a line item for that in the estimate. This gives your boss visibility into what is using up your time at a minimum, and might get you more time.
I know good engineers who pad estimates implicitly, but I recommend that you do not. One of the results of padding is trust in you may be depleted. For instance, an engineer might estimate three days for a task that she truly thinks will take one day. The engineer may plan to spend two days documenting it, or two days working on some other useful project. But it will be detectable that the task was done in only one day (if it turns out that way), and the appearance of slacking or overestimating is born. It's far better to give proper visibility into what you are actually doing. If documentation takes twice as long as coding and the estimate says so, tremendous advantage is gained by making this visible to the manager.
Pad explicitly instead. If a task will probably take one day---but might take ten days if your approach doesn't work---note this somehow in the estimate if you can; if not, at least do an average weighted by your estimates of the probabilities. Any risk factor that you can identify and assign an estimate to should go into the schedule. One person is unlikely to be sick in any given week. But a large project with many engineers will have some sick time; likewise vacation time. And what is the probability of a mandatory company-wide training seminar? If it can be estimated, stick it in. There are of course, unknown unknowns, orunk-unks. Unk-unks by definition cannot be estimated individually. You can try to create a global line item for all unk-unks, or handle them in some other way that you communicate to your boss. You cannot, however, let your boss forget that they exist, and it is devilishly easy for an estimate to become a schedule without the unk-unks considered.


If you need information about concrete things that are objective and easy to verify, for example the latest patch level of a software product, ask a large number of people politely by searching the internet for it or by posting on a discussion group. Don't search on the internet for anything that smacks of either opinion or subjective interpretation: the ratio of drivel to truth is too high.
If you need general knowledge about something subjective the history of what people have thought about it, go to the library (the physical building in which books are stored). For example, to learn about math or mushrooms or mysticism, go to the library.
If you need to know how to do something that is not trivial get two or three books on the subject and read them. You might learn how to do something trivial, like install a software package, from the Internet. You can even learn important things, like good programming technique, but you can easily spend more time searching and sorting the results and attempting to divine the authority of the results than it would take to read the pertinent part of a solid book.
If you need information that no one else could be expected to know for example, ‘does this software that is brand new work on gigantic data sets?’, you must still search the internet and the library. After those options are completely exhausted, you may design an experiment to ascertain it.
If you want an opinion or a value judgment that takes into account some unique circumstance, talk to an expert. For instance, if you want to know whether or not it is a good idea to build a modern database management system in LISP, you should talk to a LISP expert and a database expert.
If you want to know how likely it is that a faster algorithm for a particular application exists that has not yet been published, talk to someone working in that field.
If you want to make a personal decision that only you can make like whether or not you should start a business, try putting into writing a list of arguments for and against the idea. If that fails, consider divination. Suppose you have studied the idea from all angles, have done all your homework, and worked out all the consequences and pros and cons in your mind, and yet still remain indecisive. You now must follow your heart and tell your brain to shut up. The multitude of available divination techniques are very useful for determining your own semi-conscious desires, as they each present a complete ambiguous and random pattern that your own subconscious will assign meaning to.





Respect every person's time and balance it against your own. Asking someone a question accomplishes far more than just receiving the answer. The person learns about you, both by enjoying your presence and hearing the particular question. You learn about the person in the same way, and you may learn the answer you seek. This is usually far more important than your question.
However, the value of this diminishes the more you do it. You are, after all, using the most precious commodity a person has: their time. The benefits of communication must be weighed against the costs. Furthermore, the particular costs and benefits derived differ from person to person. I strongly believe that an executive of 100 people should spend five minutes a month talking to each person in her organization, which would be about 5% of their time. But ten minutes might be too much, and five minutes is too much if they have one thousand employees. The amount of time you spend talking to each person in your organization depends on their role (more than their position). You should talk to your boss more than your boss's boss, but you should talk to your boss's boss a little. It may be uncomfortable, but I believe you have a duty to talk a little bit to all your superiors, each month, no matter what.
The basic rule is that everyone benefits from talking to you a little bit, and the more they talk to you, the less benefit they derive. It is your job to provide them this benefit, and to get the benefit of communicating with them, keeping the benefit in balance with the time spent.
It is important to respect your own time. If talking to someone, even if it will cost them time, will save you a great deal of time, then you should do it unless you think their time is more valuable than yours, to the tribe, by that factor.
A strange example of this is the summer intern. A summer intern in a highly technical position can't be expected to accomplish too much; they can be expected to pester the hell out of everybody there. So why is this tolerated? Because the pestered are receiving something important from the intern. They get a chance to showoff a little. They get a chance to hear some new ideas, maybe; they get a chance to see things from a different perspective. They may also be trying to recruit the intern, but even if this is not the case there is much to gain.
You should ask people for a little bit of their wisdom and judgment whenever you honestly believe they have something to say. This flatters them and you will learn something and teach them something. A good programmer does not often need the advice of a Vice President of Sales, but if you ever do, you be sure to ask for it. I once asked to listen in on a few sales calls to better understand the job of our sales staff. This took no more than 30 minutes but I think that small effort made an impression on the sales force.
^6/2/2013: I am currently guilty of doing this a little too much. Sorry everybody, I'm working on improving!


Life is too short to write crap nobody will read; if you write crap, nobody will read it. Therefore a little good documentation is best. ... Writing good documentation is, first of all, good writing. I suggest you find books on writing, study them, and practice. But even if you are a lousy writer or have poor command of the language in which you must document, the Golden Rule is all you really need: ``Do unto others as you would have them do unto you.'' Take time to really think about who will be reading your documentation, what they need to get out of it, and how you can teach that to them. If you do that, you will be an above average documentation writer, and a good programmer.



To understand it, you will have to read the source code. You will probably have to experiment with it.
This is a good time to document, even if it is only for yourself, because the act of trying to document the code will force you to consider angles you might not have considered, and the resulting document may be useful. While you're doing this, consider what it would take to rewrite some or all of the code. Would it actually save time to rewrite some of it? Could you trust it better if you rewrote it? Be careful of arrogance here. If you rewrite it, it will be easier for you to deal with, but will it really be easier for the next person who has to read it? If you rewrite it, what will the test burden be? Will the need to re-test it outweigh any benefits that might be gained?


Use assertion checking and test drivers whenever possible. This not only catches bugs early, but is very useful later on and lets you eliminate mysteries that you would otherwise have to worry about.



Source code control systems let you manage projects effectively. They're very useful for one person and essential for a group. They track all changes in different versions so that no code is ever lost and meaning can be assigned to changes. One can create throw-away and debugging code with confidence with a source code control system, since the code you modify is kept carefully separate from committed, official code that will be shared with the team or released.


When stumped, take a break. I sometimes meditate for 15 minutes when stumped and the problem magically unravels when I come back to it. A night's sleep sometimes does the same thing on a larger scale. It's possible that temporarily switching to any other activity may work.



When disagreement arises, it must be resolved somehow, it cannot be ducked for long. Difficult people are often extremely intelligent and have something very useful to say. It is critical that you listen and understand the difficult person without prejudice caused by the person. A failure to communicate is often the basis of disagreement but it can sometimes be removed with great patience. Try to keep this communication cool and cordial, and don't accept any baits for greater conflict that may be offered. After a reasonable period of trying to understand, make a decision.
Don't let a bully force you to do something you don't agree with. If you are the leader, do what you think is best. Don't make a decision for any personal reasons, and be prepared to explain the reasons for your decision. If you are a teammate with a difficult person, don't let the leader's decision have any personal impact. If it doesn't go your way, do it the other way whole-heartedly.
Difficult people do change and improve. I've seen it with my own eyes, but it is very rare. However, everyone has transitory ups and downs.



Finally, if possible, measure the impact of your work in terms of something that will be personally motivating. For example, when fixing bugs, counting the number of bugs that I have fixed is not at all motivational to me, because it is independent of the number that may still exist, and is also affects the total value I'm adding to my company's customers in only the smallest possible way. Relating each bug to a happy customer, however, is personally motivating to me.





To be trusted you must be trustworthy. You must also be visible. If know one knows about you, no trust will be invested in you. With those close to you, such as your teammates, this should not be an issue. You establish trust by being responsive and informative to those outside your department or team. Occasionally someone will abuse this trust, and ask for unreasonable favors. Don't be afraid of this, just explain what you would have to give up doing to perform the favor.
Don't pretend to know something that you don't. With people that are not teammates, you may have to make a clear distinction between ``not knowing right off the top of my head'' and ``not being able to figure it out, ever.''




Learning new skills, especially non-technical ones, is the greatest fun of all. Most companies would have better morale if they understood how much this motivates programmers.
Humans learn by doing. Book-reading and class-taking are useful. But could you have any respect for a programmer who had never written a program? To learn any skill, you have to put yourself in a forgiving position where you can exercise that skill. When learning a new programming language, try to do a small project it in before you have to do a large project. When learning to manage a software project, try to manage a small one first.
A good mentor is no replacement for doing things yourself, but is a lot better than a book. What can you offer a potential mentor in exchange for their knowledge? At a minimum, you should offer to study hard so their time won't be wasted.
Try to get your boss to let you have formal training, but understand that it often not much better than the same amount of time spent simply playing with the new skill you want to learn. It is, however, easier to ask for training than playtime in our imperfect world, even though a lot of formal training is just sleeping through lectures waiting for the dinner party.
If you lead people, understand how they learn and assist them by assigning them projects that are the right size and that exercise skills they are interested in. Don't forget that the most important skills for a programmer are not the technical ones. Give your people a chance to play and practice courage, honesty, and communication.




Carefully consider the cost of a meeting; it costs its duration multiplied by the number of participants. Meetings are sometimes necessary, but smaller is usually better. The quality of communication in small meetings is better, and less time overall is wasted. If any one person is bored at a meeting take this as a sing, that the meeting should be smaller.


Disagreement is a great opportunity to make a good decision, but it should be handled delicately. Hopefully you feel that you have expressed your thoughts adequately and been heard before the decision is made. In that case there is nothing more to say, and you should decide whether you will stand behind the decision even though you disagree with it. If you can support this decision even though you disagree, say so. This shows how valuable you are because you are independent and are not a yes-man, but respectful of the decision and a team player.


Build vs. Buy: after considering these questions, you should perhaps prepare two draft project plans, one for building and one for buying. This will force you to consider the integration costs. You should also consider the long term maintenance costs of both solutions. To estimate the integration costs, you will have to do a thorough evaluation of the software before you buy it. If you can't evaluate it, you will assume an unreasonable risk in buying it and you should decide against buying that particular product. If there are several buy decisions under consideration, some energy will have to be spent evaluating each.


Assume responsibility in excess of your authority. Play the role that you desire. Express appreciation for people's contribution to the success of the larger organization, as well as things as that help you personally.
If you want to become a team leader, instigate the formation of consensus. If you want to become a manager, take responsibility for the schedule. You can usually do this comfortably while working with a leader or a manager, since this frees them up to take greater responsibility. If that is too much to try, do it a little at a time.
Evaluate yourself. If you want to become a better programmer, ask someone you admire how you can become like them. You can also ask your boss, who will know less but have a greater impact on your career.
Plan ways to learn new skills, both the trivial technical kind, like learning a new software system, and the hard social kind, like writing well, by integrating them into your work.


If there is not crisp definition of success, you will not succeed.


You should allow people (including yourself) to fail occasionally and should plan for some failure in your schedule. If there is never any failure, there can be no sense of adventure. If there are not occasional failures, you are not trying hard enough. When someone fails, you should be as gentle as you can with them while not treating them as though they had succeeded.


You balance your personal needs against the needs of the team in choosing what aspect of a project to work on. You should do what you are best at, but try to find a way to stretch yourself not by taking on more work but by exercising a new skill. Leadership and communication skills are more important than technical skills. If you are very strong, take on the hardest or riskiest task, and do it as early as possible in the project to decrease risk.



To get the most from your teammates, develop a good team spirit and try to keep every individual both personally challenged and personally engaged.
To develop team spirit, corny stuff like logoized clothing and parties are good, but not as good as personal respect. If everyone respects everyone else, nobody will want to let anybody down. Team spirit is created when people make sacrifices for the team and think in terms of the good of the team before their own personal good. As a leader, you can't ask for more than you give yourself in this respect.
One of the keys to team leadership is to facilitate consensus so that everyone has buy in. This occasionally means allowing your teammates to be wrong. That is, if it does not harm the project too much, you must let some of your team do things their own way, based on consensus, even if you believe with great confidence it is the wrong thing to do. When this happens, don't agree, simply disagree openly and accept the consensus. Don't sound hurt, or like you're being forced into it, simply state that you disagree but think the consensus of the team is more important. This will often cause them to backtrack. Don't insist that they go through with their initial plan if they do backtrack.
If there is an individual who will not consent after you have discussed the issues from all appropriate sides, simply assert that you have to make a decision and that is what your decision is. If there is a way to judge if your decision will be wrong or if it is later shown to be wrong, switch as quickly as you can and recognize the persons who were right.
Ask your team, both as a group and individually, what they think would create team spirit and make for an effective team.
Praise frequently rather than lavishly. Especially praise those who disagree with you when they are praiseworthy. Praise in public and criticize in private; with one exception: sometimes growth or the correction of a fault can't be praised without drawing embarrassing attention to the original fault, so that growth should be praised in private.



To gather support for a project, create and communicate a vision that demonstrates real value to the organization as a whole. Attempt to let others share in your vision creation. This gives them a reason to support you and gives you the benefit of their ideas. Individually recruit key supporters for your project. Wherever possible, show, don't tell. If possible, construct a prototype or a mockup to demonstrate your ideas. A prototype is always powerful but in software it is far superior to any written description.



The best way to tell someone about a problem is to offer a solution at the same time. The second best way is to appeal to them for help with the problem. If there is a danger that you won't be believed, you should gather some support for your assertion.







Below is the Table of Contents:


2. Beginner
Personal Skills
Learn to Debug
How to Debug by Splitting the Problem Space
How to Remove an Error
How to Debug Using a Log
How to Understand Performance Problems
How to Fix Performance Problems
How to Optimize Loops
How to Deal with I/O Expense
How to Manage Memory
How to Deal with Intermittent Bugs
How to Learn Design Skills
How to Conduct Experiments
Team Skills
Why Estimation is Important
How to Estimate Programming Time
How to Find Out Information
How to Utilize People as Information Sources
How to Document Wisely
How to Work with Poor Code
How to Use Source Code Control
How to Unit Test
Take Breaks when Stumped
How to Recognize When to Go Home
How to Deal with Difficult People
3. Intermediate
Personal Skills
How to Stay Motivated
How to be Widely Trusted
How to Tradeoff Time vs. Space
How to Stress Test
How to Balance Brevity and Abstraction
How to Learn New Skills
Learn to Type
How to Do Integration Testing
Communication Languages
Heavy Tools
How to analyze data
Team Skills
How to Manage Development Time
How to Manage Third-Party Software Risks
How to Manage Consultants
How to Communicate the Right Amount
How to Disagree Honestly and Get Away with It
Judgement
How to Tradeoff Quality Against Development Time
How to Manage Software System Dependence
How to Decide if Software is Too Immature
How to Make a Buy vs. Build Decision
How to Grow Professionally
How to Evaluate Interviewees
How to Know When to Apply Fancy Computer Science
How to Talk to Non-Engineers
4. Advanced
Technological Judgment
How to Tell the Hard From the Impossible
How to Utilize Embedded Languages
Choosing Languages
Compromising Wisely
How to Fight Schedule Pressure
How to Understand the User
How to Get a Promotion
Serving Your Team
How to Develop Talent
How to Choose What to Work On
How to Get the Most From Your Teammates
How to Divide Problems Up
How to Handle Boring Tasks
How to Gather Support for a Project
How to Grow a System
How to Communicate Well
How to Tell People Things They Don't Want to Hear
How to Deal with Managerial Myths
How to Deal with Organizational Chaos


http://samizdat.mines.edu/howto/HowToBeAProgrammer.html

Improving batteries

Supercapacitor

http://edition.cnn.com/2013/05/20/tech/whiz-kid/index.html?sr=fb052413chargephone20sec1a

Alphalab Gear

Hardware/robotics startup incubator. May come in hand in the future.

http://alphalab.org/gear/faq

Early Action Deadline: July 15 at 11:59 PM Pacific
Application Deadline: September 3rd at 11:59 PM Pacific
Cycle 1 begins: October 2013
Cycle 1 ends: May 2014

3d printing food

Not sure how I feel about Dean Kamen's surgically implanted aspiration device. Seems like unnecessary surgery and sounds kind of gross.

http://www.motherjones.com/tom-philpott/2013/05/hunger-obesity-hacker-3d-printed-meal

Persistence of vision in bicycle wheels

Display images in your bike wheels.

http://www.kickstarter.com/projects/minimonkey/monkey-light-pro-bicycle-wheel-display-system

Conducive Paint

Draw your own circuits.

http://edition.cnn.com/2013/05/23/tech/innovation/bare-electrically-conductive-paint/index.html

DIY Drones

Jordi Munoz

Sunday 26 May 2013

Next computer: desktop

Build a desktop once I settle down and won't be moving for an extended period of time.

Saturday 25 May 2013

Overcoming OCD

"Some of you will know who I am, but I am not concerned with that anymore. I am here to deliver a message.
"When I opened that email and checked to see if I was accepted, I ran to my mom and hugged her with the biggest smile. Then, I did a summer program at MIT and met the best friends anyone could ever ask for. When it was time to start my freshman year, I walked through the infinite with more confidence than well, a pre-frosh who was just accepted into the best school in the world. I did well my first semester, with the help and support of my friends of course. Soon after, it was time for my first IAP. During the month of January I came home. I remember the terrible drive home. I couldn't stop thinking of equations and concepts that I just finished talking about with my peers. This seems common and normal, but the extent by which it took over my time was abnormal. When I arrived home, my thoughts became even worse. They were magnified tenfold. I knew something was wrong when I could not sleep, eat or shower. I was avoiding everyone. I felt like I was there physically, but not mentally. I could not finish what I wanted to do during IAP, which was to prepare for classes for the upcoming semester. When I could not take thinking about the same concepts over and over and over again for hours and even days straight, I finally broke down. I cried in front of my father and told him what was wrong. I knew what I had. It was an evil, monstrous imp in my mind, that did not give up. It was a malignant tumor in my head that would not stop growing. It was a soul-sucking fiend that was never satisfied. I diagnosed myself and saw a psychiatrist, who at first did not believe me. Oh, how wrong he was. After giving me some zoloft, it was already time for the next semester.
I could not keep up with the classes I was taking. I emailed my professors with page long emails asking them deep questions that were not relevant. I had the biggest urge to derive, prove and question everything I was taught. When I couldn't handle it anymore, I sought help from MIT medical. Thinking I was suicidal, they sent me to Cambridge Hospital. I spent the night there, scared and worried. I sent a text out to all my friends talking about where I was. They became extremely worried and visited me at the place where I went to next. I was delivered to the best hospital in the world actually. But, sadly they first sent me to a psychiatric ward, where they took away my cell phone, laptop, and any other electronic devices I had. I couldn't even tell my parents where I was. They just kept me there with no definite time of leave. I wasn't allowed to go outside on my own and there were mandatory check ups every 10 minutes. This was one of the most horrible experiences in my life. I was stuck with people with bipolar disorder, schizophrenia...etc. I felt so alone, so isolated, and just plain violated. Then I heard of an institute, an institute that was the best of its kind, just like MIT. An institute to make me better. I was fortunate enough to attend that institute for about 13 weeks. I met the best of friends there. People who were dealing with the same problems I was dealing with. There were definitely many ups and downs, but I survived. I took exposure response prevention therapy along with cognitive therapy and classes for healing. When it was time for my departure, MIT informed me that I would have to complete some steps before returning. I would need to take classes "somewhere else" before coming back so they could tell I was ready for the institute's course load. So I did exactly that. I took classes at Columbia University. Then I took classes at another university and I received all A's.
And here I am today. With the help of constant psychotherapy and medicines, and the unforgettable support of my friends, I was able to overcome Obsessive Compulsive Disorder. Here I am today, writing this message. I am on summer vacation working as a teacher and a private tutor, with a whole bunch of experience points on my back.
Now what was the point of me telling you my deepest, darkest secret? I need your help. I need your prayers for me. I am applying again to MIT. My application is due on June 15th, and I find out around August if I got in. I did it once with early action, but now I need to do it again. I am nervous and anxious about the whole thing. But I am also confident and I feel strong. Please, pray or hope or just have faith in me. I don't need sympathy, but I need closure. This disorder is something that I have conquered, not by myself, but with the help of others. I wanted to let the MIT community know that OCD is not just a quirk or a little problem where people wash their hands too much or organize things too much. NO. It is much more than that. It is a crippling, mental disorder than is unbearable without help. But thank God that is over for me. I am ready for MIT.
I love MIT so much. I cannot express in words how much I have missed p-setting and staying up all night there. I want to again be part of the MIT community.
Don't take anything for granted. I know I will not anymore. Thank you for reading. I hope to see you soon. Live strong and forever MIT!" "


source: MIT confessions on facebook

10 lessons before college


  1. People older than you like it when you admit you have a lot to learn.
  2. There is no such thing as a secret – share only what you want the world to know.
  3. Someone is always watching – good or bad.
  4. Don’t do things because someone else succeeded while doing them, create your own path – trust me it’s more fun that way (you never know what’s next).
  5. It is okay to make sacrifices. You will not be young forever but you will also be older before you know it.
  6. The more chances you take the more times you will fail. Brace yourself.
  7. School doesn’t get easier.
  8. You will continuously have less time than you did the year before – every year.
  9. Be selective with who you share your successes with.
  10. Don’t waste your time trying to change other people’s opinion of you; instead spend time figuring out who you are and eventually others will follow.


source: missing link

Computer diagnosis algorithms

I don't understand how an algorithm can be used to diagnose. Is it curve-fitting based on previous cases of patient data?

5/27: probably. the machine learning is probably on patient data used to fit symptoms and measurements of previous patients to match diseases. like webmd but more quantitative.

source: http://mashable.com/2013/05/21/computer-leukemia-diagnosis/

Upgrade wardrobe

Dressing nicely gives people a good first impression. They assume you have money and that you require more money to work with since cheaper offers are not worth your time.

source: http://www.quicksprout.com/2011/09/12/why-you-should-dress-to-impress-%E2%80%93-the-roi-of-fashion/

Hire nice people

Hire nice people, because some of the smartest people can be hard to work with. Company culture is important, and you want a friendly one.

source: http://www.inc.com/magazine/201306/jeremy-quittner/i-hire-nice-people.html

To learn: Optimal Control

the fundamentals of optimal control theory with application to several areas including robotics and aeronautics. Specific topics include: extrema of functions and functionals with and without constraints, Lagrange multipliers, optimization of continuous and discrete time dynamic systems with and without contraints, interior points, bang-bang control, Pontryagin maximum principle, Hamilton-Jacobi-Bellman equations, singular optimal control, and adaptive optimal control.

Wednesday 22 May 2013

Insects are meat

Insects are considered meat.

When to ask questions

I used to be a strong advocate of asking questions whenever you don't understand something. However, as I've begun narrowing down my interests and specializing in topics, I've revised my philosophy. Now, primarily because of how time is a limited resource, I believe you should ask questions when you actually want to know something.

The difference is asking questions when you "don't know" versus when you "want to know".

Dragonfly robot

Just like its model in nature, this ultralight flying object can fly in all directions, hover in mid-air and glide without beating its wings. 




Festo is a German company. A job there would be awesome, I really agree with their bio-inspired designs.

16250 Gadgetry S13 notes archive



Installing the AVR Toolchain


The Atmel AVR microcontroller comes with an array of software and hardware tools used to write, compile, and download compiled code onto the microcontroller. Some of these programs are provided by Atmel, and some are open source and developed by the community. This document will describe the underlying software and hardware that allows programming of the AVR, two Windows OS environments that we frequently use, and guide you through compiling and downloading programs with these tools. It also points you to software in case you prefer to use Mac or Linux OS.
 

Development Environments

Windows

WinAVR. WinAVR is an integrated package that provides an IDE (programmer’s notepad) that has avrgcc, avr-libc, and avr-dude (see below) built in. We strongly suggest that you use WinAVR if you use Windows. You can download the WinAVR executable at:
 
The drivers for your avr-isp are located in WinAVR's utils/libusb/bin directory. If you have trouble because windows won't let you install the drivers because they're unsigned, you can signed drivers at http://mightyohm.com/blog/2010/09/avrisp-mkii-libusb-drivers-for-windows-7-vista-x64/
 
-- or --
 
AVR Studio. AVR Studio is the official development environment distributed by Atmel – it is a windows only application. You can use it to write code and to configure your AVR-ISP and use it to download code to the gadget. We never use AVR Studio for code development, and only use it with the AVR-ISP. We don't use AVR Studio, but you should know about it and if you'd prefer to be different, you can use it for both code development and firmware programming. See:
 
Important Note: You may need the ‘filter version’ of LIBUSB to use both AVRStudio and WinAVR simultaneously with your AVRISP2.
 

Mac

Crosspack. Mac has an integrated development environment like WinAVR for Mac OS called crosspack. You can get it:
 

Linux

From Ubuntu packages. On Ubuntu, you can simply install the packages (sudo apt-get install) avrdude and avr-gcc.
 
From source. You will need to install the low-level avr-gcc, avr-libc, and avr-dude tools (see below) separately. Here’s a step by step guide to installing these tools:
 

Tools

AVR-GCC. avr-gcc is the open source compiler that allows programs written for the AVR-series microcontroller to be turned into machine code (.hex files) that can be downloaded to an AVR. The language of AVR-GCC is C. You can read more about avr-gcc at:
 
AVR-LIBC. avr-libc provides the definitions for all of the address locations for the many registers on every current AVR device, and also provides a library of functions specific to AVR devices that are generally useful (things like delay program execution). Without avr-libc, programming for AVRs would be much more difficult as you would need to look up in the datasheet and write into your code things like the specific hex address location of the analog to digital converter’s register just to read a sensor input. More at:
 
AVR-DUDE. avr-dude is an open source downloader tool. It allows you to take the compiled code of your program and download it through a hardware device (like the AVR-ISP mkII) to your gadget. It also allows you to set up the gadgets’ fuses, or general settings. More at:
 
AVR-ISP (mkII). The AVR-ISP is a hardware device that allows you to download compiled files (.hex files) from the computer to your AVR microcontroller. In some ways, it is itself a gadget – it contains a PCB with an AVR microcontroller, a USB interface, and a blinky LED. Most importantly, it also has a six pin ribbon cable which goes to a mating connector on your board (at least if you included it when designing your PCB, which you should have done). You can connect the ribbon cable in two orientations: Wrong or Right. Fortunately, connecting it in the wrong orientation will not harm your gadget or the AVR-ISP, but if you do so the AVR-ISP’s LED will blink orange and you will not be able to download firmware to your gadget. More information at: http://www.atmel.com/tools/avrispmkii.aspx

---

Compiling and Download Programs

Printer-friendly version

How to Compile and Download Programs

This tutorial takes you through the following steps:
  • Configuring the makefile
  • Compiling code
  • Downloading the compiled code
  • Fuse Settings
The tutorial assumes that you're using a Gadgetry course mini-gadget and that you are using an AVR-ISP mkII to download code to the board.

The Makefile

The makefile is a big, scary file that configures how the low level tools will operate.  Fortunately for you, very few of the options are relevant.  Here’s what you’ll need to regularly adjust:
MCU.  Set this to whatever microcontroller you’re using. Like MCU = attiny84.
TARGET.  Set this to the name of the file with the “main” function that you would like to compile.  Leave off the .c extension.  Like TARGET = BlinkyProgram
F_CPU.  This option tells the compiler the clock speed of your board (it does not configure that clock speed – that’s done in the fuses).  Set it to whatever your input clock speed is in Hz. Like F_CPU = 8000000.
The following three you should rarely need to adjust.
AVRDUDE_PROGRAMMER.  This tells avr-dude which programming dongle you’ll be using. You bought an avr-isp mkII from us, so you’re probably using that. AVRDUDE_PROGRAMMER = avrisp2.
AVRDUDE_PORT.  Tells avr-dude what port on the computer you’re using (back in the day when computers had ports other than USB). For avr-isp mkii, this is just AVRDUDE_PORT = usb.
AVRDUDE_WRITEFLASH and AVRDUDE_WRITEEEPROM.   These are the configuration lines that tell avr-dude which flash and eeprom files to write and how quickly to do so.  Your makefile defaults should be fine.

Compiling Code

Compiling a program in is very easy (once you get the hang of it):
1. Make sure you’ve configured your makefile to point to the correct target program.
2. Open the program in programmer’s notepad and go to Tools->Make All, or if you aren’t using WinAVR or Crosspack, just use a command prompt, navigate to the directory of your program .c file and Makefile, and type “make all”.
3. If your program has no syntax errors, it will compile down to a .hex file, which you will find in your directory. If it has errors, enjoy interpreting the error messages to figure out what you did wrong and try again.

Downloading Code

Downloading code is easy:
1. Make sure your gadget is powered on, your AVR-ISP is plugged into your computer, and the gadget and AVR-ISP are plugged in.
2. Make sure you’ve plugged the AVR-ISP‘s ribbon cable in correctly (green light, instead of flashing orange light). The ribbon cable should hang over top of the serial/charging pins.
 
3. Once you’re ready, in programmer’s notepad go to Tools->Make Program, or from the
command line, just go to the directory of interest and type make program.
 
4. The AVR-ISP mkII’s LED should turn solid orange and you should see an ASCII progress bar made of # signs making its way from left to right.
 
5. Your gadget will do what you programmed it do, and you can do the dance of joy.

Setting Fuses

Fuses are configuration options for how the microcontroller will operate that are independent of your program. Thus, they typically only need to be set once for any gadget, and this should be done before you put a program on the gadget. There are a number of fuses that are typically configured:
 
Clock source and speed. This fuse sets the source of the clock (internal oscillator or external sources of different frequencies)
 
CKDIV8. This fuse divides the input clock by eight. We like to run our gadgets fast, so we typically uncheck this fuse, but it is on by default.
 
Brown-out detection. This fuse sets whether the microcontroller will reset or attempt to continue running if a brown-out is found. Brown-outs are voltage drops that can be caused by high-current events (like switching motors from full forward to full reverse). The fuse allows the brown-out detection to be set to several different voltage levels. If you use this, make sure to set it significantly under the regulated voltage that your gadget operates at.
 
BOOTRST. Enables or disables a boot reset vector. This needs to be enabled if you’d like your gadget to have a bootloader. A bootloader allows you to update the firmware over USB or another communications interface without using the AVR-ISP.
 
Bootloader size. Sets the amount of program memory dedicated to holding the bootloader. If you use a bootloader, this must be at least as big as the size of your bootloader firmware.
 
There are a number of other options that may be important based on your individual gadget, and we will provide the default fuse settings for your project 1 and 2 gadgets. Your mini-gadget was already configured with the correct fuse settings when the test program was loaded on it.

---

Gadget Serial Communication

Printer-friendly version

Testing Serial on your Gadget

Description

All gadgets in Gadgetry have a USB serial port which can be used to communicate with the computer.  This tutorial gives a brief overview of how to use a terminal program to communicate over serial with your gadget.

Serial Communication

The serial communication protocol we use on the gadget is a three-wire variation of an old protocol called RS-232.  RS-232 used to be used frequently on computers, but has been replaced entirely by USB; however, it is still often used in embedded devices.  There a number of characteristics of the protocol that can be modified:  Baud rate, Parity, Data bits, Stop bits, and Hardware Flow control.  For our purposes, only the baud rate matters and the rest of these should be left to the following default values:
Parity:  None
Data bits:  8
Stop bits:  1
Hardware Flow Control:  None
The baud rate is a measure of the speed of communication - higher baud rates allow more data to flow, but may also result in higher error rates.  Typically, we use 115,200.  A commonly used low speed backup is 9600.  

Serial Terminal Programs for Windows

A number of terminal programs are available for Windows:  HyperterminalTeraTerm, and RealTerm.  In our experience, RealTerm is by far the most flexible, and this guide will cover how to setup RealTerm to communicate with a gadget.
2.  Launch Realterm and go to the Port tab.
3.  Select a port number corresponding to the serial port number of your gadget.  You can find this by going to the device manager, expanding the Ports (COM&LPT) item, and seeing what number is next to the USB Serial Port (It should be COMXX).  Select a baud rate of 115200 (or whatever you are using), and make sure the rest of the settings are set to defaults:
4.  Once you have made the appropriate baud rate and port selections, hit the "Open" button to open the port.  If you have a program that prints something, it should now be appearing on the screen.  To send a character or file, you can either use the Send tab, or you can click on the black portion of the window and type your characters.
5.  Advanced:  The Display tab can come in handy for debugging non-Ascii characters - you can use it to print out received characters as hex, decimal, or even binary.

Serial Terminal Programs for Mac/Linux

Coolterm is recommended for those using a Mac.
There are two options for terminal programs that work in both Mac and Linux - minicom and gtkterm.

---


Programming Primer

Printer-friendly version

Programming in C, a Primer

Purpose

This document is meant as an aid for those who have minimal or no programming background. 

Description

In Gadgetry, we will be programming microcontrollers using a version of the C programming language that has been specialized to small 8-bit microcontrollers.  C is perhaps the most durable programming language ever; it is still relevant 30-40 years after it was designed.  This document will cover the very basics of programming in C.  We will discuss syntax, variables, conditionals, loops, and functions (concepts that are common to all programming languages) and do so while showing examples that use C syntax.

Syntax

Syntax for programming languages is like grammar for natural languages:  It is the rules under which statements are structured.  It is also the most common cause of errors for beginning programmers.  The syntactic rules of programming languages are very strict, and violating them will cause either compiler errors, or (possibly worse) logical errors that allow your program to compile but function in mysterious ways.  Here are two general syntactical rules:
End statements with a semicolon, except when otherwise indicated
Make sure every open brace has a matching close one, and keep track of brace pairings
Each of the following topics will show some proper syntax for using a given construct.

Variables

Variables are just program elements that store a value (that can be varied during program execution).  There are many types of variables, but there is only one that really matters to begin writing programs:  The int variable type (if you want to look up other types, you can also use char, bool, float, and double types in your programs).  An int is a variable that stores integers, or whole numbers.  This type has a natural range of numbers – it can store any number between -32,768 and +32,767 (it is 16 bit, so the range can have no more than 2^16th positions, and the range is centered on 0).  To declare a variable in C, do the following:
int theAnswer;
You can also give it an initial value:
int theAnswer = 42;
Variables must be declared at the start of a function.  Once declared, you can use them throughout the function (Which is not the same as your whole program if you have multiple functions).  Note that once declared, you don’t need (and aren’t allowed) to put the keyword ‘int’ before them.  For example:
int main(void)
{
// This is a comment – the start of the function comes after the open brace “{“
            // Here I am declaring three variables
            int theAnswer = 42;
            int questionOne = 6;
            int questionTwo;
            // Here I am using the variables in my program – note no “int”
            questionTwo = theAnswer/questionOne;
}
If you want to make a variable that can be used in multiple functions, you can declare what is known as a global variable.  You should do this right after any #include and #define statements are used, but outside of any function braces.  Global variables are commonly used in this type of embedded programming.
You can use regular mathematical operations with integers (+,-,*,/), but be aware that you should avoid exceeding the integer range.  Also, since ints are integers, if you divide and have a remainder, the remainder will be removed (so 23/5 = 4, NOT 4.6).  If you want to see what the remainder would be, use the modulus operator ‘%’ (as in 23%5 = 3).

If statements

If statements are ways to have your program execute fragments of code only if certain conditions are met.  Thus, they are very important to use if you have sensors on your gadget and want to do something based on a sensor value.  The following is the basic structure of an If-statement:
if(condition1 is true) {
            execute plan A;
}
else if(condition2 is true) {
            execute plan B;
}
else {
            execute plan C;
}

The structure is very flexible – the only required part is the if, you can opt to have an else, or an else if, and you may have as many else ifs as you like (though only one else). 
The part in the () is the conditional statement that is evaluated.  There are a number of logical operators that can be used to create a conditional statement – they are:  less than ‘<’, greater than ‘>’,less than or equal to ‘<=’, greater than or equal to ‘>=’, equals ‘==’ (yes, two equal signs, you use one for assigning a value to a variable, two when comparing two values).  Furthermore, you can chain statements together to make larger statements through the use of a logical or ‘||’, and a logical and ‘&&’.  Lastly, you can logically evaluate a single variable in an if-statement without any operators.  This works because in C, any value that is 0 is consider false, and a value that is not 0 is consider true.  So you can construct an if like:
if(theAnswer)
{
   print(“theAnswer is clearly non-zero”);
}
This is useful when you have digital inputs like buttons, as they will be read in as either 0 or 1, depending on if they are open or closed.
For an if-statement, you should place any code you wish to execute for each statement in { } after the if statement.  You should not place a semicolon after the if, else if, or else statements.  The following are some example statements using proper syntax:
int main(void)
{
            int theAnswer = 42;
            int question1 = 6;
            int question2 = 9;
            int sensorValue;

            if(theAnswer == (question1*question2)) {
                        blinkGreenLED();
            }
            else {
                        blinkRedLED();
            }
            // Here we’re calling a function that will return a value, which is copied into ‘sensorValue’
            sensorValue = readSensor();
            // In English, if the sensor is less than 100 and more than 50, do the following
            if((sensorValue < 100)) && (sensorValue > 50)) {
                        blinkGreenLED();
            }
            else if(sensorValue >= 200) {
                        blinkRedLED();
            }          
            else if((sensorValue <=50) || (sensorValue > 100)) {
                        blinkOrangeLED();     
            }
            else {
                        turnOffLEDs();           
            }

Looping

Looping is a way to specify repetition in your program without having to write repetitive code.  There are two types of loops you may wish to use – the while, and the for.  The for loop summarizes some things in the loop statement and so can make your code somewhat more concise.  The while loop looks like this:
while(condition is true) {
 do stuff;
}
You’ve learned about conditions from if-statements; the ones used by the while loop are of the same structure and can employ the same logical operators.
The for loop is a little trickier:
int counter;
int someValue = 14;
for(counter = 0; counter < someValue; counter++) {
  do stuff;
}
The for loop has three elements – first it sets a pre-declared variable to a value, in this case 0.  Then it has a conditional statement using that value (in this case, checking if it is less than someValue).  Finally, counter++ is a short hand way of saying increment the value of counter by one (equivalent to counter = counter+1;).  This is convenient if you wanted to run through some code a set number of times.  Just like if statements, for and while loops don’t end in semi-colons.
In our case, all programs you create will have a while loop that executes part of your program so long as the gadget is turned on.  This is called an infinite loop. This loop will contain the main elements of your program, and within it you will probably do something like check sensors –> evaluate sensor data with if-statements -> do something with outputs based on sensors.  You may also have loops within this infinite loop.  A loop within a loop is called a nested loop.

Functions 

Functions allow your program to be compartmentalized.  For example, you can have a function that reads a sensor, or blinks an LED.  By using a function, you only have to write the code once for that function, and you can then call that function in your program as much as you want.  All programs have at least one function, called main – this is where your program starts.  In main, you can call functions from a library, or functions you’ve written.  For each function, you can both send and receive values.  Values you send to a function are called arguments, values you receive are returned.  Some functions only have arguments and no return, some have just return values and no arguments, some have both, and some have neither.  

---


Circuit Board Checklist

Printer-friendly version

Circuit Board Checklist
Purpose
This checklist can be used to minimize errors made when creating the schematic and layout files of a gadget.  If any of the checklist items are unclear, email us with your question and put your files on your project page.
Schematic Items
___  The ISP header is in the schematic and the pins are connected to the same I/O pins as in the GadgetCore.sch.
___  There is a connector for the battery/power supply; either a three pin connector for a pack of AA or AAA batteries, or the coin cell holder if running from a coin cell, OR connection to VUSB for usb power.
___  You have used a voltage regulator for 3.3V or are using a coin cell.  You are using the medium voltage regulator (same circuit as the +5V, but different value) instead of the tiny one unless you are only running off USB or a coin cell.  An additional 5V regulator is required for the humidity, pressure, and sharp IR distance range finders.
___  The voltage regulator has a capacitor between the input voltage and ground, and one between VCC and ground.  The value of these capacitors is 1uF and 10uF.
___  The ERC does not produce errors.  The only warnings produced are about either missing values on connectors or about Power pins connected to signals.  Note: any errors/warnings from the GadgetCore schematic may be approved.
___  There is a capacitor to decouple the VCC and GND signals for every chip (Xmega, Hbridge, sensor chips).  The value of this capacitor is 0.1uF.
___  LEDs are connected to signals in series with a resistor.
___  Light sensors and thermistors use a voltage divider to read in the signal.
___  Buttons are not required to have an external pull-up resistor, but if this is the case they must be connected between the input signal and ground or input signal and vcc.  You will use PINCTRL to enable internal resistors.
___  Parts used have only come from the GadgetOne.lbr library, or you received special approval.
Layout
___  Decoupling capacitors are placed physically close to the VCC and GND pins on the part they need to decouple.  Copper wires between the capacitor and the chip’s pins are as short as possible.
___  Capacitors for the voltage regulator are placed as close as possible to the voltage regulator, with copper wires between the capacitors and the regulator as short as possible.
___  Connectors are placed logically, generally on the outside edges of the board.  When everything is plugged in, the connectors will not collide or obstruct one another (this is especially important for the female header of the ISP).
___  The parts are arranged in as tight a space as possible to still allow for routing of the copper wires.  Parts can be placed on both sides of the board, but it is strongly recommended that most surface mount parts be placed on the same side.
___  Mounting holes have been placed to mount the board to a housing.  You are not required to have any mounting holes if you prefer to use tape or Velcro.
___  The board dimensions (the rectangle that is brought up by default when the .brd file is first created) are moved to where you want the edges of the circuit board to be.
___  Copper wires for analog signals are slightly wider than average (12 mils is a good rule), and wires for high power signals are appropriately sized (seehttp://www.circuitcalculator.com/wordpress/2006/01/31/pcb-trace-width-calculator/)
___  The DRC rules are comfortably above the minimum specifications at this site:
___  The Copper/Dimension clearance in the distance tab in the DRC is 20 mil or more
___ The routed board passes the DRC with no errors.
___ Typing 'ratsnest' yields a message saying 'Nothing to do!'
___  Designators have been moved to clearly indicate part names and values.
___  You've run panelize.ulp to move all your tnames and bnames to layers 125/126 (or so).
___  Your name or initials and the gadget name are visible on the board somewhere.  This should be in either tvalues/bvalues or layers 125/126 (or what panelize creates).
___  You checked that your board passed www.freeDFM.com and you checked the plots of the different layers to make sure they looked right.
Handing Things In
___  .brd and .sch are posted on your project page
___ gerbers sent to freeDFM and the response email forwarded to us.  Note:  It must  say No Showstoppers! in the DFM results section, or you need to go back and fix your board!

---

Board Assembly Checklist

Printer-friendly version
You should print out and have this checklist near your board as you go through the steps.  For Gadgets One and Two.

  1. Acquire all parts, stencil, and PCB for your gadget.
  2. Fix the board and stencil to the table and apply a thin layer of paste.
  3. Place all surface mount parts on your board.
  4. Check all parts.  Double-check all polarities (dots / notches) of ICs and diodes.
  5. Place on griddle and heat until all paste is melted and flux dissipated.
  6. While still hot, visually inspect board and make sure parts are aligned to pads, particularly ICs.  Carefully adjust to ensure alignment, but do not worry about bridging or excess solder.
  7. Allow to cool.
  8. Double-check all polarities again in case things got moved during griddling.
  9. If parts are misaligned severely, use hot air gun and flux to adjust individual parts.
  10. Inspect board for excess solder / solder shorts (bridges).  Remove using hot air gun, flux, and copper braid.
  11. Solder on Through-Hole and/or any missing parts using the soldering iron and solder.
  12. Verify that all external/offboard parts can attach properly (sensors, servos, battery holders, etc).  Do not connect batteries at this time.  Attach any essential parts to your power circuit, such as power switches, but do not plug in power.
  13. Using a multimeter in resistance (or continuity) mode, verify that VCC and GND are not connected.  Large resistances are OK (such as 50k, 200k, 3 megaohm) and are probably your circuit elements.  Values close to zero indicate that you have a solder bridge, misaligned part, or wrongly placed part (dots not lining up).  Go back to #8 and look again.
  14. Using the multimeter again, verify that VDD and GND are also not connected except through large resistances.  Do the same with any other voltage nets you may have (UNREG, VLED, VMOTOR, etc).  Go back to step #8 as needed.
  15. USB:  Using a miniUSB cable, plug board in and verify that the device is properly recognized by your computer.  This should only take a few moments.  Be prepared to remove the device quickly.  If it is not recognized and/or the FTDI chip gets hot, remove it and go back to Step #8, taking extra care to inspect the FTDI and USB connector.
  16. Power Safety Test:  Connect your power circuit to a current-limited power supply.  Do not use batteries or wall adapters without a very low current fuse.  Set the power supply voltage to your normal unregulated voltage.  Set the current to 100-200mA.  Use alligator clips to connect the power supply in lieu of your normal method - such as to the battery terminals, coax jack, etc. 
  17. Turn on your power switch.  Disconnect the power immediately if the current limit maxes out.  Go back to Step #8 and look carefully.  If nothing bad happens, proceed to the next step.
  18. Using a multimeter in voltage mode, verify that your VCC to GND potential is 3.3V.  Your power led, if any, should be lit up.  If VCC is 3.3V, then your LED may be backwards and need to be flipped.
  19. If nothing seems to be going wrong, observe your board for a minute or two.  Ensure that no chips are getting unusually hot. 
  20. Load the bootloader on and try to program on your first program!

---

Gadget Progress Report

Printer-friendly version
Overview:

Completing a self-evaluation of your progress helps us determine how timely your efforts have been and how far along you are.  But more importantly it helps you figure out what still needs to be done on  your gadget!

Since this is a progress report it is expected that not all tasks will be complete.  But that does not mean you can just throw 'did not do yet' on everything!  We will be grading on how well-thought out your evaluation is as well as whether you've made reasonable progress in the 2.5 school weeks you've had to work on this.

Submission:

Respond to this questionnaire by March 24th via an email titled 'Gadget One Progress Report' to cmugadgetry@gmail.  Please, no pdfs or attachments, simply quote it in email and respond under each relevant section.

Progress Report Sections


Circuit Board & Parts:

The first step in getting your gadget together is making sure your circuit board is assembled and working.  You should have all of your parts on the board, and any external sensors and actuators should be mounted and ready to test.

Have you assembled your PCB?
Did you run into any issues completing the Board Assembly Checklist (in Course Documents)?
Have you loaded on the Bootloader?
Do you have all of your external components (if any) attached to your board and ready to test?

Housing:

The housing is a key component - this is what turns yet another green fiberglass rectangle into a human-usable device.  This is the what a user will see and this creates the first impression on your gadget's utility.  Ideally it is informative and not mysterious.

Have you thought about Assignment 10 and posted your sketches/designs?
Have you assembled your prototype housing?  How did it go?
Have you revisited Assignment 10 and completed the self-evaluation section?
Is your housing workable as-is?  Or what do you plan on improving before the final demonstration?

Firmware:

Firmware is simply software that is not expected to change much, if at all, over the course of a device's lifetime.  For extremely well-engineered (for cost and volume) systems, reprogrammability is not always an option.  In our case, however, it gives you flexibility as you fine tune your prototype to perform a desired task, whether it be what you initially planned for or a new, better idea that has come to you.

Since your gadget is designed to 'translate ambient information', we can think of the software not as a bunch of code but as a few simple functions or transformations.  While it sounds fancy, all it means is that you wish to take one type of information and convert it to another in a predictable way.  If writing code is not your strong suit, having a clear understanding of the desired transformations will make the programming task far more straightforward.

Have you tested your bootloader?  This can be done with old assignments such as 'MysteryProgramtoCompile'.  You should be able to reliably enter the bootloader and reprogram new programs over and over.
What transformations do you need to achieve?  What is your input and what are your outputs?  In the case of sensor and actuators, it is important to understand the range of values you anticipate.  What values do your inputs vary between?  What desired variance do you want from your outputs?
Have you begun writing your Gadget One firmware?  You should have a new project - perhaps the 'GadgetOne.zip' skeleton from the 'Gadget One library' section of Course Documents.  Pasting in functionality from previous homeworks and AVR drivers is OK!
Plan for Unfinished Work:

Not having everything completed is OK.  Not knowing how you'll finish the remainder is not OK.  By now you should have a pretty good idea on how to approach the many miscellaneous tasks needed to put a gadget together.  If you are having trouble imagining how to complete a few of the remaining sections, then please let us know so we can talk it over or cover additional material in class.

Briefly summarize what you still have left to do. 
What do you see as the most difficult aspects?  What specifically makes them hard?
Were these aspects covered by any lecture or homeworks?  If so, which ones?  If not, which ones seem closest?

---

Bootloader and ISP

Printer-friendly version

Gadget Bootloaders

Included here are two bootloader files for Gadgetry Gadgets.  We utilize the XBoot, a nice and flexible bootloader from http://code.google.com/p/avr-xboot/ .  It lets you choose miscellaneous options like which port to look for data on and how to enter the program (such as holding the button down on powerup). 
The first, dated 1-11-2011, runs at 115200.  The second runs at 19200 and is standard on macs and all gadgets from G1 on.  The source code for our specific variants is also attached.

Loading Bootloaders

There are two steps in getting a bootloader working.  You need to load the bootloader on using an external In-Series Programmer (ISP).  Then you need toenable the bootloader reset fuse, also via the ISP.
  1. Load AVR Studio or equivalent onto your computer.  To use the AVR Dragons in the lab, best to use AVR Studio 5 beta.  It is already loaded on the REL laptop Lothlorien.
  2. Open AVR Studio and connect the AVR Dragon via USB.
  3. Connect the 6-pin cable between your gadget and AVR Dragon and ensure that your gadget is powered on.
  4. Go to the Menu and select 'Connect to AVR programmer'
  5. Choose 'AVR Dragon' instead of AVR Simulator.
  6. Choose ATXMEGA32A4 from the long list of chips.
  7. Click 'verify voltage'.  If it isn't 3.3V, make sure your board is powered up and the 6-pin cable is plugged in the right way.  Then try again.
  8. Click 'read signature' and make sure it reads a valid ID.
  9. Click 'load program' and choose the xboot-19200.hex from the list and hit program.
  10. Now, click on the Fuses tab.
  11. Go through the list and ensure that BOOTRST is selected (other option is Application Reset).  If your gadget has had a bootloader before, it should already be selected.  If you have a brand new xmega, it defaults to application reset.

Modifying the bootloader

Attached in xboot.zip is our specific configuration of the xboot bootloader .  If you have an ISP and want to modify the behavior (such as changing where the button is, serial uart, etc.) you can make the appropriate changes, recompile it, and load it on using the instructions above.

---

G2 Code Snippets

Printer-friendly versionAttached is code to run the accelerometer, the LCD, and SD card.  Note that in all cases, you'll need to integrate the provided code into your projects, either by copying and pasting appropriate sections, or by including the .h and .c files.
Attached is some SD card code, courtesy of Vikram R., a Gadgetry '10 student.  Here is his comments for it:
I've attached the code for a simple program that will create a file
"hello.txt" and write "Hello World!" to it.

The Xmega specific stuff should be taken care of. You should only need to change the pin defines in sd.h to correspond to the SPI port you are using and/or the pins you are using for card-detect.

If you aren't using card-detect, you'll need to delete references to the
sd_card_present() function, or simply set it to always return true.

Depending on which timer counters you are already using, you may need to
change the timer counters in sd.h and/or rtc.h if there is a conflict.

The rtc.c/h files are used for counting time to use for file timestamps.
Please note that the present method is not accurate. I haven't figured out how to properly configure and use the Xmega's internal 32kHz calibrated RC oscillator to count seconds. If anyone can provide code for this, I would appreciate it.

Documentation for the FAT library is here:
http://elm-chan.org/fsw/ff/00index_e.html

---

Care and Maintenance of Solidoodle Printer

Printer-friendly version

Software Packages

Design: Anything that outputs an STL file. Solidworks recommended, you can also use Trimble Sketchup though you'll need to install a plugin to allow STL output. See the following for a Sketchup tutorial: http://www.solidoodle.com/how-to-2/how-to-create-a-3d-part/
Printing: Repetier-host is recommended. See the following tutorial for configuring Repetier: http://solidoodletips.wordpress.com/2012/08/22/setting-up-repetier-host/

In the REL

  • Before you print, plug in the big Solidoodle power supply and plug the USB cable into your computer.
  • Set the heated bed temperature manually to 85C - it'll take 20 minutes to warm up, so it's useful to do this first.
  • Import your STL file into Repetier and generate G-code as documented in the Repetier tutorial.
  • Printing will take 1-4 hours (or more), and your laptop needs to stay with the printer. You can wander off, but try to check on the printer every half hour. If something goes wrong, hit the E-stop in the software and decide if you want to/can start over. Email cmugadgetry@gmail.com if the printer broke or did something naughty.
  • Once the part is complete, unplug the Solidoodle's power supply but not the USB cable. You'll need to wait for the heated bed to cool to 40C or so (wait 20 minutes); once there it will be possible to remove it just by grabbing it. If it's small, you can use pliers.