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.

Category: Science

If you measure something often enough, it becomes science

  • Wasabi NB-5L: Underperformers

    Based on the poor performance of the NB-5L batteries I bought from Blue Nook, they sent me three NB-5L batteries from a fresh batch (date code BNI13) and I ran them through the same discharge test:

    Canon NB-5L - OEM Wasabi - 2014-10-29
    Canon NB-5L – OEM Wasabi – 2014-10-29

    The red line off to the far right is the three year old Canon OEM battery, which remains far and away the best battery at 1 A·h.

    The previous cells (BNF27) produced the three scattered traces with the lowest initial voltages, ending around 0.8 A·h.

    The new cells (BNI13) produced the three tightly clustered traces. They have a higher initial voltage than the OEM cell, but much lower total capacity (about 0.75 A·h).

    These batteries obviously don’t come close to their 1400 mA·h rating. The capacity depends on the load current, but I’m using 500 mA because that’s close to the camera’s drain; the results should correlate reasonably well with actual use.

    The higher voltage from the new batteries will produce a longer runtime than the previous duds, but their total capacity is lower and they’re still no match for the old Canon OEM battery.

    The new ones start out very similar to each other, but the previous batch hasn’t aged well on their shelf. If the date codes mean what I think, all of these batteries will fail quickly.

    All that’s quite disappointing, because their NP-BX1 batteries for the Sony camera turned out quite well. The date codes all have the same format and typography, so I think they come from the same factory.

    For whatever it’s worth, I think the date coding works like this:

    • B – factory? shift? OEM? Blue Nook?
    • M – last two digits of year: M=13, N=14
    • K – month: F=6, I=9, K=11
    • 20 – day 

    For the four batteries / lots I have on hand:

    • BMK20 = 2013 Nov 20 – NP-BX1 bought in early 2014
    • BNI18 = 2014 Sep 18 – NP-BX1 bought in October – new lot
    • BNF27 = 2014 Jun 27 – NB-5L bought in October – old lot
    • BNI13 = 2014 Sep 13 – NB-5L supplied in late October – new lot

    So it goes.

  • Kenmore 158: Bubble Sorted Motor Current Sampling

    Because the ET227 transistor acts as a current limiter, the motor current waveform has flat tops at the level set by the DAC voltage. However, the current depends strongly on the temperature of all those transistor junctions, with some commutation noise mixed in for good measure, so the firmware must measure the actual current to know what’s going on out there.

    Here’s one way to pull that off:

    Motor current - ADC sample timing
    Motor current – ADC sample timing

    The upper waveform shows the motor current sporting flat tops at 650 mA.

    The lower waveform marks the current measurement routine, with samples taken just before the falling edge of the first nine pulses. The (manually tweaked) delay between the samples forces them to span one complete cycle of the waveform, but they’re not synchronized to the power line. Remember that the motor runs from a full wave rectifier, so each “cycle” in that waveform is half of a normal power line cycle.

    Given an array containing those nine samples, the routine must return the maximum value of the waveform, ignoring the little glitch at the start of the flat top and taking into consideration that the waveform won’t have a flat top (or much of a glitch) when the current “limit” exceeds the maximum motor current.

    After a bit of fumbling around with the scope and software, the routine goes like this:

    • Collect samples during one current cycle
    • Sort in descending order
    • Ignore highest sample
    • Return average of next two highest samples

    Given that the array has only nine samples, I used a quick-and-dirty bubble sort. The runt pulse at the end of the series in the bottom waveform brackets the sort routine, so it’s not a real time killer.

    Seeing as how this is one of the very few occasions I’ve had to sort anything, I wheeled out the classic XOR method of exchanging the entries. Go ahead, time XOR against swapping through a temporary variable; it surely doesn’t make any difference at all on an 8-bit microcontroller.

    The sampling code, with all the tracing stuff commented out:

    //------------------
    // Sample current along AC waveform to find maximum value
    //	this is blocking, so don't call it every time around the main loop!
    
    #define NUM_I_SAMPLES	9
    
    unsigned int SampleCurrent(byte PinNum) {
    	
    unsigned int Samples[NUM_I_SAMPLES];
    unsigned int AvgSample;
    byte i,j;
    	
    //	digitalWrite(PIN_SYNC,HIGH);
    	for (i=0; i < NUM_I_SAMPLES; i++) {				// collect samples
    //		digitalWrite(PIN_SYNC,HIGH);
    		Samples[i] = ReadAI(PinNum);
    //		digitalWrite(PIN_SYNC,LOW);
    		delayMicroseconds(640);
    	}
    //	digitalWrite(PIN_SYNC,LOW);
    	
    //	digitalWrite(PIN_SYNC,HIGH);							// mark start of sorting
    	for (i=0; i < (NUM_I_SAMPLES - 1); i++)
    		for (j=0 ; j < (NUM_I_SAMPLES - 1 - i); j++)
    			if (Samples[j] < Samples[j+1]) {
    				Samples[j] ^= Samples[j+1];					// swap entries!
    				Samples[j+1] ^= Samples[j];
    				Samples[j] ^= Samples[j+1];
    			}
    //	digitalWrite(PIN_SYNC,LOW);								// mark end of sorting
    	
    //	printf("Samples: ");
    //	for (i=0; i < NUM_I_SAMPLES; i++)
    //		printf("%5d,",Samples[i]);
    	
    	AvgSample = (Samples[1] + Samples[2])/2;				// discard highest sample
    //	printf(" [%5d]\r\n",AvgSample);
    	
    	return AvgSample;
    
    }
    
  • Kenmore 158: Motor RPM and Shaft Sensor First Light

    Using basically the same Arduino firmware as before, so the pedal scales the motor current without feedback:

    Curr Sense RPM Spindle Pos
    Curr Sense RPM Spindle Pos

    The top trace is the motor current, sampled through the ferrite toroid / Hall effect sensor / differential amp, at about 525 mA/V, so the current limit along those flat tops is 630 mA. There’s a small initial spike leading into each flat top, where (I think) the rapidly rising collector voltage rams enough current through the Miller capacitance into the base to briefly push the collector current upward.

    The next trace is the motor RPM sensor, ticking along at 14 revolutions in 160 ms = 87.5 rev/s = 5250 RPM. The glitch toward the right side comes from me hitting the scope’s STOP button to freeze the display in mid-trace. There’s no trace of the setscrew glitch, although that may be due to the compressed scale rather than the absence of the glitch.

    The bottom trace is the shaft position sensor, with 1 rev in 125 ms = 8 rev/s = 480 RPM. It’s nicely divided into equal halves, which is what you’d expect from looking at the counterweight.

    Under these conditions the speed ratio works out to 10.93, a whopping 9% over my original guesstimate.

  • Monthly Science: Garden Soil Temperature

    The soil temperature near the base of the bird box, under a few inches of chipped leaf mulch, shows the expected trend for the growing season, but there’s a weird bump in mid-October:

    Garden Soil Temperature
    Garden Soil Temperature

    The NWS temperature summary confirms the anomaly, with the DEP column giving the departure from the historic average:

    DY MAX MIN AVG DEP
    ==================
     1  65  58  62   5
     2  72  58  65   9
     3  73  49  61   5
     4  65  51  58   2
     5  62  40  51  -4
     6  70  38  54  -1
     7  76  52  64  10
     8  74  52  63   9
     9  70  44  57   4
    10  63  37  50  -3
    11  56  44  50  -3
    12  63  35  49  -3
    13  63  37  50  -2
    14  78  59  69  17
    15  79  69  74  23
    16  72  53  63  12
    17  73  52  63  13
    18  68  50  59   9
    19  56  33  45  -5
    20  61  30  46  -4
    21  57  48  53   4
    22  53  50  52   3
    23  52  48  50   2
    24  59  41  50   2
    25  66  34  50   2
    26  58  43  51   3
    27  64  38  51   4
    28  73  38  56   9
    29  68  42  55   8
    

    The precipitation record shows over an inch of rain in those four days, so that weather probably blew in from the south.

  • How Big Is Your Blog, Ed?

    So the good folks in the wordpress.com support infrastructure have been manually exporting my blog and sending me a link to the ZIP file, pursuant to the still unresolved failure-while-exporting issue. A bit of back-and-forth around the latest backup / export produced an interesting data point:

    The message about the export file not being found is simply an indicator that the huge export could not finish compiling before a more general time limit was reached — in this case because your site is easily in the top .1% for size. I will pass your suggestion for improved exporting along.

    I’m sure that’s among the freebie blogs on wordpress.com, but I never thought of myself as a member of the 0.1% club.

    Huh. Snuck up on me while I wasn’t paying attention. If I could do that with money, I’d be on to something.

    I’ve never participated in their post-a-day challenges, because that’s what I do around here. Should you find something interesting, every now and again, that’s a bonus.

    Back to the workbench…

     

  • Monthly Science: Bicycling!

    Mary finished out the National Bike Challenge with a rank of 3353 of 47 k riders, which, by my reckoning, is wonderfully good. She’s #1 in the Poughkeepsie area (admittedly, of only eight riders), with the second-place rider at 90% of her point score.

    She did it by riding on her usual missions, along our usual routes, around the usual obstacles:

    NYS Rt 376 at Westview Terrace
    NYS Rt 376 at Westview Terrace

    Her bike odometer recently rolled past 20 k miles; at least one battery change stole a pile o’ miles from her total, so the bike has accumulated more than that.

    As the song goes, my gal is red hot… in the best way!

  • Current Sensing: Powered Iron Toroid

    Dell built the GX270 I’m repurposing back in 2004, early on in the capacitor plague years, but only one of the system board caps showed signs of leakage:

    Capacitor plague - 2004 Dell Edition
    Capacitor plague – 2004 Dell Edition

    While I was harvesting some of the connectors, it occurred to me that those powdered iron inductors might make good current sensors, as they’re already wound with heavy gauge copper wires.

    I picked an inductor with enough turns and, although slitting didn’t pose much of a problem, the saw did make a mess of the turns adjacent to the cut:

    Powdered iron toroid - slitting
    Powdered iron toroid – slitting

    Iron powder has more magnetic remnance than ferrite, to the extent that iron swarf clogged the gap. After the first pass, I ran the slit toroid through the degausser to shake it clean and see what damage had been done. It looked OK, so I realigned it on the saw blade and continued the mission, with all the dust vanishing into the vacuum cleaner’s snout.

    Removing the damaged sections left 22 turns. For comparison, I converted the 56 turn ferrite toroid into a 25 turn model by paralleling two 25 turn sections:

    Slit toroids - iron - ferrite
    Slit toroids – iron – ferrite

    The enamel wire on the iron toroid measures 40 mil diameter, close enough to 18 AWG.

    Paralleling two 24 AWG windings on the ferrite toroid produces twice the copper area of a single winding, so the resistance is the same as a single 21 AWG winding (3 AWG steps = factor of two area change). That’s three steps smaller than the 18 AWG on the iron toroid, so the resistance is a factor of two larger than the heavier wire.

    The paralleled winding has the advantage of reducing the power dissipation required to produce the same magnetic flux density, without the difficulty of winding heavier wire. That may not actually matter, given the relatively low currents required by the motor in normal operation.

    Wedging a Hall sensor into the gaps and stepping the current produced two useful graphs:

    Iron and ferrite toroids - Hall sensor output
    Iron and ferrite toroids – Hall sensor output

    The iron toroid has lower permittivity (less flux density for a given magnetizing force), which means the full-scale range exceeds 3 A and the useful range up to 1 A covers only 300 mV.

    The last point on the ferrite curve shows the Hall sensor output saturating just over 4 V, with 1.5 V of range.

    The slope, in mV/A

    • Powdered iron: 340
    • Ferrite: 540

    Boosting the slope of the powdered iron by 25/22 gives 386 mV/A, so the iron permeability really is 70% of the ferrite. That’s modulo the gap size, of course, which surely differs by enough to throw out all the significant digits.

    Obviously, an op amp circuit to remove the offset and rescale the output to 0-5 V will be in order.

    The previous graph for the ferrite toroid with the complete 56 turn winding shows, as expected, about twice the output of this 25 turn version:

    FT82-43 - 56 turns - 24 AWG
    FT82-43 – 56 turns – 24 AWG

    The linear part of that line is 1375 mV/A, although I can’t vouch that the data came from the same Hall effect sensor. Scaling it by 25/56 gives 613 mV/A, suggesting it’s not the same sensor.

    Having developed an emotional attachment to the ferrite toroid, I’ll use it in the first pass of the current feedback circuit. If the motor need a bit less sensitivity or lower resistance, the powdered iron toroid looks like a winner.

    Memo to self: Always degauss iron toroids before slitting!