NEX Robotics
Fire Bird V Software Manual
Various syntaxes for ISR are described in datasheet of ATMEGA2560 microcontroller and also
in < iomxx0_1.h> files in winavr/avr/include/avr folder.
//ISR for right position encoder
ISR(INT5_vect)
{
//Your code
}
//SR for left position encoder
ISR(INT4_vect)
{
//Your code
}
4.2 Robot position control using interrupts
Interrupt 4 (INT4) and interrupt 5 (INT5) are connected to the robot's position encoder. Position
encoders give position / velocity feedback to the robot. It is used in closed loop to control robot's
position and velocity. Position encoder consists of optical encoder and slotted disc assembly.
When this slotted disc moves in between the optical encoder we get square wave signal whose
pulse count indicates position and time period indicates velocity. For more details on the
hardware refer to section 3.8 and 3.9 from the Hardware Manual.
Figure 4.1: DC geared motors and position encoders
Figure 4.2: Position encoder assembly
www.nex-robotics.com
68
Need help?
Do you have a question about the Fire Bird V ATMEGA2560 and is the answer not in the manual?