Stikkord: arduino

Ideas for Drawing machine #1

My my how time flies. It’s been two years since I built my first drawing machine, a vertical pen plotter. I’ve since then built two more machines using the same hardware, but different sizes, and made over a hundred drawings and experiements. I even had a one month exibition at a tiny local cafe. Nerd goes artsy.

Currently all three machines as broken, partly from transportation, partly after an “inventors day” at Vitensenteret last year where the kids where a bit too “hands one”, if you know what I mean :) So they’ve been in the basement gathering dust, waiting for inspiration to strike.

Most of the images I’ve drawn on the machines have been based on SVG input, and quite a few have gone through Illustrators scribble effect before printing, converting filled areas into continous lines. I loved the effekt, but sort of lost my moxy. It felt that the machines should be used for something more fun than just drawing the images I gave them. At least the end result might excite ME more. Here is an example of a “scribbled” vector image:

There are so many things I want to do. I’ve been tinkering with computer generated art off and on for years, and I’ve researched complex ideas based on machine vision and artificial intelligence. One idea I’m brewing on is converting input from webcam 1 into paths, and then use machine learning to let the machine itself use webcam 2 to figure out how to control the motors to draw a result similar to input (after filtering, simplification or style transfer). I’d love to take the drawing machines in that direction, but I think I want to go back to basics a little bit first. My first drawings where simple done by giving the two stepper motors commands on rotation individually, and the patterns that came out where just lovely, flowing and organic, repeating infinitely.

Example arduino code:
void setup() /****** SETUP: RUNS ONCE ******/
{
stepper1.setMaxSpeed(1000.0);
stepper1.setAcceleration(50.0);
stepper1.setSpeed(200);
stepper1.moveTo(4048); // 2048 = 1 revolution

stepper2.setMaxSpeed(1000.0);
stepper2.setAcceleration(50.0);
stepper2.setSpeed(200);
stepper2.moveTo(-2448); // 2048 = 1 revolution minus 400 to make it asymetric asymetric

}//–(end setup )—

This is what came out when using a sponge and ink:

View this post on Instagram

Arduino + steppermotorer + svamp = kunst! #arduino #drawbot #art #diy

A post shared by Morten Skogly (@mskogly) on

Love it!

So I’m thinking of going back to exploring more random and serendipitous ideas. One direction could be a simple “random walk”, as explained in the introduction to the book “The nature of code“, by Daniel Shiffman. Alongside Conway’s Game of life, the random walk is one of the classic beginner examples in generative visual computer art.

Here is an simple example of a picture drawn by random walk-code:

I love the randomness, but also the order that comes from the fact that there are strict and simple rules to be followed. The next point on the path can only be forwards, backwards, up or down one pixel.

Go to my codepen to see the code and to generate your own.

Leave the random walk running for a while longer gave me this.

So I think I’ll try that.

Or perhaps an etch-a-sketch :)

Update: Find a route beween vertices.

See the Pen 9.9: Minimum Spanning Tree (Prim’s Algorithm) – p5.js Tutorial by Morten Skogly (@mskogly) on CodePen.

Drawing machine #2

This drawing machine is built with cardboard, hotglue and small inexpensive 9g servos from Ebay, and is programmed with an arduino.



First test

View this post on Instagram

Hvorfor lage bare en tegnemaskin når man kan lage to :)

A post shared by Morten Skogly (@mskogly) on


Second test

View this post on Instagram

#drawbot #arduino #art

A post shared by Morten Skogly (@mskogly) on

The above video shows the Drawing machine #2 running a plotclock script, but because the servomotors are placed in a different configuration than intended the result is quite interesting.

The code is available from Codebender.cc

Drawing machine #1

This has been on the todolist for a few years, but today I finally got around to building my first drawbot using Arduino. I wanted to make something that was light, minimal and portable, that can be added to any flat surface with a gluegun. I use small steppermotors with bobbins (from eBay) and thread from a sewing machine to lift a coin with a sharpened charcoal-stick though the center, and a solid metal picture frame as a base.

Version 0.1: Drawing spirals

View this post on Instagram

Hvorfor tegne selv når man kan lage en maskin til å gjøre jobben :)

A post shared by Morten Skogly (@mskogly) on




Hardware
Arduino: Duemilanove arduino board or similar, from eBay.
2 x Stepper motors: 28BYJ48, from eBay
2 x stepper drivers: ULN2003, from eBay
Gondola: Coin with center hole. Charcoal is sharpened and fitted, and fastened with a few dots of glue.
2 x Sewing machine bobbins, from eBay with thread
Charcoal stick, from eBay
Hot glue gun, from eBay

Code (based on this):
By changing the speed and number of steps it draws asymetric paths. 2048 steps = 1 revolution on these stepper motors.

Charcoal Timelapse:

View this post on Instagram

Pen plotter #1 timelapsei 12x hastighet. #hyperlapse #drawbot #arduino

A post shared by Morten Skogly (@mskogly) on




Ink Test
I cut a piece of sponge and used a pipette to add ink while the machine is running.

View this post on Instagram

Arduino + steppermotorer + svamp = kunst! #arduino #drawbot #art #diy

A post shared by Morten Skogly (@mskogly) on

Version 1.0: Running Polargraph Controller software

The machine is now running the Polargraph firmware, controlled via serial from a Processing app on my laptop. It took a bit of tinkering to get the firmware to run with my steppers and drivers, but once it was up and running it worked pretty well.

View this post on Instagram

Drawing machine #1 is taking shape!

A post shared by Morten Skogly (@mskogly) on

View this post on Instagram

#wip #drawbot #polargraph #art

A post shared by Morten Skogly (@mskogly) on

Next steps
Run the machine on grbl firmware and test other controllers.
Testing a variations of pens and paper.
Build more machines! Some of the motives I’m working on takes up to 12 hours to draw, so to increase the learning curve I would love to have at least a few more up and running.

Useful tutorials:
Wire and run one stepper and driver.
BYJ48 stepper motor on Instructables
Code for running two stepper motors in opposite directions
Polargraph Drawing Machine on Instructables

img_2651

img_2653

img_2650

Cardboard project box, spot glued to the back of the frame for easy removal.  


Test, running unicode.h library

Write L, R, U or D in the Serial Monitor to control the motor. (see also: Youtube Tutorial)

Code


Serial Monitor