'''''FINAL UPDATE: MAY 2, 2006''''' Complete documentation of our final project is available [[http://www.itp.nyu.edu/~ss3830/pcomp/final/ | here]]. '''''BINARY TEXT VISUALIZATION: DRAWING MACHINE''''' '''WEEK ONE: PROPOSAL''' ''CONCEPT / BACKGROUND'' Our plan is to build a drawing machine that generates images based on the binary code text visualization project that Sai has been working on for some time. To read about this project, click [[http://saisriskandarajah.com/worksonpaper/flash/wasteland/ | here]]. Much of the programming for this project was done last semester, so the bulk of the work will be the building of the device. This device, a sort of crude printer, will draw a series of small squares with a Sharpie on large rolls of paper. ''MECHANICS'' We have identified three required axes of movement, which we will call "x", "y" and "z": the x-axis refers to movement across the width of the roll of paper; the y-axis refers to movement down the length of the roll; and the z-axis refers to the movement of the pen on and off the paper. The drawing of the squares will be effected through a combination of movement in the x and y directions. Movement along the z-axis will only affect the height of the pen. The drawing of each square will consist of the following movements: http://itp.nyu.edu/~ss3830/pcomp/images/week9/4.jpg x pos: draw the top of the square\\ y pos: draw the right side of the square\\ x neg: draw the bottom of the square\\ y neg: draw the left side of the square\\ z pos: lift the pen from the page\\ x pos: move to the starting position for the next square\\ z neg: push the pen down to contact position\\ etc. Movement in the y direction will be controlled by a stepper motor attached to the roll of paper (or, possibly, another feed mechanism). As the motor turns, paper will be fed back and forth through the print area. Movement in the z direction will be controlled by a servo, using a piston-like mechanism to create linear motion. http://itp.nyu.edu/~ss3830/pcomp/images/week9/2.jpg The element of the project that we are having the hardest time conceiving is movement in the x direction. We will use a stepper motor and a rack & pinion mechanism to create continuous linear motion along the full width of the page. However, we are not sure how this mechanism should connect to the pen. The most obvious option is to house the entire mechanism in an enclosure that rests above the paper: http://itp.nyu.edu/~ss3830/pcomp/images/week9/5.jpg Both the x control (stepper/rack & pinion) and the y control (servo/piston) would be housed in this enclosure, with the paper passing under the entire device. The primary disadvantage to this option is that he actual drawing process is concealed by the enclosure, which takes away a little of the magical quality of the drawing machine. Option number two is to use a system of magnets to control the pen: http://itp.nyu.edu/~ss3830/pcomp/images/week9/3.jpg An arm with a slot running its full length would keep the pen stabilized in the y direction, and lift up and down to control z movement. Beneath the paper, the rack & pinion would be attached to a magnet that presses against the the underside of the drawing surface. The pen would sit in a magnet on the drawing surface, the two magnets oriented so that they are attracted to each other. A weight pressed against the arm would hold the pen perpendicular to the page. We aren't sure if this would work, mechanically, but it would create a wonderful sense of the pen moving magically across the page. So far, we have identified the following design issues that need to be resolved: 1. finding appropriate parts for the rack & pinion mechanism (possibly lego?);\\ 2. wiring the rack & pinion stepper motor so that, as it moves closer to and further from the breadboard, the excess wire doesn't get tangled;\\ 3. working out the necessary strength of the magnetic attraction;\\ 4. working out the necessary motor power to turn or feed the roll of paper;\\ 5. creating an effective linear motion servo mechanism for z movement;\\ 6. establishing the scale of the device (bigger is better, but how big?);\\ 7. design and construction of the arm that holds the pen; and\\ 8. design and construction of the mechanism that holds and feeds the paper. ---- '''WEEK TWO''' ''CALENDAR'' 4/5/06: Design \\ This week we have completed the basic design of the project. The basic layout of the device has been resolved as have the mechanical elements of the design. Certain aesthetic elements of the project remain unresolved. 4/12/06: Mechanics \\ By next week we expect to have built the device. The appearance of the device will not yet be resolved, nor will the code that runs it be complete, but if we give the device power it should feed paper and print. 4/19/06: Code \\ By the 19th we plan to have the coding for the project done. This means that the project, while not yet particularly good-looking, will essentially be complete and fully functional. 4/20/06: Tweaking/Aesthetics \\ In the final week, we plan to refine the aesthetics of the device and work out any kinks that remain. ''DESIGN'' After much conversation about the design of our drawing machine, we have come to realize that our original, large-scale idea could not be completed before the end of the semester. As such, we have scaled down our project, reducing the number of mechanical elements of the device and incorporating existing technology (rather than reinventing the wheel). The primary changes are: 1) the new device is much smaller and renders the text visualization in a single line on rolls of ticker tape; and 2) instead of designing our own paper feed mechanism, we are using the mechanism from an adding machine (a/k/a printing calculator). Also, instead of using a pen to draw the individual squares, we will use a solenoid attached to a rubber stamp (with a built in inkwell) to print the squares one-by-one, as the paper feeds. http://itp.nyu.edu/~ss3830/pcomp/images/week10/addingmachine.jpg\\ Adding Machine* There are two mechanical components of the device. The first is the basic feed mechanism, which is quite simple. We have tested it with regular 3V DC motor, and it feeds smoothly and continuously. We are ordering a stepper motor (and accessories) this week, and we expect that the controlled feed will operate without any significant problems. Here's a sketch of how it will work: http://itp.nyu.edu/~ss3830/pcomp/images/week10/1.jpg The second and more complicated part of the design is the print mechanism. A solenoid, mounted to an arm-like structure, facing down, drives a small rubber stamp with a built in inkwell. This sketch gives some impression of how the entire device will look from the side: http://itp.nyu.edu/~ss3830/pcomp/images/week10/2.jpg The stamp looks something like this, but smaller and cylindrical: http://itp.nyu.edu/~ss3830/pcomp/images/week10/rubberstamp.jpg Rubber Stamp* We are still working out what the base and the arm will be made of, but the basic design seems to work. [=*=]I will eventually replace these images with pictures of the actual parts that we are using. ''-SS ---- '''WEEK THREE''' '''pic code''' Here's the pic code we were playing with for the feed mechanism motor: CODE FOR ONE STEP WITH ONE SWITCH: DEFINE OSC 4 start: High PORTB.0 ' set variables: x VAR BYTE steps VAR WORD previous var bit stepArray VAR BYTE(4) clear TRISD = %11110000 PORTD = 255 input portb.4 Pause 1000 stepArray[0] = %00001010 stepArray[1] = %00000110 stepArray[2] =%00000101 stepArray[3] = %00001001 previous = 0 main: if portb.4 = 1 then if previous = 0 then steps = steps + 1 endif previous = 1 else previous = 0 endif portD = stepArray[steps //4] pause 200 GoTo main CODE FOR 10 steps every switch (but really only moves 2) start: High PORTB.0 ' set variables: x VAR BYTE steps VAR WORD previous var bit stepArray VAR BYTE(4) i var bit clear TRISD = %11110000 PORTD = 255 input portb.4 Pause 1000 stepArray[0] = %00001010 stepArray[1] = %00000110 stepArray[2] =%00000101 stepArray[3] = %00001001 previous = 0 main: if portb.4 = 1 then if previous = 0 then for i = 0 to 9 steps = steps - 1 portD = stepArray[steps //4] pause 200 next endif previous = 1 else previous = 0 endif GoTo main ---- '''getting input from serial''' DEFINE OSC 4 ' set variables: steps VAR WORD stepArray VAR BYTE(4) i var byte clear j var byte tx var portc.6 rx var portc.7 inv9600 con 16468 inbyte var byte start: high portb.6 blinky: for j = 0 to 7 toggle portb.7 pause 300 next TRISD = %11110000 PORTD = 255 input portb.4 Pause 1000 stepArray[0] = %00001010 stepArray[1] = %00000110 stepArray[2] = %00000101 stepArray[3] = %00001001 main: serin2 rx, inv9600,[inbyte] if inbyte = 65 then high portb.7 for i = 0 to 150 steps = steps + 1 portD = stepArray[steps //4] pause 10 next serout2 portc.6, inv9600,[65, 13, 10] inbyte = 0 low portb.7 endif if inbyte = 66 then high portb.7 low portb.6 pause 10 high portb.6 serout2 portc.6, inv9600, [66, 13, 10] inbyte = 0 low portb.7 endif GoTo main ---- ''PROCESSING CODE TO CONTROL FEED MECHANISM''' import processing.serial.*; Serial serPort; int counter = 0; float xLoc = 5; float yLoc = 5; void setup() { size (300, 300); background(255); framerate(30); println(Serial.list()); stroke(0); fill(0); serPort = new Serial(this, Serial.list()[0], 9600); } void draw() { if (xLoc > 295) { xLoc = 5; yLoc = yLoc + 10; } if (yLoc > 295) { yLoc = 5; } ellipseMode(CENTER); ellipse(xLoc, yLoc, 10, 10); } void keyPressed() { if (key == ' ') { xLoc = xLoc + 10; serPort.write(65); } }