My Uncle’s Iron

May 10th, 2006 by Keith Neufeld

My uncle Adolf is probably most directly responsible for my interest in electronics. When I was growing up, he and Aunt Wanda ran A&W Electronics, retailing and repairing TVs and other equipment. This was back in the days of chassis construction, before circuit boards, when everything was built onto a metal chassis with insulating standoffs, vacuum tubes, lots of wire, and lots of solder.

When they received TVs that were irreparable, he’d often remove the dangerous parts (picture tube, flyback transformer, and huge capacitors) and give the remaining pieces to my brother and me to take apart. Which we did with great zeal, and a couple of wirecutters. I still have boxes of components that we salvaged out of those TVs; and man, they don’t make resistors and capacitors like they used to. And that’s mostly a good thing.

So when they had a household auction recently, in preparation for moving to a retirement community, I was pleased and proud to purchase two boxes of soldering equipment.

Boxes of Soldering Equipment

I could see the Weller/Ungar pencil irons, and knew that any one of them was worth the $16 I paid for the box. It wasn’t until I got home that I could really see what all I got:

Soldering Equipment

There’s just an amazing amount of stuff crammed into the boxes. These irons have replaceable, screw-in heating elements, and the boxes have several spares of different wattages. One or two of the elements have replaceable tips like we’re used to using these days, and there are plenty of spare tips, too. Eventually, I plan to go through everything, sort out what goes with what, and do a little cleaning on the pieces that do fit together–replace brittle power cords, clean iron handles, polish heating elements, etc.

So?

I desolder a lot of components from dead electronic equipment that people give me. I really prefer older stuff with through-hole components, because SMT parts are a pain to identify and sort, and through-hole stuff is easy to prototype and breadboard with. The fastest method I’ve come up with is to pry up crimped leads with a $2 chisel, heat the solder side with a heat gun, and pull the components out with a chip puller or needlenose and drop them into a tub.

Generally.

Except (he finally gets to the point) for the TO-220 MOSFETs on the printer boards. For whatever reason, their through-holes were plated only barely larger than their leads, and I was having a dickens of a time desoldering them with the heat gun. The board was scorching, I was breathing really noxious fumes (and I like the smell of solder flux, but not so much burning fiberglass epoxy), I was bubbling and flexing the board as I pulled on the FETs’ tabs with a pliers, and still no joy. I ended up pulling the entire plated through-holes clean out of the board (um, maybe “clean” isn’t the best word to use here) and sliding them off the transistors afterward with my soldering iron.

And the Iron?

I’ve previously desoldered with soldering irons and guns, and under some circumstances, direct heat can be very effective at removing stubborn leads. So a couple of nights ago, I got around to digging through the auction boxes to see whether I could find a wide tip. I was looking for something that would hit all three transistor leads at once, and I found exactly that–a gimongous .3″ chisel-tip 40W heating element, still sealed in its original bubble package.

I opened the package, cleaned the oxidation off the tip, screwed it into one of the handles, and plugged it in. When it started getting up to temperature, I smiled in appreciation at the ceremonial first tinning of the new tip. I grinned at its extreme shininess as I wiped off the solder on the damp sponge. I dropped my jaw in amazement as the transistor slipped right out of the board in about a second of applying the tip to the leads. I desoldered the remaining thirty or so transistors in a matter of brief minutes.

The tip kept heating up the whole time. As I was finishing, I would occasionally cast shadows on the iron and see that the tip was now red-hot. I’d wipe it on the damp sponge and see little embers rise into the air as it tore off and burned rough parts of the sponge surface. I was rather unnerved to see this from an element rated at 40W.

But boy, did it desolder them transistors! Yee-haw!

Obligatory FPS Reference

I’m somehow reminded of the differing effectiveness of various weapons against various monsters in Doom. When you run into a cacodemon, you better make sure you have the nailgun handy–even though it’s utterly useless against several other species.

Stepper Motors, Part II: Testing Motion

May 10th, 2006 by Keith Neufeld

The Wiring

Sunday, worked in around the community orchestra concert, I got the stepper motor moving using my old friend, the 754410 dual H-bridge driver. I hooked each coil across an H-bridge, and used my Curiously Strong LogoChip as a controller, with two pins running each bridge (forward and reverse). Four pins per motor may or may not be the best way to build a complete CNC machine, but it worked nicely for testing.

Stepper Motor with LogoChip Controller and 754410 Driver

The red/yellow/black wire set from the LogoChip to the driver board provides regulated 5V and unregulated 9V to any auxiliary circuits I want to connect–I like to think of it as the PTO. The red/grey/blue/orange wires from the LogoChip to the driver board are the step control signals, and the red/black/blue/orange wires are permanently cabled into the motor. The yellow/green wires feed from one of the variable outputs on my bench power supply, and provide drive power separate from logic power, to keep dips and noise due to the motor from interfering with the logic control circuitry.

The Software

After wiring up the driver board, I wrote a little LogoChip program to control the driver. I needed to provide a quadrature-encoded signal (one goes high, two goes high, one goes low, two goes low) on two sets of two pins, and be able to reverse it. It turned out to work really nicely to modularize the CW/CCW quadrature code in one function, and put the icky code to deal with turning pins on and off in a separate function–it makes the quadrature code reusable to run multiple motors, among other things.

Here’s what I ended up with:

  • stepper.txt – Program to drive bipolar stepper motor

Here’s the code:

;   stepper.txt
;
;   06-May-2006  Keith Neufeld
;
;   Test/drive bipolar stepper motor, using external 754410 driver chip.
;   Two coils are driven in quadrature:
;
;       ===|       |=======|       |=======|       |=======|
;          |       |       |       |       |       |       |
;          |=======|       |=======|       |=======|       |===
;
;       =======|       |=======|       |=======|       |=======|
;              |       |       |       |       |       |       |
;              |=======|       |=======|       |=======|       |

;------------------------------------------------------------------------------
;   Debug system
;------------------------------------------------------------------------------

constants [[debug 0]]
;constants [[debug 1]]

;------------------------------------------------------------------------------
;   Section to manipulate stepper motor.
;   Coil 1 driven by C7/C6.  Coil 2 driven by A2/A3.
;------------------------------------------------------------------------------

constants [
    [coil1-port portc] [coil1-ddr portc-ddr]
    [coil1a-bit 7] [coil1b-bit 6]

    [coil2-port porta] [coil2-ddr porta-ddr]
    [coil2a-bit 2] [coil2b-bit 3]
]

to stepper-off
    clearbit coil1a-bit coil1-port      ;   set all coil outputs low
    clearbit coil1b-bit coil1-port

    clearbit coil2a-bit coil2-port
    clearbit coil2b-bit coil2-port
end

global [steps-per-sec msec-per-step]    ;   timing "constants"
global [coil1-pos coil2-pos]            ;   current coil state

to init-stepper
    stepper-off                         ;   shut down all coil outputs

    clearbit coil1a-bit coil1-ddr       ;   set all coil pins as outputs
    clearbit coil1b-bit coil1-ddr

    clearbit coil2a-bit coil2-ddr
    clearbit coil2b-bit coil2-ddr

    setsteps-per-sec 2                  ;   2 steps per second
    setmsec-per-step 1000 / steps-per-sec       ;   precalculate wait per step

    setcoil1-pos 0                      ;   initialize quadrature to (0,0)
    setcoil2-pos 0
end

to step-set                             ;   push out new quadrature values
    ifelse debug [
        send 48 + coil1-pos             ;   0/1 with no CR
        send 32                         ;   space with no CR
        print coil2-pos
    ] [
        ifelse coil1-pos [
            clearbit coil1b-bit coil1-port      ;   clear before set
            setbit coil1a-bit coil1-port
        ] [
            clearbit coil1a-bit coil1-port      ;   clear before set
            setbit coil1b-bit coil1-port
        ]

        ifelse coil2-pos [
            clearbit coil2b-bit coil2-port      ;   clear before set
            setbit coil2a-bit coil2-port
        ] [
            clearbit coil2a-bit coil2-port      ;   clear before set
            setbit coil2b-bit coil2-port
        ]
    ]
end

;   CW pattern:
;       0110.0110
;       0011.0011

global [new1 new2]                      ;   temps for coil values

to step-cw
    setnew1 not coil2-pos
    setnew2 coil1-pos

    setcoil1-pos new1
    setcoil2-pos new2

    step-set                            ;   do it
end

to step-ccw
    setnew1 coil2-pos
    setnew2 not coil1-pos

    setcoil1-pos new1
    setcoil2-pos new2

    step-set                            ;   do it
end

;------------------------------------------------------------------------------
;   Routines to tie it all together
;------------------------------------------------------------------------------

to init-all
    init-stepper
end

to powerup
    init-all
end

to startup
    init-all
    loop [
        step-cw
        mwait 100
    ]
end

The Movement

I started up the motor control with a loop [ step-cw wait 10 ] from the LogoChip console, then turned up the variable power supply until the motor was chunking along at a step per second. That channel of my power supply is only good for 1.5A, and I found that no matter how high I turned the dial, the meter didn’t read any higher than about 2.5V. I guess the coil power calculations were pretty close.

Next, I played with different timing values, to watch the motor turn at different rates and test its torque. I found that on this power supply, I could very easily stop or spin the motor contrary to the control signal. That was a little disappointing, but I realize also not at all a fair test, with the motor so underpowered.

Finally, I knew the 754410 is only rated for 1A per bridge, and I was attempting to use it for much more than that. I was being careful not to sustain high-voltage testing for long periods, but I was still curious how the 754410 was reacting thermally. The result was fascinating–I could quite distinctly feel the chip getting warmer as I ran the motor and cooler when I stopped it. I’m used to components heating up, but I’ve never before experienced it so directly in real time (at least, not without scorching my fingers).

I had known that the 754410 wouldn’t be my ultimate drive circuit, but I hadn’t known I would hit the wall with it so quickly. After realizing how hot it was running, I knew the next step was building a drive circuit with discrete power transistors. And I just happened to have some on hand: MOSFETS, from the stepper drivers in some old printers.

Review time in my Malvino–quite possibly the best $130 I ever spent.

Stepper Motors, Part I: Confirming Values

May 6th, 2006 by Keith Neufeld

The Project

My friend Joel has a computer numerically controlled (CNC) drilling machine that he built from a mail-order unpopulated circuit board and a set of plans. Its table holds materials up to about 10″ x 14″, and I go over to use it any time I need to drill a circuit board. It’s not terribly inconvenient to use his, and it’s always a nice excuse to visit with him while we’re setting it up and letting it run–but I’ve wanted my own for as long as I can remember. They’re just cool.

There are lots of descriptions of and plans for CNC drilling machines on the Web, so I won’t go into a lot of detail. The basic idea for this model, though, is that a drill is suspended in place above a table that slides around to position the workpiece. The table is positioned by long screws (all-thread) turned by stepper motors, which are motors that move small increments (steps) in response to an input signal, rather than running freely. Each step is a small fraction of a complete rotation, and coupled with the worm-drive effect of the lead screw allows for very precise positioning of the workpiece–easily 1/1000″, and often 1/8000″. (Of course, mechanical issues like backlash do intrude, but 1/1000″ doesn’t seem to be terribly hard to achieve.)

The Motors

So . . . I want to build my own CNC drilling/milling machine, and since I do electronics bottom-up, the project starts with the motors. And boy, do I have motors. I have these giant steppers out of heavy-duty wide-carriage impact printers from a former employer just begging to be used.

Big Stepper Motor

If you look carefully, you can see the ruler underneath the motor–it’s a good 2″ in diameter. Pretty heavy, too.

As we wrapped up our TechArt installation, my thoughts have been returning to these motors, and wondering what it would take to start building drivers for them. This weekend, in between community orchestra rehearsals, I sat down with one of the motors and started making notes. Here are the specs from the sticker on the back side:

PULSE MOTOR
TYPE PJ55E1U97A

A / Phase: 2.5
Ω / Phase: 0.85

Nippon Pulsemotor Co Ltd

Uh, .85Ω per phase? Are they kidding??? That’s an insanely low coil impedance compared to what I’m used to on traditional motors. I can see already this is going to be a challenge.

The Coils

The first thing to do with an unknown stepper motor is figure out the coil wiring. Steppers have multiple coils, each determining either one or two rotor positions, and each with an external wire or pair. From the steppers I’ve played with, four wires generally means two coils each powered in alternating directions, five wires is one common plus four unidirectional coil connections, and six wires is three unidirectional coils. This motor has four, so it was a simple check with an ohmmeter to determine which wires go to which coils.

Red to black: 1.3Ω
Orange to blue: 1.2Ω

Internal resistance of meter (shorting probes together): .3Ω
Variation due to probe placement and pressure against pins: up to .2Ω

So yeah, that’s pretty much .85Ω per coil. Wow.

The label says 2.5A per coil. To get 2.5A current, 2.5A * 1Ω = 2.5V and 2.5A * .85Ω ≡ 2.1V. That’s a really low coil voltage, given some assumptions I’ve already made about the drive circuitry, so I can tell that’s going to be a challenge.

Finally, I hooked wires to my bench power supply and touched them to the coil wires, just to watch the rotor move. In that very unscientific experiment, it looked like the stepping behavior (speed and impact of single steps) was about the same when using a 5V supply as when using a 2.5V supply. That gave me hope that I might be able to fudge on the details and use a higher coil voltage than nominal–although I don’t want to heat up the motor and melt the coils during intense use.

The step pattern I tried moved the motor CCW: black/red, blue/orange, red/black, orange/blue.

Craft to Art; Construction to Exhibit

April 26th, 2006 by Keith Neufeld

Andrea’s doing an amazing job prepping the cabinet for display. While I was painting the primer, the cabinet looked white and ucky like this:

And here’s my wife helping on the first coat:

But bring it to someone with vision and you get a sweet-looking flat grey base coat on the outside:

And a “camel” color on the interior that really makes the coffin shape pop:

Andrea has also “bagged” (sponged) on some bronzing, which looks great:

And I can hardly wait to see the pink (fuschia?!) that comes next, with a crackle coat to follow. Sweet!

Ultrasonic Rangefinder, Part III: Receiver / LogoChip Interface Attempt

April 26th, 2006 by Keith Neufeld

I haven’t touched the DIY rangefinder project for a couple of weeks, but I realized I also never wrote up my latest work on it.

Receiver Comparator

After my previous post about building two amplifier stages, I intended to use one of the spare channels on the LM324 as a comparator to “digitize” the amplified receiver signal and provide a clean input to the LogoChip. Unfortunately, the first time I prototyped it was late in the evening when my brain doesn’t work too well, and I built it just like the first two stages–as a linear amplifier. I was really surprised to see more analog waveforms on my scope when I expected sharp edges. At only 24kHz, I didn’t think it should be a slew rate problem, but I wasn’t thinking clearly and just set it aside for the night.

The next day, my error was obvious, and I pulled out the feedback resistor to let the op amp run open loop with infinite gain. It cleaned up the signal, although still not as much as I would have expected. Once the basic circuit was working, I replaced the fixed voltage divider with a 20k trimpot and tuned it as well as I could, trying to find the sweet spot to weed out all the noise but pass all the real signals.

I hadn’t seen it before, but now I wondered whether I was getting some false readings from noise, as John suggested he had encountered when working on similar circuits. I looked briefly at adding a low-pass filter to the circuit (it’s already high-pass filtered by the capacitive coupling from the receiver to the first amplifier stage due to the single-ended op-amp I’m using), but haven’t done it yet. First I wanted to connect it to the LogoChip and see what kind of results I got.

PIC CCP

An ultrasonic rangefinder measures distance by emitting a “ping” and counting the time until the echo is detected; dividing by the speed of sound translates the round-trip time into a distance. Because of the short durations involved, the easiest way to do this on a PIC microcontroller is with the “capture” section of the Capture/Compare/PWM (CCP) subsystem. It uses a high-resolution timer and interrupt circuitry to give a very precise measurement of how long something takes to happen.

I started with John Harrison’s CCP code from his srf_demo.txt example on the TechArt wiki LogoChip with Ultrasonic Sensor page. His code was using the PIC’s CCP module #1; but in my application, I was already using CCP1 to provide the 24kHz signal for my transmitter, so I started translating to use CCP2. The control and behavior of the two CCP channels are rather different, so it wasn’t a matter of simple substitution. Here’s what I ended up with:

Here’s the receiver section of the code:

;------------------------------------------------------------------------------
;   Routines for manipulating CCP2 and timer 3 for capture.
;------------------------------------------------------------------------------

constants [
    [CCP2CON $fba]                      ;   capture/compare/PWM 2 control reg
        [CCPxM-CAP-EVERY #0100]                 ;   capture every falling edge
    [CCPR2H $fbc]                       ;   CCP 2 register low byte
    [CCPR2L $fbb]                       ;   CCP 2 register low byte
    [PIR2 $fa1]                         ;   peripheral interrupt request 2
        [CCP2IF 0]                              ;   timer 3 interrupt bit
    [CCP2-PORT portc]                   ;   uses portc pin 1
        [CCP2-BIT 1]
    [CCP2-DDR portc-ddr]

    [T3CON $fb1]                        ;   timer 3 control register
        [T3CCP2 6]                              ;   timer 3 CCP mode bit 2
        [T3CCP1 3]                              ;   timer 3 CCP mode bit 1
                                                        ;   1x src CCP1+2
                                                        ;   01 src CCP2
        [T3CKPS1 5]                             ;   timer 3 prescale bit 1
        [T3CKPS0 4]                             ;   timer 3 prescale bit 0
                                                        ;   11 = 1:8
        [TMR3ON 0]                              ;   timer 3 enable bit
    [TMR3H $fb3]                        ;   timer 3 high byte
    [TMR3L $fb2]                        ;   timer 3 low byte
]

;   Initialize CCP by configuring timer 3 and enabling capture mode.
to ccp-init
    write CCP2CON CCPxM-CAP-EVERY       ;   config to capture every falling edge

    clearbit T3CCP2 T3CON               ;   set T3CCP to 01 to make T3 src CCP2
    setbit T3CCP1 T3CON                 ;       and T1 src CCP1

    setbit T3CKPS1 T3CON                ;   set T3CKPS to 11 to use 1:8
    setbit T3CKPS0 T3CON                ;       prescalar

    setbit TMR3ON T3CON                 ;   enable timer 3

    setbit CCP2-BIT CCP2-DDR            ;   set CCP2 (RC1) pin for input
end

;   Record starting value of timer 3 and clear capture flag.
global [ccp-before]
to ccp-start
    setccp-before ((read TMR3H) * 256) + read TMR3L
    clearbit CCP2IF PIR2
end

;   Wait for capture event and return duration.
global [ccp-after]
to ccp-wait
    waituntil [testbit CCP2IF PIR2]     ;   wait for capture interrupt
    setccp-after ((read CCPR2H) * 256) + read CCPR2L
    output ccp-after - ccp-before
end

I added code to send a ping and take a measurement:

;------------------------------------------------------------------------------
;   Top-level routines to tie it all together.
;------------------------------------------------------------------------------

;   For the sake of testing, activate on powerup.
constants [[standalone 0]]
to powerup
    pwm-init
    ccp-init
    if standalone [ pwm-on ]
end

;   Send a short burst of tone.
to ping
    pwm-on
    mwait 1
    pwm-off
end

;   Ping and measure time to reply.
to range
    ccp-start                           ;   record start time
    ping
    output ccp-wait                     ;   wait for echo and return duration
end

Wrote a little loop to display the results on the PC, and was disappointed to see that they really didn’t vary at all in proportion to the distance from the sensor to an obstacle. After a few minutes of head-scratching, I noticed that I hadn’t wired the comparator output to the LogoChip’s CCP input. Oops! And that’s when I realized I had a much bigger problem.

Overloading Port C1

The PIC’s CCP modules are implemented in hardware, and they’re hard-wired to specific pins. The input pin for CCP2 is the same as general-purpose pin C1–in fact, most if not all of the PIC’s pins have multiple functions that are selected by configuration registers.

My problem arose because C1 is already being used by the LogoChip firmware–as the Go/Stop input! Because LogoChip Logo isn’t open-source, I can’t see exactly how it’s being used, and have to guess what would happen if I tried to use it as a capture input. Since pressing a button attached to that pin makes the LogoChip stop executing user code and return to an idle state, I can’t imagine I’d have an easy time overriding that behavior and getting it to use the pin solely for CCP with no interference.

So what now? I need both CCP modules–one to use the PWM output to drive the 24kHz transmitter, and the other to watch and count time on the receiver. I don’t think I’ll be able to overload C1 with CCP2 for the receiver, so I’m left with a couple of options: swap the pins, or use CCP1 for both transmission and reception.

Swap the Pins

My first thought was to use CCP1 as the receiver (since its corresponding port, C2, is otherwise unused) and make CCP2 the transmitter (on port C1, the Run/Stop button). John says he has previously overridden C1 and used it as an output when the Run/Stop functionality wasn’t needed, so this should work.

In the long run, though, I’m a little uncomfortable giving up the Run/Stop button. I’d like to be able to integrate this technology into hobby robots, and I’d like to be able to leave them powered up but in an idle state, without having to duplicate the preexisting Run/Stop behavior myself in software. Swapping the PWM-transmit / capture-receive pins should work for a quick fix, but I’m not sure it’s where I want to be in the larger game.

Use CCP1 for Both Transmission and Reception

Alternately, I could overload CCP1 for both transmitter and receiver. There’s precedent–another student in class is using the Parallax PING))) (TM) sensor module, which has only three pins–ground, power, and bidirectional signal.

To do that, I’d need to make sure that transmission and reception don’t interfere with each other. Keeping transmissions out of the receiver circuit is easy–put a diode from the comparator output to the LogoChip so the transmitter signals don’t go “upstream” into the comparator.

Keeping comparator signals out of the transmitter driver is a little trickier, but I think I have a reasonable solution, based on something I was considering doing anyway. I’d like to be able to drive multiple sensors from one LogoChip, but there’s only one (er, two, maybe, sorta) PWM output available. To drive multiple rangefinders, I’d need to multiplex the PWM signal somehow–and there are plenty of ways to do that.

The most straightforward is to use a few LogoChip output pins to select which transmitter to drive and AND (or NAND) them with the PWM signal. Cake! And it tidily solves my receiver-interfering-with-transmitter problem–the receiver can dump whatever it wants onto the PWM output, but it won’t go anywhere harmful unless one of the transmitter select lines is activated.

Sounds like a win all around, and I think I’ll investigate it as soon as things calm down with the exhibit and I can get back to tinkering. It means a little more work on the software side (switching CCP1 back and forth between PWM and capture modes), but I’ve never been afraid of writing code.

Cabinet Construction

April 24th, 2006 by Keith Neufeld

While Andrea’s been working on editing video and searching for materials, I’ve been slowly building the cabinet that will house the project–and too busy to upload all my pictures. Here’s an overview of the process.

Large Sheets of Plywood

It all started a little over two weeks ago, at Lowe’s with two sheets of 15/32″ plywood in the back of the Possum Van. The cabinet is about the size of an arcade game, and they’re normally made from ~3/4″ plywood; but this won’t have to stand up to the same kind of abuse they take, so I figured ~1/2″ would be fine. It also reduces the weight dramatically, making it less difficult to lug around.

Plywood in the Back of the Van

A friend and his son helped with some of the initial cuts. Because my tablesaw isn’t very accessible, and I don’t have an extension table anyway, we were cutting plywood on the floor (on 4×4 supports) using my circular saw, and the factory edge of another plywood sheet as a guide. I picked up a new Freud blade for under $15, and it’s incredible–very sharp, very easy to push, very clean cuts. We were all amazed. No more $7 Piranha blades for me!

Ripping Plywood

Starting the Base

For load-bearing elements (the top and bottom of the base cabinet, the bottom of the upper cabinet, and the inner back of the upper cabinet), I used 3/4″ plywood that I had on hand. After cutting all the pieces for the base, I leaned them together to make sure they were sized correctly to fit the way I intended.

Cabinet Base Leaned Together

Not shown here is assembly of the cabinet pieces. I used my biscuit joiner for the whole thing. The biscuit joiner is basically an angle grinder with a very small (3″) circular saw blade and a fancy fence. You hold it up against the edge of a board, squeeze the trigger, and push it against the wood; it cuts a little slot in the wood. You repeat that on the opposing edge that you want to join; then take “biscuits,” little pieces of compressed beechwood that look like flattened footballs, jam them into the slots with glue, and have a pretty solid joint with (theoretically) perfect alignment. Since I was working alone most of the time, it would have been difficult to shoot a picture of the biscuiting process.

Building the Picture Frames

The front of the cabinet will have three swinging “picture frames,” which I made from maple that I had lying around. I used through mortise and tenon joints on the corners for strength, and cut them on a friend’s tablesaw using his tenoning jig.

Tenoning Jig

The joints fit pretty snugly, so they didn’t take much clamping during glue-up. (Love the random white-balance shifts my camera makes on indoor shots!)

Gluing up Picture Frames

Back to the Shop for the Rest of the Cabinet

Because the cabinet’s side panels are continuous from top to bottom (they’re on the outside, not interrupted by any horizontal elements), they had to be glued on last, so I had all the other parts of the base assembled before adding the sides. I wasn’t sure yet how smoothly the glue-up was going to go, so I did them one at a time. In order to seat the biscuits as well as possible, I ended up locating a clamp over each one. You can never have too many clamps.

Gluing up Cabinet Base

After completing the base, I glued up the outer frame of the upper cabinet. (It’s sitting on the assembled base.) Due to the design of the interior, I knew I was going to have to add the coffin panels last–and this meant that the outer frame would be unsupported whilst gluing it up. I clamped on a couple of pieces of scrap plywood to hold it square during assembly until dry. Once again, one pipe clamp over each biscuit.

Gluing Upper Cabinet Exterior

Because the upper cabinet is so large, I was really concerned about the integrity of its corners when I turned the outer frame upright–but I had nothing to worry about; it turned out to be surprisingly sturdy. I test-fit the panels for the coffin liner, then cut the liner fronts from more maple stock, using my tapering jig on a tablesaw. I left them a bit long so I could fit them exactly once I got them back to the cabinet–then regretted having done so, when I didn’t have a good way to cut them to size back at the shop.

I biscuited the fronts onto the liners and let them dry, then fitted the entire assembly into the outer shell and biscuited the outer liner ends to the shell ends, the fronts to the shell edges, and the inner liner ends into the shell sides. I needed gravity’s help during assembly, so I built one liner at a time with the cabinet laying on edge, then turned it upright to clamp and dry. I used scrap stock to hold the inner liner ends tightly against the cabinet shell across their entire width.

Gluing Left Coffin Liner

The biscuit joints on the right liner ended up a little more snug than those on the left, so I used a clamp per biscuit to pull them together. I would have used C-clamps for the entire face-to-shell joint, but I only have four 4″ clamps, so they’re all on the bottom section. The weight of all the pipe clamps sticking out the right side made the cabinet almost a little tipsy.

Gluing Right Coffin Liner

It’s not easy to see from this shot, but the coffin back is recessed a few inches into the cabinet, leaving a “service area” between the false back and the actual back door. That made it tricky to clamp the coffin back onto the coffin edges. I laid the whole cabinet upside down across a concrete ledge and a bucket (suspended to leave room on the bottom to attach clamps), stacked scrap 2x6es above the biscuits, laid a longer 2×6 across each end, and clamped that down tightly to the cabinet.

Gluing Coffin Back

I’m particular enough that I know I would have clamped it tightly like that anyway. However, in this case it was actually necessary–the coffin back was bowed about an inch and a half from end to end, so the top popped completely clear of its biscuits while clamping the bottom. Some of the biscuit joints were pretty loose, so I was really nervous it was going to spring open when I removed the clamps–but it held very nicely (thank goodness). If we do have any problems with it, I can always put some nails in from the back.

Finishing Touches

I needed a notch in the back of the base, for the power cord to come out when the back door is closed:

Base Notched for Power Cord

While the coffin back was drying (I gave it a long time, to be safe), I borrowed a rotary rasp and ground out the notch for the cord.

Notching Base with Rotary Rasp

Putty

My cuts and joints weren’t perfect, and I had some cracks to fill. (They would have been better had I been able to use a tablesaw for the large pieces, but still not perfect.) I gooped them up pretty nicely with some painter’s putty and a putty knife, then did some final sanding to smooth up the plywood before priming.

Puttying Cracks

Primer

Because plywood just drinks up paint, I put two coats of oil-based primer on all of the visible (exterior) surfaces, and a single coat on all of the interior (back-side) surfaces to help seal against humidity changes. The primer said it dries to topcoat in only eight hours, and I was very impressed with how dry it was by this morning. I haven’t uploaded those pictures yet–they’ll come in the next post.

Cabinet Modeling

April 4th, 2006 by Keith Neufeld

Andrea and I envision the cabinet for our TechArt final project, A Woman’s Mind, being built in two sections, for ease of hauling it around. The large, upper portion will contain the visible elements of the exhibit; and the small, lower portion will house the computer, UPS, LogoChip, cooling fans, etc.

Tonight, I modeled the upper portion of the cabinet, to get a better feel for the proportions, and to have something more concrete to use when discussing construction details with Andrea. I used an amazing new CAD package called CardBoard (TM). Its user interface is incredibly intuitive; and in addition to the basics like Cut and Paste, it offers operations I’ve never seen in other CAD software, such as Slice, Fold, and Tape.

As you can see below, it has stunningly photorealistic, three-dimensional renderings, even going so far as to simulate shutter shake and mismatched white balance across multiple views.

Here’s the upper portion of our cabinet with all of the screens closed. Note that the picture-frame of the outer screen is excessively wide; I hadn’t yet figured out how to model it at a narrower setting.

Cardboard Cabinet Model, Front View

The outermost panel obscures the entire contents; opening it reveals smaller screens, and begins to expose the shape of the cabinet interior. Again, the picture-frame is a bit wide and not necessarily to scale.

Cardboard Cabinet Model, Front Panel Open

Opening all of the front panels reveals the entire shape of the cabinet interior; as well as the head (monitor), heart, and fertility mechanisms (not yet modeled).

Cardboard Cabinet Model, All Panels Open

The rear panel will be locked and will open only for maintenance, providing access to a shallow false back and to the space surrounding the false interior. These spaces will hold the wiring needed to connect the sensors and actuators to the LogoChip, as well as the cables from the computer to the head monitor.

Cardboard Cabinet Model, Back Open

I plan to model the lower portion tomorrow night, working from the outline drawing of my earlier post. Hopefully Andrea and I can talk it over in class Thursday, and I can start actual construction this weekend.

Cabinet Plans: First Draft

April 3rd, 2006 by Keith Neufeld

First Draft of Cabinet Design

Multiplexing Ultrasonic Sensors

April 3rd, 2006 by Keith Neufeld

Last week in class, we talked about the potential need to have multiple Devantech SRF-05 ultrasonic sensors connected to one LogoChip. Different LogoChip output pins could connect to the different sensors’ trigger inputs, and then the sensors’ echo signals could all feed into one LogoChip input (because only one would be triggered at a time). We were trying to draw how to connect them together without burning them up, and I knew there was a right way to do it but couldn’t think of diodes.

Here it is:

Schematic to Multiplex Ultrasonic Sensors to One Digital Input

The echo signals are TTL, active high. That means that when the signal comes back, the sensor’s output will change from 0V to 5V. Put another way, 0V is normal; 5V means an echo was detected.

The diodes are one-way “valves” that allow electricity to flow from a sensor to the LogoChip when the sensor’s output is high (echo detected), but not from one sensor to another, under any circumstances. This protects the sensors from shorting each other out. When all of the sensors’ outputs are low, no electricity flows through the diodes to the LogoChip, so the pulldown resistor connects the LogoChip’s pin to ground (weakly) for a default input of low.

You could use some of Tom’s multiplexing techniques to connect even more ultrasonic sensors, but at $25 each, I expect cost will be the issue before running out of LogoChip pins.

Ultrasonic Rangefinder, Part II: Receiver

March 26th, 2006 by Keith Neufeld

Last night, I prototyped the transmitter circuit; today, I worked on the receiver. Coe’s design uses a two-stage op-amp circuit, with AC coupling on the input from the transducer to the first stage, to amplify the received signal before sending it to a comparator. I wanted to do the same, but I prefer to run from a single supply voltage, so I used an LM324 and added voltage dividers to bias the signal up to 2.5V.

First, I powered up the circuit from last night and measured the receiver’s signal on my scope. With the transmitter and receiver about 2” apart, the receiver signal was about 2V peak-to-peak, attenuating to about .5V p-p at 2’. If it continues to attenuate by a factor of 10 every 2’, then to measure distance out to 10’ (round trip of 20’), the received signal would be 2 * 10-10, or .2nV. Let’s hope that’s not the case!

The Circuit

Each stage of the amplifier circuit is taken directly from the LM324 datasheet, “AC Coupled Inverting Amplifier” (although the two stages are DC coupled). The receiver’s signal is AC-coupled to the first amplifier’s inverting input, with a 2.5V bias to the non-inverting input.

Ultrasonic Receiver Amplification Schematic

I’m not sure why C1 is needed on the bias voltage divider, but the output waveform was considerably cleaner with it than without, so I left it in. I also don’t know what RB does, and Forrest Mims’ Engineer’s Mini Notebook on op-amp circuits didn’t show it but the datasheet did, so I left it in as well.

Values

The bandwidth-gain product for the LM324 is 1MHz, so a 24kHz input means the maximum possible gain is about 41.7. The gain is set by the quotient of the feedback and input resistors, and it worked very naturally to select RF = 1MΩ and RIN = 24kΩ.

According to Mims, CIN should have a value of 1 / (2π flow RIN), where flow is the lowest frequency to pass the filter. This gives CIN = 1 / (2π 24kHz 24kΩ) ≅ 280pF–except the first time around, I mistakenly calculated using RF (1MΩ) instead of RIN (24kΩ), and got 6.6pF. I had a 10pF on hand, so I substituted it; but it was still far too low a value, as will be seen shortly.

I breadboarded the circuit on my workbench and measured about .04V peak-to-peak directly from the receiver element, with both transducers pointed at the ceiling. (That was about an 8’ round trip, so my dire prediction of .2nV was fortunately not the case.) Next, I measured only about .08V p-p at the output of the first amplifier stage, so obviously something was wrong. It was at this point that I added C1, which brought the amplifier output to about .1V and cleaned it up dramatically–but with a gain of 40, it should have been more like 1.6V.

I was suspicious about the value of the AC coupling capacitor, CIN, and began substituting different values for it, with the following results:

Condition Signal Amplitude
direct transducer output .04V
CIN = 10pF, C1 absent .08V
CIN = 10pF, C1 = 10uF .1V
CIN = 100pF .5V
CIN = 1nF .6V
CIN = 10nF .6V

It looked like I must have miscalculated by an order of magnitude (at this point, I hadn’t yet caught my frequency error in the calculation), and 100pF was probably close to the best valued, but still a little too far down the knee of the filter’s response curve. .6V output was still a little low for a gain of 40, but within a range I was willing to accept, given that I was estimating the values by counting hashmarks touched by a dirty, wiggling waveform on my scope. I put the 1nF back in and called it good.

Second Stage

After honing the values on the first stage of amplification, the second stage was easy–just more of the same. I used all the same values, but omitted the AC coupling capacitor, since I’m happy to DC-amplify around the 2.5V bias. The second stage gives me a trapezoidal waveform (clipping both the top and bottom of the transducer’s sine wave) running rail-to-rail of the LM324′s advertised output capacity–from 0V to about 4V. Tomorrow I need to run that through a comparator to clean it up just a little more, and then steal John’s capture/compare LogoChip code to start timing the echoes.