"Okay, Why Knot, do your thing," Seth Goldstein says, stepping back with the flamboyance of a magician. We're in his Bethesda basement, lured here by word of a robot who can tie a necktie. It took about five years to design and build, and soon it will be in a Philadelphia museum. We watch. His wife watches.

Seconds pass. Goldstein, who is 65 and has 12 patents (for such objects as a miniature catheter and a type of laser scanning microscope), steps forward and mouse-clicks on a computer displaying what looks like EKG readings, then returns to the spectator's position: Arms crossed, head jutted forward.

"Do your thing, Why Knot."

Or not. Occasionally the machine has precision issues, Goldstein says, since it is dealing with something so delicate as a polyester necktie. Once it gets going it'll be fine, says Goldstein.

But let's dispel the fantasy that Why Knot whips out a standard four-in-hand knot in 2.3 seconds. It's more like nine minutes and 350 steps. It's not even a robot or some sort of cybernetic manservant, but a "kinetic sculpture," as Goldstein calls it, something you'd sort of expect a guy in the burbs to build in his basement from a big, bad Erector set.

If there is a purpose to Why Knot and its July 15 public opening at the Franklin Institute Science Museum in Philadelphia, it's showing that mechanical engineering -- and its friction, momentum and voltages (yee-ow!) -- can be titillating stuff. Because, really, there is no other point, says Goldstein.

"Who's ever made a tie-tying machine?" he asks. "That's not something you can economically justify, but if you're a retiree, you don't have to worry about that anymore. I'm free!"

After earning four degrees at the Massachusetts Institute of Technology and working more than 40 years as a mechanical engineer -- including three decades at the National Institutes of Health designing biomedical instruments -- Goldstein decided to create Why Knot "for the hell of it."

Others have more lofty explanations, however. Tom Perry, managing director of education for the American Society of Mechanical Engineers, whose foundation provided $30,000 for the project (including $10,000 for the development of educational materials) and arranged its permanent exhibition at Sir Isaac's Loft at the Franklin Institute, believes that Why Knot forces people to confront the complexity of the human body.

"Just the mechanics it takes to reach up and scratch your forehead" is amazing, says Perry. Then you look at Goldstein's machine, and all those infrared lights and optical sensors and the 10 electric motors that propel a series of 350 laborious movements to tie and untie one standard knot -- all that shaft rotation and energy conversion, all that controlled motion and heat.

Goldstein has named some of the mechanical parts that have dominated umpteen hours of his life. There is the Hooker, for example. Then the Grabber, the Breaker and the Finger. "You see, I don't get out enough," he says. And the Roller, formerly a toilet paper roll with a wire clothes hanger, is another favorite. Just see how it smoothly transfers the tie to the closest thing Why Knot has to hands. (The process has begun!)

Next phase: Shaping the four-in-hand.

The project started benignly enough: "Why don't you build a machine that ties a necktie?" asked Paula Stone, Goldstein's wife, over breakfast one morning in fall 1999. "Great idea!" said her husband, who had been seeking a spare-time project. When he retired in 2002, Why Knot became a full-time obsession -- and frequent headache.

The original version took a year to organize, and many times he says he was thinking, "Forget this thing; it's never going to work." Like, how do you untie the dang tie after nine meticulous minutes of producing a four-in-hand? (Don't even think about asking Why Knot for a Windsor.) "I couldn't face the process," says Goldstein.

He later solved it after walking around the block a couple times. But he was still forced to move the electric motors by hand, ensuring round-the-clock maintenance when machine parts would go "spastic," which was often.

So Goldstein called in the geek squad. The key to the second, more successful version of Why Knot is the computer program, which was designed by electrical engineer Randy Pursley. Optical sensors detect the presence of reflected light at different points in the cycle, triggering voltage that is then fed into the system. The computer monitors this voltage, which signals whether the tie is in the right place. If it isn't, Why Knot can take corrective action or start all over again.

Meanwhile, his wife has overheard all the failures and goofing off from upstairs. The swearing when he wrestles with numbers, the giggling when he develops shapes. The limb-jangling gong from his earlier Rube Goldbergesque machine, a lazy, plaid-shirted grungebot named Homer, who, after 30 seconds, lifts a cup of coffee.

Stone sits on a blue computer chair, smiling with a finger on her lips as she watches her husband from the doorway. Goldstein is giving a knot-tying play-by-play to a photographer. The process is at its five-minute mark, a little more than halfway. "It gets a little hypnotic," he says. "By the time something goes wrong I'm in this fog" -- he slumps and hangs out his tongue -- "and mistakes go by me."

Suddenly a tiny widget slinks into view, creeping onto Why Knot's bicycle pedal. No, it's a tiny piece of nature: a fuzzy, yellow caterpillar. So young, so dangerously close to the rotating bike chain.

Maybe we should help it, says Stone.

No! Let it play out, we implore. Nature vs. machine -- we've been dying to know the outcome.

Now back to the automated wonder of four-in-hand. The tie is red, wrinkle-free polyester, 60 inches by 3 inches -- which, Goldstein admits, is "a little narrow for today's fashion." He has bought a set of identical ties just in case one disintegrates after 1,000 knots a month. A striped Burberry silk tie won't cut it: the texture, the friction, the everything would be all wrong. Why Knot needs exactitude; it needs the precision of a Hershey factory, the one Goldstein visited at age 7, the trip that got him hooked on machines after watching them wrap that foil around the chocolate bars.

"Okay, we're getting ready for the big one." The final knot-shaping maneuver.

He puts a knuckle to his teeth.

Why Knot goes:

Ktchtchtchtchtch.

"Phew! Yes!" (Goldstein exhales.)

He has written a maintenance book for the museum to care for Why Knot. It has diagrams and instructions. "If I stay at this museum, I'm going to have a heart attack! I gotta get this thing out of here and have a life," he says. And then, moments later: "I may want to make that knot tighter." But it's too late, since the machine is already congratulating itself. Why Knot, a true creation of the 21st century, knows how to clap when it's finished the job:

Thonk-thonk-thonk-thonk.

Thonk-thonk-thonk-thonk.

Thonk-thonk-thonk-thonk.

Thonk.

Stone's gaze lingers on Why Knot. "It's going to be sad to see it go," she says.

"It's going to be traumatic," says Goldstein, who will drive his creation to Philadelphia next week. "Gonna be like empty-nest syndrome."

Why Knot executes some of the 350 steps it takes to tie a necktie. "It gets a little hypnotic" watching it operate, says creator Seth Goldstein.Seth Goldstein, inspired by a suggestion from his wife, Paula Stone, spent years developing a necktie-tying machine. Next week his invention goes on permanent display at the Franklin Institute Science Museum in Philadelphia.