Maximize the Failure Rate

This is a reminder to myself.  It’s about failure, which is a paradoxically fantastic thing if you have the right attitude.  Let me describe the attitude I am working to gain.

  • If you fail three times in a week, make a goal of trying (and possibly failing) five times the next week.  Failure is the right thing as long as you’re trying sincerely and the rate of failures is increasing, or you’re failing less each time.
  • You won’t succeed at really complex things until you’ve failed a lot first, so your best bet is to fail as fast as possible.  Enjoy the journey!
  • Mere repetition isn’t sufficient.  After each failure, try something significantly different.
  • Report and graph the failures.  Talk about them.  Things that get reported tend to improve.
  • Goals need to be simple, but some goals are inherently complex.  You can simplify a goal by maximizing the rate of failing to achieve the goal.
  • If rapid iterations of failure are not possible due to circumstances outside your control, fail in parallel!  Try many things at once.  Don’t forget to report on all of the failures.
  • When you finally do succeed, continue to try other things.  In other words, keep failing!

This is particularly applicable to small business.  Discouragement resulting from failures can spread like a disease.  However, the “maximize the failure rate” attitude can make you immune to that kind of discouragement.

Wrong attitude: “We failed.  Maybe we should give up.”

Right attitude: “We failed again?  Ye-haw, that means success is closer!  Now how can we fail faster (or less expensively) next time?”

Save the Art!

My sister, Maria, is an excellent artist.  Her paintings make you sit up and think about how people feel.  Her art captures life better than a photograph.

But what does she do when a piece doesn’t fit her high quality standards?  Not long ago, she finished a fine painting of a cowboy.  Everyone liked it, but Maria said the eyes were too big.  Ok, maybe the eyes were a bit larger than normal, but does that justify what she did next?

A little bit of the history of an important artist is gone for good.

Gooathon

This past week was spring break.  That’s what my kids’ school called it, anyway.  I’m not sure I would call it that.

Since my kids had the week off, I made a deal with them: if they spent at least 4 hours playing outside every day Monday through Thursday, on Friday I would buy The World of Goo, a very entertaining computer puzzle game.  They have been playing the demo for a while, so they were motivated!

On Monday, they played outside for 3 hours and went to the library for an hour.  We decided going to the library counts.  So far so good.

On Tuesday, it rained and rained.  We decided that working inside also counts.  They did an amazing job on the house.  With hardly a fuss, they cleaned the entire family room, their bedrooms, the living room, and some of the kitchen.  Good work, kids!

On Wednesday, a temporal anomaly threw our city into December.  About 6 inches of snow piled up.  They played in their snow boots for a while, but it was quite cold, so they did a little more work inside.

By this time, it was apparent that the weather had no respect for our plans.  We expected the weather to clear up on Friday, so we bought WoG for Thursday, intending to get them to play outside again Friday.  So my kids had a Gooathon day.  I had other work to do, but I heard them laugh and get frustrated a lot.  They had a good time.

On Friday, as you might expect, the weather was still uncooperative, so my kids solved some more Gooey puzzles.  My wife and I don’t want them to play computer games all the time, but we think occasional gaming is very good for learning to read and think logically.  There is a mind-bogglingly large assortment of puzzle games available for Linux these days!

Thus ended winter break this year.

Why Keep a Journal?

I need to keep a journal because as I change over time, my method of comprehending everything also changes, and some memories no longer fit my new system of comprehension.

If my memory were a computer database, then I would be adding rows to giant tables continuously, while changing the schema every time I find a better way of understanding things.  Over time, some of those rows would become so far out of sync with the schema that no query would find them.  Some of those practically forgotten rows would remain important, though.  Keeping a journal is like copying vital data to an external store with a more stable schema.  (The English language is more stable than my system of comprehension.)

I wonder if I ought to express that without a computer analogy.  My kids need to learn it, but they certainly aren’t versed in all this jargon.

NewEgg, You Amaze Me

Last week, an important desktop computer used by my family died. The connection between the power supply and motherboard fried somehow. I’ve never seen a connection fail like this before: all of the connections attached to red wires had burned the surrounding plastic within the connector. It was difficult to detach the connector, and even when I cleaned up the motherboard and used a new power supply, the motherboard refused to power on. Nothing else was damaged.

I suspect the motherboard was drawing too much current and the connector failed over time. Newer motherboards have separate 12V connectors which could solve the problem.

Anyway, I immediately found a better motherboard (PCCHIPS A15G (V1.0) AM2+ MCP61P) and a faster, lower power CPU (AMD|A64 X2 5200 2.7G AM2 65N R) on NewEgg for a total of $108 including shipping. The computer will be better than ever. NewEgg sure knows how to keep me as a customer.

Delay Compensation in the G-Code Firmware

I’ve been building small RepRapped objects successfully.  (Larger objects not so successfully… I’ll talk about that another time.)  One significant problem I’ve noticed is that a series of short line segments is drawn much too slowly.  You can see this if you draw a circle using just the cartesian bot.  If the circle has only a few segments, then it is drawn at about the speed you specify, but the speed falls as the number of segments increases.

The RepRap host software has several knobs intended to compensate, but I found it very difficult to find the right adjustments.  No adjustment seemed to be right for all line segments.  The knobs in Skeinforge seem even more complicated.

I tried to compensate for the delays by adding buffers to the G-Code firmware.  I figured that if the firmware always has the next command ready in a buffer, there will be no pauses.  I wrote code that buffered several line drawing commands in the Arduino, but as it turned out, even a 16 segment buffer did not reduce the pauses at all.

Then I started thinking about what’s really going on.  The Arduino can’t calculate anywhere near as fast as a modern CPU.  For each line segment, the Arduino does a lot of floating point calculations, including several decimal to floating point conversions and a square root operation to calculate the line distance.  No amount of buffering or interrupt coordination is going to reduce the time required to perform those calculations.  We could move some of the calculations to the host, but I am not interested in giving up the current simplicity of the protocol.

So then I started to think about compensating for the command processing delay automatically.  I realized that every line drawing command is likely to incur about the same amount of calculation delay.  All I need to do is raise the feed rate automatically to compensate for the delay.

Using a little algebra, I found a simple way to calculate an adjusted feed rate based on the line distance and a constant command processing delay.  I added code to the firmware that performs that calculation, then I wrote a script that computed the delay per line drawing command.  I measured the delay to be about 28 milliseconds.

I plugged that number into the firmware and it worked!  Now, drawing a curve takes about the same amount of time whether there are 16 segments or 500.  I hardly have to worry about beading or stretching anymore.

The adjustment works so well in practice that I don’t think the host needs to be able to control it.  It adjusts the speed of every segment, regardless of what host software produced the commands, and not just short segments; it adjusts short segments more than long segments.  The adjustment always seems to produce the expected results.  I think everyone ought to take advantage of this because it makes the machine much easier to tune.

I’ve posted the patch on SourceForge.

I’ll describe how I derived the calculation.

r = specified feedrate, mm/s
R = adjusted feedrate, mm/s
d = line distance, mm
w = latency (seconds) per command caused by command transmission and processing
t = time to draw the line

r*t = d

t = d/r

The equation for R should have the same time and should include w:

t = w + d/R

We can reasonably assume that the command processing latency is about the same for every line.  R will be slightly higher than r, to compensate for w.  By substituting t with d/r, we can compute R.

w + d/R – t = 0

w + d/R – d/r = 0

w/d + 1/R – 1/r = 0

-w/d – 1/R + 1/r = 0

1/r – w/d = 1/R

1 / (1/r – w/d) = R

So computing R is not very hard and we can do it right in the firmware. (After all, the firmware already computes a square root to find the distance of each line, so a couple more divisions will make only a trivial difference.)  Note that if w = 0 (implying no command processing delay), then the w/d term becomes 0 and R = 1/(1/r), thus R = r.  Also note that (1/r – w/d) can be zero, negative, or so small that R is computed as an excessively large feed rate. We need to handle those situations by limiting the adjusted feedrate to the maximum feedrate the steppers can handle.

The firmware actually deals with feed rates in mm/min, so the equation becomes:

60 / (60/r – w/d) = R

This computation is implemented by the patch mentioned above.

Unabashed Dorky Enthusiasm about Willowrise

It turns out I am supposed to unleash my inner dork.  In other words, I should write about my passion.

I am passionate about building a family business.  That’s what Willowrise is.  We have plenty of skills and talent, but we’re still working out how to present our skills to the world.  We’re certainly not a retail shop, yet that’s what our current home page makes us out to be.  We’ll probably always have an online retail shop, but that should not be our main focus.

As a business, we want to build on each other’s talents and create expressive things.  Much of our business so far has been independent of each other, even though we are a tightly knit family and we work together well.  We are looking for projects that exercise our combined talents.  Some ideas:

  • Instructional design (could be a perfect fit)
  • Outdoor games (not video games–we want to encourage people to play outside!)
  • Hmm, we need more ideas!

We have created and sold many great pieces of art, the excellent Dayspring CD, some cool web sites, some software, and even some hand-made flutes, but these have mostly been individual efforts.  Working together is what we really want to do.