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

  • Death of the Bake-A-Round

    After nigh onto a year of twice-weekly baking, I finally managed to destroy our Pyrex Bake-A-Round tube, in exactly the manner I expected. Despite liberal buttering-up before inserting the dough, sometimes the bread sticks to the tube and requires a bit of probing with a long knife along the sides to release it. Given that the tube just came out of the oven, I’m holding it one-handed with a pad… it fell over onto the wood cutting-board counter.

    The loaf inside is remarkably akin to a two-pound dead-blow hammer and, as you’d expect, the tube shattered like, uh, glass. Fortunately, I was belly-up to the counter and facing into a corner, so the fragments remained mostly in place.

    Shattered Bake-A-Round tube
    Shattered Bake-A-Round tube

    What surprised me, though, was that (at least for this 30-year-old B-A-R tube) the glass wasn’t tempered. The fragments are long, thin, razor-sharp daggers.

    Glass fragments
    Glass fragments

    Now we must get used to eating rectangular bread slices again…

    In other good news, there weren’t many minuscule glass fragments on the loaf. I was surprised at how closely baked flax-seed meal resembles either chitin or glass, but a thorough scan with my headband magnifier and a bit of deft brushing cleared the loaf for consumption.

    After some of the stuff I’ve eaten over the years, an errant glass chip or two isn’t going to do me a bit of harm. The ladies figured if I was willing to eat it, they couldn’t back down, so it’s all good.

    (Top pic with flash, bottom without: it’s hard to take a picture of glass!)

  • Seiko Epson RTC-65271 Real Time Clock Datasheet

    RTC-65271 Module
    RTC-65271 Module

    I have a stash of RTC65271 real-time clock modules and might use one in an upcoming project. They’re obsolete by nigh onto two decades, but it’s a one-off project and I know I’ve been saving these things for some good reason.

    Alas, the datasheet doesn’t seem to appear anywhere else on the web; you can find an overview & general description, but not how the thing actually works.

    However, if you happen to have a chip and need the datasheet, this is indeed your lucky day: a scanned RTC65271 Datasheet.

    The datasheet alleges it’s “functionally compatible with MC146818A and DS1287“, and those datasheets may be more readable, if not exactly applicable. It seems to be (similar to) the clock chip used in the original PC/AT, if you recall those relics, and might actually use standard hardware & software protocols.

    Dealing with this thing may be more trouble than it’s worth in this day of bus-less microcontrollers with Serial Peripheral Interface widgetry. A back-of-the-envelope count says it’d require three ‘595 output chips and a ‘166 input chip to fit on an SPI bus. Yuch…

    Hey, if you want one, drop me a note. I have far more than a lifetime supply at my current rate of consumption.

  • Digital Photography: Sometimes Underexposure Is Your Friend

    Took some pix of the high school marching band yesterday and the whole lot came out one stop underexposed… exactly as I intended.

    Their uniforms are dead black wool with a yellow left-shoulder flap. The camera looks at all that black, desperately attempts to make it neutral gray, and blows out all the highlights. Given that the only highlights are the face and hands, the absolutely critical part of the image looks awful.

    Auto Exposure
    Auto Exposure

    The first picture (a small crop from a much bigger image) shows what the auto-exposure algorithm comes up with:

    Exposure Bias : 0
    Exposure Mode : Auto
    Exposure Program : Auto
    Exposure Time : 1/1000 s
    FNumber : F4
    Flash : No, auto
    Focal Length : 60.1 mm
    ISO Speed Ratings : 125
    Light Source : Daylight
    Metering Mode : Center weighted average

    Notice the burned-out highlights: the left hand is flat, the clarinet keys reflect retina-burn white, and the yellow shoulder is monochrome.

    Under those circumstances, the only thing to do is override the camera’s opinion and force some underexposure. You can either meter each shot manually or just tell it to knock the auto-exposure back a bit. I generally choose the latter, if only because the camera comes up with a reasonable approximation of a good exposure faster than I can. If I don’t lay the center-weighted spot on the black side of a uniform, that is.

    Minus 1 stop
    Minus 1 stop

    So the second picture (another small crop) is “underexposed” by a stop:

    Exposure Bias : -1
    Exposure Mode : Manual
    Exposure Program : Auto
    Exposure Time : 1/1250 s
    FNumber : F5.6
    Flash : No, auto
    Focal Length : 60.1 mm
    ISO Speed Ratings : 125
    Light Source : Daylight
    Metering Mode : Center weighted average

    Much better.

    We can quibble about the color quality, but at least the highlights aren’t blown out and there’s some texture to the uniform. The black part of the uniform is a dead loss, but that’s pretty much the way it’s got to be: the camera simply doesn’t have enough dynamic range to handle a dead-black uniform and glare-white reflections.

    One of the band members has absolutely gorgeous deep-dark-brown skin that I have yet to get right. Either the highlights burn out or her skin blends into the shadows. Twiddling the gamma doesn’t help much.

    More on the details of why you want underexposure, even in what look like evenly illuminated scenes is there.

    Sometimes, though, you just gotta fix it in the mix, as described there.

    Memo to Self: Set the color balance to “daylight”, too, because bright primary colors against black can be confusing.

  • The Decline of Literacy: Part Two

    Saw this in a somewhat downscale grocery store while chaperoning a Marching Band event.

    Hand Dryer Graffiti
    Hand Dryer Graffiti

    I’d give him (it’s a mens’ restroom) some bonus points, as I think he caught and corrected the error, but then there’s that “to”. Ouch.

    I ask you, though, what grade were you in when you learned how to spell “much”? I doubt you’ve had any trouble spelling it since then.

  • The Decline of Literacy: Part One

    Enunciator Panel Placard
    Enunciator Panel Placard

    Saw this one on the outside of an old-style school building while working as an Election Inspector in the recent primary.

    I’m guessing: the person who typed this up heard the word, but never encountered it in actual use.

    The correct word, of course, is annunciator, as defined there. Not exactly a homonym, but a pretty close match.

    Wrong word, used properly, and spelled correctly. It’s not like I’ve never made that sort of mistake, fer shure!

  • TCFFHRC Rules Document: LyX / LaTeX Settings

    I’m editing the Trinity College Home Firefighting Robot Contest rules document using the LyX GUI front end to LaTeX to handle the formatting.

    Yes, yes, I know OpenOffice and its ilk have all the features you think you need. When you actually try to put together a book-length document, you find that the features don’t actually work / work together / behave reliably. Been there, done that. Enough times to be wary, indeed.

    So LyX / LaTeX is the least-worst alternative and actually does a pretty good job after you get the various configurations beaten into shape. After that, you just type, add tags, and it’s all good.

    Here’s a list of the settings I’m using… for future reference, natch, because figuring this stuff out from first principles takes a while.

    Document settings

    Document Class: report
    Text Layout: MedSkip vertical, Single line, Two-column
    Page Layout: US Letter, fancy headings
    Page Margins: 0.75 inch all around, 0.3 inch separations</pre>
    <strong>LaTeX Preamble</strong>
    <pre>\usepackage{ragged2e}
    \usepackage{lastpage}
    \usepackage{url}
    \usepackage{dvipost}
    \usepackage{breakurl}
    \usepackage[labelfont={bf,sf}]{caption}
    \renewcommand{\bottomfraction}{0.7}
    \pagestyle{fancyplain}
    \fancyhf{}
    \lhead{\fancyplain{}{Trinity College Home Robot Contests}}
    \rhead{\fancyplain{}{2010 Rules}}
    \lfoot{\fancyplain{Modified \today}{Modified \today}}
    \cfoot{Copyright 2009 by Trinity College}
    \rfoot{\fancyplain{\thepage\ of \pageref{LastPage}}{\thepage\ of \pageref{LastPage}}}
    \RaggedRight
    \dvipostlayout
    \dvipost{cbstart color push Blue}
    \dvipost{cbend color pop}
    

    Trickery

     

    Some of those packages aren’t part of the default LyX / LaTeX installation on Ubuntu. Searching for LaTeX in Synaptic is tedious, but works.

    The three ways to export to PDF are not identical.

    • dvipdfm doesn’t produce clickable TOC links.
    • pdflatex, the default, doesn’t produce change bars, which is a crippling defect for a rules document under heavy revision. It’s OK for the final draft, though.
    • ps2pdf doesn’t produce searchable text; it’s all graphics. Ptooie!

    So use dvipdfm during development (to get change bars) and use pdflatex for the final product (to get clickable links). There has got to be a way around that, but I haven’t a clue as to what’s going on under the hood.

    In order to track changes:

    Document -> Change Tracking -> Track Changes.

    In order to print change bars and suchlike:

    Document -> Change Tracking -> Show Changes in Output

    Figures appear on-screen in dot-for-dot mode by default, so tweak the on-screen ratio to maybe 50%. Force the printed width of all figures to 3 inches for two-column layout. Insist that picture resolution bear some resemblance to reality: 3 inches at 300 dpi -> 1000 pixels across.

    There seems to be no way to export LyX directly to ODT. Exporting to RTF strips off most of the formatting, as you’d expect, and change tracking Goes Away.

    Exporting to HTML produces one honkin’ big lump of HTML with a bazillion image files in a separate directory. That’s probably OK for most purposes.

    Memo to Self: Turn off change tracking for minor editorial tweakage, because nobody really cares.

  • Adding a Device to LTSpiceIV

    Searching around for an LM386 SPICE model turned up this useful thread.

    The model has some limitations, discussed there, but seems practical. So far, the main gotcha is that the output voltage doesn’t center neatly at Vcc/2, but that’s in the nature of fine tuning.

    The trick is getting the model & symbol into Linear Technology’s LTSpiceIV

    Running under WINE in Xubuntu, the emulated C drive is in your home directory at

    .wine/drive_c/

    with the Linear Tech LTSpiceIV files tucked inside that at

    .wine/drive_c/Program\ Files/LTC/LTspiceIV/

    Incidentally, WINE puts the program icon in

    .local/share/icons/05f1_scad3.0.xpm

    It’s not clear what the prefix means, but the actual executable is scad3.exe (I think that’s historical cruft, as the new overall name is LTSpiceIV).

    Copy the LM386.sub file to lib/sub and the LM386.asy file to lib/sym, then restart LTSpiceIV.

    After putting the symbol in the schematic, I had to edit its attributes (other-click the symbol), make both InstName & Value visible to see them on the schematic, then move them to somewhere other than dead-center in the symbol. I can’t figure out how to make that happen automagically, as it does with other symbols. Comparing the two files to ordinary components doesn’t show anything obviously missing.

    Link rot being what it is, here’s the LM386.sub file:

    * lm386 subcircuit model follows:
    
    ************************************original* IC pins:     2   3   7   1   8   5   6   4
    * IC pins:     1   2   3   4   5   6   7   8
    *              |   |   |   |   |   |   |   |
    .subckt lm386 g1  inn inp gnd out  vs byp g8
    ************************************original*.subckt lm386 inn inp byp  g1  g8 out  vs gnd
    
    * input emitter-follower buffers:
    
    q1 gnd inn 10011 ddpnp
    r1 inn gnd 50k
    q2 gnd inp 10012 ddpnp
    r2 inp gnd 50k
    
    * differential input stage, gain-setting
    * resistors, and internal feedback resistor:
    
    q3 10013 10011 10008 ddpnp
    q4 10014 10012 g1 ddpnp
    r3 vs byp 15k
    r4 byp 10008 15k
    r5 10008 g8 150
    r6 g8 g1 1.35k
    r7 g1 out 15k
    
    * input stage current mirror:
    
    q5 10013 10013 gnd ddnpn
    q6 10014 10013 gnd ddnpn
    
    * voltage gain stage & rolloff cap:
    
    q7 10017 10014 gnd ddnpn
    c1 10014 10017 15pf
    
    * current mirror source for gain stage:
    
    i1 10002 vs dc 5m
    q8 10004 10002 vs ddpnp
    q9 10002 10002 vs ddpnp
    
    * Sziklai-connected push-pull output stage:
    
    q10 10018 10017 out ddpnp
    q11 10004 10004 10009 ddnpn 100
    q12 10009 10009 10017 ddnpn 100
    q13 vs 10004 out ddnpn 100
    q14 out 10018 gnd ddnpn 100
    
    * generic transistor models generated
    * with MicroSim's PARTs utility, using
    * default parameters except Bf:
    
    .model ddnpn NPN(Is=10f Xti=3 Eg=1.11 Vaf=100
    + Bf=400 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
    + Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
    + Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
    + Tf=1n Itf=1 Xtf=0 Vtf=10)
    
    .model ddpnp PNP(Is=10f Xti=3 Eg=1.11 Vaf=100
    + Bf=200 Ise=0 Ne=1.5 Ikf=0 Nk=.5 Xtb=1.5 Var=100
    + Br=1 Isc=0 Nc=2 Ikr=0 Rc=0 Cjc=2p Mjc=.3333
    + Vjc=.75 Fc=.5 Cje=5p Mje=.3333 Vje=.75 Tr=10n
    + Tf=1n Itf=1 Xtf=0 Vtf=10)
    
    .ends
    *----------end of subcircuit model-----------

    And the corresponding LM386.asy file:

    Version 4
    SymbolType CELL
    LINE Normal -64 -63 64 0
    LINE Normal -64 65 64 0
    LINE Normal -64 -63 -64 65
    LINE Normal -60 -48 -52 -48
    LINE Normal -60 48 -52 48
    LINE Normal -56 52 -56 44
    LINE Normal -48 -80 -48 -55
    LINE Normal -48 80 -48 57
    LINE Normal -44 -68 -36 -68
    LINE Normal -40 -72 -40 -64
    LINE Normal -44 68 -36 68
    LINE Normal -16 -39 -16 -64
    LINE Normal 0 32 0 48
    LINE Normal 48 -8 48 -32
    SYMATTR Value LM386
    SYMATTR Prefix X
    SYMATTR ModelFile LM386.sub
    SYMATTR Value2 LM386
    SYMATTR Description Low power audio amplifier
    PIN -16 -64 LEFT 8
    PINATTR PinName g1
    PINATTR SpiceOrder 1
    PIN -64 -48 NONE 0
    PINATTR PinName In-
    PINATTR SpiceOrder 2
    PIN -64 48 NONE 0
    PINATTR PinName In+
    PINATTR SpiceOrder 3
    PIN -48 80 NONE 0
    PINATTR PinName V-
    PINATTR SpiceOrder 4
    PIN 64 0 NONE 0
    PINATTR PinName OUT
    PINATTR SpiceOrder 5
    PIN -48 -80 NONE 0
    PINATTR PinName V+
    PINATTR SpiceOrder 6
    PIN 0 48 LEFT 8
    PINATTR PinName bp
    PINATTR SpiceOrder 7
    PIN 48 -32 LEFT 8
    PINATTR PinName g8
    PINATTR SpiceOrder 8

    Props to Roff, who actually created those files…