Sunday, December 2, 2012

punt punt punt

punt punt punt
a few days ago on the facelolz i said that

It's now conclusive that I do not ask enough questions when I get stuck on things, and that this is unacceptable as it will impact my work performance. (I theorize that this ask-questions problem is why I am so mediocre at school).
Therefore, my goal for the next two weeks is to ask at least five dumb but coherent questions a day, and as proof of that I will write the answers up on my blog.
(I am still thinking a bit as to whether this casual-question-asking will actually translate to me asking more questions when I feel like people expect me to know more than I actually do).
So! then i asked questions. turns out most of the questions were so silly they don't even merit writing down and/or I've completely forgotten them. But here today I'm writing down some notes on controls courtesy of Shane with mock-quadcopter demos by Charles (not duplicated here).

some of those questions were silly questions like how do i do controls in real life, as opposed to in labview on a $10,000 national instruments card.
then my brain went "speaking of things i want[ed] to do consistently to improve on skills..."

src files. wacome graphire4 4x6, inkscape, gimp. crashlanding, caeldera, digitalstrip2 fonts from blambot. ~4.
all posts | all images ||  NEXT
the theory behind both is the same, ignore current incompetence (flaunt it? sorry, internet, for adding to the general scuz of atrocious material) and focus on learning learning learning to get to where i want to go...
(credit to MITERS folks for creative inspiration, including conversations with Dane about post-apocalypticc robot boxcar somethings.).

hmm. Right. controls.

Say I have a quadrotor. How would I go around implementing controls for it?

e.g. in 2.737 mechatronics class, we use a digital signal analyzer to characterize the plant. But no one tries to do that to their quadrotor. One possible way: mount quadrotor on stick, rotate it along one axis at a time. But, in real life:

Generally PD controllers.
If you didn't know that, you could model it as a mass and damper (really simple model). Small number for damping (only comes from moving through air, minimal), e.g. damping coefficient of 0.1. Don't know distribution of mass along quadrotor axis, so just model as evenly distributed -- really does not matter since will end up tuning gains empirically anyway.

Proportional controller is like a torsional spring. Bigger error, bigger control effort.
Derivative controller is like additional damping. Otherwise, with proportional controller will correct for error but then due to lack of damping will oscillate.

Start out with too little gain, because then it will fly but drift off to the side. With too much gain, it will oscillate and flip over. Then slowly increase P gain.

Converging on the gains -- a common method is Zieger-nichols. General idea is to up the P gain until it just begins to oscillate. Now up the damping (D gain) until compensate for oscillation, use some magical constants, ... that sort of thing.

PD fine for flying indoors. But outdoors, wind will cause constant offset. Need I[ntegral] term. Also helpful if one motor is weaker than others, other sources of constant error.

Bandwidth and sampling frequency.
Limitation: how fast can control code loop run on microcontroller (mcu). Mcu has system clock (16Mhz for atmega's). Rule of thumb, +-* each operation 1 clock cycle. Dividing integers four clock cycles. Floating point, tens of cycles. More margin because processor will need to respond to interrupts. This is upper bound on sampling frequency.
Lower bound, well, only need to respond to user input, and human reaction time perhaps 0.5 secs, 20 Hz. But also want to reject higher frequency noise e.g. from wind.

If calculate these and not overlap, need more efficient code or more powerful processor.

Tuning gains -- actually pilot dependent. Some people like higher gain despite closer to instability because will respond quicker to sudden turns. While people shooting video will want higher damping so that footage is smooth, okay to more slowly respond to errors in position. 

Segging things are like quadrotors but with one axis instead of two.

Sunday, November 25, 2012

misc. ubuntu things

I was always a bit disappointed that bash history saves  to disk only the session that is closed last.
Turns out there is a way to fix that:

vi ~/.bashrc
export PROMPT_COMMAND='history -a; history -r'

I have a vmware ubuntu 11.04 (natty narwhal) setup.
things I investigated today:

  • screenlets and digitalclock ("dark clean" theme)
    • digitalclock appears glitchy -- artifact of vmware?
    • themes for the cairo-clock
  • equinox set of themes
  • elegant-gnome theme (was not able to get this to install)
  • wallpaper-clocks
  • orta theme
Currently settled at Dusk with transparent menubars

Thursday, November 1, 2012

what is a "competent engineer"? (possibly this is just part 1)

mumble academic success mumble

Thinking back, I can't remember accurately how I felt freshman year. Now if I'd written things down in a blog post... So here I go, reporting on how I feel now as a senior.

Lately, it seems like my conversations with people outside of bland filler (well, actually useful filler like knowing what is going on in my friends' lives, but I qualify filler as things not really interesting to people in general) is focused on theorizing about how people learn.

I feel like I've been lost the entirety of my time at MIT. About all I can say for myself is that I can graduate and I am competent enough to... to? I honestly don't know.

I've always been trying to find that missing something that would let me have a happy pset / general academic experience. When I say that I don't learn well in the traditional academic model, I'm resigned, not "too cool for school". Maybe if I were more confident in seeking help. Maybe if I trusted that if I asked my friends questions, they would make the correct judgment call for themselves about their level of hosage versus their obligation to me. Maybe if I studied the material better so that I could ask credible questions (instead of my general "?___? what is everything" that I know can't be answered effectively) at office hours. Maybe if I didn't care if I should have tried harder, should have read the textbook, should have attended lecture, should have not taken a class without the prereqs, and spoke up in office hours anyway.

But maybe all I needed to do all along was be optimistic enough to bug people to help me. Maybe I wasn't missing anything except believing, trying, not flailing around and simply thinking things are doable.

I don't know. I had a pretty wonderful psetting experience recently. And thinking back, I can't remember a single instance where I had an experience like this. Even given my terrible memory, it can't have been more than a handful of times. I'd given up. I'd concluded that the only thing to do is muddle along and build things and try to figure out -- if I could do it over again, what I would try to do to get the most out of my classes. What if it wasn't that I was incapable of learning from school, but rather that I just never figured things out? That would mean that to help other people like me, the key isn't to make cool things to build, but rather to figure out how to learn the most from lectures and not flail around and get lost and lose self-confidence in the meanwhile.

So much for being secure in my goal to remain excited about everything and defiant about not digging deeper into a subject.

Lately an MIT admissions blog post title Meltdown has been making the rounds. It's really popular because it strikes a cord in most / many students here, but not everyone. Is it better or worse to experience extremes of emotion? As usual, I suppose there is no single optimal Kp for the relationship between amount of stress and drama / emotional response in a person -- but I can still wonder if there would be a more optimal one for me. How do I become competent? Yet even the competent people I know feel inadequate to some extent. So what hope is there?

I know, I know. I'm focusing on negatives again.

Maybe I can try that as an experiment -- not care what people might think, just care about what makes me happy. For just a few weeks, not care about the fact that I'm never on time either to meetings or with homework, take that as okay. This is something I am working on. I am just a person with flaws, which is okay. (At least I haven't killed anyone). YAY more experiments! :D

I think other people would find this weird. But it makes me feel better, so what the heck. I'll be that weird person with the weirdly personal blog. Because it's my blog.
edit 11/1/12 AHHHH i am such a terrible group person person.  i... i'll leave this up here because i think everyone else deserves a reminder that you're lovely.

what are real engineering

A lot of my confusion stems from trying to understand what counts as being a real mechanical engineer. Or what I would define as success.

Here are potential answers:
  • Having the confidence to build parts that people can rely on and won't fall apart
  • Creating a start-up that reaches the injection-molding stage and is cash-flow positive
  • Being able to use and even more so maintain and fix mills and lathes and other shop equipment
  • Being able to competently TA a class and answer technical questions
  • Getting As in my classes
  • Being knowledgeable like Amy and Shane and Charles in being able to tell you how to build and source almost anything
  • Being internet famous for technical things
  • Being able to fix anything that breaks
    • Knowing about cars
  • Being able to make awesome things from trash
    hi nick
    you should update your blog even more, i swear you've made at least three more instruments since then. of course I'm one to talk...
    • Being able to identify useful things from trash
    • Having professors like you and think you are competent (or at least not disappoint them)
    • Being able to help underclassmen
    Basically this is a compilation of thing I wish I were better at.

    One thing at a time, I suppose.

    Oh nyancat. This has turned into another of those whining about incompetence posts. It's interestingly hard to convince myself to tout my competencies. I can only do it when I feel really angry or snarky. I remember Amy and try to convince myself to not constantly focus on my incompetency, but rather accept it and work to remedy it. So that I can be that competent female engineer that the younger me could point to and say, that is someone I would aspire to be. Which is another annoying thing, competency is inseparable from the issue of gender disparity for me. -___-;; It's kind of distracting and rather useless in terms of actually becoming competent.

    possible competencies

    Things I am good at:

    • I've traveled. A lot. I will always have a fascination with cultures around the world.
    • I've worked with biology
    • Wanting to fix things. Being angry yet entertained at the state of the world.
    • Being enthusiastic about people learning to build things
    • Thinking in absurd ways
    • Having lots of different interests
    • I can speak and read Chinese
    • ?___? I have no idea. Nothing on here is technical competence...
    I'll leave it an open question for now. In the meantime, I am going to go sleep in the sofa under my loft, which somehow makes me feel better (except then I don't want to get up), and then wake up and finish my overdue essay. Oh, and talk to facilities about washing trash cans at 8:30 am.

    segue! hello there, trash cans behind the student center.
    something is really off about my solidworks dimensions. oh well.
    i felt silly for spending hours CADing nyancat. but after spending hours CADing a trash can (yes, I suck at CADing / CADing efficiently) I would happily go back to internet meme engineering. Also then I don't have to look at my teammates' CAD and feel terrible. Oh right, I'm supposed to feel inspired by other people's work.
    speaking of nyancat, 2.009 professor wallace shows up in a nyancat shirt sometimes.
    speaking of nyancat part 2, one of my hallmates (ben katz) got contacted by the creator of nyancat. He legit engineered nyanhat thing.
    Speaking of classes...
    Strobe Lab 6.163
    Lab 5: Bullet Photography
    In other news, I have been making shiny strobe lab pictures, even if I'm neither building high voltage strobe circuits nor going to get more than a bare minimum B in that class.

    Bullet going through a stream of water. GIMP composite of four images, flipped horizontally.

    this was the setup for the water stream photos

    this was the setup for the LN2 carnation shots and shows location of the rifle (which we didn't touch, the professor shot it)
    These pictures were with: Andrew Schlaepfer, Merritt Boyd, Monica Ruiz, and Prof. Bales

    They're so pretty! This class doesn't make me feel any more technically competent though.
    Well, anyway. Aside from classes and wondering how other people define competency, I've been mostly unproductive in terms of projects. My immediate project will be the persistence of vision poi project, and then I have two major goals (aside from getting a job or getting into grad school).
    • Help make sure the open source hardware bootcamp in China happens this summer
    • Implement my kits idea in some form, where a concrete engineering curricula is implemented using physical kits combined with online delivery of content
      (eek. I have to talk to a professor about this. Also this is my one chance of getting into grad school. Also, remind me to braindump about 2.007x sometime, which is the alternative to implementing this as my own startup...).
    • Actually document my projects. I harp on people to document their projects, but I don't really have my own cohesive documentation scheme ^^;
    With respect to thoughts about school, here is a pretty well-known TED talk:
    A transcript can be found here:

    Thursday, October 25, 2012

    General Update / Capture the Flag Competition

    I have disappeared for a long time.
    I hope to fix that by issuing... a series of short low quality posts! Or something.

    I thought I'd briefly mention the MIT Lincoln Labs Capture the Flag competition.
    image credit: the CTF people listed on the image; from the lec 1 slides
    "In this version of a "Cyber" Capture The Flag competition, you will work in teams of three to both to defend your system and attack those of others. The target system is a Content Management System (CMS) Web Application with a plug-in architecture. New functionality will be introduced during the competition via plug-ins, so be prepared to adapt to novel situations quickly."
    I'm in this with two hallmates, Pranjal and Cathy, and two dormmates. We're not super-serious about it, but I am excited!

    Back in the day before -- actually who am I kidding, I'm still this way -- I thought that computer security was reserved for really cool people. Going into this, I have no idea what's going on, which means anything I do I'll learn a lot from (even if I don't contribute anything to the actual competition). Yay! (yes, this is my "well i'm not taking any CS classes, how will i feel good about my minimal progress in becoming an engineer if I don't try to pursue multiple topics, also everything is fascinating" syndrome kicking in).

    Unfortunately, the lectures are all during 2.009 lab meetings, but they put the slides up (whoops, j/k, they took them down as of 10/25/12). But for me, while I'm learning a lot, I still have zero idea of how to actually do anything. That is, actual practice.

    One way, I learned, is to check out previous Capture the Flag competitions. In particular Pranjal mentioned the Stripe one. There's actually detailed walkthroughs for it, so I'll be checking those out.

    image credit:

    Oh yes, I should rant about that sometime. The whole attitude that: you're completely lost but you should still try to do the lab because that's how you're supposed to learn things according to years of ... tradition. Maybe that's not the way I want to learn, maybe I want to not get frustrated and lost and not learn anything and have zero confidence in myself . Maybe I want to rush through things and then when I want to, on my own time, I'll go back and learn things in depth for reals and prove to myself that I do have critical thinking skills. -___-; For instance, I don't feel like I learned 2.007 in depth, but now I want to actually be a good UA, I'm going back and reviewing the material in preparation for next semester (and just to actually learn engineering / estimation instead of putting s* together and hoping it works). (although I have zero regrets about doing the PSTaHIW method first, since it's given me the confidence / continued interest in building things that keeps me going and and gives me the confidence to go back and read up on all the engineering).

    Whoops, looks like I just ranted about it.


    Additionally, I am tired of whining about myself on my blog. I do that enough in my own head. So f* hardcore engineering, I'll place faith that I'm on the road somewhere and have fun in the meantime.

    To add to my list of things to blog about: 2.007x, post-graduation plans, cultures (MITERS) changing over time, confidence and asking questions correctly, miters seminars, the whole diy nanotech thing, parrots and swapfest, hair color, strobe lab (bullets!), how maker faire went (project packing optimization!), stepper motor position profiles, trash can washers and MIT facilities magic, things and youtube videos i've learned about china, emailing a jacob's ladder, NHK filming, one-day loft, nyanwallace, 18 MIT seniors working on washing trash cans XD || veggie co-ops, camping trips, slugtalks, ...

    (Side note: I wonder if I built a caffeine pill vending machine, would I earn money on any reasonable sort of time scale? Dispensing pills would be an interesting problem to solve, even if some days I hate trying to replicate work which has already been done infinity times by the invisible engineers of the past/present).

    I've decided to neglect The original idea was to have a blog that was presentable for job-like things, then I wanted to separate project and personal posts, and now I'm just going to try to blog, because I always find it worthwhile. Even now, I'm trying to dig up some of the files I made for MAS.863 How to Make Almost Anything, where I made a terrible site (required) and never put any of my files up, and I'm just sad. Sad. As in, there are five operating systems,  four computers, and a few USB sticks (some of which are no doubt lost), random emails in gmail, two dropbox accounts, and who the f* knows searchspace between me and my files. Sad. @___@

    Monday, October 1, 2012

    recap (maker faire, hackaday and hexarideablepod, emergency nyanpancake)

    I guess now is as good a time as any to reflect on my years of building things (years now?!). Hello, crackaday.
    Quick note: hexarideablepod is run off of two A123 magic 12v batteries and is actually controlled by drill triggers. @__@

    First, a brief interlude.

    Back in the day I made some nyancakes for MAS.863. That was cut out on the shopbot from pink foam, around which I poured a full pound of easymold two-part silicone mix, aka $26.52 1lb Easymold Silicone Rubber (price has gone up since then).
    one of the earlier tries. turns out it's sad without a mold release agent, aka vegetable oil.

    Kind of pricey for a single cake. Most of the silicone goes into the areas around the nyancake which can't really be hollowed out without doing a two-part mold process. Being utterly lazy, I didn't do that.

    Well, lately I've been thinking that a better idea is to make cute little nyancupcake molds. So Saturday around 3 am when we were packing up getting ready to leave for maker faire, I decided to emergency nyancake.
    • 3:19am
    Nancy R. Ouyang
    hi charles, can i 3d print a tiny nyancake right now?
    like 1'' x .5 ''
    if not that's okay!
    i recognize i am slightly crazily procrastinative
    • 3:21am
    Charles Guan
    squee squee squee
    0_0 do you have the stl?
    it's gonna take like 15 minutes just to heat the machine up
    i somehow think this is a bad idea 0___0
    if you're really down i'll go heat it up right now
    This actually turned out pretty well!

    So then I was staying over at Dane Kouttron-wrote-own-software-for-giant-robot-arm-turned-3d-printer-currently-printing-[transportation to be disclosed] person. After getting home from maker faire I took my 1 lb Easymold Silicone Putty ($20) (putty, because since this is way smaller I don't need to pour in the silicone) and mashed the two parts (white and purple putties) together and then stuck it into the mold. The only issue is I lost one of the eyes which wouldn't come out of the 3d print.

    The next morning, I pancaked! Using box pancake batter. This turned out surprisingly well -- the pancake batter resulted in lots of holes yet it held the shape pretty well. We vegetable oiled the interior, spooned a bit of batter in, used the spatula to speed flip everything over, and let it sit for a few minutes, and then took it off the burner and let it cool to medium hot (this is a theory, that letting it cool a bit = contracts and better shape retention, and cooling too much = well idk).

    ahhh one-eyed cat pancakes
    Then once we got to maker faire I had this awesome idea of getting someone to 3d print me a slightly larger cake mold and ask the pancake printer people to make some pancakes for me.

    Some helpful people in the 3d printer pavilion printed this out, although it finished after we left so no pancakes :'( Ah well, good shot at emergency maker faire project.

    Note spider webs, sphincter compared to earlier print; need more drool control :) Appears to be branch from MTM snap

    Okay, so back to existential crisis.

    (I am totally doing this to intro all my projects so far, because I'm shameless. Also I made a portfolio recently and realized I should actually organize things).

    I would count 2.007 as the first time I really started building things (which is an interesting thing in itself -- does this mean I only count electromechanical things I built mostly by myself?). As usual I'm plagued by my sense of inadequacy. Because I try to point out to my friends how awesome they are when they talk about their failures and envies, I can recognize the symptoms of this cognitive distortion. And at maker faire -- I got a hackaday post off of what I would call a ripoff design, when all my friends have made such awesome projects. Just at maker faire, there was Bayley and Kramnik's oneTesla (soon to be kickstarted), Nick's wholly unique forging-his-own-path-at-MITERS musical instruments and tricopter, Charles's chibikarts, Shane's crazy motor controllers, tinykart, and quadrotor, also Ben Katz's I'm-a-crazy-freshman (okay Kramnik is too but he's not new to MITERS) awesome!scooter, dgonz's scooter and robot arm, Hunter Bank's let-me-almost-make-an-entire-scooter-in-two-days (designed beforehand), Dane's crazy death scooter (pics not up yet), Ted's bike-scooter, and a ton of projects

    oh robot hexalord all the projects
    Anyway, you see what I mean? Here I'll list out how I think about my projects. I'll roughly list my projects in my scale of rather inadequate to completely inadequate. Mostly it's a combination of two axis -- how much engineering I put into it and whether it actually worked or not.

    1) hexapod 18 servo
    -- failure because I never built controls / even sensors for it. Also now dead in the water because after several plane trips, I appear to have killed the pololu serial servo controller - a whopping $50 -- which goes to teach me a lesson, buy things with the bare minimum I need because I'll likely destroy it ;___; . To become legit: need to make actual (3d printed?) case for it, also figure out servo calcs instead of beast-it-and-hope-it-works as I've been doing. Figure out how to write inverse kinematics controls, make a GUI interface, make it dance.

    2) hexaridaeblepod
    -- failure because I did very little engineering -- almost entirely a ripoff of the epic rpalanteo instructables. Also I don't think I'll be working on anything other than maintenance for a long time. Well, maybe add some LED strip lights and a speaker playing nyancat, because I am apparently hexapod nyancat project person.

    fewer kids than last year, also no rides the second day because I didn't have batteries because other people's projects ate them... ;__; the whole reason I brought hexarideablepod was to give kids rides
    Also it runs much faster / scarier at 24v but I seem to be on a blowing-up-controllers spree right now.
    3) Nyancake
    -- failure because zero engineering involved besides CADing the model.

    4) persistence of vision yoyo
    Failure because I never actually carried through on it and got it working (display text) with rotation, and got it to work as a yoyo. Although I did learn about charlieplexing, wrote terrible pov yoyo code which only worked when you waved the yoyo in a straight line.

    5) 24v motor controller (h-bridge)
    Well, I attempted to make this in 48 hours. That was a fail. I am most sad that I failed to even get to test it because I had issues with routing tiny traces under components, which the mill didn't cut out, and also soldered the caps on top instead of poking out the bottom so I couldn't reach the leads to solder them down. Derr. Fail. It was a simple H-bridge controller and I couldn't even manage that despite lots of help from the thorough documentation on Charles's and Shane's blog. Also it played into the pattern (yay cognitive distortion) of me not finishing final projects. -___-;;

    6) Electronics vending machine
    -- failure because oh yea, speaking of not-finished final projects, this was for MAS.863, I made this over 48 hours -- CAD'd and lasercut over 24 hrs -- and I skipped the entire final class for it and only brought the half-working thing to the open house. Professor Gersheneld, I'm super sorry for taking up a spot in the class and not doing my fair share of work, although I guess in the end I am the only who lost out.

    7) Random lasercutter stuff
    (lab glass, business cards, clock)
    -- failure because, well actually I really like the lab glass present for Dan Fourie (found glass of reuse = free gift for putz cruftmas), but for the most part, no engineering involved.
    gift for my friend, alice chung
    clock face for what was actually supposed to be a waterjet-marble class, but I wimped out.

    Cathy Wu! and anodized aluminum laser-etched..
    yay fuzzy pictures. "MIT 2013, Meche (2-A), ~dream it. build it. ~"
    8) Nyanweight
    -- failure because I intended to make a 3d nyancat, but ended up making an engraving only because I spent countless hours and couldn't get masterworks to overlap the cuts in the right order (yay pixels = many paths ending on the same point).

    speaking of which, I don't know where i put this. oops.

    9) hexapod reading group
    Katy Gero took charge and spearheaded the lasercutter - bristol board - doube-sided tape replica of berkeley biomimetic millisystem's hexapods. Cool linkage design. So again I had nothing to do with the design, although I'm happy I inspired people to make things.

    credit: katy gero
    10) nyantart
    -- failure because it is entirely a derivative of lvl1 work. Zero engineering! Yay GIMP trace of bitmap on internet!

    hi lasercutter <3>

    11) Metrify wireless sensors
    -- failure because I didn't do any board design (all by mark spatz) -- I was more business "cofounder" (no, we didn't pursue the project as a startup, but it did help me get a job my amazing internship at fitbit). also uber thanks to startlabs for funding us and redstar ventures for hosting us.

    daww generic chinese nrf24l01+ knockoff of nordic breakout board.
    12) 2.008 project
    -- failure due to my terrible grade in that class, also I don't feel like I contributed much to my team. I didn't pay enough attention to lecture even though I am fascinated by manufacturing, I didn't learn all the ins and outs of the magical mold-making process since I worked on the thermoform mold.

    does it say MIT? or hell?
    Hmmkay. Look, all the dumb projects I have done.

    Tuesday, September 18, 2012

    fixing the hexarideablepod shaft slipping issue

    I've had this recurring problem where the set screws on hexarideablepod prevent the aluminum torque transmission bar from slipping radially on the shaft, but have issues preventing it from slipping axially.

    Today I learned today courtesy of Mars, regarding ways to prevent axial slippage:
    • Retaining rings (clips, e-clips, c-clips, circlips) are more for axial alignment, not very load-bearing
      • E-clips are "Side-Mount External Retaining Rings" 
      • the middle part of the E isn't supposed to go inside a keyway.
        Yea, that retaining ring I put on earlier (sticking the middle part in the keyway and dremeling an imprecise groove for the other "ear" parts of the e) wasn't actually being that useful, although it did seem to help. 
    • Cotter pin + washer is a good solution, 
      • can probably take a hand drill even and drill a small diameter hole through the shaft
    • Even a small divot instead of a flat channel will go a long way to helping the set screws not slip around the shaft
    • I could mount a steel plate to my aluminum linkage and weld the linkage permanently to the motor shaft steel, 
    And then finally the "duh" easiest solution, since I'm only concerned about inward slippage, is make a PVC standoff. 

    This is super exciting, since I can finish this in 15 minutes (wellllll. If our bandsaw wasn't out of service.... a long story... oh MITERS) and then the hexarideablepod will be mostly mechanically robust.

    The electricals will be a piece of cake because I found drill triggers that are 24V 16A and make me happier than my 15V triggers. (yea, yea, I should make my own dumb motor controllers, but the packaging is just so convenient. People will even sit on turned-off hexarideablepod and play with the triggers just because). So I just need to rewire that, and make a more permanent battery mounting solution, and I'm all set.

    Oh, and find another tennis ball, I lost one of my floor protectors.
    Also add some 12V rgb LED strip lighting.

    Next for NYC Maker Faire: 
    • hexadancingpod
      • model & print new body
      • buy new pololu serial servo controller because I am too lazy to make my own
      • build battery pack
      • buy accelerometer and ultrasound (or find)
      • write software
    • nyancat singing poptart
      • arduino + speaker
      • arduino + piezo
      • attiny + piezo -> buy surfacemount attiny's, scrounge up piezos (get digikey account)
    • vending machine
      • add buttons
      • if time, add ir led sensors
      • ??? payment ???
    • pov poi
      • buy rgb LEDs
      • route board
      • packaging?
    Other notes:
    My shaft measured about 43/64'' (672 mil) , so it seems like the standard given motor shaft diameters, in this case 3/4'' (725 mil), is larger than the actual shaft size (? check this with someone).

    Some notes I was taking:

    Common ways of preventing axial slippage in the inward direction:
    • cotter pin
      • requires drilling a thin hole all the way through the motor shaft
    • retaining ring
      • requires machining a precise groove all around the motor shaft
      • which means if I lamely do it with a dremel (how do people do it anyway? build a fixture with a cutting edge, apply power to the motor, in a temporary lathe sort of way?) then the retaining ring isn't going to be very strong (it'll pop out).
      • I'm not sure about installing it since I have keyways on both sides of the shaft so it's hard to not have one of the ends of the "e" dig into a keyway instead of a groove.

    Sunday, September 2, 2012

    party plotting, also braindump of things to blog about

    Back from fitbit. Which was a freakin' awesome internship. More on that later. When I catch up with my 5000 backlogged blog posts (such as, f*** I'm an old senior now, what do I even tell freshman, oh how far I have fallen, also f*** I realized I want to go to grad school but grade fail, sometimes I hate myself, wait maybe that's all the time, my adventures around San Francisco, the Coultier fashion exhibit was awesome, also Hardware Startup Meetup at Lemnos Labs, random Chinatown restaurant was awesome, I went to the Crucible and made glass tiles,

    I did not live on a yacht nor at the Crucible this summer :'(, I should write up our startlabs experience, did I ever talk about weird Chinese social network stuff I learned last semester, I want to do hall murals, did you know paint is really expensive, emergency Europe trip, three countries in three days is terrible idea, how to avoid falling prey to corruption in Europe, did you know if you wear henna you will get to have random conversations (yay thanks to Annie Shin friend in East Bay)
    , the results of hackNYancat err hackNY
    I think it says "most APIs used." Yes, we were also known as All the APIs.
    , did I tell you I'm blond as of this morning and hopefully rainbow tonight, this person I met coming back on BART from the SF Pride Parade
    , did I mention I went to Jamaica too, I am an awesome spoiled person, f*** being technically competent if everyone envies the fact that I get to fly for free, did I mention sleeping for two nights at airports before I got home from San Francisco to Atlanta, updates on the diy nanofabrication class, updates on the 21w.789 android class with Victor Youk and Sherry Wu,

    , spontaneous presentations with diyBio olin Avery at barcamp boston

    , also there was Iron Man cosplay created at the hobby shop at Anime Boston 2012, also there will be epic MITERS seminars this semester covering Solidworks and Eagle and microcontrollers, updates on hexarideablepod (yay youtube video!

    also drill trigger motor "controllers"), scheming to finish vending machine, scheming to make a new hexapod because I killed the $50 pololu serial servo controller, I knew I should have gone with fewer outputs, how to get strange things through airport security (it helps to be female and Asian), POV poi scheming, Josh Gordonson made a more awesome spiral on the lathe for Maslab, I learned many things like strain gauges in 2.671 but not as much as I should have, I am an excellent pseudo scientist, did you see the "science" in my inkscape scientific poster caffeine study thing, open source hardware bootcamp in Shanghai likely this upcoming summer, according to David Li, khan academy + adafruit mashup is my latest Grand Vision for Becoming a Good Person and Convincing Myself Slash Others That I am Technically Competent, oh the hexapod reading group and origami hexapod making
    Go check out Katy Gero's blog! Right now! :D
    , obligatory post on origami nanorobots, tinkerCAD CAD in browser is interesting, so is nclab Online STEM library, I am crazy and dumped $600 on a solidoodle 2, crap I should get around to making Instructables for the make-ten-instructables-and-get-3dprinter-or-CNCrouter-thing, make-ten-instructables-and-get-3dprinter-or-CNCrouter-thing, Ace Monster Toys was my summer makerspace, I should blog about controls so I actually learn it before I take a grad class).

    Okay, some of those belong in my head, others belong on the MITERS blog, and some belong on the nouyang blog. Anyway.

    Right. As it turns out, I am now 21. (No, I had work, I didn't do anything on my birthday).
    Also, as it turns out, my hall hosts the first EC party of each semester. Which would be this Saturday. This clearly needs to be the subject of a qualitative scientific experiment to determine what number of drinks I need to reach a desired level of intoxication. Or maybe the I'm plotting to get so drunk that I never want to drink again experiment.

    1. Alcohol takes several minutes to reach your brain. Therefore I should wait several minutes between datapoints. Perhaps twenty?

    2. However, then it is unclear whether at the "two drink" mark I will have two drinks in my system or 1.8. However, since alcohol is known to metabolize very slowly, perhaps over the span of an hour or two we can assume that the effects of metabolism may be ignored. The small drink approximation?

    3. Ideally I could consistently measure something proportional to how much alcohol I have in my system. However, there are no good DIY blood alcohol content meters that I can just whip up in the next week. See

    4. Also make sure I have a friend who will make me drink lots of water.

    5. Also this is probably an even worse idea than the caffeine experiment.


    [update] So I didn't actually conduct my experiment, because I'm a sane person and I've always been a bit leery of alcohol. Also according to advice from friends, a drink an hour or two is much more reasonable. I did figure out how I feel (what state of mind I am in) prior to feeling terrible / nauseous. My curiosity is satisfied now.

    Thursday, May 31, 2012

    Focuswriter, ubuntu 12.04, typewriter sound effects

    In short, in Ubuntu 12.04, if you get "unable to load typewriter sounds" in Focuswriter, open a terminal and enter "sudo apt-get install libsdl-mixer1.2-dev" (if you try "libsdl-mixer1.2" you will get package not found).

    Focuswriter (sudo apt-get install focuswriter) is a full-screen tool in Ubuntu for distraction-free writing.
    You can theme it like so, though I prefer the console-like green on pure black, monospace font.
    What I really like is the typewriter sound effects (it helps me concentrate & feel productive instead of despairing over my papers). I got the typewriter sounds working in 10.04 through some magic I've forgotten. Now I have a clean install of 12.04 on my netbook, but when I went into Settings > Preferences > check Typewriter sound effects > Ok, it said "unable to load typewriter sounds".
    @Lito: You need to install the package libsdl1.2-mixer to get typewriter sound effects because they are now fully optional.

    Okay... so I try "sudo apt-get install libsdl1.2-mixer" but get package not found.
    According to this bug report, it should just magically be fixed. And according to, this package is in Precise.
    Turns out the package is actually called "libsdl-mixer1.2-dev" for ubuntu. So "sudo apt-get install libsdl-mixer1.2-dev" and yay typewriter sound effects will load.

    If you get a package not found error, run "sudo apt-get update" to make sure you have the latest packages. If you still don't see it, Ubuntu Sofware Center > Edit > Software Sources and make sure all the sources under "Ubuntu Software" and "Other Software" are checked.

    SMS gateway to Cosm using Tropo

    Here I present a terrible way to use Tropo to create an SMS gateway to Cosm feeds while waiting for the official Cosm SMS gateway to exit beta status.

    This stores your Cosm API key in plain text (I don't know how to avoid this) so it is a terrible solution, but a very easy one.


    I read
    curl --request POST \
    --data '{"title":"My feed", "version":"1.0.0"}' \
    --header "X-ApiKey: YOUR_API_KEY_HERE" \
    --verbose \

    How to translate that into python? See

    The app

    Create a new Tropos application and use a hosted file.
    ** If you don't know how to setup Tropo to do the following, see Appendix 1.

    File Name:
    File Text:

    import urllib2

    val = currentCall.initialText
    test = ('{ "version":"1.0.0", "datastreams":[{"id":"potvalue", "current_value":"%s"} ]}' % val)
    contenttype = "X-ApiKey"

    #Edit to your Cosm api key and feedurl,
    apikey = "COSM-API-KEY"
    feedurl = ""

    opener = urllib2.build_opener(urllib2.HTTPHandler)
    request = urllib2.Request(feedurl, data=test)
    request.add_header(contenttype, apikey)
    #request.add_header('Content-Type', 'your/contenttype')
    request.get_method = lambda: 'PUT'
    url =

    This file can later be edited at
    ** If you don't know what your Cosm Api Key or feed URL is, see appendix 3.

    Now add a new phone number for your app.
    ** see appendix 2 if you're unsure how.

    Text that number with a value (e.g. "45"). Wait a few seconds and Tropo will text you back that same value (acts as a confirmation message that Tropo got it). Then wait another 30 seconds or so and refresh your Cosm feed URL. Voila! Your new value shows up there.

    Todo next for me, connect a pot to an Arduino Uno + GPRS shield from Sparkfun, have the pot values sent to Cosm via SMS.


    Appendix One.
    1) Start by clicking on the "Your Applications" Quick Link.
    2) Click on the link to Create New Application near the top right of the new page.
    Click on the Tropo Scripting icon.
    4) For Tropo Scripting Application Name, enter in a name like Tropo Test.
    5) Click on the "Use a Hosted File" link and choose "Create a new hosted file for this application".
    The File Name can be whatever you'd like, it just needs to end with the language extension you intend to use (.rb for Ruby, .php for PHP, etc). For the File Text, see above.

    Appendix Two.

    8a) To the right of the Skype phone number is an "Add a new phone number" link - go ahead and click on it.
    8b) Select your preferred area code and then click the + sign next to the area code to add it to your application. Click the X at the top right to close the window and you'll be returned to your application settings page.
    9) That's it!

    Appendix Three.

    Note: If you don't have an API key for Cosm yet, follow (actually that is for the old pachube interface, I updated it for the new Cosm interface below):

    Login to Cosm and click on "Keys" in the top right corner (or go to, where USERNAME should be replaced by whatever username you chose when you signed up).

    Click the blue "+key" button (

    Give it some label, select "use any public feed", and select permissions options 'read' and 'update' (because you will want to use this key both to retrieve and to update Cosm datastreams). Ignore "advanced restrictions".
    Click "create".

    After clicking "Create" note down the feed ID that you have just created (e.g. would be feed ID 15556).

    Thursday, May 17, 2012

    project ideas

    nyanscooter: electric scooter with nyan graffiti attachment. Either water rainbow trails, or chalk rainbow trails, or LED trails at night.

    nyan "that was easy" button

    Thursday, May 10, 2012

    Inkscape 42''x36'' Scientific Poster w/ SVG source (Caffeine's Impact on Sleep)

    This is a followup post to Caffeine's Impact on Sleep, Inkscape A0 Scientific Poster draft

    Finished my 42''x36'' poster today (turns out 2.671, my Measurement and Instrumentation class, didn't want A0). I saw some awesome horizontal and vertical designs Tuesday, and now I have this super-cluttered and not very aesthetically pleasing poster *sigh* Oh well. I liked my draft version better for its simplicity and think I have too much text on this final version.
    Larger size PNG image available on dropbox,
    !! PDF version available (large file, ~10Mb), as well as SVG source!!

    Again, thanks to Alexander Erlich for the Inkscape template
    Also, thanks to netalloy for the coffee cup vector
    And thanks to OnlyPositive for the picture of the sleepy cat.

    Google Docs
    Spreadsheet here. I calculated averages and stddevs with =AVERAGE( ) and =STDEV( ) respectively, and turned formatted time (e.g. 07:30:00) into decimal hours (e.g. 7.50) (also applied Format > Number > Two decimals) using the formula =INT(F4)*24+HOUR(F4)+MINUTE(F4)/60

    Here is the matlab code I used. It's very messy and I don't actually understand what it means. In fact, I had to do post-processing of the Matlab > Export Setup > Rendering, Resolution = 300 > Export > figureN.png in the GIMP prior to dropping it in Inkscape to get the images I wanted.

    caffeine4=[0 0 0 0 0 0 0 0];
    sleep4=[6.95 10.87 9.75 7.52 10.95 9.43 8.75 10.23];
    day=[25 26 27 28 29 30 31 32];
    [AX,H1,H2] = plotyy(day,sleep4,day,caffeine4,'plot');
    title('Phase 4: Daily Hours Slept and Caffeine Intake');
    xlabel('Date (in April)');
    %xlim([26 13]);
    set(get(AX(1),'Ylabel'),'String','Amount Slept Daily (hrs)'); 
    set(get(AX(2),'Ylabel'),'String','Daily Caffeine Intake (mg)') ;
    axis(AX(1),[25 32 0 11]);
    axis(AX(2),[25 32 0 700]);
    set(AX(1),'YLim',[0 11], 'YTick',0:1:11, 'box','off');
    set(AX(2),'YLim',[0 700],'YTick',0:100:700,'box','off', 'box','off');
        'Marker', 'o',...
        'MarkerEdgeColor', 'none',...
        'MarkerFaceColor', 'b');
        'Marker', 'o',...
        'MarkerEdgeColor', 'none',...
        'MarkerFaceColor', 'g');

    Above code resulted in this graph:
    This data was actually 25 April to 2 May, but instead of learning about timeseries in MATLAB, I just cheated and stuck "April / May" in the xlabel and used 31 and 32 to not break my code. I planned to post-process in gimp to turn "31 32" into "1 2" but forgot to do so.

    For phase 3, I couldn't figure how to get rid of the 20.5 and 21.5 tick marks when I expanded to graphs to reasonable size, so I did post-processing in GIMP. Here are the two images I smushed together into the third:

    Misc. other tricks too lazy to document fully:
    Using "shift-J" in Vim to turn newlines (ctrl-click-drag to get a column of values from google doc separated by newlines) into spaces, which Matlab uses to delimit vector data.

    Making Instagram-like effect with kitten in top-left corner via kitten > right-click Add layer mask > (1) Gradient tool white-to-back, radial, click-drag from center to slightly past edges of images. This transparency-ed a large part of the cat face so (2) Ellipse select most of cat face, Gradient tool white-to-light-gray, radial, click-drag from center to edge of ellipse.

    Inkscape, Filter effect > Make arrowheads match color to the lines. (If you decide to change the color of the arrowheads).