The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Author: Ed

  • Digital Camera Resolution: It’s Not The Dots

    Overview of the scene - 8 MP image
    Overview of the scene – 8 MP image

    A rule of thumb for cameras is that more glass is better, so I’ve always been skeptical of those little bitty chips o’ glass in front of all those pocket-sized camera CCDs.

    A while ago I took some shots with my Casio EX-Z850 at various resolutions, chopped out a chunk with some good detail from the middle of the images, and resized (cubic interpolation) the smaller ones to match the 8 MP image. The exposure was automagic: 1/200 sec at f/7.4. Zoomed as far as the optical zoom would go, hand-held ’cause at that shutter speed it’s OK, sharpness and contrast one click higher than the default.

    As nearly as I can tell, there’s only a slight difference between 8 & 6 MP, enough to be noticeable at 4 MP, and it’s getting on toward icky at 2 MP. The picture isn’t any bigger because I wanted to preserve the actual dots in the 8 MP image.

    Resolution Test - Shield
    Resolution Test – Shield

    Notice the weird color gradations in the shields with bright primary colors. This was hand-held, so the camera reached the same image conversion conclusions each time, starting with different physical pixels. A bit of rummaging turns up the Island Coffee Co logo at http://www.islandcoffee.net/.

    Just to show that resolution doesn’t matter in real life, check out the snail. Zoomed all the way out, macro focus, 1/125 f/2.8 (wide open), hand held, resized as above.

    Snail
    Resolution Test Images: Snail

    As nearly as I can tell, the 2 MP image is the only one that’s noticeably worse and it’s still just fine. The other three are different, but even the 2 MP one isn’t bad.

    Moral of the story: lots o’ dots is good, but beyond a few MP it just doesn’t matter. I think 4 MP is the sweet spot, based on an entirely insufficient sample, with 8 MP if you’re planning tight cropping. Otherwise, save 2 MB per image: 8 MP -> 4-5 MB, 4 MP -> 2-3 MB.

    The other High Truth: lots of light is a Good Thing. You get really crappy pictures when there’s not enough light, but it seems that’s where all the interesting stuff happens.

    Update: Uploaded the PNG version of the shield resolution test, as the JPG was fairly crappy, plus 8 MP overviews of the scenes. The text is antialiased and looks awful when you zoom in, but the whole point is to show the actual dots produced by the camera: there aren’t that many dots for the letters.

    Snail overview - 8 MP image
    Snail overview – 8 MP image
  • MAX4372 Sense Input Protection: Looks Good to Me

    Current Setpoint Errors - Full Scale
    Current Setpoint Errors – Full Scale

    Contrary to what I’d thought, the MAX4372 circuitry has a simple gain error: it’s about 10% low over the full-scale 300 mA current range.

    A bench supply produces 5 V through an 8 Ω resistor, although the slope of the purple line is more like 7.3 Ω. Close enough.

    The blue line is the current sense voltage, which is exactly the same as the setpoint voltage plus a little PWM noise contributing to the waviness. Unlike the previous solar-powered chart, the bench supply voltage doesn’t drop enough to saturate the current sink, so the result is a nice straight line.

    The red line is the MAX4372 output, which is consistently 10% low right up to the end; I can fix that with simple software scaling. The curve doesn’t flatten out, either, because the common-mode voltage across the sense resistor stays well above the it-stops-working-well limit around 2 V.

    MAX4372 Schottky Protection Hack
    MAX4372 Schottky Protection Hack

    Conspicuous by its absence is any sign of nonlinearity due to the Schottky protection diode across the sense terminal inputs. The full-scale sense voltage is 300 mA x 0.5 Ω = 150 mV, which is sufficiently below the 1N5819 threshold of about 300 mV.

    The picture shows the hack-job mod I applied to the circuit board; basically a cut-and-solder job with 10 Ω SMD resistors and a through-hole 1N5819. Yes, I stacked those two chips to get 5 Ω on the -Sense input; it’s a nice way to get good fixed ratios.

    Despite what the stripes look like, both of those through-hole resistors are 1.0 Ω: brown-black-gold-gold.

    The MAX4372T, the heart of this discussion, is the nearly invisible black rectangle just in front of the diode’s right-hand lead.

    Although I should take a look at the high-value resistor / no diode protection circuitry, this one will suffice for now. It’s worth mentioning that I haven’t managed to burn this MAX4372 out, despite perpetrating much the same indignities on it as I did to the others, so the diode protection really is working.

    Whew!

  • Homebrew Magnetizer-Demagnetizer

    Those “nonmagnetic” tweezers remind me of a story and a useful gadget.

    Two years ago a lightning strike blasted a football-sized chunk of concrete out of the garage door apron, blew out a bunch of networking gear, magnetized every ferrous object in the house (including the nails in the hardwood floors), yet didn’t do any damage to anything else.

    Including us: we were sleeping about 20 feet from the crater. Whew & similar remarks.

    Anyhow, all my machine-shop equipment and tooling was magnetized, too. Suddenly, lathe bits attracted swarf like, well, magnets, endmills sported fur coats, scales snapped onto the workpieces they were supposed to measure, and tweezers picked up screws without any pressure. Not a good situation.

    Homebrew Magnetizer-Demagnetizer
    Homebrew Magnetizer-Demagnetizer

    Fortunately, I’d built a demagnetizer loosely modeled on one described in the Sept/Oct 2000 Home Shop Machinist. It got plenty of power-on minutes after that strike, returning my tools to their normal condition.

    Those flooring nails will be magnetized forever.

    The general idea is pretty simple: recycle the motor from a can opener-class gadget. Strip off all the shading coils and other frippery, saw enough from the pole pieces to position tools in the air gap, plug it straight into the wall outlet, and shake the magnetism right out of your steel.

    It has another nice trick: a relatively low DC voltage that magnetizes your tools. The transformer has a 35 VAC center-tapped secondary, a pair of stud diodes yields about 24 V DC, and that honking big cap whacks the bumps off the full-wave rectified DC waveform.

    Absolutely nothing is critical, but the original article suggests measuring the AC current into the motor winding, then choosing a DC voltage to force that current (Ohm’s Law: E=IR!) through the coil’s DC resistance. I picked a transformer that was close enough to work; anything in the 10-20 VAC range would probably be fine, too.

    The small DPDT toggle switch routes either AC or DC to the winding. If I were doing this again, I’d use a bigger switch, but that’s what I had in the junk box at the time.

    Use a momentary pushbutton for the main power switch, as you do not want this thing on for more than a few seconds. The motor windings get warm from the abuse; it was designed to run with the back EMF from the now-missing rotor, making the currents far higher than the design spec. Use fairly husky wire, not doorbell stuff, inside the box.

    I used 100% junk-box parts for this project and bolted everything to the outside of a recycled aluminum box because the inside was pretty crowded with that husky wiring.

    Demagnetizing: feel the buzz, then pull the tool a goodly distance from the pole pieces before you release the pushbutton.

    Magnetizing: stroke the tool over one of the pole pieces, repeat as needed.

    That should handle any residual magnetism in those tweezers…

  • Nonmagnetic Tweezers: Don’t Believe The Hype

    A small package of 6000 SMD resistors just arrived from a Hong Kong eBay seller. It showed up promptly despite traveling halfway around the world, had neat packaging, and I’ll give ’em good feedback.

    Also included was a free needle-tip tweezers, just exactly what you need for plucking those little ceramic rectangles from their packages. I  already have a bunch of needle-tip tweezers in my rack, but you can never have too many tools and this one won’t go to waste.

    Gooi TS-11 tweezers
    Gooi TS-11 tweezers

    The package has what appears to be comprehensive instructions in both Chinese and Japanese (to my untrained eyes, anyway). Not much in English, other than that Anti-magnetic, anti-acid and non-corrosive Stainless Steel line; perhaps this isn’t the export model. Indeed, it lacks the obligatory country-of-origin labeling, but, given where the package came from, one may reasonably assume the usual Chinese origin.

    The tweezers are (almost illegibly) stamped STAINLESS NON-MAGNETIC and bear a tidy sticker: gooi TS-11 ANTIMAGNETIC.

    Gooi TS-11 Antimagnetic sticker
    Gooi TS-11 Antimagnetic sticker

    The build quality and surface finish are, um, a bit rough, but Gooi seems really proud of their non/anti-magnetic properties.

    Needless to say, a magnet sticks firmly…

    I have no convenient way to test their anti-acid (whatever that is) and non-corrosive properties, but I’m betting these suckers are plain old Chinese mild steel, made from recycled US scrap. Perhaps the previous iteration was stainless and we’re stepping down the cost-saving ladder? If they would just change the packaging to match reality, that would be fine with me.

    [Insert standard observations about Chinese quality control here.]

    Y’know, come to think of it, I’m sort of wondering about those 6000 SMD resistors. With any luck they’ll actually work when I get around to using them. If not, I suppose it serves me right for buying direct from Hong Kong via eBay, eh?

    And, yes, I know some stainless steel is magnetic.

  • MAX4372 Sense Input Protection: The Story Continues

    Measured vs setpoint currents
    Measured vs setpoint currents

    As noted here, there’s a difference between the current setpoint (controlled by the PWM analog outputs) and the measured values. As it turns out, there’s a better way to look at those datapoints.

    This is a graph of measured current against the setpoints. Looks pretty good to me, apart from a teensy offset error. There really isn’t much in the way of a gain error over the entire range.

    Having had a bit of time to think this over, the measured current-sink current should generally be numerically equal to the setpoint value, simply because there’s an external op-amp forcing that to be true. The twiddlepot adjusting the op-amp gain doesn’t enter into this, because the loop forces that voltage to match the PWM output. So, duh, the purple line should be spot on, at least up to the point where the sink transistor saturates.

    What’s more interesting is that, over this range, the MAX4372 output is also spot on, which is not obvious from the previous chart. It flattens out when the common-mode voltage at the sense resistor drops below a volt, more or less, which is what the datasheet leads you to believe.

    The datapoints comes from the same panel on a different day, so the points don’t quite line up if you’re comparing them. The brown solar panel voltage curve flattens out when the current sink transistor saturates, but the panel can continue to supply increasing current into a dead short, so the current continues to rise for a bit.

    After I get the Circuit Cellar column laid to rest, I gotta figure all this out from first principles, then run the current up to 300 mA from the dreaded bench supply.

    But the short answer seems to be that the Schottky protection circuitry doesn’t have much effect up through 75 mV. Which seems reasonable, come to think of it.

  • MAX4372 Sense Input Protection: Results

    Solar Photovoltaic Panel Maximum Power Point Cloud
    Solar Photovoltaic Panel Maximum Power Points

    Here’s the result of using the Schottky diode input protection circuit I proposed there. I used 10 and 5 ohm resistors, twice the values shown in that schematic.

    The circuit runs a load test and determines the maximum power point (MPP) of a solar photovoltaic panel every minute. The points represent the results of about two hours of winter-afternoon sunlight.

    The test program applies an increasing load in steps of 10 mA (it’s a small panel, OK?) and records the corresponding panel voltage. One combination of current and voltage extracts the most power from the panel; that’s the MPP.

    Obviously, the MPP varies with the amount of sunlight falling on the panel, so the result of the test is a cloud of points. That’s what you see in the graph: the highest points represent the most intense sunshine, the lower points come from shadows and changing sun angle.

    The load is applied through a current sink that draws 100 mA per volt, as generated from a microcontroller PWM output. That’s pretty well calibrated by twiddling a gain pot, so I think it’s quite close.

    The graph shows that the 10 mA steps recorded by the now-well-protected MAX4372 high-side current amp are low by about 10%, regardless of the absolute current level. That’s more error than predicted by the SPICE model (even with the larger resistors) and may represent contributions from something other than the protection network.

    However, it does look as though a simple calibration routine could compensate for the error. That’s a simple matter of software, right?

    Most important of all, the MAX4372 has survived the usual mistreatment. The load test is essentially DC, where the inductor counts as a piece of wire. Under those conditions, the combination of a stiff voltage source and an imposed load exceeding 600 mA produces a lethal differential voltage across the current-sense resistor. The diode clamps that voltage to 300 mV or so, which is enough to protect the MAX4372.

    Rumor from my source at Maxim says the protection circuitry inside the MAX4372 can withstand maybe 50 mA, so the high-value external resistor approach (without the diode) may be the better way to go. Getting rid of the nonlinear diode should be a win…

    Update: A different plot shows a different result. I think the offset comes from something other than the protection circuitry.

  • They’re Getting Bolder!

    Turkey on the Patio
    Turkey on the Patio

    Got up this morning, looked out the kitchen window, and there stands a turkey on the patio!

    They’ve been edging closer and closer for the last week or so; we think the snow cover is making the seeds under the feeder look more attractive. As nearly as we can tell, though, they have yet to venture across the patio to the feeder: no tracks in the snow.

    What would be really impressive: a row of turkeys lined up on the patio railing, just like they do on our neighbor’s split-rail wooden fence.