Saturday, December 8, 2012

Kochs Snowflake

I did a fractal today called Kochs Snowflake.

I was inspired by this guy.
https://www.facebook.com/snowart8848
I'm going to try to duplicate some of his drawings on the white board.

Friday, November 16, 2012

Swirls and Stars

I digitized on of my wife's quilting patterns. It came out kind of jagged. I am thinking of adding an SD card interface to the Arduino to do more complicated pictures smoother.

Saturday, May 12, 2012

finally figured this one out

I went back and figured out how to do this picture that I had done when this was just an extension of a desktop. now I got it to work with the arduino. I had to do it in two steps. first one program writes the xy data points to the EEPROM memory. then another program reads them and plots them.

Thursday, March 29, 2012

a smaller size pen highlights errors in the system

I need to find the 2.5 mm round point markers again. I got them at Dollar Tree but they haven't had them the last few times I was there.

Wednesday, March 28, 2012

undrawing

I was tinkering with the size that I draw this picture so I didn't bother to erase the board before I drew. It turns out the pen had just died and it undrew. Looks kind of neat. I may have to try this on purpose with some of my old markers.

Saturday, February 25, 2012

Friday, February 17, 2012

Valentines day on the white board

I did a little thinking last Saturday. I looked up the equation for a tear drop. Then I turned it upside down and leaned it a little right and left. Here is how it came out on Tuesday.

Thursday, January 26, 2012

Performance art.

Here is the latest drawing.
Since this is really a form of performance art the pleasure is in watching it draw more than looking at the finished picture. I am working on uploading a video.


Sunday, January 22, 2012

Some improvements

I raised the voltage that I run the motors to 12 volts. They run hotter but I don't think they are too hot. That let me speed it up about three times what it was. I tried some things to explore the limits and characteristics of the system.

Then I went back to some old favorites and updated them to work with the LEDs and switch that I added.

They look a lot better with the 12 volt steps.
I am working on some of my other old favorites.

Tuesday, January 17, 2012

stages 0 through 8

Here are the stages of the dragon fractal with curves. I like the individual stages better than the parade.


 















 And here's a short video. The battery died after only a few seconds.

Thursday, January 12, 2012

parade of dragons

I got it to do stages 0 through 8 all in a row.
I added some LEDs and a "switch" so I can have it tell me to center the marker, erase the board, and press the button. Then it will wait for me instead of just giving me a minute to do those things whether that was long enough or not.
I am going to order the new version of the Arduino that has lots more memory so maybe I will be able to do more stages. When I get that I will mount it to the frame it isn't all just hanging.


Tuesday, January 10, 2012

Dragon fractal with curves.

I got the curves to work on the dragon fractal.
Still needs a little tweeking but it is getting there.






Friday, January 6, 2012

Dragon fractal.

I'm working on the dragon fractal in Arduino that I had done in QBASIC.
I want to do it with curves instead of sharp corners. It looks much cooler that way.

Tuesday, December 13, 2011

AS220 Labs

I adapted some code that AS220 Labs posted for a drawbot they made.
It worked.
http://www.as220.org/labs/drawbot/

Monday, August 8, 2011

not quite working

Didn't quite work right. I think I have to work on getting the weight that I use with the pen just right. Not enough and it sticks like this. Too much and it skips steps and gets out of place.
Here is a link to the code I used.
http://dl.dropbox.com/u/37661946/fourballo.pde


back to it

I dug the doodler out this week and started working with it again. I had to fix some parts that got broke when it was put into storage.

I am trying to figure out how to post the code. Maybe dropbox.com or hackaday?

Thursday, April 21, 2011

answers to some code requests

some readers asked about the code.
Christopher, i am not sending it Gcode. I send it a single character followed by a carriage return.
The character is a digit 0 through 7. 0 means move up one step, 1 means up and to the right one step, 2 means move right one step, etc. everything is then calculated in a quickbasic program and sent through the serial port. now i have replaced the basic stamp board with the Arduino so now all the code is internal to it and it can run without the PC connected. i am having some problems with that setup though. when it gets toward the top of the board the steppers slip some steps and it gets lost as to where it really is. I think possibly because I am taking Vin and ground from the connector on the Arduino and the motors draw about 750 ma I am getting too much drop across that connection. I may change the driver from a unipolar design that grounds one end of the coil or the other while supplying power to the center to an H bridge driver that supplies power to one end and ground to the other and switches both to change the steps. That should supply the same amount of magnetic force while using half the current.
Here is the code to draw several pictures one after the other in quickbasic.

'WHITE BOARD PLOTTER TESTS
CLS
PI = 3.141593
GOSUB WBPSETUP


'SCREEN 12 '640 * 480 graphics



'OPEN "COM1:2400,N,8,1" FOR RANDOM AS #1
OPEN "COM1:2400,N,8,1,CD0,CS0,DS0,OP0,RS,TB2048,RB2048" FOR RANDOM AS #1
'OPEN "COM1:2400,N,8,1,RS,TB2048" FOR RANDOM AS #1


'GOTO FOURBALLO
'GOTO CESARO4


START:

HEADING = 0
CENTERX = 0
CENTERY = 0
LENGTH = 0
X = CENTERX
Y = CENTERY
FIRSTLOOP:
LENGTH = LENGTH + .3

HEADING = HEADING + 2.08

X = COS(HEADING) * LENGTH + X
Y = SIN(HEADING) * LENGTH + Y
GOSUB WBPMOVE
IF LENGTH < 18 GOTO FIRSTLOOP

FOURBALLO:
HEADING = 0
CENTERX = 0
CENTERY = 0
SIZE = 5
PHASES = 72

X = SIZE: Y = 0: GOSUB WBPMOVE
INPUT "ERASE THE BOARD AND PRESS ENTER "; N$

FOR HEADING = 0 TO (PHASES * 2 * PI) STEP (.02)
MOVCIRC = HEADING / PHASES
R = SIZE
R1 = COS(HEADING * 2)
R2 = SIN(HEADING + MOVCIRC)
R = R + R1 * R2 * SIZE
X = COS(HEADING) * R + CENTERX
Y = CENTERY + SIN(HEADING) * R
GOSUB WBPMOVE
NEXT
X = SIZE: Y = 0: GOSUB WBPMOVE
INPUT " PRESS ENTER "; N$

CESARO4:
CSIDE = 7.5
CSTAGE = 0
SIDE = CSIDE * .453 ^ CSTAGE
X = 0
Y = -(CSIDE / 3)
GOSUB WBPMOVE
INPUT "PRESS ENTER"; N$

FOR CSTAGE = 0 TO 7
SIDE = CSIDE * .453 ^ CSTAGE
FOR CUBE = 1 TO 4
STAGE = CSTAGE
GOSUB SPIKE
HEADING = HEADING + PI / 2
NEXT CUBE
HEADING = HEADING - PI / 2
NEXT CSTAGE
GOTO CESARODONE

SPIKE:
IF STAGE = 0 THEN GOSUB FORWARD: GOTO DONE
STAGE = STAGE - 1
GOSUB SPIKE
HEADING = HEADING + (84 / 180 * PI)
GOSUB SPIKE
HEADING = HEADING - (168 / 180 * PI)
GOSUB SPIKE
HEADING = HEADING + (84 / 180 * PI)
GOSUB SPIKE
STAGE = STAGE + 1

DONE:
RETURN

FORWARD:
X = X + SIDE * SIN(HEADING)
Y = Y + SIDE * COS(HEADING)
GOSUB WBPMOVE
RETURN

CESARODONE:
X = 0: Y = 0: GOSUB WBPMOVE

CLOSE
END

WBPMOVE:

WBPX = X
WBPY = Y
WBPOLDX = WBPXNOW
WBPOLDY = WBPYNOW
WBPXDELTA = WBPX - WBPXNOW
WBPYDELTA = WBPY - WBPYNOW
IF ABS(WBPXDELTA) < (WBPSTEPSIZE) AND ABS(WBPYDELTA) < (WBPSTEPSIZE) THEN GOTO WBPMOVEDONE

WBPXDIR = SGN(WBPXDELTA)
WBPYDIR = SGN(WBPYDELTA)

IF ABS(WBPYDELTA) > ABS(WBPXDELTA) THEN GOTO WBPYBIGGER

WBPXBIGGER:
FOR WBPX = WBPXNOW TO X STEP (WBPXDIR * .01)
WBPY = Y - ((X - WBPX) / WBPXDELTA) * WBPYDELTA
GOSUB WBPTRYSTEPPING
NEXT WBPX
GOTO WBPXFINISH

WBPXFINISH:
GOSUB WBPTRYSTEPPING
IF ABS(X - WBPXNOW) > WBPSTEPSIZE OR ABS(Y - WBPYNOW) > WBPSTEPSIZE THEN GOTO WBPXFINISH
GOTO WBPMOVEDONE

WBPYBIGGER:
FOR WBPY = WBPYNOW TO Y STEP (WBPYDIR * .01)
WBPX = X - ((Y - WBPY) / WBPYDELTA) * WBPXDELTA
GOSUB WBPTRYSTEPPING
NEXT WBPY

WBPYFINISH:
GOSUB WBPTRYSTEPPING
IF ABS(X - WBPXNOW) > WBPSTEPSIZE OR ABS(Y - WBPYNOW) > WBPSTEPSIZE THEN GOTO WBPYFINISH
GOTO WBPMOVEDONE

WBPTRYSTEPPING:
'try stepping in each direction and see which way gets closer to x,y

'TRY STEPPING 0
WBPLEFTTRY = WBPLEFT - WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT - WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(0) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 1
WBPLEFTTRY = WBPLEFT
WBPRIGHTTRY = WBPRIGHT - WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(1) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 2
WBPLEFTTRY = WBPLEFT + WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT - WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(2) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 3
WBPLEFTTRY = WBPLEFT + WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT
GOSUB WBPTRYDIST
WBPTRY(3) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 4
WBPLEFTTRY = WBPLEFT + WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT + WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(4) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 5
WBPLEFTTRY = WBPLEFT
WBPRIGHTTRY = WBPRIGHT + WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(5) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 6
WBPLEFTTRY = WBPLEFT - WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT + WBPSTEPSIZE
GOSUB WBPTRYDIST
WBPTRY(6) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

'TRY STEPPING 7
WBPLEFTTRY = WBPLEFT - WBPSTEPSIZE
WBPRIGHTTRY = WBPRIGHT
GOSUB WBPTRYDIST
WBPTRY(7) = SQR((WBPXDIFF * WBPXDIFF) + (WBPYDIFF * WBPYDIFF))

WBPTEMP = 0
IF WBPTRY(1) < WBPTRY(WBPTEMP) THEN WBPTEMP = 1
IF WBPTRY(2) < WBPTRY(WBPTEMP) THEN WBPTEMP = 2
IF WBPTRY(3) < WBPTRY(WBPTEMP) THEN WBPTEMP = 3
IF WBPTRY(4) < WBPTRY(WBPTEMP) THEN WBPTEMP = 4
IF WBPTRY(5) < WBPTRY(WBPTEMP) THEN WBPTEMP = 5
IF WBPTRY(6) < WBPTRY(WBPTEMP) THEN WBPTEMP = 6
IF WBPTRY(7) < WBPTRY(WBPTEMP) THEN WBPTEMP = 7
ON (WBPTEMP + 1) GOSUB WBP0, WBP1, WBP2, WBP3, WBP4, WBP5, WBP6, WBP7
FOR WBPZ = 1 TO 6000: NEXT

'CALCULATE WHERE THE PEN IS NOW
WBPS = (WBPLEFT + WBPRIGHT + WBPBASE) / 2
WBPAREA = SQR(WBPS * (WBPS - WBPLEFT) * (WBPS - WBPRIGHT) * (WBPS - WBPBASE))
'VERTICAL DISTANCE FROM SPOOLS DOWN TO THE PEN IS
WBPHEIGHT = (WBPAREA * 2) / WBPBASE
WBPWIDTH = SQR((WBPLEFT * WBPLEFT) - (WBPHEIGHT * WBPHEIGHT))

WBPXNOW = WBPWIDTH - WBPCENTERWIDTH
WBPYNOW = WBPCENTERHEIGHT - WBPHEIGHT

RETURN

GOTO WBPMOVE

WBPTRYDIST:
WBPTRYS = (WBPLEFTTRY + WBPRIGHTTRY + WBPBASE) / 2
WBPTRYAREA = SQR(WBPTRYS * (WBPTRYS - WBPLEFTTRY) * (WBPTRYS - WBPRIGHTTRY) * (WBPTRYS - WBPBASE))
'VERTICAL DISTANCE FROM SPOOLS DOWN TO THE PEN IS
WBPTRYHEIGHT = (WBPTRYAREA * 2) / WBPBASE
WBPTRYWIDTH = SQR((WBPLEFTTRY * WBPLEFTTRY) - (WBPTRYHEIGHT * WBPTRYHEIGHT))

WBPXTRY = WBPTRYWIDTH - WBPCENTERWIDTH
WBPYTRY = WBPCENTERHEIGHT - WBPTRYHEIGHT
WBPXDIFF = WBPX - WBPXTRY
WBPYDIFF = WBPY - WBPYTRY

RETURN

WBPMOVEDONE:

'THE SEMIPERIMETER IS THE DISTANCE BETWEEN THE SPOOLS PLUS
'THE LENGTH OF EACH STRING DIVIDED BY TWO
'THE AREA OF THE TRIANGLE IS THE SQUARE ROOT OF
'THE SEMIPERIMETER TIMES THE DIFFERENCE BETWEEN THE
'SEMIPERIMETER AND EACH SIDE
'WBPLEFT = LENGTH OF LEFT STRING
'WBPRIGHT = LENGTH OF RIGHT STRING
'WBPBASE = DISTANCE BETWEEN SPOOLS

WBPS = (WBPLEFT + WBPRIGHT + WBPBASE) / 2
WBPAREA = SQR(WBPS * (WBPS - WBPLEFT) * (WBPS - WBPRIGHT) * (WBPS - WBPBASE))
'VERTICAL DISTANCE FROM SPOOLS DOWN TO THE PEN IS
WBPHEIGHT = (WBPAREA * 2) / WBPBASE
WBPWIDTH = SQR((WBPLEFT * WBPLEFT) - (WBPHEIGHT * WBPHEIGHT))

WBPXNOW = WBPWIDTH - WBPCENTERWIDTH
WBPYNOW = WBPCENTERHEIGHT - WBPHEIGHT
'FOR WBPZ = 1 TO 10000: NEXT

RETURN

WBP0:
PRINT #1, 0
WBPLEFT = WBPLEFT - (WBPSTEPSIZE)
WBPRIGHT = WBPRIGHT - (WBPSTEPSIZE)
RETURN

WBP1:
PRINT #1, 1
WBPRIGHT = WBPRIGHT - (WBPSTEPSIZE)
RETURN

WBP2:
PRINT #1, 2
WBPLEFT = WBPLEFT + (WBPSTEPSIZE)
WBPRIGHT = WBPRIGHT - (WBPSTEPSIZE)
RETURN

WBP3:
PRINT #1, 3
WBPLEFT = WBPLEFT + (WBPSTEPSIZE)
RETURN

WBP4:
PRINT #1, 4
WBPLEFT = WBPLEFT + (WBPSTEPSIZE)
WBPRIGHT = WBPRIGHT + (WBPSTEPSIZE)
RETURN

WBP5:
PRINT #1, 5
WBPRIGHT = WBPRIGHT + (WBPSTEPSIZE)
RETURN

WBP6:
PRINT #1, 6
WBPLEFT = WBPLEFT - (WBPSTEPSIZE)
WBPRIGHT = WBPRIGHT + (WBPSTEPSIZE)
RETURN

WBP7:
PRINT #1, 7
WBPLEFT = WBPLEFT - (WBPSTEPSIZE)
RETURN


WBPSETUP:

'48 STEPS IS ONE TURN OF THE MOTOR
'20 TURNS IS ABOUT TWO FEET
'468 STEPS IS ABOUT 12 INCHES, 39 STEPS PER INCH
'THE WHITE PART OF THE BOARD IS 34.5 INCHES WIDE * 22.5 INCHES TALL
'THE CENTER OF THE SPOOLS ARE 33.875 INCHES APART
'THE CENTER OF THE SPOOLS ARE ABOUT .75 INCHES ABOVE THE BOARD
'IF BOTH STRINGS ARE 24 INCHES LONG
'THE PEN IS ABOUT 16.5 INCHES BELOW THE TOP OF THE BOARD
'THE SEMIPERIMETER IS THE DISTANCE BETWEEN THE SPOOLS PLUS
'THE LENGTH OF EACH STRING DIVIDED BY TWO
'THE AREA OF THE TRIANGLE IS THE SQUARE ROOT OF
'THE SEMIPERIMETER TIMES THE DIFFERENCE BETWEEN THE
'SEMIPERIMETER AND EACH SIDE
'WBPLEFT = LENGTH OF LEFT STRING
'WBPRIGHT = LENGTH OF RIGHT STRING
'WBPBASE = DISTANCE BETWEEN SPOOLS
'WBPS=(WBPLEFT + WBPRIGHT + WBPBASE)/2
'WBPAREA = SQR(WBPS*(WBPS-WBPLEFT)*(WBPS-WBPRIGHT)*(WBPS-WBPBASE))
'VERTICAL DISTANCE FROM SPOOLS DOWN TO THE PEN IS
'WBPHEIGHT = (WBPAREA*2)/WBPBASE
'WBPBASE = 33.875
'50.5 INCHES BETWEEN THE CUPHOOKS
'32 INCHES FROM THE LEFT HOOK TO THE CENTER OF THE BOARD

WBPSTEPSIZE = 11.125 / 500


PRINT "POSITION THE PEN AT THE CENTER OF THE BOARD."
INPUT "PRESS ENTER"; N$

INPUT "ENTER THE LENGTH OF THE LEFT STRING "; WBPLEFT
'WBPLEFT = 28.5
INPUT "ENTER THE LENGTH OF THE RIGHT STRING "; WBPRIGHT
'WBPRIGHT = 27.75
'INPUT "ENTER THE DISTANCE BETWEEN SPOOL CENTERS "; WBPBASE
'WBPBASE = 33.875
WBPBASE = 50.5
'INPUT "ENTER THE HEIGHT OF THE WHITE AREA "; WBPTALL
WBPTALL = 22.5
'INPUT "ENTER THE WIDTH OF THE WHITE AREA "; WBPWIDE
WBPWIDE = 34.5
WBPS = (WBPLEFT + WBPRIGHT + WBPBASE) / 2
WBPAREA = SQR(WBPS * (WBPS - WBPLEFT) * (WBPS - WBPRIGHT) * (WBPS - WBPBASE))
WBPHEIGHT = (WBPAREA * 2) / WBPBASE
WBPCENTERHEIGHT = WBPHEIGHT
PRINT "WBPCENTERHEIGHT="; WBPCENTERHEIGHT
WBPCENTERWIDTH = SQR((WBPLEFT * WBPLEFT) - (WBPCENTERHEIGHT * WBPCENTERHEIGHT))

PRINT "WBPCENTERWIDTH="; WBPCENTERWIDTH

RETURN