NEX ROBOTICS FIREBIRD V ATMEGA 2560 Hardware Manual page 120

Robotic research platform
Table of Contents

Advertisement

Commands for servo motor control:
7.5.7
ATMEGA2560 microcontroller adaptor board can drive three servo motors. Out of which S1 and
S2 servo motors can be controlled with serial control protocol. These motors are used to move
the camera or sensor pod in pan and tilt direction.
8
Data
9
Data
A
Data
B
Data
The servo motor will move between 0° to180° given an 8 bit value between 0x15 and 0x65 (in
hex)
The Servo motion resolution is = 180 / (0x65 – 0x15) = 2.25 degrees / step.
Example: Move servo motor1 by 90 degrees.
Numbers of steps required = 90°/2.25 = 40steps = 0x28 hex
Byte to send = 0x15 + 0x28 = 0x3D
Lower nibble = D hex
Upper nibble = 3 hex
Combining these nibbles with the commands:
Step1: send 0x8D through the serial port
Step2: delay by 3 milliseconds
Step3: send 0x93 through the serial port
© NEX Robotics Pvt. Ltd. and ERTS Lab, CSE, IIT Bombay, INDIA
Load servo angle lower nibble
Load servo angle upper nibble and move the servo motor.
Load servo angle lower nibble
Load servo angle upper nibble and move the servo motor.
Table 7.7
Fire Bird V ATMEGA2560 Hardware Manual
120

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FIREBIRD V ATMEGA 2560 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents