Prints (0)
-
No Prints Yet
Be the first to upload a Print for this Design!
Description
Summary This is a variant of the other tensioner I made for CNC hot wire cutter. It doesn't build as much in height. It is used to keep the hot wire tension even if the axes on the cnc machine moves. The servo is modified to rotate 360 degrees and the controller is an Arduino pro mini. The code I made for it is simple and the one thing that one may have to change is the "map(a,b,c,d)" command to suit. Code included below. #include
Servo servo;
const int potPin= A0; const int servoPin= 5; const int LED= 13;
void setup(){ pinMode(potPin, INPUT); pinMode(servoPin, OUTPUT);
servo.attach(servoPin); //Serial.begin(9600); //Only for testing. }
void loop(){ int potAngle= analogRead(potPin);
potAngle= map(potAngle, 0, 800, 0, 180); //To centre the servo with this potentiometer, the full range is not used in this particular case.
servo.write(potAngle);
if(potAngle == 90){ //Indicate when servo is centered and stationary. digitalWrite(LED, HIGH); } else{ digitalWrite(LED, LOW); }
//Serial.println(potAngle); //Only for testing.
delay(15); //15 is normal and about 200 at testing.
}
Comments