Tuesday, November 1, 2011

A note about H-bridges

If you are a n00b like I was back in freshman year, or just forgetful (like I am now) you might want to take note before you burn out a bunch of transistors.

At some point you may realize you only need 2 inputs to control your h-bridge. You will tie the left hand inputs (base of Q1,Q3) together, and the right hand inputs (base of Q2, Q4) together.





Likely, burning transistors will at some point result, because the inputs will be left floating. For me, I accidentally pulled out the input wires.

"The important thing is you cannot leave any of the terminals AC and BD float. Let’s look at the AC terminal in more detail. Since A and C are tied together, and if it is left float then there will be a path for current through the collector of Q1, through its base, through the base of Q3, through its emitter to the ground. So, Q1 and Q3 are on resulting a short circuit. So, you must be careful if you are thinking about reducing the control pins by tying A with C and B with D. You just can’t leave the tied terminals open or float. They should be either grounded or pulled high."

Read more here: DC Motor Interfacing to PIC Micro. Scroll down to the "Important Note."

Convergence Plots

Argh, as usual, I never really finish any personal projects thanks to schoolwork...but it isn't all bad, here's a school-related project that is really cool:



You can solve the equation shown by posing it as a problem mapping from R2->R (rather than the complex numbers C->R). You can do this by expanding it out if you substitute the term a+bi for z.

Then I used three different methods of finding minima: Newton's method, fixed step-size gradient method, and the conjugate gradient method. The gradient methods were sloooooow especially at the center where the gradient is small.

Yellow means it converged to the point [a,b] = [0,1]. Green: [1,0]. Blue: [0,-1]. Red: [-1,0]. Orange converges to the origin [0,0]. White means it didn't converge to any of those but didn't go wildly careening off in some direction (diverge). Black means it did diverge, though I actually came up with that late in the game so some of these plots might not be totally accurate according to that legend.

In other news, some progress on the laser cutter but that's about it.

Sunday, August 7, 2011

My First PCB

Welp, I've always wanted to try getting my own pcb fabricated with BatchPCB and it is about time I did so. First things first though--I need a circuit. I found this current limiter on instructables, and I really like it.




While breadboarding this project I ran into some difficulties...This comic I made documents the trouble:


So then it was time to make a permanent version. However I suck at perfboard and my soldering iron is about ten times too hot and has no knobs or anything. So I brushed up on my EAGLE skills.



Hopefully that doesn't look too terrible! Venture Industries is just me paying homage to the Venture Brothers, which is only the best animated TV show ever.

In short, it does this:
  • I put it in between my experiments and my power source (usually for me, the 5V line from the USB port of my computer).
  • During normal usage, the current my experiments draw is underneath some threshold value. The green LED is lit.
  • When my experiment goes awry and the current draw is above that threshold, the green LED turns off and the red LED turns on and the current drops down something small (for example no more than 5V/.47kohm = 25mA).
  • My computer doesn't have to shut off the USB ports as a safety measure! +1 to laptop longevity.

Of course, I'm not about to send it off to BatchPCB right now...It's almost 5am. I don't trust myself so much at this hour. So I will error check again after sleep and then send it off. You have something like 12 hours of the posting time to warn me if you see a mistake! GO!

Anecdote: I was seeing a small (.05 or so) drop in voltage from the input to the output. I replaced what looked like a kind of thin, kind of old breadboard wire. The drop disappeared. Science FTW.

Sunday, July 17, 2011

Mid-project update: You give a mouse a cookie...

You give Shira an old G4 computer, and...
  • She'll want to install Ubuntu 10.04 Server Edition on it.
  • She'll want to run the Minecraft server.
  • She'll want more than 400Mhz. She'll go on eBay to find replacement processors.
  • She'll want to install a Quicksilver proc in the Sawtooth (AGP graphics) machine.
  • She'll need to cut the aluminum heatsink to fit with a dremel.
  • She'll want some thermal paste.
  • She'll want to know why her processor doesn't run. She'll restore the old processor to its place.
  • She'll suspect it is the out of date firmware.
  • She'll need to reinstall Mac OS 9 to update the firmware.
  • But she cut the CD drive, so she'll need to rearrange everything in the case to make it reach the other IDE connection point.
  • She'll need to torrent Mac OS 9, because nobody owns or sells that anymore.
  • She'll need to format the drive as HFS+ so the installer can write on it...
  • She's tired now. She'll want to take a break to watch South Park at 2:30AM.
  • She'll need to run the Ubuntu LiveCD but it won't run anymore.
  • She'll want to try a new IDE cable (but it won't work)...
  • She'll finally format the drive with mac-fdisk and a utility on Mac OS 9
  • She'll install Mac OS 9
  • She'll find firmware update is a .bin and can't be opened without Stuffit Expander
  • She'll try to unpack the update on her OS X laptop, but the G4 won't run it like that
  • She'll try to install Stuffit Expander on the G4 from the install CD but it crashes the computer
  • She'll download a version that does install and use it to unpack the firmware update
  • She'll find that the firmware update requires at least Mac OS 9.1
  • She'll apply the 9.1 update.
  • She'll curse the name of the person who packaged the US UPDATES with incompatible UK SOFTWARE. ARGH.
  • She'll torrent 9.2.1 US English. God Bless America.
  • FINALLY! She will install 9.2.1, and run the firmware update. Firmware version updated!
  • She will swap the processor, cross her fingers, and press the power button...
  • OMFG IT WORKS IT WORKS FINALLY FINALLY IT WORKS
  • She'll want to run some tests and install Ubuntu again, but the CD drive isn't powered, because she accidentally connected the fans in parallel with it...
  • She'll want to fix it but her soldering iron tip is burning through itself (and yes, this can happen. I have seen it happen twice). Time for a new one.
  • She'll go to the hated Radioshack. She will want to make this very clear: she hates Radioshack. But it is in walking distance, while Fry's is a thirty minute drive.
  • She'll find that Radioshack won't have the same type of tip, so she'll have to put down $10 on a new El-Cheapo iron...urgh.
  • She'll discover that the CD drive is powered but Chuck Norris himself couldn't get the LiveCD to boot off of it. The Debian LiveCD won't boot either. Just Mac CDs work. Weird.
  • She'll spend two hours reading about Open Firmware, trying to get something with any distro of Linux on it to boot.
  • She'll find the magical command: boot usb1/disk@1:1,\install\yaboot
  • She will shout in surprise and then sigh when something appears about corrupted Amiga block partition thingies, and presents a 'boot: _" prompt. However, the install will continue after about ten seconds.
  • Install complete! But what's this... "DriveReady SeekComplete uncorrectable error???"
  • She will listen to dying hard drive sounds and conclude that her IBM drive is almost dead. Unfortunately, nobody is selling hard drives at 2am.
  • She'll find a small family run electronics shop the next morning, where a very nice dude sells her a replacement drive (IBM Deskstar 20.5 GB) for $10, and throws in another drive (Western 40GB) for free. They are even formatted as HFS already!
  • She'll install Ubuntu again and run the Minecraft server.
So what's the verdict?

1) The Minecraft server and Java are resource hogs, so while the rig can run them, it does a terrible job. Clients connected to the Minecraft server experience severe lag and the game becomes completely unplayable.

2) Since there is nothing to be lost, I may eventually open it up again and mess with the bus speed and CPU multiplier.

3) I no longer think the CPU is the bottleneck. I'm not really a hardware person, and I don't know how all this works, but I get the sense that the 100Mhz bus speed isn't going to cut it. The G4 has a 100Mhz bus speed. My laptop has a 1.07Ghz bus speed. Oh well.

So...what kind of awesome, interesting things can I do with a dinosaur tower?

Wednesday, May 25, 2011

Macro Photography

I'm working on a reverse lens macro photography setup. My initial trials are done with a Canon EOS Rebel.

The plus side to film is the nostalgia. The down sides are everything else.

Anyway, I have the lens reversed and mounted at the end of a long cardboard tube (poster tube I essentially cut in half). I have a remote trigger and a tripod and a Ikea lamp that is focused by a magnifying glass so that it delivers a pinpoint of light to the object I am taking a picture of. The focusing is done by sticking a compass in a book and using the fine tuning wheel to raise and lower the book cover.

I'll spare you the details until I have my more finalize setup, which hopefully actually happens (I need a DSLR...).

Sugar vs. Splenda vs. Salt


Magazine Cover


Xacto blade

Saturday, February 19, 2011

Picking and Choosing Your Coeffecients: Playing with the DCT of an Image

Where have I been?
Junior year is a ton of work. I've been extremely busy.

What is the post about? (Super simple version)
Sometimes I want to make a salad.



For my definition of "salad" I have a set of ingredients with which I can make ANY salad I like, ingredients like lettuce, tomatoes, cucumbers...etc.

A recipe for any given salad is essentially a 'linear combination' of those ingredients, for example, 1 tomato, 2 heads lettuce, 4 drops vinegar, 1 lemon. I am scaling and adding things from my dictionary of salad ingredients to make my particular salad.

I may want to play with that list, deleting terms, scaling terms differently, or who knows what. I might just want to demonstrate to you how the salad begins to look more like the salad we want to have as we add more and more of the ingredients in.

I can do this with anything. Here, I do it with images, and I represent them as a linear combination of 'checkerboards.' For example, for one case, we have 64 different checkerboards, which look like this:



I could prepare any image if I had all of these 'checkerboard' ingredients. I could convince you that it was the same image even if I only had a few of those checkerboards available (specifically, imagine I ran out of the ones towards the bottom right...I really don't need them). That's the theory behind lossy image compression.

What is the post about? (Less simple version)
I'm taking the 2 dimensional DCT of 16x16 blocks of this image of a bunny rabbit, then picking and choosing which coefficients to keep before computing the inverse and reconstructing the image. Since M,N=16 so there are 256 basis images.

Some pdfs for your reading pleasure:
-"Lab 6: the Discrete Cosine Transform"
-JPEG Tutorial
-Image Compression and the Discrete Cosine Transform

Results
Original Image:


DC Coefficient only
(the very first term, which is just the average value of the image part)


AC Coefficients only (everything else but the DC Coefficient)


Line Coefficients only (no 'checkerboards' -- 'stripe' coefficients only )


First Four 'Lowest Frequency' Coefficients
(the first 2x2 coefficients from top left)


No Horizontal Stripes


No Vertical Stripes



I'll Do it Later
1. To take the DCT of the whole image (not just a block at a time).
2. To make a animation showing the terms added in a sequential zig-zag, showing the reconstruction of the image from all basis vectors.

Time to start my homework.
-Shira

Saturday, October 9, 2010

Three Step Rainbow Cake



Ingredients:
  • Ready-made cake mix in a box, like the ubiquitous Betty Crocker kind.
  • Food coloring.
  • Water or milk.
Step one: Mix some water or milk with some powder. Aim for a thick batter consistency.

Step two: Add food coloring. For layers, just parcel out the batter into small bowls, mix several drops of color to each bowl, and then just layer them in your microwave-safe cake-preparation container. If the batter is thick enough the layers will stay neatly separated.

Step three: Microwave. Time: usually at least a few minutes. Check by inserting knife; the cake is done when the knife comes out clean.

Hints: Cake rises. Use a larger dish than I did. There is a glass dish hidden inside this cake.



Pretty pretty colors. Of course now my hands are stained again. If it isn't oil paints then it is hair dye; if it isn't hair dye then it is food coloring.



Flourishes: add pieces of apple to the batter, or banana slices, or chocolate. Serve with a cold glass of milk.

Inspired by the rainbow-cake endeavors of my friend Dani. Her blog is here: http://lovingsweets.wordpress.com/

Thursday, September 30, 2010

Hair Dye

At the end of this summer I decided to dye a section of my hair some bright color. To this end I bought some Manic Panic in "Shocking Blue" and "Atomic Turquoise." I initially had it done at the salon along with my haircut.



Later, while traveling in Japan, I saw a brown duck with a blue feather that reminded me of my new hair. Google seems to say that it is a female wood duck. Here's an image of a similar (though not exactly the same type) duck.


I like the idea that the design used for my hair can be found in nature.

The hair dye is semi-temporary so I have done two subsequent re-dyes by myself and with the help of my friends. Both the bleach and dye processes are really easy to do yourself; you can find instructions on the back of the box or online.

Here's a picture of my most recent hair. I did part in Manic Panic "Purple Haze" and part in "Shocking Blue" again.




As a last note, here's a link to a pdf I found that goes over the chemistry of bleaching hair in detail: journal.scconline.org/pdf/cc1970/cc021n13/p00875-p00900.pdf

Tuesday, August 3, 2010

Painting Still Not Finished

This painting is starting to drive me crazy. Still, I promise I will finish it. Otherwise I'll never get that floorspace back in my workshop...



Work will have to stop for a while (vacation, school starting) after this week.

Thursday, July 1, 2010

Summer Update

A pretty empty update for now...most of my projects are crawling along as a lot of my time is sucked up by my writing class, my summer research, my efforts to learn Japanese before my trip to Japan in August, and my terrible afternoon-nap-habit (I blame the heat...it makes me drowsier than usual).

One thing I did start doing again this week is cooking (after weeks of eating out or eating PB&J sandwiches). Earlier this week I made pasta primavera (with fried red & yellow bell peppers, fried yellow & green squash, and red, yellow, and orange tomatoes to garnish it) and also tomato-cilantro soup (tomato-basil recipe with a substitution). I like cooking, so next week I am going to try my hand at a chicken-liver paté.

I've also been decorating and cleaning my new place. Allen left his plants with me so I could babysit them over the summer, and I don't really want to give them back, though I do want to put them in nicer planters. This is a glass of green tea with fresh mint from my garden.



The coaster is a mosaic I made at the Getty Villa. I couldn't pass up a chance to do some arts & crafts, even though everybody else at the table was under the age of 12. If you can't tell, I tried to depict a stylized skull, since I had just seen the Aztec Pantheon exhibit. It's an exhibit worth seeing unless you have already visited/plan to visit the Museo Nacional de Antropología in Mexico City (that's where all the pieces came from). If you're into blood and gore then you can get a kick of of the sacrificial stone, sacrificial knives, and sacrificial stone eagle with a hole in the back for burning the hearts of the sacrifices.



After mosaic-ing I remembered my plan to make a large mosaic to cover a portion of the wall of my parents' courtyard. I scouted out a tile store and will be preparing some photoshop mockups in the coming months.

I mistakenly bought some plaster of paris before realizing that mosaics require a different sort of adhesive and also grout. Since I don't feel like returning it Asher will most likely be enjoying a homemade birthday piñata (inflated balloons are coated in plaster of paris to make the body of the piñata) and eventually I will have to try my hand at sculpture.

Coming soon:
  • My FM transmitter works, but is waiting on me to order a 7 segment display and level-shifters so I can run it off the car's outlet.
  • When I get a camera I can show off my newly decorated home
  • I got hit by the LED art bug again and am designing tiny lamps (but so far I've been coming up with the wrong pairings of batteries/bulbs and nothing lasts as long as it ought to)
  • When school starts up again and I can gain access to the School of Architecture's laser cutter, I will attempt to learn some basic AutoCad so I can make the Settlers of Catan plywood board

Finally here is another shot of the painting, coming along very slowly.