NEX Robotics
Fire Bird V Software Manual
2. Auxiliary power can supply current up to 1 Ampere while Battery can supply current up to 2
Ampere. When both motors of the robot changes direction suddenly without stopping, it
produces large current surge. When robot is powered by Auxiliary power which can supply only
1 Ampere of current, sudden direction change in both the motors will cause current surge which
can reset the microcontroller because of sudden fall in voltage. It is a good practice to stop the
motors for at least 0.5seconds before changing the direction. This will also increase the useable
time of the fully charged battery.
5.4 Servo motor control using Timer 1
Fire Bird V robot has camera pod and sensor pod attachment. It has two servo motor for pan and
0
0
tilt movement. Servo motor is an essentially geared DC motor which rotates from 0
to 180
based upon input signal in the form of pulse train.
Servo control is done by sending a PWM signal to the PWM input pin of the servo motor. The
servo motor compares this signal to the actual position of the servo and adjusts the angle of the
servo motor accordingly. Position of the servo motor is determined by the pulse width of
waveform which has frequency between 30Hz to 60Hz. Generic servo motor gives 0 to 180
degrees rotation for pulse width of 1 to 2 milliseconds. 50Hz is considered as ideal frequency.
The pulse width may change for different type of servo motor
We will be generating approximately 52.25 Hz (approx 19.13ms time period) PWM signal using
timer 1. Pulse will remain high for first 1 to 2 ms depending on the angle we want to set and then
pulse will remain low for the rest of the time.
Camera pod has two servo motors called as pan and tilt motors. Pan motor moves camera left
0
and right. It has 180
swing. Tilt motor moves camera up and down. It can also give swing of
0
0
180
but after mounting camera swing gets restricted to 0 to 120
.
We will control these servo motors using timer 1. Very high resolution PWM waveform can be
generated using timer input capture or overflow interrupt along with output compare register
(OCR) but it is bit complicated method and requires frequent interrupt servicing. We will be
using a simpler method to generate control signal for these servo motors which gives relatively
less resolution in servo angle control but does not require frequent interrupt servicing. Timer 1
will be used in 10 bit fast PWM mode which has 10 bit resolution. Servo motor can be connected
to the three servo connectors (S1, S2 and S3) which are located on the ATMEGA2560
microcontroller adaptor board. For more details refer to section 3.19.11 from the Hardware
Manual.
For concept of PWM and PWM generation using timer refer to section 5.3.1 and 5.3.2.
www.nex-robotics.com
85
Need help?
Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?