van Rijn

Writes and draws stuff

I'm afraid I'm STILL on the Write LMR trip. It's not got tired yet.

I've decided to motorise a miniature Etch-A-Sketch.

I decided on steppers. Not servos. Servos hadn't enough rotation. Continuous servos had no positional feedback.

Here's my prototype circuit. Simple ULN2803 driver and a PIC 16F628. There's a max232 on there, too as the RS-232 interface to the PC.

WOW! It draws a circle. The most impressive bit of this is my implementation of Bresenham's line drawing algorithm. The circle is made up of straight lines. Straight lines are more difficult to draw than you might imagine...!

Look out for more swirly patterns coming soon. Maybe even an LMR logo!

What you see in the main photo there is a "Hilbert Curve." It's a space filling curve in that the algorithm causes the "pointer" to pass through all the cells in a given area.

Hey, how weird does the inside of an Etch-A-Sketch look? I HAD to do this. I programmed it to scan back and forth so all the grey dust got scraped off the glass. It took about an hour! Hmmm... Resolution is 750x500 = 375 KiloPixels (there's a new one) x 10ms per step = 3750 seconds = 62.5 minutes.

I presume all those little metal balley things (description specially for Frits) are where the magic grey coating comes from.

Below is my attempt at a Lissajous figure with two phases. I'm happy with that.

I got the machine to draw a picture of my eldest offspring. It's done by making "pixels" which consist of veritcal lines. The lines are closer together (more dense) for increasing levels of darkness. Later I will try to use a Hilbert curve to make up each pixel with an increasing "order" for increasing levels of darkness. The result should be much better, but it will be sloooooow.

This second photo is slightly easier to see the subject because it's so blurry!

For the sake of completeness, here's the front panel of the software I wrote on the PC to control it, including a preview of the image.

I'm off to see if I can get it to draw the contents of a DXF file. How hard could THAT be?

Can you believe it doesn't EVEN Write LMR yet? How remiss of me...

Update (7-Mar-2009): NOW, it writes LMR. BTW, reading a DXF file is more difficult than I thought.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

It can't be that hard for raster pictures of line drawings (I know it's only a subset of the full problem). A decade or more ago I used to configure and install document management systems. Engineering companies had loads of CAD drawings (made the old way with ink and rulers) that they wanted to use in their new AutoCAD workstations. We found a company in Phoenix that had built a box that you fed a scanned image of a drawing into and it produced a vector file for AutoCAD from the raster. It wasn't perfect, but it was good enough for be a start for "as building" drawings. Company was called GTX. Box was expensive and big, but mainly because it contained a lot of custom hardware. I'm sure a GPU does all this and more nowadays.

Mike

Let others do the donkey work for you! Let the visitors of your website click on the perceived lines in your images. Akin to what the Giant White Glove Project did when trying to track a certain moving object in this video.

A thousand clicks a week would render a vector image in a , ehhm, week!

That's great Rik !

Air traffic controllers could save a bundle by outsourcing the data processing in a similiar fasion - of course I'd be scared as hell to get near any plane...

hilarious !

I was just looking at your picture of inside the etch-a-sketch. I wonder how it would look backlit? Nothing fancy, just drill a few 5mm holes either side without spilling the magic balls and then insert a couple of LEDs. Would the coating block the light well enough so that the picture appears backlit?
To the best of my knowledge THAT hasn't been done before. Funky. I'm not ready to drill holes in the EAS just yet, though. Soon!
So are you going to attach the whole thing to a giant motor that shakes it to clear the pallete?

Funny you should say that, I have a third stepper for that very thing!

But this has got to the stage where I've proven the principle. I suffer from a disease common to engineers, where I get to a stage where I say: "Right, I've shown I can do that, so I don't actually have to do it."

If you'd asked me a week ago, I'd have said I was going toetch a PCB for it, but I'm not sure if I will bother!

One thing seems likely: I want to get it to draw a curve using a RISC-coded curve algorithm. Currently the circles are a series of straight lines scripted from the PC. I want the PIC to do the donkey work.

How about capturing a VERY short sample from the A/D port on the PIC and let the Etch-A-Sketch draw the curve like an oscilloscope. Or capture a longer sample and have a button to go one "page" forward/backward in the sampled data. It won't be useful, but it will certainly have geek value.

You want to SHOW that the pic can do the donkey work.

I suffer from the same infliction 8-(

Nah. I don't care who can see where the donkey work is done. I only want to prove it to myself. Selfish? So sue me!

By the way, you made coffee come out my nose. Thanks for that!