A servo motor is a rotary actuator that allows for precise control of angular position. It consists of a suitable motor coupled to a sensor for position feedback.
Servo is controlled on the concept of PWM (Pulse Width Modulation). The refresh interval (the minimum time to refresh servos in microseconds) is 20000, which means that the servo is refreshing at a frequency of 50Hz. For most of the servos, a certain range of PWM correspond to the range of angle servo can rotate. Minimum pulse width is the shortest time for the pulse has been HIGH and maximum pulse width is the longest time for which the pulse is HIGH. Hence if the range of motor angular position is from 0 to 180, then minimum pulse width corresponds to 0 and maximum pulse width corresponds to 180.
evive has two dedicated servo motor outputs pins.
Signal pin of servo 1 is connected to digital pin 44 and servo 2 is connected to digital pin 45.
In the following example, I will be showing you how to control servo through channel 1. Given below is the circuit diagram:
A Servo pin has three wires (Order to be connected in evive, left to right)
There is a servo library which can be used to control the servo motor. The available functions are provided in the table below:
In this example we will attach a servo motor and set the angle of the servo to 90 degrees.
Arduino uno has 6 PWM pins: 3, 5, 6, 9, 10, and 11 which provide 8-bit PWM output with the analogWrite() function.
We will controlling serov using Pin 3.