Sie sind auf Seite 1von 34

SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

ELECTRICAL SPECIALISATION COURSE O-148


PROJECT REPORT ON

DETERMINATION OF LOOK ANGLE FOR SATELLITE


TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

Guided By Syndicate
Lt Cdr Nikhil Jain Lt A Kalgan
Lt DT Poovaiah

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CERTIFICATE

This is to certify that the project report titled “DETERMINATION OF


LOOK ANGLE FOR SATELLITE TRACKING BY ROLL & PITCH
DETERMINATION USING ADXL” which is being submitted by Lt A Kalgan
and Lt DT Poovaiah is a record of students own work carried out by them
under my guidance and supervision in fulfillment of the requirements of
Electrical Specialisation Course.

(Nikhil Jain)
Lt Cdr
Project Guide

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

ACKNOWLEDGEMENT

We would like to extend our gratitude to our guide Lt Cdr Nikhil Jain, Lt Cdr S
Agarwal and Lt Cdr KN Bhat in helping us to complete this project. We would
also like to thank the FTP staff, for their unending support and also for
providing a conducive atmosphere to work in

(A Kalgan) (DT Poovaiah)


Lieutenant Lieutenant

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

AIM & SCOPE OF THE PROJECT

1. The aim of project is to generate look angle for satellite tracking for use
with ship borne antennas. This can be accomplished by using a digital
IC namely ADXL 202 E as an accelerometer to sense roll and pitch and
using this data to compute necessary actuation signals given to
elevation and training motors to maintain the ship borne antenna in line
of sight with satellite.

2. The scope of the project includes developing an accelerometer for


sensing roll and pitch, a visual basic code to determine look angle for
the satellite based on various inputs.

3. The future scope of project involves development of servo system using


stepper motors to move the antenna in accordance with the look angle.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CONTENTS

1. INTRODUCTION

2. WORK FLOW ISSUES AND CONCERNS

3. DATA ACQUISITION

4. GLOBAL POSITIONING SYSTEM

5. LOOK ANGLE

6. WORK UNDERTAKEN

7. FUTURE SCOPE

8. APPENDIX

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 1

INTRODUCTION

1.1 Brief Introduction to Accelerometer

An accelerometer is a device for measuring acceleration. An


accelerometer inherently measures its own motion.

Accelerometers are used along with gyroscopes in inertial guidance


systems, as well as in many other scientific and engineering systems. An
accelerometer is an instrument for measuring acceleration, detecting and
measuring vibrations, or for measuring acceleration due to gravity
(inclination). Accelerometers can be used to measure vibration on cars,
machines, buildings, process control systems and safety installations. They
can also be used to measure seismic activity, inclination, machine vibration,
dynamic distance and speed with or without the influence of gravity.

Accelerometers are perhaps the simplest MEMS device possible,


sometimes consisting of little more than a suspended cantilever beam or
proof mass (also known as seismic mass) with some type of deflection
sensing and circuitry. MEMS Accelerometers are available in a wide variety of
ranges up to thousands of g's. Single axis, dual axis, and three axis models
are available.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

1.2 Basic block diagram of Accelerometer

1.3 Brief introduction to our project

The aim of our project is determination of Look angle for ship borne
satellite tracking antenna. The parameters required for this are Roll and Pitch
of the ship, Satellite’s longitude and the latitude and longitude of the ship.

We are using ADXL 202 E, a dual axis accelerometer for determination


of roll-pitch data and GPS receiver for latitude and longitude data.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

A Satellite tracking antenna system used onboard ship as a part of


maritime communication satellite system has a directional Micro strip patch
array antenna which is continually trained in the direction of satellite so as to
receive signals there from and transmit there to in spite of the continuous
change in platform in form of roll, pitch and turning movement of the ship as it
travels along its course, even in high seas.

The system would broadly encompass the following:

(a) Acquisition of roll and pitch data.

(b) Acquisition of ships own position data, which would include the
latitude, longitude and the ship’s heading.

(c) Computation of the satellite look angles, after taking into


consideration the ship’s motion.

(d) Design of a control system for satellite auto tracking and antenna
platform stabilization. (The control system part of the design is not
included in the scope of this project.)

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

1.4 Block diagram of our project

ADXL
202 PCB

CONTROL
SYSTEM FOR
ELEVATION
COMPUTER

GPS CONTROL
SYSTEM FOR
TRAINING

1.5 Hardware deployed

1. ADXL 202AE Accelerometer


2. 8052 Microcontroller
3. LM 7805 Voltage Regulator
4. PC
5. MAX232 Driver

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 2

WORK FLOW ISSUES AND CONCERNS

The entire development of the system consists of the following steps

2.1 Choosing a programming language

We had to choose a generic language for the development of the GUI


and the software which can take in various values of the five variables. The
programming tools which we considered were Visual Basic, MATLAB and VC
++. We have worked in VB 6.0 owing to its versatility and flexibility.

2.2 Acquisition of the hardware

This was the field which was of the maximum concern and it was the
field where we faced the maximum problems. Firstly the ADXL IC was not
readily available in the market since it was not a commonly used one. It is a
dual axis accelerometer and is used only for specific purposes.

Next stage was the difficulty in mounting the ADXL202E on a PCB, as it


was available in the LCC package. So the ADXL202E had to be micro
soldered on to a PCB.

And above all the remote nature of this place made it little difficult to
acquire other components in time.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

2.3 PCB Layout and testing the programme

This by far was the area in which we faced the biggest hurdles in our
project. Since the main component of our project, the dual axis accelerometer
ADXL202E was not available with us till the later stages of our project, we
faced difficulties in checking the correctness of the codes that we had written
and in designing the PCB layout for our project.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 3

DATA ACQUISITION

3.1 Acceleration data acquisition using ADXL202E

The heart of this project is ADXL 202 chip, which is a low cost, low
power, complete two axis accelerometer with the measurement range of +/-
2g. The ADXL 202 can measure both dynamic acceleration (e.g. vibrations)
and static acceleration (e.g. gravity)

The ADXL 202 is a complete dual axis acceleration measurement


system on a single monolithic IC. It contains a polysilicon surface micro
machined sensor and signal conditioning circuitry to implement open loop
acceleration measurement architecture. For each axis an output circuit
converts analog signal to a duty cycle microprocessor. The ADXL 202 is
capable of measuring both negative and positive acceleration to level of
+/-2g. The accelerometer measures static acceleration forces such as gravity
allowing it to be used as a acceleration sensor.

The actual structure of the sensor consists of 46 unit cells and a


common beam. The differential capacitor sensor consists of independent
fixed plates and central plate attached to the main beam that moves in
response to an applied acceleration. The two capacitors are series
connected, forming a capacitive divider with a common movable central plate.
When at rest, the values of the two capacitors are the same and therefore,

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

the voltage output at their electrical centre is zero. When acceleration is


applied, the common central plate or “beam” moves closer to one of the fixed
plates while moving farther from the other. This creates a mismatch in the two
capacitances resulting in an output signal at the central plate. The output
amplitude of the signal varies directly with the amount of acceleration
experienced by the sensor.

A simplified diagram of ADXL sensor at rest

3.2 Principle of operation

The above figure is a simplified view of the ADXL 202’s acceleration


sensor at rest. The actual structure of the sensor consists of 46 unit cells and

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

a common beam. The differential capacitor sensor consists of independent


fixed plates and central plates attached to the main beam that moves in
response to an applied acceleration. The two capacitors are series
connected, forming a capacitive divider with a common movable central plate.
When at rest, the values of the two capacitors are the same, and therefore,
the voltage output at their electrical centre is zero.

ADXL sensor responding to an externally applied acceleration.

Figure shows the sensor responding to an applied acceleration. When


this occurs, the common central plate or “beam” moves closer to one of the
fixed plates. This creates a mismatch in the two capacitances, resulting in an
output signal at the central plate. The output amplitude of the signal varies
directly with the amount of acceleration experienced by the sensor.

The output thus obtained is in PWM form, this form is converted in RS


232 asynchronous format by the microcontroller. The RS 232 driver/receiver
raises the voltage level to +/- 10 volts, and this is sent to the serial port of the

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

computer to be logged into it for further utilization in various applications.

The roll pitch data in RS 232 format is interfaced with the PC through a
COM port using the following logic. We use a baud rate of 9600, 8 bit data
with no parity bit here even though the freedom of resetting all the data is also
provided in the software foreseeing future enhancements.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 4

GLOBAL POSITIONING SYSTEM

The parameters required for the computation of satellite look angle are
the latitude, longitude and the ship’s heading. These parameters can be
made available by using Global Positioning System (GPS).

4.1 Theory
The global positioning system is an earth orbiting satellite based
navigation system. GPS is an operational system, providing users world wide
with twenty four hour a day precise operation in three dimensions and precise
time traceable to global time standards. GPS is operated by the United States
under the direction of department of defense (DoD) and was designed for and
remains under control of US military. GPS applications have expanded to
include surveying, space navigation, and automatic vehicle monitoring,
mapping and geographic information.

The global positioning system consists of three segments

1. The Space segment


2. The Control segment
3. The User segment

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

4.2 Working of the Global Positioning System

There are 24 operational satellites. They orbit the earth approximately


every 12 hours. They are positioned in six orbital planes. Therefore there will
usually be something in the order of 6 to eight satellites visible above the
horizon any point in the world and at any time of the day.

Each satellite emits information relating to its position, relative to earth


and timing information. This timing information is derived from extremely
accurate atomic clocks that are synchronized to all other satellite clocks and
to the ground control stations.

GPS receivers are equipped with quartz clocks that are synchronized to
GPS time via the data transmitted from the constellation. And timing is the
basis of the location computation. The satellites radiate the coded signals that
are received by the GPS users. The computation in its simplest form is space
based triangulation.

4.3 Producing Locations

The determination of position is done using following method:


A signal is transmitted from a satellite containing the time of departure of the
signal. The signal is received by the GPS receiver and the time of arrival is
registered.

We can determine the distance from our receiver to a particular


satellite. This allows the construction of a hemisphere, whose centre is

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

satellite and whose radius is calculated distance from a particular satellite to


our receiver.

When this process is repeated for another satellite that is in view, then
the two hemispheres will cut through each other. Repeating this process
again with a third satellite and the intersection of three hemispheres will form
a point, which is where our receiver is located. The accepted rule for most
receivers is that it must continuously track a minimum of four satellites to
produce a location that contains latitude, longitude and altitude.

Here using the same logic that we used for receiving the roll pitch data
can be used but due to non availability of the bit sequence being used we are
not directly being able to receive the data in VB programme viz. satellite
position, ships latitude and longitude. To overcome this data is being fed in
manually.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 5

LOOK ANGLE

The look angles are the angles (coordinates) to which the earth station
antenna must be pointed to communicate with the geosynchronous satellite.
These angles are the azimuth (A) and the elevation (E). These are calculated
on the basis of knowledge of latitude and relative longitude both in degrees of
the earth station, in fact theta is the absolute value of difference between the
geostationary satellite longitude and the earth station. Azimuth is usually
defined as the angle by which the antenna, pointing at the horizon must be
rotated clockwise around its vertical axis, from the geographical north, to
bring the antenna bore sight into the vertical plane containing the satellite
direction. Value of the azimuth angle is between 0 and 360 degrees. The
azimuth angle is calculated based on the following equation:

Cos θ
AZ = a tan
Sin Φ

Where,
Φ = earth station longitude.
θ = absolute value of the difference between the geostationary
satellite longitude and the earth station longitude.
Determination of Azimuth angle is based on the location of the satellite
and the earth station.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

The elevation angle is defined as the angle by which the antenna bore
sight should be rotated in the vertical plane that contains the satellite direction
from the horizontal to the satellite direction. The elevation angle is calculated
using the equation below:

El = cos θ * cos Φ - 0.15


√ 1 – ( cos θ * cos Φ )2

With any initial transverse angle T and elevation angle E, if the hull is pitched
through an angle P and then rolled through an angle R, the initial x
component is cosT.cosE; the initial y component is sinT.cosE; and the initial z
component is sinE.
From which the new transverse angle T1 and the new elevation angle
E1 required to maintain the load position undisturbed after applying hull pitch
and roll angles can be solved as:

cosR.sinT.cosE - sinR(cosE.sinP.cosT + cosP.sinE)


T1 = a tan
cosP.cosT.cosE – sinP.SinE

And,

E1 = a sin[ sinR.cosE.sinT + cosR(sinP.cosT.cosE + cosP.sinE)]

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 6

PROGRESS OF THE PROJECT GROUP

The project group has undertaken the following for completion of project

1. Understanding the circuit and construction of PCB.

The primary requirement for the project was to build a circuit for extracting
accelerometer output alon the two axes and give it in a suitable format to be
able to be processed by the PC. We went about designing the circuit with a
view of the following

(a) Suitable power supply


We require +5V dc for operation of ADXL, microcontroller and RS 232 driver.
Thus we chose LM 7805 as a voltage regulator using our past experience
with the component during submission of our project in part completion of
BTECH degree. The voltage regulator requires a step down supply of 6V/ 12
V DC which can be easily be supplied using an adapter. The detailed
configuration and working of the voltage regulator is attached in the appendix.

(b) Accelerometer
There are various types of accelerometers which are available in the market.
However for our purpose we required a dual axis accelerometer which should
be compact as well as cost effective. Keeping the above considerations in
mind we chose ADXL 202E. However due to the remote nature of this place
the IC was not readily available. Owing to the absence of IC during the major

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

part of this phase the group concentrated on using a Pulse Width Modulation
generator to generate a duty cycle modulated output resembling the output
given by ADXL. The group worked with PWM generator with limited success
however on procurement of ADXL it has been groups endeavour to
incorporate the IC and complete the project as mentioned in the scope.

(c) Microcontroller
The group chose AT89S52 which is a low-power, high-performance CMOS 8-
bit microcontroller with 8K bytes of in-system programmable Flash memory.
The on-chip Flash allows the program memory to be reprogrammed in-
system or by a conventional nonvolatile memory programmer. C language
was chosen to program the microcontroller due to experience of the project
member with the language. The code developed is mentioned in the
appendix.

(d) MAX 232


Serial RS-232 communication works with voltages which are not compatible
with normal computer logic voltages. On the other hand, classic TTL
computer logic operates between 0V ... +5V (roughly 0V ... +0.8V for low, +2V
... +5V for high). So, the maximum RS-232 signal levels are far too high for
computer logic electronics, and the negative RS-232 voltage for high can't be
understood at all by computer logic. Therefore, to receive serial data from an
RS-232 interface the voltage has to be reduced, and the low and high voltage
level inverted. In the other direction the low logic voltage has to be increased
and a negative voltage has to be generated.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

RS-232 TTL Logic


-----------------------------------------------
-15V ... -3V <-> +2V ... +5V <-> high
+3V ... +15V <-> 0V ... +0.8V <-> low

All this can be done with conventional analog electronics, e.g. a particular
power supply and a couple of transistors .The necessary signal level
conversion with an integrated circuit (IC) from the MAX232 family It should be
noted that the MAX232 is just a driver/receiver. It does not generate the
necessary RS-232 sequence of marks and spaces with the right timing, it
does not decode the RS-232 signal, it does not provide a serial/parallel
conversion. All it does is to convert signal voltage levels. Generating serial
data with the right timing and decoding serial data has to be done by
additional circuitary.

2. Mounting of the components on the PCB.

The mounting of the components on to the PCB was major bottleneck for the
project group since the accelerometer is available in LCC package and
dimensions of the IC are extremely small and requires micro soldering setup.
The group generated the required PCB layout using available software. The
group has however taken external help required for soldering of ADXL to
PCB. The group has been successful in designing a PCB as required for the
achievement of the scope of the project.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

3. Loading of the software

The group has developed Visual Basic code for calculation of the look angle
and the microcontroller code for reading the ADXL output and interfacing with
PC.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

CHAPTER 7

FUTURE SCOPE

The future scope of project involves development of servo system using


stepper motors to move the antenna in accordance with the look angle.

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

APPENDIX A

MICROCONTROLLER CODE

#include <at89x52.H>
#include <stdio.h>

#define LOW 0
#define HIGH 1

#define XOUT P3_3


#define YOUT P3_2
#define K 720

unsigned int T_1,T_2,T1X,T1Y,T1YStart,T1YEnd,ZXCal,ZYCal,ZXActual,ZYActual,T2Cal;


unsigned char XAccel,YAccel;
unsigned char XSign,YSign;

char command;

time1ms()
{
unsigned int i;
for (i = 0; i<125; i++) // the value is (1000 * n us)/8
;
}

delay_ms(int n)
{
unsigned int i;
for (i=0; i< n ; i++)

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

time1ms();
}
void myputchar(char c)
{
while(!TI);
TI=0;
SBUF = c;
}

putnum(unsigned char n)
{
unsigned char k;

char s[4];
s[0] = n/10+'0';
s[1] = n%10+'0';

for(k=0;k<2;k++)
myputchar(s[k]);
}

void ReadAccel()
{
unsigned int T2_X,T2_Y;

TR0 = 0;
TH0 = 0;
TL0 = 0;

while(XOUT);
while(!XOUT);

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

TR0 = 1;
while(XOUT);
T1X = TH0;
T1X <<= 8;
T1X |= TL0;
while(!XOUT);
TR0 = 0;
T2_X = TH0;
T2_X <<= 8;
T2_X |= TL0;

TR0 = 0;
TH0 = 0;
TL0 = 0;

while(YOUT);
while(!YOUT);
TR0 = 1;
while(YOUT);
T1Y = TH0;
T1Y <<= 8;
T1Y |= TL0;
while(!YOUT);
TR0 = 0;
T2_Y = TH0;
T2_Y <<= 8;
T2_Y |= TL0;

T_2 = (T2_X+T2_Y)/2;

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

void FindZActual()
{
ZXActual = ((unsigned long)ZXCal * (unsigned long)T_2) / T2Cal;
ZYActual = ((unsigned long)ZYCal * (unsigned long)T_2) / T2Cal;
}

void CalculateAccel()
{
if(T1X > ZXActual){
XAccel = ((unsigned long)K*(unsigned long)(T1X-ZXActual))/T_2;
XSign = '+';
}
else{
XAccel = ((unsigned long)K*(unsigned long)(ZXActual-T1X))/T_2;
XSign = '-';
}

if(T1Y > ZYActual){


YAccel = ((unsigned long)K*(unsigned long)(T1Y-ZYActual))/T_2;
YSign = '+';
}
else{
YAccel = ((unsigned long)K*(unsigned long)(ZYActual-T1Y))/T_2;
YSign = '-';
}
}

void CheckCal()
{
unsigned char i;
unsigned long ZX,ZY,ZT2;

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

if(P0_7==0){

ZX=ZY=ZT2=0;
for(i=0;i<50;i++){
ReadAccel();
ZX += T1X;
ZY += T1Y;
ZT2 += T_2;
}
ZXCal = ZX/50;
ZYCal = ZY/50;
T2Cal = ZT2/50;

while(P0_7==0);
}
}

void main()
{

SCON = 0x52;
TMOD = 0x21;
TH1= 0xfd;
TR1 = 1;

delay_ms(500);

ZXCal = 3511;
ZYCal = 2708;
T2Cal = 6867;

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

while(1)
{
CheckCal();
ReadAccel();
FindZActual();
CalculateAccel();
myputchar('!');
myputchar(XSign);
putnum(XAccel);
myputchar(',');
myputchar(YSign);
putnum(YAccel);
myputchar(0x0A);
myputchar(0x0D);

delay_ms(500);

}
}

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

APPENDIX B

VISUAL BASIC CODE

Dim n
Const PI = 3.14159265
Function Arcsin(X)
Arcsin = Atn(X / Sqr(-X * X + 1))
End Function

Private Sub Command1_Click()


CLOSECOM
OPENCOM Text1.Text
DTR 0
RTS 0
End Sub

Private Sub Command3_Click()

A = Val(Text2.Text) * PI / 180 ' Satellite Longitude


b = Val(Text3.Text) * PI / 180 ' Earth station Longitude
C = Val(Text4.Text) * PI / 180 ' Earth station Latitude

If ((C > 0) And (b < A)) Then


D=A- b
T = 180 - (Atn(Tan(D) / (Sin(C)))) * 180 / PI
E = (Atn((Cos(D) * Cos(C) - 0.15) / (Sqr(1 - (Cos(D) * Cos(C)) ^ 2)))) * 180 / PI
ElseIf ((C > 0) And (b > A)) Then
D=b-A
T = 180 + (Atn(Tan(D) / (Sin(C)))) * 180 / PI

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

E = (Atn((Cos(D) * Cos(C) - 0.15) / (Sqr(1 - (Cos(D) * Cos(C)) ^ 2)))) * 180 / PI


ElseIf ((C < 0) And (b < A)) Then
D=b-A
T = (Atn(Tan(D) / (Sin(C)))) * 180 / PI
E = (Atn((Cos(D) * Cos(C) - 0.15) / (Sqr(1 - (Cos(D) * Cos(C)) ^ 2)))) * 180 / PI
ElseIf ((C < 0) And (b > A)) Then
D=A- b
T = 360 - (Atn(Tan(D) / (Sin(C)))) * 180 / PI
E = (Atn((Cos(D) * Cos(C) - 0.15) / (Sqr(1 - (Cos(D) * Cos(C)) ^ 2)))) * 180 / PI
End If

T1 = T * PI / 180
E1 = E * PI / 180
P = Val(Text6.Text) * PI / 180
R = Val(Text5.Text) * PI / 180

If ((C > 0) And (b < A)) Then


Training = 180 + (Atn((Cos(R) * Cos(E1) * Sin(T1) - Sin(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) / (Cos(P) * Cos(E1) * Cos(T1) - Sin(P) * Sin(E1)))) * 180 / PI
Elevation = Arcsin(Sin(R) * Cos(E1) * Sin(T1) + Cos(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) * 180 / PI
ElseIf ((C > 0) And (b > A)) Then
Training = 180 + (Atn((Cos(R) * Cos(E1) * Sin(T1) - Sin(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) / (Cos(P) * Cos(E1) * Cos(T1) - Sin(P) * Sin(E1)))) * 180 / PI
Elevation = Arcsin(Sin(R) * Cos(E1) * Sin(T1) + Cos(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) * 180 / PI
ElseIf ((C < 0) And (b < A)) Then
Training = (Atn((Cos(R) * Cos(E1) * Sin(T1) - Sin(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) / (Cos(P) * Cos(E1) * Cos(T1) - Sin(P) * Sin(E1)))) * 180 / PI
Elevation = Arcsin(Sin(R) * Cos(E1) * Sin(T1) + Cos(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) * 180 / PI
ElseIf ((C < 0) And (b > A)) Then

FTP/O148-SSCL229
SATELLITE TRACKING BY ROLL & PITCH DETERMINATION USING ADXL

Training = 360 + (Atn((Cos(R) * Cos(E1) * Sin(T1) - Sin(R) * (Sin(P) * Cos(E1) *


Cos(T1) + Cos(P) * Sin(E1))) / (Cos(P) * Cos(E1) * Cos(T1) - Sin(P) * Sin(E1)))) * 180 / PI
Elevation = Arcsin(Sin(R) * Cos(E1) * Sin(T1) + Cos(R) * (Sin(P) * Cos(E1) *
Cos(T1) + Cos(P) * Sin(E1))) * 180 / PI
End If
Text7.Text = Training
Text8.Text = Elevation

End Sub

Private Sub Command4_Click()


For i = 1 To Len(Text7.Text)
SENDBYTE Asc(Mid$(Text7.Text, i, 1))
Next i
End Sub

Private Sub Command5_Click()


For i = 1 To Len(Text8.Text)
SENDBYTE Asc(Mid$(Text8.Text, i, 1))
Next i
End Sub

Private Sub Form_Load()


CLOSECOM
OPENCOM "COM1:9600,N,8,1"
DTR 0
RTS 0
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Me
CLOSECOM
End Sub

FTP/O148-SSCL229

Das könnte Ihnen auch gefallen