Monday, November 16, 2015

Pager muscles for balloon sculptures

A pager muscle is just a pager motor with a length of high-performance fishing line attached. The twisting of the line causes it to shorten and pull the two sides of the joint closer together.
Right now I am working on a practical way to actuate balloon sculptures or balloonbots if you will. A YouTube video shows how it works.

In the video the motor is being driven by a 9-V battery that is pulse-width modulated down to 80/255, or effectively a 3-V supply. The controller drives the motor for 150 msec in one direction and 120 msec in the other direction with 100 msec rests between changes of direction.

Here is the Arduino sketch used for the demo:

int motorDirPin = 2;      // Motor direction connected to digital pin 2
int motorSpeedPin = 3;    // Motor speed connected to digital pin 3
int motorSleepPin = A3;      // Motor sleep to analog pin 3
int forwardSpeed = 80;
int pulseLength = 150;
int reversePulseLength = 120;
int restLength = 100;

void setup()
{
  pinMode(motorDirPin, OUTPUT);       // sets the pin as output
  pinMode(motorSpeedPin, OUTPUT);     // sets the pin as output
  pinMode(motorSleepPin , OUTPUT);     // sets the pin as output

  digitalWrite(motorDirPin, LOW);     // sets the default dir to be forward
  digitalWrite(motorSpeedPin, LOW);   // sets the default speed to be off
  digitalWrite(motorSleepPin , HIGH);   // sets the sleep mode to be off
}

void loop()
{

  // Set the motor direction to forward
  digitalWrite(motorDirPin, LOW);   
  analogWrite(motorSpeedPin, forwardSpeed);      // speed forward
  delay(pulseLength);
  analogWrite(motorSpeedPin, 0);      // 0 speed forward
  delay(restLength);
  
  
  // Setndirection to reverse
  digitalWrite(motorDirPin, HIGH);    
  analogWrite(motorSpeedPin, (255-forwardSpeed));      // speed reverse
  delay(reversePulseLength);
  analogWrite(motorSpeedPin, 255);      // 0 speed reverse
  delay(restLength); 
  
}

No comments: