+ All Categories
Home > Documents > uploaded

uploaded

Date post: 14-Dec-2014
Category:
Upload: vicky
View: 120 times
Download: 8 times
Share this document with a friend
Popular Tags:
40
CONTENTS 1. Introduction to Serial Data communication 1.1. RS-232 Interfacing. 1.2. RS-232 Pin configuration. 1.3. RS-232 Error conditions. 1.4. Examples of RS-232 interconnections. 1.5. Making RS-232 interconnections work. 1.6. UART. 2. Multitasking programmable Robot Design 2.1. Parts of Robot 2.1.1. Control (ATMEGA8) section. 2.1.2. Sensor section 2.1.3. Motor driver 2.1.4. 2G4 Interface (CC2500) module (Wired & wireless both) 2.1.5. RS-232 programmer 2.2. Light sensor based Robot 2.2.1. Path follower 2.2.2. Other applications 2.3. PC Controlled robot 2.3.1. Data communication through UART module on HyperTerminal 2.3.2. Robot motion control through PC. 3. GPS Data Reception, Extraction & Analysis. 3.1. Introduction to GPS. 3.2. Data formats. 3.3. Data Reception and Extraction algorithm. 3.4. Data analysis. 3.5. Applications and Future Scope 4. Manipulator Arm mechanism 4.1. Introduction to Alligator arm 4.2. Servo controlled mechanism 4.3. Servo commands 4.4. Applications
Transcript
Page 1: uploaded

CONTENTS

1. Introduction to Serial Data communication1.1. RS-232 Interfacing.1.2. RS-232 Pin configuration.1.3. RS-232 Error conditions.1.4. Examples of RS-232 interconnections.1.5. Making RS-232 interconnections work.1.6. UART.

2. Multitasking programmable Robot Design2.1. Parts of Robot

2.1.1. Control (ATMEGA8) section.2.1.2. Sensor section2.1.3. Motor driver 2.1.4. 2G4 Interface (CC2500) module (Wired &

wireless both)2.1.5. RS-232 programmer

2.2. Light sensor based Robot2.2.1. Path follower2.2.2. Other applications

2.3. PC Controlled robot2.3.1. Data communication through UART module

on HyperTerminal2.3.2. Robot motion control through PC.

3. GPS Data Reception, Extraction & Analysis.3.1. Introduction to GPS.3.2. Data formats.3.3. Data Reception and Extraction algorithm.3.4. Data analysis.3.5. Applications and Future Scope

4. Manipulator Arm mechanism4.1. Introduction to Alligator arm4.2. Servo controlled mechanism4.3. Servo commands4.4. Applications

5. Digital Compass data Extraction & analysis5.1. Introduction to Digital Compass (HMR3000)5.2. Specifications of HMR30005.3. Pin Configuration5.4. NMEA Sentences5.5. Data extraction and analysis5.6. Applications, Features and benefits

Page 2: uploaded

INTRODUCTION TO SERIAL DATA COMMUNICATION

A successful and useful interface standard must define the lowest level details of the interface, such as the voltage (or current) values, the shape of the signal, and the performance of the interface under many normal and abnormal conditions. One of the most common interface standards is the RS-232 standard, which is published by the Electronics Industry Association (EIA).

It is used in many types of applications where relatively low performance is acceptable to the user or all that can realistically be provided because of cost and technical constraints.

TYPES OF SERIAL COMMUNICATION

1. Asynchronous (most commonly used)2. Synchronous

CHARACTERISTICS OF SERIAL COMMUNICATION

1. VOLTAGE LEVELS

Two voltage levels are required to represent binary data. The RS-232 standard specifies these values.

Binary 1 (MARK) -3 to -25 V

Binary 0 (SPACE) +3 to +25 V

Page 3: uploaded

2. SIGNAL BAUD RATERS-232 has limited baud rate up to 20KBaud thus cannot be used in high speed operations.

3. SLEW RATESlew rate is the transition rate from one value to another. The baud value indicates the number of bits per second that can be sent. Of course the baud value is limited by the slew rate.

SLEW RATE = ΔV/ΔT

4. DISTANCEThe RS-232 specification states that the specification is intended for connections of 50ft or less. Beyond 50ft, the signals may be degraded by noise, attenuated, or rounded, and reliable transmission is not assured.

5. DATA BITSThe RS-232 standard does not define the bits send between the start and stop bits, but 5, 6, 7, or 8 bits are most commonly used. At an idle state signal is at mark value. Transmission begins when the line goes to the space value, as the beginning of the start bit. Next comes the user data bits. After data bits, there may be a parity bit, which is used to check errors. Finally after the parity bit, line goes to the mark value. This is the beginning of the stop bit.

RS-232 ERROR CONDITIONS

Any communications system can have various types of errors. The most obvious one occurs when a data bit is changed from a 1 to a 0 or a 0 to a 1. There are some other types of important error conditions that can occur. These are as follows:

1. Framing error: - exists when the receiver expects a stop bit but does not get one. This may be caused by noise or signal degradation which caused the

Page 4: uploaded

stop bit to look like the opposite signal state. The receiver character is therefore not framed properly by the start and stop bit.

2. Overrun error: - occurs when a new character appears at the receiver circuitry before the previous character has been handled and disposed of completely.

3. Parity error: - occurs when the parity bit received with the character bit indicates that one or more of the data bits has an error. This indicates that the entire group is successfully received, but one of the received bits may be wrong.

EXAMPLES OF RS-232 INTERCONNECTIONS

1. Temperature meterIn a temperature meter application an electronic meter is used to monitor the temperature at a remote, dangerous location.

2. Computer to Terminal

Page 5: uploaded

3. Computer to Computer

MAKING RS-232 INTERCONECTIONS WORK

1. Bits and BaudFirst item to be checked is the bit and baud settings. Both systems should be set for the same baud value and bit configuration. The baud values are usually in the 300Baud and higher range. A system that is sending data in both directions, half duplex or full duplex, the baud value does not have to be the same in both directions. The keyboard to computer channel may use a low baud value whereas the computer to screen channel uses the much higher rate.The situation regarding the bit configuration is more complex.Number of bits per character; 5, 6, 7 or 8Number of stop bits; 1 or 1.5Parity bit; even, odd or none

2. Connectors and PinoutsThe RS-232 specification recommends a 25 pin connector. It has male and female forms. In DTE to DTE or DCE to DCE interfacing we require a special adapter called a Null Modem. The simplest null modem swap wires 2 and 3, the transmitter and receive data lines.

Page 6: uploaded

A 25 pin connector is most common but not the only choice. Some systems often use smaller connectors like 9 pin D-shaped connector DB-9. Connecting a 9 pin D to a 25 pin D unit requires an adapter cable that takes the signal on one connector and brings them across to the correct pin on the other.

UART

A universal asynchronous receiver/transmitter (usually abbreviated UART) is a type of "asynchronous Receiver / transmitter", a piece of computer hardware that

Page 7: uploaded

translates data between parallel and serial forms. UARTs are commonly used in conjunction with other communication standards such as EIA RS-232.

Structure:A UART usually contains the following components:• A clock generator, usually a multiple of the bit rate to allow sampling in the middle of a bit period.• Input and output shift registers• transmit/receive control• read/write control logic• transmit/receive buffers (optional)• Parallel data bus buffer (optional)• First-in, first-out (FIFO) buffer memory(Optional)

Features:Operation speed is up to 19.2Kbaud.Choice of 5,6,7, or 8 bit characters.Parity or no parity.Provision of one, one & a half, or 2 stop bits.Support for various handshake lines.

Page 8: uploaded

MULTITASKING PROGRAMMABLE ROBOT DESIGN

The Robot is the ideal platform to start working into the field of wireless communication and autonomous robotics.The iBoard mini is a controller board, simple yet feature packed so as to cater to a wide range of applications. This kit is based around the widely used ATmega8 microcontroller based on the AVR architecture. It strives to bridge the gap between concepts been taught in the classrooms and actually implementing them practically. Robot is essentially related to a variety of fields comprising of embedded C programming, microcontrollers, wireless communication, electronics and mechanics. With this kit we had a hands-on experience of working with line sensors, use of different actuators like DC geared and stepper motors, their drivers, interfacing wireless modules, serial communication with the PC, inter PC wireless communication.

PARTS OF ROBOT

1. CONTROL SECTIONThe Robot controller board is designed around the ATmega8 microcontroller. Features:

-Built around the popular AVR series microcontroller the ATmega8

-18 General Purpose I/O pins for interfacing different I/O options

-2 general purpose LEDs and Switches

Parts Identification: Power Switch: It’s a basic push to on - push to off type switch.

IC 7805: It’s a three terminal linear 5 volt regulator used to supply the microcontroller and other peripherals.

Page 9: uploaded

Reset Switch: This switch is used to reset the microcontroller.

I/O Port (Sensor port) : At a time, 18 individual sensor modules can be connected to this port. The port also provides a 5V supply needed to drive the sensors.

FRC Connector: This is a 10 pin connector used to connect to the Programmer which connects to the PCs Serial port during programming or for general UART communications.

Switches: Two general purpose switches are connected in the active LOW configuration.

LED: Two LED’s are connected in active LOW configuration.

CrystalOscillator: A crystal sets the microcontroller’s clock frequency to 12MHz

2. SENSOR SECTIONSensor section of the Robot consist of 5 light sensor units each comprising of a pair of IR LED and a Photodiode. The section can be connected to the microcontroller’s input port in order to receive and interpret thr surrouding physical factors.The ON/OFF voltage levels of the sensors can be adjusted by the Trim Pot.

3. MOTOR DRIVER SECTIONIt can be used to:

-Connect only two DC motors or -One Stepper Motor

Power Ratings: -Max o/p current: 800mA -Max i/p Voltage: 36V

4. 2G4 INTERFACE (CC2500) MODULEThe module converts cc2500 SPI interface to RS232 interface (38400 bps).

Page 10: uploaded

Protocol: After reset (system power on) it expects 3-configuration bytes. Byte-1: Self address: (1-254) (0 or 255 for broadcast) Byte-2: Remote address: (1-254) (0 or 255 for broadcast) Byte-3: channel number: (0-255) if no addressing is needed just transmit 3-bytes of zeros (0x00, 0x00, 0x00). The self/remote address can be changed at any time by just giving a low pulse on pin-3 and transmitting 3-bytes (self address, remote address, channel number)

LIGHT SENSOR ROBOT

This kit can be used in many applications where light sensing robots have to be designed. The most primary one is the Path follower (or Line Follower).

In the early stages of our project, we designed a black Line follower robot with ability to perform its function under various possible conditions. Sensor outputs were taken to the input port (PORTB) of the microcontroller where it was interpreted as per programmed set of instructions. Microcontroller sent its commands to the output port (PORTC) which was connected to the Motor Driver section. Thus, an autonomous output was generated by the robot through its motion.

OTHER APPLICATIONS

This follows a modular approach throughout its construction, so the user can easily add new features and behaviours from line following, obstacle avoiding to swarm robotics and a basic micro mouse. It can also be used as a generic embedded systems development platform.

Wireless communication module enables this robot to spread out its horizon towards development of unmanned remotely (Wired or Wireless) controlled systems.

Page 11: uploaded

Some of the applications are:1. Path Finder.2. Obstacle Detector.3. Security monitoring system.4. Grid Solver.5. Micro mouse.6. Household robots.7. Military applications etc.

PC CONTROLLED ROBOT

After designing an autonomous light sensitive path follower robot, we stepped towards the development of a Robot that can be controlled and made interacted with the PC. Again, we took help of RS-232 interfacing using UART serial data communication module.

Developmental stages:1. Interface set up between PC and the Robot using RS-232 interfacing with the

help of UART communication module.2. Algorithm design for data transmission and reception by the microcontroller

(ATMEGA8).3. Microcontroller programming for data communication in C language with the

help of the programmer kit (RS-232 interfacing module).4. Set up of communication link between robot and PC on hyperterminal –

Characters were received and transmitted back by the robot.5. Algorithm design and programming for Robot motion control according to the

data bytes received from the PC.

GRID SOLVER ROBOT

After completing the above activities, we started working on the development of an unmanned Robot that can interact and communicate with the computer and solve a rectangular grid. Robot started from the root position (0,0), traversed the grid according to the developed motion control algorithm to reach to the destination point communicated to it by the PC. During the traversal, Robot transmitted the coordinate value in character form to the computer so that the user could know the robots present location.

Page 12: uploaded

ALGORITHM:

start

Configure motors and sensors and different functions for various motions.

Take input for coordinatesX Coordinate? ->iY Coordinate? ->j

Take j number of diagonal turns comprising of one right turn, one

straight run, one left run and another straight run.

Isi>=j

Take i number of diagonal turns comprising of one right turn, one

straight run, one left run and another straight run.

Take (i-j) number of straight run.

Take (j-i) number of straight run.

Take a single right turn.

Stop

Yes No

Start

Page 13: uploaded

GPS DATA RECEPTION, EXTRACTION & ANALYSIS

INTRODUCTON

GPS stands for the Global Positioning System. It refers to a system of satellites and receivers that allow people and devices to pinpoint their precise location on the earth. The heart of the system relies on 24 satellites that orbit the earth twice per day. Devices that are equipped with GPS equipment receive transmissions from at least a few of the satellites and are able to discern very precise positioning data.

GPS receiver receives the real time raw data from maximum number of visible satellite. The GPS receiver uses the NMEA (National Marine Electronics Association) 0183 standard. The protocol consists of various GPS communication sentences like GPGGA, GPRMC, GPGLL, and GPGSV.

GPS uses a one-way ranging technique from the GPS satellite that is also broadcasting their estimated position. Signals from four satellites are used with the user generated replica signal and the receiver phase is measured. Using triangulation the location of the receiver is fixed. Four unknowns can be determined using the four satellites and appropriate geometry .Latitude, Longitude, altitude, and a correction to user’s clock. The GPS ranging signal is broadcast at two frequencies: a primary signal at 1575.42 MHz (L1) and a secondary broadcast at 1227.6MHz (L2).Civilians uses L1 frequency which has two modulation,viz. C/A or clear acquisition code and p or precise or protected codes. P codes are mainly for the military use.

TRILATERATION

It is a method used by GPS receiver to calculate its position from the signal receiver by three satellites. Assume coverage region of every satellite from a sphere around itself. When two such spheres come in contact, they form a plane. It gives two points of intersection. The receiver neglects the point far above earth’s surface and the point on surface is considered to be the position of the GPS receiver.

A GPS receiver calculates its position by carefully timing the signals sent by the constellation of GPS satellites high above the Earth. Each satellite continually transmits messages containing the time the message was sent, a precise orbit for the satellite sending the message (the ephemeris), and the general system health

Page 14: uploaded

and rough orbits of all GPS satellites (the almanac). These signals travel at the speed of light through outer space, and slightly slower through the atmosphere. The receiver uses the arrival time of each message to measure the distance to each satellite thereby establishing that the GPS receiver is approximately on the surfaces of spheres centred at each satellite. The GPS receiver also uses, when appropriate, the knowledge that the GPS receiver is on (if vehicle altitude is known) or near the surface of a sphere centred at the earth centre. This information is then used to estimate the position of the GPS receiver as the intersection of sphere surfaces. The resulting coordinates are converted to a more convenient form for the user such as latitude and longitude, or location on a map, and then displayed.

ERRORS IN GPS

1. Ephemeris error

1.1 Incorrect satellite position transmitted by GPS

1.2 Affects ranging accuracy.

2.Satellite clock error

3. Multi path reflection

4.Atmospheric delay

4.1 Ionosphere error

4.2 Troposphere error

5. Random measurement noise

5.1 Dilution of Precision (DOP)

Applications

GPS has become a widely used aid to navigation worldwide, and a useful tool for map-making, land surveying, commerce, scientific uses, tracking and surveillance, and hobbies such as geo caching and way marking. The precise time reference provided by GPS is used in many applications including the scientific study of earthquakes and as a time synchronization source for cellular network protocols.

Page 15: uploaded

DATA FORMATS

GPS protocol consists of various communication sentences like

- $GPGGA- $GPRMC- $GPGLL- $GPGSV- $GPGRS

Each format has different data syntax where character bytes are separated by comma (,). For GPS data interpretation, we have used GPGGA format to determine latitude , longitude, time and other relevant information as GPGGA covers all of them in a simple and easily understandable syntax. Some examples of the data formats are given below:

Eg. $GPGGA, hhmmss.ss, ddmm.mmmm, N, ddmm.mmmm, E, q, ss, y.y, a.a, z, g.g, z.t.t, iii*cc

$GPGGA,053043.33, 1834.7645, N, 7328.6592, E, 1, 04, 3.9, 201.5, M,,,, 0000*08

053043.33 --- Time (hhmmss.ss)

1834.7645 --- Latitude (ddmm.mmmm)

N --- North Direction

7328.6592 --- Longitude (ddmm.mmmm)

E --- East Direction

1 --- Quality of GPS fix

04 --- No. of satelites

3.9 --- HDOP (Horizontal Dillution of Precision)

Eg. GPGLL(Geographic Position Latitude Longitude & time)

$GPGLL, 3751.65, S, 14507.36, E, 225444, A

Eg. $GPGRS, 024603.00, I, -1.8, -2.7, 0.3,,,,,,,,,,, *6C

Eg. $GPRMC, 225446, A, 4916.45, N, 12311.12, W, 0.5, 054.7, 1911194, 020.3, E*68

Page 16: uploaded

GPS DATA RECEPTION & EXTRACTION

Data Acquisition:

The GPS was connected to PC for testing via RS-232 cable. We have used GPGGA sentence as it serves our purpose in an efficient and effective manner.

Data Processing:

The algorithm was designed to identify only GPGGA sentences. The bytes are then stored in a buffer. The data packets are separated using commas so the algorithm counts the number of commas to identify start bytes, latitude, longitude, time, HDOP and number of satellites.

Eg. $GPGGA, 123519,4807.038, N, 01131.000, E, 1, 08, 0.9, 545.4, M, 46.9, M,, *47

Algorithm:

(A) Define port 1 0x3F8Define port 2 0x2F8

(B) Global Declaration n=0,data.1. Start2. Define O/P ports.3. Create file f_all (.xls).4. If (n>=2000), goto step 11, else goto step 5.5. Counter=0;6. Store output of GPS in buffer[i] till kbhit()==27 (esc).7. for (j=0 to j<6), check if (buffer[j]=="$GPGGA"),counter++.8. If (counter>=6), print the line i.ebuffer[].

8.1 flag=0;8.2 read buffer[j] & if (buffer[j]==','),flag++.

8.2.1 if (flag==0), n1=j+2.if (flag==1), n2=j+2. ...

…if (flag==7), n8=j+2.if (flag==8), n9=j+1.

8.3 open files f_all,f_time,f_lat,f_lon,f_hdop (.xls).8.4 for (k=n1;k<n2;k++) store buffer[k] in f_all&f_time.8.5 for (k=n2;k<n3;k++) store buffer[k] in f_all&f_lat.8.6 similarly, we store all the data in respective files.

9. close all files.10. n++.11. open file f_latlon in append mode.12. read all the data from f_lat& store row-wise is f_latlon.13. repeat step 13, read data from f_lon.14. close all files.15. Stop

DATA ANALYSIS

Page 17: uploaded

GPS data (GPGGA) was successfully received and extracted with the help of developed algorithm. Data was observed as follows:

a. Using C language algorithm (mentioned in the previous section)

HDOP = 50

HDOP = 7.7

Page 18: uploaded

b. Using Hyperterminal

DATA COLLECTION

Obtained GPGGA sentences and extracted information were collected and recorded in different excel files. Almost 500 readings were collected and extracted during the process for proper analysis.

1. The f_all.xls- Contains information about all the relevant parameters i.e. Time, Latitude, Longitude, Direction, No. of Satellite & HDOP value.

2. The f_time.xls- contains information about time data in a column.

Page 19: uploaded

3. The f_lat.xls – contains information about the latitude data.4. The f_lon.xls – contains information about the longitude data.5. The f_hdop.xls – contains information about the Horizontal Dilution of

Precision (HDOP).6. The f_latlon.xls – contains information about the latitude and longitude

simultaneously in consecutive rows.

DATA ANALYSIS & GRAPHICAL REPRESENTATION

With the help of excel files obtained after extraction of GPS data, we plotted the following graphs:

Latitude v/s Longitude Graph(taken on 18th June 2010)

1834.588

1834.59

1834.592

1834.594

1834.596

1834.598

1834.6

1834.602

1834.604

1834.6067353.0227353.0247353.0267353.028

7353.037353.0327353.0347353.0367353.038

Series2

Latitude v/s Longitude Graph (Taken on 28th June 2010)

1834.85 1834.852 1834.854 1834.856 1834.858 1834.867352.799

7352.7995

7352.8

7352.8005

7352.801

7352.8015

7352.802

7352.8025

7352.803

Series2

Page 20: uploaded

APPLICATIONS AND FUTURE SCOPE

The GPS system is widely used in various applications. The most important advantage of this system is that it can be used intervene potentially lethal environment. Thus it can be used in several Unmanned Ground Vehicles.

Since it is immune to jamming and deception, it can be used for reconnaissance of enemy territory and other hostile environments. Other potentially lethal situations are:

- Warfare

- Landslides

- Earthquakes

- Mine Collapse

- Floods

- Fire

This system is an aid to any vehicle which moves in more than one axis, vehicles moving in air, sea, under sea and even on land.

This system may find a broad range of future applications in different fields like:

- Aeronautics and its developments- Defence and Military applications- Marine Forces- Disaster management- Security

Page 21: uploaded

MANIPULATOR ARM MECHANISM

INTRODUCTION TO ALLIGATOR ARM

Serial16Servo Controllerchip isideal formaking autonomoussystems which runoverHobby servomotors. Thesoftwarehelpstodevelop thecomplexsequencesinrealtimeonthehardwarelikeroboticarms, walkers,bipeds andanyotherservocontrolledsystem.Thischipprovidesasynchronousserial(UART) connectivity.Independentspeed andrange settings foreachservowhiledelivering0.5-microsecondresolutionfor smooth outputacrossitsbroadoutputpulse range of200through 2400microseconds.VisualSo f twa re forPCisavailabletomakethingsveryeasy.

Features

•Control16hobbyservosfromPCandMicrocontroller•UARTinterface•Independentrangesettingforeachservo•0.5uSresolution•50Hzupdaterate•28PinDIPSizechip•Outputpulserangeof200through2400microseconds•Simplehardwarerequiredtomakeitfunctional•Easytousesoftware•Servosequencerwithspeed,delay,gotoandmanyother

Features•Homeandneutralpositionsetting• VariableBaudrate—Workson9600bps,19200bps, 38400bps,57600bpsor115200bps•Auto-detectionofBaudrate

Thebasicideaofthischipistocontrolupto16servos foranyoftheprojectwhichusesservos. Itworksonserialcommands andsoonceanycommandissentthroughUARTitholdsormoves theservos tocommandpositionuntilthenextcommand isreceived.Thissaves alotof coding time atm i c r o c o n t r o l l e r orP C e n d . Additionallythet i m e r s and I /Opins ofmicrocontrollerarefreetodosomeotherworka n d interfacewith a d d i t i o n a l hardwareandsensors. ThehardwareisverysimpleandcanevenbebuilteasilyonBreadboardorGeneralPurposePCBinminutes.

Page 22: uploaded
Page 23: uploaded

SERVO CONTROLLER MECHANISM

HardwareSetup

HardwarerequiresfollowingcomponentswiththeSerialServoControllerChip

• 1- 5VregulatorIregulatedpower supplyI+5V&GNDlinesfromMCUBoard• 1- 16MHzcrystal• 2- 22pfceramic capacitors• 1-LED• 1-100flFwattResistor• 2- 40X1Maleheaderstrips

AdditionalhardwarerequiredtoconnectwithPC

• PC-MCUSeriallinkorUSB-UARTlink

ThecircuitcanbeassembledonBreadboard,Generalpurpose PCBorSpecialPurposePCBas perrequirements.WeusethesamechiponourUSB16Servocontroller.Ittakestheserial commands fromPCthroughUSB-UARTBridge.

Pinconnections

PinNumber

Connection

Description1 RESET2 RXD ConnectstoTXofMCUIPCUART3 TXD ConnectstoRXofMCUIPCUART4 NC5 LED StatusLED,glowswhenready6 Servo7 Pulseoutput forServo#77 VCC +5Vinput8 GND Ground9 Crystal 1 Pin1of16MHzCrystal10 Crystal 2 Pin2of16MHzCrystal11 Servo16 Pulseoutput forServo#1612 Servo15 Pulseoutput forServo#1513 Servo14 Pulseoutput forServo#1414 Servo13 Pulseoutput forServo#1315 Servo12 Pulseoutput forServo#1216 Servo11 Pulseoutput forServo#1117 Servo10 Pulseoutput forServo#10

Page 24: uploaded

18 Servo9 Pulseoutput forServo#919 Servo8 Pulseoutput forServo#820 VCC +5Vinput21 VCC +5Vinput22 GND Ground23 Servo6 Pulseoutput forServo#624 Servo5 Pulseoutput forServo#525 Servo4 Pulseoutput forServo#426 Servo3 Pulseoutput forServo#327 Servo2 Pulseoutput forServo#228 Servo1 Pulseoutput forServo#1

SERVO COMMANDS

BasicServocommandstructure:

Startbyte(S) Command + Databyte(C)

ServoByte(Servo)

DataByte1 (DB1)

DataByte2 (DB2)

Startbyteisalways0XAA(Decimal170). Allotherbytesmustbelessthan0X80(Decimal128). Servobytewillselectservonumber.0X00(Servo1)to0X0F

(Servo16). Databyte2isnotusedinsomeofthecommandsandifnotused donotsendany

extracharacters. Shortnamesarewritteninbracketinaboveline.

Page 25: uploaded

Servocommands:

Action Start Byte (S)

Command+Databyte(C)

Servo Byte (Servo)

DataByte1 (DB1)

DataByte2 (DB2)

Comments

7bitServoPosition

OxAA OxO9 OxOOtoOxOf

Data&Ox7F

None S

etServoPosition(17

uSResolution)Data

=DB1

2OO+(17*Data)uSPulse

MaxData=OX7F(Decimal127)

8bitServoPosition

Option 1

OxAA OX2OI (Data>>7)

(OX2OorOX21)

OxOOtoOxOf

Data&Ox7F

None SetServoPosition

(8.5uS Resolution)

D

ata=((C&OXO1)<<7)+

DB1

2OO+(8.5*data)uSPulse

MaxData=OXFF(Decimal

13bitPosition

Option 1

OxAA OX4OI (Data>>7)

OxOOtoOxOf

Data&Ox7F

None S

etServoPosition(O.5

uSResolution)Data=

((C&3F)<<7) +DB1

2OO+(O.5*data)uSPulse

MaxData=OX3FFF(Decimal16383)

Page 26: uploaded

Servo Speed Setti

OxAA OXO8 OxOOtoOxOf

Speed&Ox7f

None Speed=DB1HighestSpeed—OLowestSpeed—127MaxSpeed=OX7F(Decimal127)

SetNeutralPosition

OxAA OXO4 OxOOtoOxOf

Data&Ox7F

(Data>>7)

Data=((DB2&OX3F)<<7)+DB1

NeutralPosition=2OO+(O.5*data)uSS

etHomePosition

OxAA OXO5 OxOOtoOxOf

Data&Ox7F

(Data>>7)

Data=((DB2&OX3F)<<7)+DB1

HomePosition= 2OO+(O.5*data)uS

SetMaxPosition

OxAA OXO6 OxOOtoOxOf

Data&Ox7F

(Data>>7)

Data=((DB2&OX3F)<<7)+DB1

MaxPosition= 2OO+(O.5*data)uS

SetMinPosition

OxAA OXO7 OxOOtoOxOf

Data&Ox7F

(Data>>7)

Data=((DB2&OX3F)<<7)+DB1

MinPosition= 2OO+(O.5*data)uS

ResponsesfromServocontrollerchip: ‘a’:Command Accepted andActionwillStartaccording tothe

command ‘e’:Errorincommand ‘d’:DataError ‘s’:ErrorinServoNumber ‘m’:Minimumvaluegreat

APPLICATIONSManipulator arm acts as an excellent prototype to work on various Robots and unmanned systems. It is used as a model to develop, interpret and modify our designed systems as per the required standards and output levels.

DRDO R&DE (Engrs), Pune has used similar arm in their recent developments like DAKSH (ROV), Takshak etc. The arm that has been used in DAKSH has 6 degrees of freedom for its movement in almost all possible directions.Thearm is widely used in artificially intelligent and robotic systems. Some of its applications are listed below:

1. Robotic arms2. Walkers3. Bipeds4. Military purpose Robots5. Humanoid6. Industrial Robots7. Unmanned Vehicles.

Page 27: uploaded

DIGITAL COMPASS

INTRODUCTION TO DIGITAL COMPASS (HMR3000)

The Honeywell HMR3000 is a digital compass module thatprovides heading, pitch, and roll outputs for navigation. Thethree of Honeywell’s magneto-resistive sensors are oriented inorthogonal directions plus a fluid tilt sensor is employed tomeasure the vector components of the earth’s magnetic fieldand a gravitational reference. These solid-state sensors createa strap down compass that is both rugged and reliable. The dataoutput is serial full-duplex RS-232 or half-duplex RS-485 with1200 to 19,200 data rates.

The HMR3000 uses Honeywell magnetic sensors with proven MR technology and a two-axis tilt sensor to bring you theheading information. This electronically gimballed compass gives accurate heading even when the compass is tilted up to45 degrees. This low power, small device is housed in a non-magnetic metallic enclosure that can be easily installed onany platform.

The HMR3000 allows the user to configure compass output to include any combination of six NMEA standard messagesand to change measurement parameters for the magnetometer to suit the application. The sophisticated auto compasscalibration routines will correct for the hard-iron magnetic effects of the platform. The wide dynamic range of themagnetometer (±1 G or 100 μT) allows the HMR3000 to be useful in applications with moderate local magnetic fields.

SPECIFICATIONS OF HMR3000

Page 28: uploaded

PIN CONFIGURATION

HMR3000 Connection Diagram—Computer RS-232 to HMR3000Unregulated Supply

Page 29: uploaded

Regulated Supply

NMEA SENTENCES

HMR3000 Serial Data Communication

The HMR3000 serial communications are governed by a simple, asynchronous, ASCII protocol modelled after the NMEA 0183 standard. Either an RS-232 or an RS-485 electrical interface can be used. ASCII characters are transmitted and received using 1 start bit, 8 data bits (LSB first), no parity (MSB always 0), and 1 stop bit; 10 bits total per character. Baud rate can be any one of 1200, 2400, 4800, 9600, 19200, 38400.

Query for NMEA Sentences

The three NMEA standard sentences (HDG, HDT, and XDR) and three proprietary (HPR, RCD, and CCD) messages can be queried as follows.

The three standard query messages accepted are:

$TNHCQ,HDG*27<cr><lf>$TNHCQ,HDT*34<cr><lf>$TNHCQ,XDR*22<cr><lf>

The three proprietary query messages accepted are:

$PTNT,HPR*78<cr><lf>$PTNT,RCD*67<cr><lf>$PTNT,CCD*76<cr><lf>

Page 30: uploaded

Format of NMEA Sentence Outputs

HDG Heading, Deviation, & Variation

$HCHDG,x.x,x.x,a,x.x,a*hh<cr><lf>

If either the deviation or variation parameter has not been programmed, the

corresponding field will be null (per NMEA0183 version 2.1, section 5.2.2.3).

Parameters have not been programmed if their absolute values are greater than

3200mils or 180.0 degrees. Positive deviation and variation is indicated by a = E;

negative values by a = W. Heading field willbe null if it cannot be calculated (see

HPR proprietary sentence). NMEA requires that units for heading measurement be

degrees.

Eg. In Degree Mode

$HCHDG,85.8,0.0,E,0.0,E*77

$HCHDG,271.2,0.0,E,0.0,E*44

$HCHDG,271.1,10.7,E,12.2,W*52

$HCHDG,0.0,10.7,E,12.2,W*57

Mil Mode is not allowed by NMEA standard

HDT Heading, True

$HCHDT,x.x,T*hh<cr><lf>

The heading field will be null if variation has not been programmed (see HDG and

Definitions), or if heading cannot becalculated. If deviation has not

beenprogrammed, it is assumed to be zero, otherwise it is added to measured

heading and variation to express true heading of compass board.

Eg. In Degree Mode

$HCHDT,86.2,T*15

$HCHDT,271.1,T*2C

$HCHDT,0.9,T*20

Mil Mode not allowed by NMEA standard

XDR Transducer Measurements

$HCXDR,A,x.x,D,PITCH,A,x.x,D,ROLL,G,x.x,,MAGX,G,x.x,,MAGY,G,x.x,,MAGZ,G,x

.x,,MAGT*hh<cr><lf>

Page 31: uploaded

Each of the six possible measurements - pitch; roll; and magnetic x, y, z, and total—

can be individually included in orexcluded from the message (see “XDR has …”

parameters). See NMEA 0183 for a detailed description of the “Type-Data-Units-ID”

field encoding. The “Data” field of an included measurement will be null if its contents

cannot be determined dueto saturated measurements. Only units of degrees are

allowed by NMEA for pitch and roll measurements.

Magnetic measurements are transmitted in engineering units (milli Gauss)

determined by a tuneable conversion factor.MAGX aligns with the compass board

north-south axis, and MAGZ is perpendicular to the plane of the compass board.

MAGT is the total magnetic field strength determined by calculating the square root

of the sum of the squares of MAGX,MAGY, and MAGZ.

Eg. In Degree Mode

$HCXDR,A,-0.8,D,PITCH,A,0.8,D,ROLL,G,122,,MAGX,G,1838,,MAGY,G,-

667,,MAGZ,G,1959,,MAGT*11

Applications

Applications include: Compassing & Navigation, DeadReckoning Backup to GPS Systems, Marine Navigation,Antenna Positioning, and Land Surveying.

FEATURES & BENEFITS

High Accuracy, <0.5° with 0.1° Resolution Wide Tilt Range of ±40° Up to 20 Updates per Second NMEA Standard Sentence Outputs Hard Iron Calibration Routine RS-232 or RS-485 Serial Data Interfaces PCB or Aluminium Enclosure Options 6-15 volt DC Unregulated Power Supply Interface

Page 32: uploaded

REFERENCES

1. Data Communications by William L. Schweber.2. www.wikipedia.com 3. Robot (WiBot) manual by Thinklabs.4. Data Communication by Fourazan.5. ATmel ATMEGA 8 Microcontroller Datasheet.6. www.serialservo.com 7. www.robokits.com 8. www.thinklabs.com


Recommended