Fablab Aachen @ Fabacademy

Group Assignment

Week 09 + 11: Making a machine project




This week we got the following tasks:

  • Make a machine, including the end effector, build the passive parts and operate it manually.
  • Automate your machine. Document the group project and your individual contribution.
    • Jiyoung did the frame and the syringe casing
    • Paulina did the electronics
    • Jia did the porgramming

Brainstorming

We had a brainstorming session on what kind of machine we want to build. We ended up with some more artistic ideas and began narrowing it down to based on how much we liked the idea and how feasible it is.
We ended up with the thought: "We want to create a pankace art machine"

The Idea and Inspiration

Pancake art is the a fun and playful way of preparing your breakfast with an artistic twist. Based on how long the batter is on the pan the batter gets darker. This is then used to create greyscale images (or brownscale). We though about building a machine which can create this pancakes for you to have a fun and delighting morning every day.

Concept Draft - The UltiCrêper

The natural flow of prototyping

Back to the drawing board . . .


We tested several designs with 3D printed stuff and laser cut pieces. We ended up using the laser cut pieces because prototyping with the lasercutter ist just way faster than 3D printing. The 3D printed parts did sometimes not fit and we therefore trimmed down our laser cutted parts and went more minimal with each iteration. We ended up with flat pieces which we glued together with wood glue and screws. It is surprisingly stable in the end





Electronics



For the electronics we are using an Arduin Uno with a FabScan Shield (link) which was designed in the Fab Lab Aachen for the FabScan (link). The shield is documented very well so it was easy to use it. Additionally we used Pololu A4988 Stepper Motor Driver Carrier (Datasheet) to drive the stepper motors. All in all it was very easy to control the motors like this. Each motor has a STEP and a DIR pin. Applying a HIGH signal to the STEP pin lets the motor do one step (rotation). Applying a HIGH or LOW to the DIR pin changes the direction of the rotation.

We also fabricated some extension wires :)




Programming


        
/*
  Using a Pololu A4988 or StepStick Stepper Motor Driver with FabScan-Shield.
*/
#define MS_PIN   A5 //HIGH for 16 microstepping, LOW for no microstepping

#define EN1_PIN   2
#define STEP1_PIN 3
#define DIR1_PIN  4

#define EN2_PIN   5
#define STEP2_PIN 6
#define DIR2_PIN  7

#define EN3_PIN   11
#define STEP3_PIN 12
#define DIR3_PIN  13

#define EN4_PIN   A0
#define STEP4_PIN A1
#define DIR4_PIN  A2

int x;
boolean done;
int curDIRx;
String forwards;
String backwards;
String left;
String right;
String down;
String up;
int pumpx;

void setup()
{
  pinMode(EN1_PIN, OUTPUT);
  pinMode(EN2_PIN, OUTPUT);
  pinMode(EN3_PIN, OUTPUT);
  pinMode(EN4_PIN, OUTPUT);

  digitalWrite(EN1_PIN, HIGH); //deactivate driver (LOW active)
  digitalWrite(EN2_PIN, HIGH); //deactivate driver (LOW active)
  digitalWrite(EN3_PIN, HIGH); //deactivate driver (LOW active)
  digitalWrite(EN4_PIN, HIGH); //deactivate driver (LOW active)

  pinMode(DIR1_PIN, OUTPUT);
  pinMode(DIR2_PIN, OUTPUT);
  pinMode(DIR3_PIN, OUTPUT);
  pinMode(DIR4_PIN, OUTPUT);

  digitalWrite(DIR1_PIN, LOW); //LOW or HIGH
  digitalWrite(DIR2_PIN, LOW); //LOW or HIGH
  digitalWrite(DIR3_PIN, LOW); //LOW or HIGH
  digitalWrite(DIR4_PIN, LOW); //LOW or HIGH

  pinMode(STEP1_PIN, OUTPUT);
  pinMode(STEP2_PIN, OUTPUT);
  pinMode(STEP3_PIN, OUTPUT);
  pinMode(STEP4_PIN, OUTPUT);

  digitalWrite(STEP1_PIN, LOW);
  digitalWrite(STEP2_PIN, LOW);
  digitalWrite(STEP3_PIN, LOW);
  digitalWrite(STEP4_PIN, LOW);

  pinMode(MS_PIN, OUTPUT);
  digitalWrite(MS_PIN, LOW); //no microstepping


  x = 0;
  done = false;
  forwards = "FRONT";
  backwards = "BACK";
  down = "down";
  up = "up";
  left = "left";
  right = "right";
  pumpx = 0;
}

void setDirX(String dir)
{
  if (dir == "FRONT") {
    digitalWrite(DIR2_PIN, 0); //LOW or HIGH
    digitalWrite(DIR3_PIN, 0); //LOW or HIGH
  } else {
    digitalWrite(DIR2_PIN, 1); //LOW or HIGH
    digitalWrite(DIR3_PIN, 1); //LOW or HIGH
  }

}

void moveX(String dir, int n) //maximum 6000 back and forth from front or back position
{
  while (x < n) {
    digitalWrite(EN2_PIN, LOW); //activate motor
    digitalWrite(EN3_PIN, LOW); //activate motor
    setDirX(dir);
    digitalWrite(STEP2_PIN, HIGH);
    digitalWrite(STEP3_PIN, HIGH);
    delay(2);
    digitalWrite(STEP2_PIN, LOW);
    digitalWrite(STEP3_PIN, LOW);
    delay(2);
    digitalWrite(EN2_PIN, HIGH); //deactivate motor
    digitalWrite(EN3_PIN, HIGH); //deactivate motor
    x++;
  }

  x = 0;

}

void setDirY(String dir)
{
  if (dir == "left") {
    digitalWrite(DIR1_PIN, 0); //LOW or HIGH
  } else {
    digitalWrite(DIR1_PIN, 1); //LOW or HIGH
  }
}


void moveY(String dir, int n)
{
  while (x < n) {
    digitalWrite(EN1_PIN, LOW); //activate motor
    setDirY(dir);
    digitalWrite(STEP1_PIN, HIGH);
    delay(2);
    digitalWrite(STEP1_PIN, LOW);
    delay(2);
    digitalWrite(EN1_PIN, HIGH); //deactivate motor
    x++;
  }

  x = 0;

}

void setDirPump(String dir)
{
  if (dir == "down") {
    digitalWrite(DIR4_PIN, 1);
  } else {
    digitalWrite(DIR4_PIN, 0);
  }
}

void resetPump(){
  while (pumpx > 0) {
    digitalWrite(EN4_PIN, LOW); //activate motor
    setDirPump(up);
    digitalWrite(STEP4_PIN, HIGH);
    delay(2);
    digitalWrite(STEP4_PIN, LOW);
    delay(2);
    digitalWrite(EN4_PIN, HIGH); //deactivate motor
    pumpx--;
  }
}

void pumpIt(String dir, int n) //maximum 3000 units up or down
{

  if(pumpx == n){
    resetPump();
  }
  
  while (pumpx < n) {
    digitalWrite(EN4_PIN, LOW); //activate motor
    setDirPump(dir);
    digitalWrite(STEP4_PIN, HIGH);
    delay(2);
    digitalWrite(STEP4_PIN, LOW);
    delay(2);
    digitalWrite(EN4_PIN, HIGH); //deactivate motor
    pumpx++;
  }

}
void drawPat(int a) { //One Unit is 4000 by 4.5cm distance to the plate edge

  moveX(forwards, a);
  moveY(right, a - 500);

  moveX(backwards, a - 500);
  moveY(left, a - 1000);
  pumpIt(down,1000);

  a = a - 500;

  while (a >= 1000) {
    moveX(forwards, a - 500);
    moveY(right, a - 500);

    moveX(backwards, a - 500);
    moveY(left, a - 1000);
    a = a - 500;
  }

}
void loop()
{
  while(!done){
    drawPat(4000);
    done = true;
  }
  
}

        
        

The hardest part about programming was to measure how many steps what distance is. We tried this first with motors which were not attached to the machine because we feared breaking the machine if we rotate the motors too much. In the end we measured the distance to step ratio and and encoded them into functions. We also wanted to implement a parser which translates an svg to machine movement but sadly ran out of time. In the current iteration the pattern the pancake machine runs is hard coded. We also created so much dust and dirt during the building of the machine that it is no longer food safe. We need to exchange the syringe before actually cooking some pancakes :(




Running Pancake Machine \o/ [without batter :( ]




Files

Zip with Arduino Code, svg files and the syringe case 3D Model