Making Things Interactive

February 24, 2008

Godzilla Puncher v3 (servo no work proper)

Filed under: 5: Making Motion,Gaku Sato — ponkotsu @ 3:43 am

So as it turns out, the first set of transistors I tried were inadequate in handling the current load required to activate a solenoid, as they’re only rated for low-power use like logic circuitry.  After being advised to try a power transistor, those were replaced with a 90W TIP3055, apparently used in applications like audio amplification.  This could handle the current loads and the solenoid would make a semi-audible clicking sound, but no activation.  After much confusion and some mysterious smoky smell (which was later identified as Jet’s wristwatch), we found that the transistor/solenoid circuit worked with either the TIP120 transistor or with no resistance on the input signal (to base).  It was determined that the solenoid input voltage was less than the required trip voltage due to the characteristics of the “better” TIP3055.  Since it is used for highly sensitive applications, the input-to-output voltage relation is more linear, thus resulting in an insufficient output voltage with the 1K resistor on the transistor input signal (to base).  This also explains why it worked when we piped 5V straight to base, and why even with the resistor, it worked with the TIP120, which has a more steep non-linear input-to-output curve.  Once we figured that out, the rig was tested with Godzilla in place, who was, alas, punched square in the face.

Radioshack seems to be completely out of TIP120s so my new wiring’s just waiting on that piece.  That is, at least for the solenoid portion…

My other problem was servo control.  I was only succeeding at making an unreliably twitchy speed-controlled rig.  Chris told me he was able to get position control by using the 5V power from the Arduino and sending analogWrites to the control pin.  So I thought perhaps the 9V input was excessive?  Anyways I tried that technique, but still nothing.  I tried Servo.write(angle) with <Servo.h> as well as analogWrite(various 0~255) and it’s always speed control.  I’ve yet been able to get the servo (Tower Hobbies TS-53) to go to any position and stop before it pins itself one way or the other.

At this point, I’m just going to move onto assignment 6 and hope I can get the servo to respond well in that rig.  Then hopefully I’ll successfully be able to even have a midterm project proposal, since otherwise without proper servo control, my small-scale accurate actuation is limited.  LIMITED!  And my project would require this.  I’m afraid even if I went with a linear actuator that I’d have the same problem.

Anyways more debugging Tuesday…

#include

int PotPin = 2; // input pin – potentiometer
int PhotoPin = 3; // input pin – photoresistor
int ServoPin = 11; // output pin – servo
int SolePin = 5; // output pin – solenoid

Servo Ultraman; // set servo
long angle = 0; // 95 to stop…

int punch = 0;
int msecond = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(PotPin, INPUT); // 0~1005
  pinMode(PhotoPin, INPUT); // 750+
  pinMode(ServoPin, OUTPUT);
  pinMode(SolePin, OUTPUT);
  analogWrite(ServoPin, 0);
  digitalWrite(SolePin, LOW);

Ultraman.attach(ServoPin);
  Ultraman.setMaximumPulse(2400); // 2400 default
  Ultraman.setMinimumPulse(544); // 544 default

Ultraman.write(0);
}

void loop()
{
  angle = analogRead(PotPin);
  angle = angle*180/1005;
  Ultraman.write(angle);
  msecond = millis()/1000;
  if(millis()-msecond*1000 == 0) // display every second
  {
  Serial.print(“pot”);
  Serial.print(analogRead(PotPin)); // potentiometer reading
  Serial.print(“:angle”);
  Serial.print(angle); // calculated angle
  Serial.print(” photo”);
  Serial.println(analogRead(PhotoPin)); // photoresistor reading
  }
  if(analogRead(PhotoPin) > 750 && punch == 0)
  {
  Serial.print(“punch!”);
  punch = 1;
  digitalWrite(SolePin, HIGH);
  delay(500);
  digitalWrite(SolePin, LOW);
  }
  if(analogRead(PhotoPin) < 750) {punch = 0;}   Servo::refresh(); }[/sourcecode]

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: