43
FYS3240 PC-based instrumentation and microcontrollers Time & synchronization, GPS & INS Spring 2013 Lecture #11 Bekkeng, 15.4.2013

Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

FYS3240

PC-based instrumentation and microcontrollers

Time & synchronization, GPS & INS

Spring 2013 – Lecture #11

Bekkeng, 15.4.2013

Page 2: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

TIME AND TIME

SYNCHRONIZATION

Page 3: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

TAI and UTC time

• International Atomic Time (TAI) as a time scale is a weighted

average of the time kept by over 300 atomic clocks in over 60 national

laboratories worldwide.

• Coordinated Universal Time (UTC) is the primary time standard by

which the world regulates clocks and time, and is based on TAI but

with leap seconds added at irregular intervals to compensate for the

slowing of the Earth's rotation.

• Since 30 June 2012 when the last leap second was added TAI has

been exactly 35 seconds ahead of UTC. The 35 seconds results from

the initial difference of 10 seconds at the start of 1972, plus 25 leap

seconds in UTC since 1972.

• UTC is the time standard used for many internet and World Wide Web

standards. The Network Time Protocol (NTP), designed to synchronize

the clocks of computers over the Internet, encodes times using the

UTC system.

Page 4: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Synchronize PC clock to NTP server in

Windows

Note: this Internet time settings is not available when the computer

is part of a domain (such as the domain UIO.no)

Windows Time service

Page 5: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Leap seconds

• A leap second is a one-second adjustment that is occasionally

applied to UTC time in order to keep its time of day close to the

mean solar time.

o Solar time is a reckoning of the passage of time based on the Sun's

position in the sky.

• Leap seconds are necessary partly because the length of the

mean solar day is very slowly increasing, and partly because the

atomic, fixed-length SI second, when adopted, was already a little

shorter than the current value of the second of mean solar time.

• Time is now measured using stable atomic clocks, whereas

the rotation of Earth is much more variable.

Page 6: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

• GPS time is the atomic time scale implemented by the atomic clocks

in the GPS ground control stations and the GPS satellites themselves.

• Periodic corrections are performed to the on-board satellite clocks to

keep them synchronized with ground station clocks.

• GPS time is NOT corrected for leap seconds.

• GPS time is NOT equal to UTC or TAI time.

– GPS time remains at a constant offset of 19 seconds with TAI.

– As of July 2012, GPS time is 16 seconds ahead of UTC because of the

leap seconds added to UTC.

– GPS time was set to match UTC in 1980

• However, the time offset from UTC is contained in the GPS broadcast

message and is usually applied automatically by GPS receivers.

GPS time

From: http://leapsecond.com/java/gpsclock.htm

A GPS satellite clock run faster

(about 38 μs a day) due to

velocity and gravity effects

(follows the Relativity theory)

Time dilation

Page 7: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Computer clocks

• Hardware clocks

– Real Time Clock (RTC) is an integrated circuit on the motherboard.

– The RTC has a battery backup power so that it tracks the time even while the

computer is turned off.

– Based on a 32.768 kHz quartz crystal oscillator.

– Maximum resolution of 1 millisecond (1 kHz).

• Software clocks

– Maintained by the operating system, based on the RTC interrupts.

– When the system starts it sets the system time to a value based on the real-time

clock of the computer and then regularly updates the time based on interrupts

from the RTC.

• Timers/Counters

– 8253/8254 PIT (Programmable Interval Timer)

– APIC (Advanced Programmable Interrupt Controller)

– ACPI (Advanced Configuration Programmable Interrupt)

Page 8: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

High-Resolution Timers/Counters

• High Precision Event Timer (HPET) is a 64-bit up-counter with a

frequency higher than 10 MHz.

• Time Stamp Counter (TSC) is a 64-bit register in the CPU (cores)

that increment each processor clock cycle. However, can be unreliable

on a modern multicore computer due to:

– multicore computers can have different values in their time-keeping

registers.

– variability of the CPU frequency due to power management technologies or

performance technologies such as Intel Turbo Boost Technology.

• A comparator can be used to generate an interrupt.

Access the TSC (or HPET) timer using the Windows API functions

QueryPerformanceCounter (μs resolution) and QueryPerformanceFrequency

∆𝑇 = QueryPerformanceCounter(n) − QueryPerformanceCounter(n − 1)

QueryPerformanceFrequency

Page 9: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

QueryPerformance from LabVIEW

TSC example

Page 10: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Computer clock drift

• The software clock is a bad timekeeper!

• The computer clock drifts away from the correct time. At the

time of synchronization with a time server the clock is reset to

the “correct time” (but with a small offset).

• Could update the computer clock often, but a much better

solution is to read UTC time directly from a timing card (such

as NI PXI-6682) connected to GPS, IRIG-B or IEEE1588.

Software / Operating System (OS)

limits timing resolution and

accuracy! The performance is

system (hardware, OS) dependent.

Page 11: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

GLOBAL POSITIONING

SYSTEM (GPS)

Page 12: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Navigation, guidance and control

Navigation : Determination of the physical position and velocity of a body

Guidance : Determination of a trajectory for the body towards its goal

Control : Stabilization and actuation of the body along the trajectory

Navigation

Guidance

Control

UAV

Measurements

State feedback

Sensor feedback

Page 13: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Geographic (geodetic) latitude f

Angle (in the meridian plane) between

the equatorial plane and the

perpendicular to the ellipsoid at the

given point

Geographic (geodetic) longitude l

Angle (in the equatorial plane)

between the origin meridian and the

meridian plane of the point

Ellipsoidal height (altitude) h

ELLIPSOIDAL GEOGRAPHIC

COORDINATES

l

j h

Y

X

Z

Page 14: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Satellite navigation

• A satellite navigation system with global coverage is called a global navigation satellite system, or GNSS. – GPS (USA)

– GLONASS (Russia)

– GALILEO (EU): In-Orbit Validation • 30 satellites in 2019

– Compass (China): Chine + Asia-Pacific • 35 satellites in 2020

• A satellite navigation systems can give very accurate – Position

– Velocity (doppler)

– Time

Page 15: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

The Global positioning System

(GPS)

• Space segment

– 24 (28/31) satellites orbiting the Earth at an altitude of approximately

20,200 km. The orbital period is about 12 hours

– Six orbital planes with four satellites in each.

– At least four satellites are visible from any point on the ground at

any time

• Control segment

– Tracking stations around the world monitor and measure orbit and

satellite clock correction parameters. These corrections are

transmitted up to the satellites and broadcasted to the user segment.

• User segment

– GPS receivers, giving the user information about the receiver

position, velocity and time

Page 16: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Triangulation in 3D

One satellite

Two satellites

Three satellites

Page 17: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Satellite navigation

• The GPS receiver compare the time of transmission of the coded signal from the satellite with the time of arrival at the receiver

• The velocity v is the velocity of electromagnetic waves in vacuum, including a model of the average delay in the troposphere and ionosphere

• Variations in neutral density, temperature and humidity in the atmosphere, and electron density in the ionosphere, affects the velocity of electromagnetic waves, and therefore gives an error in the measured distance s

• Orbit errors and multipath (due to reflections) also contribute to the total error in the measured distance to a satellite

s = v * Δt

Index of refraction (n):

n(λ) , c = f * λ

Multipath

Page 18: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

TEC MAP

TEC = Total Electron Content

Page 19: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Satellite navigation in 3D

• The distance to at least four satellites must be known!

• Three satellites need for three distance measurements

– Measure “signal time of flight” : s = v * t

• The fourth satellites is needed in order to remove clock errors in

the receiver unit

– GPS satellites have calibrated atomic clocks, but a GPS receiver has only a

standard quartz crystal oscillator

– An error of 1 ms in the receiver clock gives a position error of

3*108 m/s * 1 ms = 300 km

• Navigation data message from each satellite: – Satellite time (when the message was transmitted) + correction

– Satellite position (when the message was transmitted), using ephemeris (orbit data)

– Almanac data (orbit data etc. for ALL satellites)

• More satellites gives better accuracy!

Page 20: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Pseudorange

The measured pseudorange 𝑃 𝑘 from a satellite k can be expressed as

(since we can assume no clock error in the satellite):

𝑃 𝑘 = (𝑋𝑘 − 𝑥)2+ (𝑌𝑘 − 𝑦)2+ (𝑍𝑘 − 𝑧)2+ 𝑑 + 𝑣 = 𝜌𝑘 + 𝑑 + 𝑣

Where d is the position error due to receiver clock error, (Xk,Yk,Zk) is

the known position of satellite k, (x,y,c) is the true receiver position, and

𝑣 is zero mean Gaussian white noise with variance σ2

Page 21: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

GPS signals

• Frequencies used in the GPS system:

– L1: 1575.42 MHz –C/A code and P(Y) code

– L2: 1227.60 MHz –P(Y) code

• Every satellites transmit a unique PRN (pseudorandom noise) code (C/A

code)

• A doppler shift is introduces (on L1 and L2) due to relative motion

between the satellite and the receiver

• The receiver must perform a correlation (search in received data) in

order to detect the PRN code from a satellite

– local PRN codes are correlated with the navigation message

Page 22: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

New GPS signals

Page 23: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

New GPS signals II

Page 24: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Differential GPS (DGPS)

• Used to increase the GPS position

accuracy (different types of DGPS)

• Reference stations on known

locations on the Earth can calculate

the position based on the C/A coded

signals, an compare with the known

location of the station. This gives the

position error from the GPS system,

and this error can be broadcasted to

all receivers

• The accuracy depends on the

distance from the reference station(s)

Page 25: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

GPS accuracy

• GPS (C/A code) : 10 – 30 meters (only L1 used)

• GPS (P(Y)-code) : 1 – 3 meters (military receivers, L1 and L2 used)

– P(Y) is an encrypted code!

• DGPS : 1 – 5 meters

• CPDGPS : < 1 cm (static), < 5 cm (kinematic)

• EGNOS : 1 – 5 meter (EGNOS is EU’s DGPS)

Note: SA-code turned off in May 2000 ! CP = carrier phase

Page 26: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Pros and Cons for GNSS

• Pros:

– All weather service, any time in the world, 24/7.

– Gives high accuracy, independent of navigation time

• Cons:

– Need external signals. The GPS system is a “line of sight” system,

and signals can be blocked (tunnels, under water, indoor, in

narrow fjords) • Also space weather effects

– Noise transmitters (jammers) can make the system useless

– The ITAR (International Traffic In Arms) regulation demands

special GPS receivers to be used for space (and military)

applications • GPS receivers have a limitation in maximum velocity and maximum altitude.

– Can not be used (alone) on platforms that require high dynamics • Position update rate for GPS receivers is typically 1 – 10 Hz, but 50 Hz versions

are also available.

• For such applications the GPS receiver must be aided with an INS (inertial

navigation system).

Page 27: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Inertial navigation

Page 28: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Atmel Xplained Inertial One sensor

board

• 3 Axis Magnetometer (compass)

• 3 Axis Accelerometer

• 3 Axis Gyroscope

• Temperature sensor

• I2C sensor interface

Page 29: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Examples of Inertial navigation

system use

Page 30: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Accelerometer • Can not separate translation from

gravitational acceleration

– Measures the sum of gravitational

acceleration (g = 9,81 m/s2) and the vehicle

translational acceleration

• For a static object (no translation) an

accelerometer can be used as a tilt

sensor.

• For a dynamic object (under

acceleration) gyros must be used to

find the relative orientation (attitude)

• Can not be used for navigation in “free

fall”, such as a satellite or a rocket

during ballistic flight g

MEMS accelerometer

Page 31: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

MEMS rate gyros

2F m v

Coriolis effect:

Page 32: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Inertial navigation system (INS) basics

• Based on Newton’s laws of motion

• From measured acceleration the position can be determined

by mathematical integration

• The initial position, velocity and orientation must be known

before the navigation starts

– Relative, not absolute, measurements from the INS

∫ Acceleration

∫ Velocity Position

Page 33: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Gimbal

• A gimbal is a pivoted support that

allows the rotation of an object about a

single axis.

• A set of two gimbals, one mounted on

the other with pivot axes orthogonal,

may be used to allow an object

mounted on the innermost gimbal to

remain immobile regardless of the

motion of its support.

Page 34: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

INS types

Inertial platform

(gimbal) Strapdown

system

Page 35: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Strapdown system –

Inertial measurement

unit (IMU)

• 6 degrees of freedom( DOF)

• 3 orthogonal accelerometers.

• 3 orthogonal rate gyros that

measure the angular velocity

about each of the three

accelerometer axes.

Page 36: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Gimbal vs. Strapdown INS system

Rotation matrix

(describing the

vehicle attitude)

Error ~ t3

Page 37: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by
Page 39: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

GPS/INS integration

• Combine data from GPS and INS by data fusion (e.g. in a

Kalman Filter )

• Does not depend on external signals (due to INS)

• Gives high accuracy, independent of navigation time (due to

GPS)

• Can be used on platforms that require high dynamics (due to

INS)

Page 40: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Multi sensor fusion

Sensor fusion gives reduced uncertainty (reduced

standard deviation)

1 for sensor B

1 for sensor A

1 for fusjon

Page 41: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Example: Image corrections from a

line imager in an airplane

• GPS and IMU used

Line imager raw data Corrected image

Page 42: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Kalman Filter equations

The Kalman Filter is the workhorse in navigation

applications and sensor fusion

Page 43: Time & synchronization, GPS & INS · Inertial navigation system (INS) basics • Based on Newton’s laws of motion • From measured acceleration the position can be determined by

Tilt-compensated compass

• Android phones and Apple iPhones have gyroscopes,

accelerometers and magnetic field sensors

• To make a tilt compensated compass: • Rotate measurements to a common phone frame

• De-rotate magnetometer readings (level the sensor) to

correct for phone orientation

The Horizontal component of the Earth’s magnetic

field is used for compassing, since it points to North