Servo Motor
Introduction:
Servo motor is an electrical device, whenever we need to push or rotate anything with specific precision, we use servo motor. If we want to rotate any object to a specific direction or push to any specific direction, we use Servo Motor. Basically a servo motor is consist of a DC motor, a variable resistor or potentiometer and a couple of gears.
It is a motor which run using servo mechanism. Servo motors are rated in kg/cm. This tells us how much weight our motor can lift in a particular distance. Lesser the distance greater will be the load lifting capacity.
Servo motor works on PWM (Pulse Width Modulation) principle, means its angle of rotation is controlled by the duration of applied pulse to its Control PIN. High speed force of DC motor is converted into torque by Gears. Potentiometer is connected to the output shaft of the Servo, to calculate the angle and stop the DC motor on required angle.
Usage:
Servo motors can be seen used everywhere like Robotics, Industrial purpose, Automated manufacturing, Solar tracking system, Antenna positioning, Metal cutting and positioning, Textile industry, Automatic door openers etc.
Application:
Project for Reference:
Code:
Arduino – File – Examples – Servo – Sweep
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop() {
for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
}
No comments:
Post a Comment