Motor Control

Technical References/Movement 2007. 9. 13. 15:12

Idea

Learn about the use of a small motor with one single circular movement and try to express a story using it. You could be inspired by the use of lights and shadows, mechanical art machines, an other examples. You can get references in the art of Tinguely, but also in the more nature-centered Calder.

Think about the story, it doesn't need to be a traditional one. Doesn't need a beginning and an end, some stories are just cyclic. Motors can express the change of the time, use the mechanics in expressing this.

It is not easy to come out with a simple story when having very simple tools. Don't die thinking about it, go hands on!







Code example for moving a stepper motor

In the class we see how to use a small motor where we can control both speed and direction of rotation, in order to give a heart to our small story.

/* Controlling a Stepper Motor
 * ---------------------------
 *
 * (cc) 2007 SADI, Seoul, RoK
 */

int pin1 = 8;
int pin2 = 9;
int pin3 = 10;
int pin4 = 11;
int timer = 20;

void setup(){
  pinMode(pin1,OUTPUT);
  pinMode(pin2,OUTPUT);
  pinMode(pin3,OUTPUT);
  pinMode(pin4,OUTPUT);
}

void moveForward() {
  digitalWrite(pin1,HIGH);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,LOW);
  delay(timer);
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,HIGH);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,LOW);
  delay(timer);
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,HIGH);
  digitalWrite(pin4,LOW);
  delay(timer);
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,HIGH);
  delay(timer);
}

void moveBackward() {
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,HIGH);
  delay(timer);
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,HIGH);
  digitalWrite(pin4,LOW);
  delay(timer);
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,HIGH);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,LOW);
  delay(timer);
  digitalWrite(pin1,HIGH);
  digitalWrite(pin2,LOW);
  digitalWrite(pin3,LOW);
  digitalWrite(pin4,LOW);
  delay(timer);
}

void loop(){
  if (digitalRead(3)) {
    moveBackward();
  }
  else {
    moveForward();
  }
}

 
: