Showing posts with label UW. Show all posts
Showing posts with label UW. Show all posts

2007-12-01

Blog Fodder

Erica sent me an email titled Blog Fodder with some pictures of the microscale in action.







And she also gave me a nice graph of a few sample runs



It's clear that the scale can be improved, but is pretty close to working now. Erica brought it home for me to work on. I think I have enough code space left to add the Derivative and Integral terms back into the PID loop, which should make it less noisy.

I also want to compensate for flag position in the final readout formula, so it can predict what the mass would be if it were perfectly balanced. This part is harder, and I'm not sure if it's needed.

2007-11-26

Microscale documentation

This document describes how to use the microscale.

Powering Up

- Boot the computer.
- Open microscale.ht on the desktop.
- Turn on the scale by moving the switch to the right. The LCD should turn on in about a second, and the scale will start balancing.

Calibration

- Zero the scale, by typing z into the terminal window. The Zero value can be adjusted manually via the [ and ] keys. The zeropoint is shown on the LCD's top row.
- Place a 100mg mass on the scale, wait for it to balance (about 10 seconds).
- Adjust the slope until the readout is close to 100mg, using the + and - keys.
- Verify the calibration with a smaller mass.
- Verify the zeropoint with no weight on the scale.
- Type s in the terminal window to save the calibration. This calibration will automatically be recalled next time the scale is powered on.
- To reduce the noise during the calibration, you can reduce the gain on the scale. The gain is controlled with the , and . keys (, decreases)

Operation

- Type h into the terminal if the scale is currently sending data to the laptop.
- Select the Transfer menu, Capture Text.... If a submenu pops up, choose Stop, then repeat this step.
- Choose where you want the data saved. The current default is under My Documentsmicroscale data. The file should have a .txt extension, but that is not required.
- The scale is now ready to record. Type r into the terminal just before the sample is started. The scale will reset the seconds counter to 0 and send a header row to the screen, followed by data every second.
- When the sample is finished, type h into the terminal to stop the data.
- From the Transfer menu, choose Capture Text, Stop. The file is now ready to be moved to another computer or opened in Excel.

Data format

- Column 1 is the time since r was last pressed.
- Column 2 is the temperature in C at the interface Circuit board.
- Column 3 is the calibrated reading in milligrams.
- Column 4 is the analog reading of the flag position. 512 is "balanced". If this reading is within 524 to 500, the scale is getting a reasonably good reading.
- Column 5 is the number of counts being applied to the DAC beyond the zeropoint. It is only here so that a bad calibration can be fixed after the measurement is taken.

Notes

- The data can be made less noisy by adjusting the gain down. The cost is a slower response time.
- Gain can be adjusted on the fly during a reading with no side effects.
- The gain is saved with other calibration data when s is typed.
- It may be a good idea to write down the calibration data for a particular run, as a backup.

2007-11-18

Microscale v2.5

I meant to be writing about this as it happened, but instead I will summarize. After the last attempt, we decided to make the scale out of metal, so it would be a bit more robust. The new version was designed in Solidworks in about a day, ported over to FlowMaster, and cut on a waterjet at work. The waterjet process took all of two hours, including polishing. The cut itself was around 7 minutes. Sadly, I didn't take any pictures of the individual pieces, but the final assembly photos are nice.



The scale is made out of 1/4" Aluminum. I hand drilled and tapped all the holes with bad equipment. The tap actually twisted if I applied too much torque. It's quite possibly the cheapest. tap. ever. At least it didn't break on me. I did break a screw that I was using to clean up the holes, but it wasn't strictly required, right? You can just make out the copper wire counterweight on the lower right side of the assembly. It's the hokiest part of the design, but it works.

Here's the best view you'll get of the new flag design.

The idea is that when it is centered, the IR beam is half blocked. When the arm is off balance, the changing radius of the flag blocks more or less than half of the beam. The advantage is that the arm can move up to 5 times further than it could before and still get a valid reading. The flag was drawn in Solidworks and cut out of 0.06" Aluminum on the waterjet. I then polished the cut face to make readings a little more consistent. There is an adjustable block above and below to limit the motion of the arm, and to protect the flag in general. Th flag hitting the lower stop actually makes me think of the big hammering guy sculpture out in front of SAM.




While assembling and tweaking the new flag design (using the capacitor as a simulated sample), I somehow damaged the galvanometer itself. It got really sticky, and would stay in the balanced position without being balanced. We ended up heading out to Radio Shack to get a new one (and another spare) for ~$16 each. While I was at it, I made the arm longer by about 50%, bringing the scale to about 150 counts per milligram. The longer arm and new flag allowed me to re-tune it to respond faster.

Here's a picture of the computer taking data via hyperterminal. The serial stram is simply recorded to a text file, and can be imported directly into Excel later.



Note: Remember to ask Erica for a picture of the scale in use, and a screenshot of the resulting graph.

Also, while trying to fix the balance arm, the screen went blank! It was fairly easy to trace. The scale still worked, but the negative voltage for LCD contrast went away. The only problem with having a donated collection of stashed parts is that the parts are old, and actually require some work to make them function. Current LCDs are fine with ground on the contrast pin, but older ones want -3 to -10 volts. Fortunately enough, the MAX233 creates -10 volts for itself to use for RS-232 communication. Since it's just a tiny load, I ran the LCD contrast to this supply. The problem turned out to be a fleck of loose solder shorting out the supply. Good thing the Max233 is resilient.


I'm calling it done at this point (Hence the completed tag). Erica's brought it to school, and she'll calibrate and tell me how it goes. It's version 2.5 because of all the mechanical upgrades, though the code is essentially the same as the v2.0.

Now for the next project...

2007-11-17

MicroScale v2.0

Erica found an article at Scientific American describing how to make a small micro-gram balance using a part ripped from an analog multimeter and some other electronics.
























I love voiding warranties.

I first built the "manual" version, and we were able to detect the change of mass by adding individual grains of salt to the scale. Each one caused a 0.004 volt change on the sensing voltmeter. Using this info, and some of the ideas from the automatic version, I proceeded to make my own version of the PID controlled scale.

I used an Atmel Mega48, and a tweaked version of the Orangutan Library for Pololu. I can get away with this because I bought a Baby Orangutan and a regular Orangutan controller from them at Robothon 2007. I did the first prototype of the code in the Baby O processor, but then decided I wanted it for another project. The Mega48 is smaller, but otherwise identical to the Mega168. I added a few routines to the LCD code, and patterned my UART functions off of the same.

I tried a new wiring technique on the circuit board for this project (jumpers on top), and didn't really like it that much. I'll go back to pseudo-traces on the next project.



You can't see much in that photo, but I am using A MAX233 for RS-232 conversion, as well as creating some negative voltage for LCD contrast (It's an OLD LCD. Newer ones only need Ground for contrast). I also have a 5 volt precision reference (MAX675), a really nice 16-bit DAC (MAX541), and a basic Quad Op-Amp for amplification. The closed box looks WAY better, don't you think?



Shown on the screen is a very early version of the code. Here is the mounting arrangement for the scale itself. You can see I took a slightly different tack that the original article, but have borrowed some ideas from them. The coil on the right is actually a counterweight, to (mostly) offset the weight of the glass coverslip and holder.



In the next update, I should have an actual measurement and some code details.