Teaching ma­chines to draw

November 28, 2017

Turns out my step­pers and dri­vers worked just fine, I just did­n’t have enough volt­age. 9V bat­tery does the trick. I also found out my first EasyDriver is in fact per­fectly fine, which is good news.

October 3, 2017

Managed to sol­der pins on my EasyDrivers, they fit nicely into the bread­boards now. Hopefully I did­n’t cook any of the com­po­nents.

Driver BA Graphic Design level sol­der­ing

Driver

October 15, 2017

I found out you can get AutoCAD for free as a stu­dent, so I used that to draw up the shaft sup­ports I need to build. What a good piece of soft­ware. (I can’t be­lieve I ever thought it was a good idea to do this in Illustrator)

Mounting

October 17

Bought some more com­po­nents to help with the wood:

October 18, 2017

Had a good talk with a tech­ni­cian at Camberwell to­day con­cern­ing cut­ting my MDF (shouldn’t be a prob­lem) and drilling holes for my shaft sup­ports (might be a prob­lem). Turns out the 40cm drill bit I bought yes­ter­day is go­ing to be use­less - you can chuck it in a drill press, but be­cause it’s so long it will wob­ble and make it im­pos­si­ble to drill a pre­cise hole. The work­shop has some spe­cial drill router bits that should work bet­ter.

Cutting the 5mm steel rod is­n’t a prob­lem, he says. I’m start­ing to think hav­ing two shafts at the end might be use­ful, it al­lows me to tighten each tim­ing belt seper­ately (but then again I’m in­creas­ing friec­tion and I could prob­a­bly cut both belts to the same lengths with rea­son­able pre­ci­sion)

Workshops are closed Wednesday af­ter­noons, and they’re do­ing in­duc­tions Thursday - So I’ll be cut­ting my MDF Friday af­ter­noon.

Also I held some screws up agains things and found out that I do have the cor­rect ma­chine screws to go in my lin­ear bear­ings, and my wood screws will fit in my an­gle brack­ets.

Parts

October 20, 2017

Got my MDF cut to size - turns out I could­n’t get 15 pieces be­cause you loose 3mm with each cut (the width of the saw blade). I man­aged to put to­gether a ver­sion of the slide mech­a­nism us­ing MDF blocks and mount­ing brack­ets.

MDF slide mechanism

Because the rods are so long, there is quite a lot of springy-ness to them - hop­ing this won’t be too much of a prob­lem since there is­n’t go­ing to be much weight on them.

Problems:

I’ve or­dered some ma­chine-made alu­minium shaft sup­ports which should solve both prob­lems at the same time.

Hoping to in­stall the drive shaft (with tem­po­rary sup­port) and do a test with the mo­tor by the end of next week.

October 25, 2017

The alu­minium shaft sup­ports ar­rived:

Aluminium shaft supports

With them in­stalled, every­thing seems much more sta­ble. There’s also the added ben­e­fit that the slide sits much lower over the table sur­face, which means the even­tual pen won’t be too far from the pa­per. The alu­minium sup­ports are also much lighter than the MDF ones. Still, the slide does­n’t run per­fectly smooth, but I’m hop­ing some small ad­just­ments and a bit of oil will solve that.

Driveshaft mount

Following my dis­il­lu­sion­ment with the MDF shaft sup­ports, I got an alu­minium part to take the dri­ve­shaft. A few lay­ers of pa­per to bring it to the height of the mo­tor shaft.

I came up with this arrange­ment to mount the tim­ing belts:

Driveshaft mount

It con­sists of two cor­ner braces, an M5 screw and some nuts, all of which I had al­ready. However I doubt this will be sta­ble enough to sup­port the belt once it’s un­der ten­sion.

I’m mount­ing the belt as close to the lin­ear bear­ing as pos­si­ble, so there’s the least amount of lever­age to get it stuck.

October 31, 2017

I came up with this arrange­ment to at­tach the slid­ing plat­form to the tim­ing belt:

Belt attachment

It’s a mend­ing plate mounted to the slide with two M4 screws. The belt is squeezed be­tween it and the plat­form - orig­i­nally I was go­ing to use two plates be­low the plat­form, but this is sim­pler and has the added ben­e­fit of hold­ing the belt up (which means it needs less ten­sion). This way I don’t need to worry about try­ing to join the two ends of the belt to­gether. I can also ad­just the ten­sion when I need to.

I re­peated this on both sides, con­nected by the dri­ve­shaft. I then con­nected the step­per (happy to re­port the EasyDriver sur­vived my sol­der­ing) and it works!

It’s mov­ing very slowly at the mo­ment, but I should be able to fix that by go­ing from 1/8 mi­crostep­ping to 1/4 or 1/2 - ef­fec­tively re­duc­ing the res­o­lu­tion by half and dou­bling the speed. The EasyDriver has two ports two do this which means I’ll be able to ad­just speed/​res­o­lu­tion based on the draw­ing I’m try­ing to do.

Still miss­ing a shaft sup­port and step­per for the Y-axis.

November 2, 2017

I man­aged to dou­ble the speed of the slide us­ing this logic table:

MS1 MS2 Microstep Resolution
Low Low Full Step (2 Phase)
High Low Half Step
Low High Quarter Step
High High Eigth Step

Logic table source

However ap­par­ently you get less torque the big­ger the steps are? The low­est that would work re­li­ably is quar­ter steps. This ar­ti­cle would sug­gest it’s way more com­pli­cated

I’ve also laid out the x-axis plat­form, which needs to fit a step­per, the belt at­tach­ment, two shaft sup­ports and its own belt sup­port. I’m run­ning the belt in be­tween the two bear­ings so it should­n’t get stuck. I’ve re­alised the pen should prob­a­bly go be­tween the bear­ings as well to re­duce lever­age that could twist the plat­form.

Ordered some wire to con­nect the sec­ond step­per once it ar­rives.

November 9, 2017

The step­per ar­rived, and it fits into the mount per­fectly (thanks, National Electrical Manufacturers Association). Here’s the full wiring setup with an Arduino, two EasyDrivers, and wires go­ing off to the mo­tors:

Wiring

I wrote the most ba­sic script to run the ma­chine I could think of. Here’s some pseudo code:

while i < 1000
    Set stepper one to direction 0 or 1
    Set stepper two to direction 0 or 1
    Do 500 steps on each stepper
    i++

This draws a sort of di­ag­o­nal grid - the very first work to come out of the draw­ing ma­chine! Mostly this is a way to have the ma­chine mov­ing con­tin­u­ously so I can tin­ker with things.

The whole thing is quite wob­bly, how­ever some of this might be reme­died when I find a beter way than mask­ing tape to at­tach the pen to the draw­ing plat­form. Bringing the pen as close to the slide as pos­si­ble should help: re­duces the amount of lever­age.

Tracey makes the point that the wob­bly-ness might be part of the work: My in­di­vid­ual hand­writ­ing is show­ing through me not be­ing able to drill a hole in th right place. Though I’m hop­ing to get things at least a lit­tle more steady.

On the Y-axis I’m clearly run­ning at the up­per limit of torque that the step­per can put out. When there is two much re­sis­tance it gets stuck and makes an aw­ful noise. The range of mo­tion is lim­ited by the belt go­ing into a skewed an­gle, but it’s still over a me­tre.

I have full range of mo­tion on the X-Axis, which is about 90cm. Because the slide is much lighter and shorter (hence less ten­sion on the belt) there aren’t any torque is­sues.

November 10, 2017

Killed my lap­top.

I made the mis­take of mess­ing with the wiring while the ma­chine was run­ning. I had­n’t sol­dered pins onto the MS1 and MS2 switches on October 3, so I just stuck jumper wires through the holes into the bread­board. One of these came loose, and when I tried to put it back, my lap­top went black.

My best guess is that I some­how made a short, which sent 12V from the mo­tor cir­cuit into the Arduino and my lap­top’s USB port. The lap­top went dark im­me­di­ately and would­n’t turn on any­more, needed pro­fes­sional re­pair: Wrong as­sump­tions:

  1. The Arduino is id­iot-proof. It’s clearly not.
  2. 12V is­n’t enough to do any harm. It clearly is.
  3. Laptops have fuses in the usb ports. Maybe? My ma­chine did­n’t need a board re­place­ment, which in­di­cates the 12V did get stopped some­where.

I’ve bought some­thing called a USB Isolator which is de­signed to pre­vent this ex­act thing from hap­pen­ing. It goes up to 30.000V - should do. Also not go­ing to touch any wires while there’s volt­age on them again. I also put pins on the MS1 and 2 switches, so no more loose wires.

November 13, 2017

Tutorial w/ Tracey

November 15, 2017

Did some draw­ings us­ing my freshly fixed lap­top (Now be­ing ex­tra care­ful and us­ing the USB iso­la­tor). I fig­ured out a way to re­duce the vi­bra­tion in the ma­chine: Waiting about 100ms be­tween each com­mand. slow things down, but the re­sults are much nicer.

I took some mea­sure­ments to work out how far the ma­chine moves in a given num­ber of steps. It’s about 0.025mm per step (which seems way too pre­cise, but I’m done mess­ing with the mi­crostep­ping res­o­lu­tion for the mo­ment), or 40 steps in a mil­lime­ter. I got slightly dif­fer­ent re­sults for each axis (0.023mm/step on the x-axis). I’m as­sum­ing this is due to dif­fer­ences in the step­per mo­tors (they come from dif­fer­ent man­u­fac­tur­ers) and in­con­sis­ten­cies in the over­all con­struc­tion of the ma­chine.

Based on this data I ex­panded the dri­ver code, so the ma­chine is now aware of where it is at all times. This al­lows me to move the pen to any point on the table. By set­ting the two step­pers to dif­fer­ent speeds I can draw a straight line be­tween ar­bi­trary points. So far I’ve been us­ing straight Javascript to make draw­ings - sim­ple loops, ran­dom num­bers etc. The next step will be to run SVG files through the ma­chine.

I’ve adapted a script I wrote ear­lier this year to con­vert SVG files to ma­chine in­struc­tions, but it looks like it needs some more work be­fore it is us­able. For shapes with straight lines (<polygon>, <line>), <rectangle> etc.) it just ex­tracts the points. Shapes with Bezier curves in them are con­verted into straight line seg­ments - if the res­o­lu­tion on this is high enough, it should look like a smooth curve in the draw­ings.

This is my git repo for all of this.

November 24, 2017

I’ve had three draw­ings stolen from the stu­dio, which I guess is some form of com­pli­ment. Some ideas by peo­ple I talked to about the ma­chine:

In other news, the miss­ing shaft sup­port is fi­nally on the way. It should help make the ma­chine more sta­ble, maybe solve some of the is­sues with the y-axis get­ting stuck.

November 25, 2017

Here’s some of the im­ages I made on the draw­ing ma­chine this week. Most of were de­signed in Illustrator, with any ran­dom­ness com­ing only through the ma­chine it­self (by it get­ting stuck, some­one bumbping into it, teh pen run­ning out of pa­per etc.)

Machine drawing 1 Machine drawing 2 Machine drawing 3 Machine drawing 4 Machine drawing 5 Machine drawing 6 Machine drawing 7 Machine drawing 8

December 20, 2017

TODO in­sta­gram im­ages

January 19, 2018

Emma sug­gests I look at Wind Drawings by Cameron Robbins. As he de­scribes it,

The Wind Drawing Machines are in­stalled in dif­fer­ent lo­ca­tions to re­ceive weather en­ergy and trans­late it into an ab­stract for­mat of ink draw­ings on pa­per. […] The ma­chines re­spond to wind speed and wind di­rec­tion, and al­low rain and sun to also play on the draw­ings. The prin­ci­ple em­ployed here is that the wind di­rec­tion ori­ents a swivel­ing draw­ing board con­nected to a wind vane, while the wind speed dri­ves a pen on a wire arm around in a cycli­cal mo­tion.

I like the no­tion that these are ab­stract draw­ings, but also in some sense a very ac­cu­rate record of a spe­cific place at a cer­tain time. Similar maybe to Sam Winston’s work. The first thing I thought of was do­ing some­thing with Met Office Data, but that seems con­trived.

January 24, 2018

TODO Random pixel shad­ing

January 25, 2018

TODO Random pixel shad­ing lay­er­ing

January 26, 2018

I man­aged to source some CMYK ball­points. Unfortunately, they only come in a pack of 20 to­gether with 4 other colours that are less use­ful. Here’s the first four-colour draw­ing I did, us­ing the ran­dom­ized pixel method:

Here’s one us­ing reg­u­lar pix­els, us­ing [this Warhol print] (Primarily be­cause it has bright colours, sec­ondly be­cause it con­tin­ues the tra­di­tion of us­ing com­mu­nist lead­ers as test sub­jects):

I pre­fer the sec­ond one a lot. Each pixel is inked much more evenly, lead­ing to cleaner colours. The square pix­els also make it eas­ier to align each layer, al­though get­ting it per­fect seems pretty dif­fi­cult. I did, how­ever, run this draw­ing at quar­ter step to save time, so there should be room for im­prove­ment if I’m will­ing to wait twice as long. Having de­vel­oped this method of lay­er­ing colours on top of each other, I’m now ef­fec­tively screen­print­ing (as op­posed to do­ing line draw­ings).

Some more in­sights from this test:

January 28, 2018: Another Drawing Machine

Over the weeked I made the de­ci­sion to build an­other draw­ing ma­chine. I’ve been strug­gling for ages to find some sort of interactive mode” for the orig­i­nal draw­ing ma­chine. I tried build­ing some sort of shape recog­ni­tion soft­ware that would al­low you to draw shapes and have the ma­chine in­ter­pret them. I also talked about build­ing a lan­guage-pro­cess­ing sys­tem that would al­low peo­ple to write Sol Lewitt-style in­struc­tions and have the ma­chine in­ter­pret them. None of that seemed too promis­ing.

So the so­lu­tion is to build a sec­ond draw­ing ma­chine, one that is de­signed to be an in­ter­ac­tive in­stal­la­tion. It’s go­ing to look some­thing like this:

TODO add sketch

The plan is to have it done by the Friday.

I’ve al­ready writ­ten some of the con­trol code. I’m us­ing socket.io to dis­play the func­tion graphs in real time.

I’ll need the fol­low­ing parts:

Things I’m not sure about yet:

Using Wikipedia, I man­aged to cob­ble to­gether the fol­low­ing func­tions to gen­er­ate sine, tri­an­gle, saw­tooth and square waves that will even­tu­ally con­trol the mo­tors. $$a$$ is the am­pli­tude, $$p$$ is the pe­riod, $$o$$ moves the curve up and down and $$\varphi$$ moves the curve from left to right (I’m us­ing this to an­i­mate it on screen).

$$\DeclareMathOperator{\sgn}{sgn}$$ $$\DeclareMathOperator{\atan}{atan}$$ $$\DeclareMathOperator{\asin}{asin}$$ $$\DeclareMathOperator{\cotan}{cotan}$$

Sine: $$f(x) = a\sin(2\pi px + \varphi) + o$$

Square: $$f(x) = a\sgn\big[\sin(2\pi px + \varphi)\big] + o$$

Triangle: $$f(x) = a\arc­sin\big[\sin(\frac{2\pi}{p}x + \varphi)\big] + o$$

Sawtooth: $$f(x) = \frac{-2a}{\pi}\arctan\big[\cot(\frac{x\pi+\varphi}{2p})\big] + o$$

January 29, 2018

I’ve started con­struc­tion on the sec­ond draw­ing ma­chine. I’m us­ing a wooden clip­board from the col­lege art shop for the con­trol panel - seems ap­pro­pri­ately hap­haz­ard. Apparently I’m the first per­son to ever buy one of these in the art shop - it took them about 5 min­utes to find the price in the reg­is­ter.

I drilled holes to mount six po­ten­tiome­ters and wired them to the Arduino’s ana­logue in­puts:

Then I plugged their read­ings into the code for the sine func­tions, and to my amaze­ment it worked on the first try. You can twist the knobs and watch the curves on the screen change in real time. Insert mad sci­en­tist laugh­ter here. There seems to be some in­ter­fer­ence be­tween some of the po­ten­tiome­ters - ma­nip­u­lat­ing one changes the read­ings of other ones in the se­ries. Apparently this is be­cause some of them have too much re­sis­tance. I’ll re­place and see if that’s fixes it.

Peer as­s­es­ment

TODO make the 100 draw­ings book pub­li­ca­tion

January 31, 2018

The flip switches for draw­ing ma­chine two ar­rived. I’m plan­ning to use these to

  1. Switch be­tween dif­fer­ent func­tions for each step­per
  2. Toggle some sort of ran­domi­sa­tion for each fun­tion pa­ra­me­ter on each step­per

I’m fo­cussing on one for the mo­ment. Since there are four func­tions to choose from, I can com­bine two switches to gen­er­ate four pos­si­ble po­si­tions by think­ing of each switch as a digit in a bi­nary num­ber:

Switch A Switch B Binary Result
Open Open 00 Sine
Open Closed 01 Triangle
Closed Open 10 Square
Closed Closed 11 Sawtooth

Febuary 1, 2018

Got the sec­ond draw­ing ma­chine work­ing to­day:

I found out that to draw a cir­cle (and sim­i­lar shapes), the two func­tions need to be on dif­fer­ent phases - oth­er­wise you just get straight lines. At the mo­ment I’m do­ing this by adding a hard coded num­ber to $$\varphi$$, but that’s not the best so­lu­tion. I can’t just add an­other knob be­cause there are no ana­logue in­puts left on the Arduino. However, I could add an­other switch to add a sec­ondary func­tion to the offset” knobs.

This will make the ma­chine need­lessly com­pli­cated and more an­noy­ing to use. So I’m def­i­nitely do­ing it. Prob­lems:

Febuary 9, 2018

A new plan for ac­tion

Following the mid-term re­view with Tracey and con­ver­sa­tions with var­i­ous peo­ple.

The draw­ing ma­chine pro­ject needs a point. I think the point is the fol­low­ing:

Book Structure

The ma­chine learn­ing pub­li­ca­tion could be in a sim­i­lar for­mat.