You are on page 1of 88

RFID based positioning for libraries.

DEPARTMENT OF MECHANICAL ENGINEERING

KINGS COLLEGE LONDON

MSc Project Report

RFID Based Positioning for


Libraries
By: Thaer Slaibi

Student ID: 1062841

Supervised by: Prof. Mark Miodownik

September 2011

DECLARATION

This report is su

itted to the Depart e t of Me ha i al E gi eeri g Ki gs College Lo do

as part of the

course and is solely the original work of its author, except where clearly specified otherwise. It has not been
previously submitted to this or another university.

Student:

Signature:

Date:

RFID based positioning for libraries.

Table of Contents

1. Abstract ......................................................................................................................... 3
2. Introduction ................................................................................................................... 5
3. Background & Literature Survey: ............................................................................ 12
4. Theoretical Development:......................................................................................... 27
4.1 System requirements: ............................................................................................ 27
4.2 RFID Global Standards: ......................................................................................... 30
4.2.1 The 900 MHz Class 0 UHF RFID tag specifications: ............................................. 30
4.2.2 The 13.56 MHz Class 1 standard: ............................................................................ 33
4.2.3 The 860MHz 930 MHz Class 1 RFID tags: .......................................................... 34
4.3 Design and theory:.......................................................................................................... 36
4.3.1 High accuracy positioning approach: ....................................................................... 39
4.3.2 Low accuracy positioning approach: ........................................................................ 46

5. Simulation Results & Analysis: ................................................................................ 48


1.

The number of power levels: .................................................................................... 50

2.

Scalability: ................................................................................................................. 52

3.

The number of RFID readers: .................................................................................... 54

4.

The number of RFID reference tags: ......................................................................... 56

6. Conclusion and Future Work ................................................................................... 59


7.

References: ................................................................................................................... 62

Appendices: ......................................................................................................................... 66
2

RFID based positioning for libraries.

1. Abstract
Radio Frequency identification - abbreviated RFID is a radio wave wireless
technology used to identify objects by reading date stored in an RFID tag attached
to them. This tag can be either an active or passive tag depending whether it has
its own source of power. The past decade has witnessed a vast spread of this
technology in many real life applications. The most widely spread use of these
applications is its role in supply chain management in factories, distribution
networks, Inventory, shops etc. However; it has many other applications in
access control (e.g: Oyster cards, vehicles parking etc), files archiving, animals
tracking, augmented Reality, and recently indoor positioning systems.
International RFID standards were defined earlier and helped a wider spread of
this technology.

RFID technology was introduced to indoor positioning field due to the lack of a
dedicated technology designed solely for this goal. RFID has many advantages
over other technologies used for this type of applications that made it the most
suitable for the field. Recently, many researchers have tried to provide a proof of
concept

through

experimental and

simulation

prototypes

using

different

approaches and algorithms. This project is dedicated to a special case of indoor


positioning systems; which is its use in the materials library at Kings College
London. This project is also applicable in different types of libraries and
warehouses which have much in common with the materials library. In such
applications, the system has to cover a large area that also has a relatively large
number of items which can be targeted by the positioning process.
3

RFID based positioning for libraries.

This project will first investigate the theories and concepts associated with the
application field, and then will try to introduce two positioning approaches that can
be used in different types of environments. While the high accuracy approach uses
RFID reference tags and readers to estimate an accurate position of the target
item, the low accuracy approach is designed for usage when low accuracy
requirements are defined, especially when the targeted environment consists of a
number of rooms rather than one open space. The latter is a simplified general
positioning approach designed for a specific type of libraries as defined earlier.
Matlab simulation will be used to investigate the accuracy and reliability of the
introduced high accuracy approach. The simulation results have proven feasibility
and accuracy of this approach.

This report is composed as follows: The second section is an introduction,


followed by the third one which investigates the literature review and previous
work done in the field. The fourth section investigates theoretical concepts starting
by defining requirements, then a brief description of the global RFID standards,
and finally a detailed description of the two suggested approaches. The fifth
section provides detailed description, discussion and analysis of the simulation
results, while the sixth provides a brief conclusion and suggested future plans.

RFID based positioning for libraries.

2. Introduction
RFID is an acronym for Radio Frequency Identification. Its a technology that
uses radio waves to automatically identify objects. This is achieved by storing the
required data (e.g.: an object ID number) within a microchip attached to the object
in concern, which allows a reader operating on a common wave frequency to
access this date once required [14].

AN RFID system consists of three components; the first is the RFID tag (simply a
tag or a transponder), which is a microchip that holds a small memory enough to
store a few kilobytes of identification data. There are two types of RFID tags: the
first is Active tags, while the second is Passive tags. On the first type, a battery is
attached to the tags chip to provide power to its radio communication and data
storage functions. This also allows higher range for signals but forces a shorter life
time. Tags of this type need to get their batteries replaced from time to time.
Otherwise; they might stop functioning. The second type uses the energy beamed
by the reader to reply to its request. This type of tags has the advantage of lower
cost and longer average lifetime. RFID tags are also classified to read only tags
and read/write tags. Table (1) bellow explains in details the differences between
active and passive tags [6] [8] [9] [14].

The Second component of an RFID system is the RFID reader (simply reader or
interrogator). It has the function of scanning for RFID tags upon request. This can
happen even with a situation of no line of sight as the radio waves can overcome
physical obstacles [9] [14].
5

RFID based positioning for libraries.

The reader collects data and directs it to the third component of the RFID system;
which is a central computer with software dedicated to handle this data and control
its flow through the system and transforms it into meaningful information [9].

Active RFID tags

Passive RFID tags

Power

Battery operated

No internal Pwer

Required Signal

Low

High

Long range (up to 100m)

Short range (around 5m)

Relatively large (up to 128

Small (128 b)

Strength

Communication
Range

Data Storage

Kb)

Tag cost

Relatively high (average

Low (average 0.3 - 3)

10-70)

Tag size

Various

Sticker

Fixed infrastructure

Lower (cheaper interrogators)

Higher (expensive

cost

readers)

Per asset variable

Higher (higher tag cost and

cost

battery replacement)

Areas of use

High volume assets moving

High volume assets

within a designated area

moving through a specific

Lower (tag cost)

RFID based positioning for libraries.

point

Applications

Auto manufacturing

Supply chain

Hospitals - asset tracking

High volume

Construction

manufacturing

Mining

Libraries / book stores

Laboratories

Pharmaceuticals

Remote monitoring

Passports

IT asset managemen

Electronic tolls
Item level tracking

Table 1: detailed comparison between active and passive RFID tags. [6] [8] [9] [14]
[20].
RFID is not a new technology, rather its origin dates back to World War Two.
Recently, RFID comes under the spotlight for its potential for changing the world
by replacing barcodes and providing many services that are unknown today [6].
The most common use of RFID technology is replacing traditional barcode
systems. It can do so due to the fact it has some advantages over barcode
systems. Those include the NLOS (non line of sight) property of RFID technology.
However, this is not the only advantage RFID has. Unlike traditional barcode
systems, RFID readers can read more than one tag at a time. And they can do so
under harsh conditions of heat, cold, and even chemical exposure. This due the
fact that The tag can be read through up to two inches of non metallic derbies
including paint, plastic, cloth and concrete [6].

RFID based positioning for libraries.

Other advantages of RFID systems include but not limited to: placement flexibility,
speed of reading, and higher data capacity. Not to mention the fact that some
RFID tags are re-writable [6].

Due to the above mentioned pros, RFID systems are used nowadays in a wide
span of real life applications, including supply chain management (in factories,
distribution networks, Inventory, shops etc), access control (e.g: Oyster, vehicles
access etc), files archiving, animals tracking, augmented Reality, and recently
indoor positioning systems.

During the past decade, there has been a mass trend toward more research in the
field of indoor localization and positioning [3]. This field has recently gained more
interest to support applications such as item positioning in warehouses and
libraries, patient and equipment localization in hospitals, visitors guidance through
museums and large buildings, and autonomous robots guidance [14] [5] [1].
A few technologies have been tested to support this goal. Currently, many
wireless communication technologies are available or even designed for
positioning. Among them, Global Positioning System (GPS), WLAN (IEEE 802.11),
Bluetooth (IEEE 802.15) and RFID are most commonly used ones. GPS is a
satellite-based navigation system being widely used to track moving objects in
outdoor environment with great successes. However, poor coverage of satellite
signal for indoor and building intensive environments decreases its accuracy and
makes it ineffective for solving indoor positioning problems. The IEEE 802.11
standard () gains a growing favor in positioning applications. IEEE 802.11
WLAN is widely adopted in public hotspots. Therefore, positioning system based

RFID based positioning for libraries.

on 802.11 standard requires little additional infrastructure. However, the accuracy


(about 3-30 meters) of location estimation by 802.11 is not very satisfactory for
some applications which require a high accuracy. Compared to WLAN, the range
of Bluetooth is shorter (about 1015 meters). The advantage of Bluetooth is the
small size of tags and also readers which could be easily embedded in most of
existing mobile devices () The accuracy of Bluetooth based positioning system
has reported a 3.76 meters accuracy. Similar to WLAN, low accuracy is the main
obstacle of Bluetooth based positioning system [7]. Thus, RFID might be
considered as one of the most suitable techniques for indoor positioning, in spite
of the fact that it wasnt originally designed for this purpose.

The objectives of this research project is to study the suitability of using RFID
technology for items positioning within a library; the materials library within Kings
College London. Taking in consideration a few important conditions that usually
accompany working in such environments, such as the relatively large number of
items that might be targeted in the positioning process and the wide areas within
such library. Those conditions are reflected in the system requirements related to
performance, accuracy, cost and scalability.

Many studies took place trying to develop positioning systems using RFID
technology during the past decade. However most of those studies focused on
environments with a relatively small number of items [1], [13]. Others used RFID
for positioning of moving objects like robots [2] and cars [6]. But very few studies
have investigated the possibility of using RFID for positioning within a large
building like a library or a warehouse, with too many items leading to questioning
some performance and accuracy issues. (see the next section for more details).
9

RFID based positioning for libraries.

Another great advantage that RFID technology also has is the wide adoption of
different RFID systems within libraries. The technology is already used as a base
for items management, borrowing systems, and security systems within libraries.
[14] Thus, the adoption of RFID based positioning systems might be of a relatively
lower cost comparing to other options. Such systems can use the infrastructure
already used by the available ones. This might also include the computer wired
and wireless networks for the communication between system components.

One of the research questions that are usually accompanied by positioning and
localization studies is defining accuracy requirements. Any study or design will try
to achieve perfect results with the highest possible level of accuracy. But
sometimes, tradeoffs need to be made between accuracy and performance. This
should not be seen as a shortcoming of the designed system as long as accuracy
requirements are fulfilled.

Accuracy level of a positioning system is usually determined by its purpose,


elements, and needs. A system employed indoor to locate small items within a
small room usually needs more accuracy than one works within a large area with
comparatively larger items; thats why GPS systems can give results with a few
meters error but still satisfying. Another example is a localization and positioning
system that supports an autonomous robot [2]. This system might require an
accuracy level thats high enough to help the robot exploring the environment.

Another issue that is usually investigated is the need for acceptable accuracy level
even in dynamic environments. Environments in concern like warehouses and
libraries usually operate with some objects or people moving within. This

10

RFID based positioning for libraries.

movement might affect the path of the radio waves take while trying to reach the
targeted item. Besides, it might make those waves take more than one unique
path; hence the positioning accuracy can be considerably reduced. Any designed
system shall consider this factor and enhance avoidance and reduction
mechanisms to deal with the noise caused by moving objects [10]. Hence, one can
clearly see how important is overcoming the issues like multi-path, obstacles
handling, and interference.

This study will first explore previous work on the field and investigate the current
state of art on the area. Then it will focus on designing two RFID positioning
approaches that can work in such environments. A mathematical simulation will be
built for the designed systems. Later, Matlab will be used to simulate the system
and investigate accuracy and performance issues.

11

RFID based positioning for libraries.

3. Background & Literature Survey:


Research has been exploring this field for more than a decade now. Researchers
have noticed in a relatively early stage of the RFID industry development that it
can be used for indoor positioning. This section is dedicated to show some of the
major related research papers and experiments done so far. It will also try to
explore similarities and differences between such papers goals and those of this
project.

Generally, it will be shown that a relatively large number of previous studies do


exist. But most of them have focused on the positioning of either one item or a
small number of items. Others have focused on the use of this technology to
support autonomous robot guidance, or human guidance within large buildings.
Very few studies tried to explore the positioning of a large number of items within a
relatively large indoor area. Only a small portion of those have expanded their
work into real life experiments to question performance and accuracy issues within
such environments.

SpotON (2000) is one of the earliest known RFID location system designs [13]. It
targeted creating an object tagging system that uses the radio waves strength
data, and focuses mostly on hardware and embedded systems. It used an
aggregation algorithm for three dimensional positioning. SponOn researchers have
designed a sample system to prove their approach which depends on independent
reader nodes without central control. They tried first to implement a positioning
system using commercial components, and then they described a custom
12

RFID based positioning for libraries.

hardware design based on the experiments and lessons learnt on the first part
[13]. However, a complete system has not been made available as of yet [1].
Besides, as the cost of implementing so many independent sensors is expected to
be so high; cost issues were not taken in strong consideration. No detailed
estimation for cost issues was made [13].

Later on; a major enhancement in the field has been achieved as researchers
started using a new strategy to achieve more accurate positioning. This strategy
was based on the fact that older scopes depended mainly on signal strength as
received back to a few RFID readers. Thus, a location was determined referring to
the readers closest to the targeted RFID tag. However, the systems accuracy
depended mainly on the number of readers that can sense the target tag at the
time. Using more readers separated with shorter distances meant a higher
positioning accuracy. But this was on the account of cost. RFID readers are
expensive. Their cost was a major part of such system. An urgent need to
enhance another approach that achieves a higher accuracy with lower cost has
appeared [1].

Nonetheless, research projects like LANDMARC (Location Identification based on


dynamic active RFID calibration - 2004) introduced using reference tags (or
landmarks [12]). The idea behind this concept is to install a regular uniform mesh
of reference tags with a higher intensity than the readers one. The positioning of
an RFID tag in concern is estimated comparing to the known position of a few
reference tags surrounding it. If this can be achieved using more than one reader,
a higher accuracy can be achieved, and the environment dynamics can be
accommodated [1].
13

RFID based positioning for libraries.

A probable drawback of such design was the fact that the detected K nearest
reference tags might be different from the set of tags thats really surround it to
different factors, especially in the situation of having obstacles as shown in fig. (1).
Besides, it does not clearly provide a way to deal with dynamic environments. It
supposes that estimating position using a few reference tags will yield an accurate
value, which is not always the situation. However, LANDMARC is considered one
of the main enhancements - especially accuracy wise - on which many later
researchers focused and tried to build on while trying to enhance it and overcome
its drawbacks as will be shown later.

Fig (1): Showing how an obstacle (wall) will affect the estimated position on
LANDMARC [1].

14

RFID based positioning for libraries.

Later on, more researchers tried to explore this field of study and use the
technology for different applications. One probably interesting application was the
experiment done for Samsung Electronics Ltd. by Hae Don Chon, Sibum Jun,
Heejae Jung, and Sang Won An (2004) [6]. The target of this study was to
enhance telematics and develop a safer car driving experience. The researchers
suggested that a GPS systems regular accuracy of ten to twenty meters can be
enhanced by combining it to RFID technology to allow a more detailed and
accurate navigation. Their approach was based on attaching an RFID reader to
each car enabling it to read special RFID tags attached uniformly on the roads as
shown in fig. (2)[6].

Fig. (2): The RFID based navigation system suggested by Hae Don Chon and
others (2004) [6].

No wide implementation of this approach is known. This might be due to the


numerous costs and efforts required to install special purpose tags that can
survive expected severe conditions on the roads surface like heat, cold and
pressure with a resolution thats high enough to enhance GPS accuracy. Not to
mention the high cost RFID reader that needs to be attached to each and every
car to enable it to use this system. Besides, the performance of this design can be
questioned when implemented on highways where cars can travel in high speeds.
15

RFID based positioning for libraries.

Another reason might be that the fact that GPS systems were enhanced enough
using different approaches since 2004; when this paper was published.
One research paper that might be considered more relevant to this projects scope
is the one written by Chong Wang, Hongyi Wu, and Nian-Feng Tzeng (2007) [8].
In this paper, the work focused on 3D locating an item placed within an indoor 3D
space such as a warehouse or a storage container using a number of RFID
readers and tags proposing two schemes. The first scheme is the active scheme
that uses active RFID tags to locate a reader within the space in concern. This
approach was designed to locate a person or an important object or equipment
that can be provided with an RFID reader. The second scheme is the passive
scheme, which was designed to locate one or more objects that have RFID tags
attached to them. Both schemes tried to estimate a 3D position, and both used
Nelder-Mead nonlinear optimization to minimize the error of an objective function.
Another difference between the two schemes was the number of power levels
used by the reader. Whereas only one level is needed on the first one, a few
power levels emitted from a few RFID readers are required by the latter [8].

Analysis and simulations were carried out to evaluate the two suggested schemes
that came out with acceptable accuracy levels for both schemes. The first scheme
was considered to be more accurate and has lower hardware cost. On the other
hand, the second scheme works better when locating more than one object
simultaneously. All results were obtained using Matlab and some were proven
using a relatively small scale hardware experiment. As mentioned before, both
schemes have proven an acceptable accuracy level using some approaches that
were designed to enhance accuracy [8]; but neither simulation nor experiments
16

RFID based positioning for libraries.

have targeted an environment with a relatively large number of items


simultaneously.

Another probably interesting work in the field is the one of Abdelmoula Bekkali,
Horacio Sanson and Mitsuji Matsumoto (2007) [12]. In this paper, a new
localization algorithm was introduced using only two mobile RFID readers and a
number of RFID landmarks with known positions but random distribution. The
presented algorithm is an analytical method to estimate the location of targeted tag
using multilateration with the reference tags and a probabilistic RFID map based
technique with Kalman filtering to enhance the location estimation process. This
approach used two mobile RFID readers for the process as shown in fig. (3).

This relatively new algorithm can be considered as a positive accomplishment in


the field for a few reasons. First, the estimated location is completely independent
on the two readers locations. It depends only on the landmarks. This can be
helpful on some environments where the readers can move until the tag in
concern is detected before the positioning process starts. Besides, using only two
readers in medium size areas will lead to a major decrease in the systems total
cost as readers are the most expensive component in similar systems [12].

17

RFID based positioning for libraries.

Fig. (3): Abdelmoula Bekkali, and others (2007) approach using 2 mobile RFID
readers [12].

The researchers of this project have also defined an online database of the
probability distribution function (PDF) of the location error for each landmark. This
will help correcting the location estimation of the target, instead of using RF
fingerprinting which should be defined in offline mode. Therefore, it will be less
complex and immune to the time variations of the environment. [12].

Unfortunately, this approach cannot be seen as a perfect one as it has some


disadvantages. It required a high number of RSS (received signal strength)
measure samples to achieve the expected accuracy. This can increase the
systems processing and memory requirements and also limit the scalability which
is a major question for the environments in concern.

The use of RFID technology for positioning purposes has expanded to different
areas of application. This includes position estimation and navigation of moving

18

RFID based positioning for libraries.

objects, especially autonomous robots. A good example of studies exploring this


field was written by Norie Uchitomi and others (2010) [2].

This study aimed to estimate the position of an object carrying an RFID reader.
This system can be used to support a navigation system for robots or even
humans. But unlike conventional methods, this design claims being able to
determine a higher level of accuracy using only one passive RFID tag at a time,
even if a large number of tags is attached within the area. To achieve this it
proposed estimating the position using S-CRR (Swift Communication Range
Recognition) method. This method uses the communication area model of an
RFID reader at two communication boundary angles. The communication
boundary angle is defined that it is an angle where the RFID reader is able to
begin to communicate with an RFID tag. The communication area model shows
the envelope of the communication range corresponding to the relative angle
between the RFID reader antenna and the RFID tag. In S-CRR method, the RFID
reader antenna is rotated in a horizontal plane in one observation point. At this
time, the RFID reader antenna is radiating the signal to RFID tags at regular
intervals. By this operation, the RFID reader recognizes the communication
boundary angles. The position of the RFID tag is considered to be on the
circumferential line in the communication area model of an RFID reader at the
communication boundary angle. Moreover, the system detects two communication
boundary angles. Thus, the RFID tags position is estimated as the intersection of
two circumferential lines of the communication area model of an RFID reader at
the communication boundary angle [2]. See fig. (4) that shows the S-CRR
methodology.

19

RFID based positioning for libraries.

This method has a few advantages as it only requires one reader and one tag on
its range to estimate a position accurately without moving the object itself. Only the
readers antenna has to move. This approach might be of great benefit in the field
of autonomous robots guidance but is not much suitable for the field of our study
where positioning is done on static, smaller scale objects having tags attached to
them.

Fig (4): S-CRR methodology and the concept of the communication area model
[2].

Later on, more studies have tried exploring the possibility of hybrid positioning
systems which combine RFID with other (mainly wireless) technologies to
enhance performance and/or accuracy. A good example of such research studies
is COCKTAIL (2010) [3] which is an RFID hybrid scheme for indoor positioning.
Instead of depending solely on the Radio Signal Strength Indicator (RSSI) which
might suffer problems of multi-path phenomenon and obstacles, and accuracy
options when deployed in large areas; COCKTAIL researchers suggested
combining the traditional approach with another concept, namely the dynamic of
20

RFID based positioning for libraries.

RSSI, which is the variance of signal strength caused by the target object, and is
more robust to the environmental changes [3]. The combination of the two
approaches was proposed to enhance accuracy and scalability. To achieve this,
RFID was combined with Wireless Sensor Networks (WSNs) where sensors were
separately deployed [3].

This is not the first study that tried to use dynamic of RSSI for positioning. It was
used before but sometimes suffered some communications overhead and
interference [3]. However, COCKTAIL might be the first one that combines it with
another technology.

In COCKTAIL, positioning is done in two stages. First, sensors use the dynamic of
RSSI to figure out a cluster of RFID tags as a set of candidates. Then, a traditional
RSSI based positioning approach is carried out within the cluster found in the first
stage using a methodology similar to LANDMARC explained earlier. By defining
such cluster in the first stage, its almost guaranteed that no tags which are not
close enough to the target object are included in the next step. COCKTAIL
experiments have reached a good level of accuracy up to 0.45m which
outperforms many other approaches [3].

COCKTAIL might be considered one of the successful studies combining RFID


with another technology. It has achieved a relatively remarkable level of accuracy.
However, theres no clear proof that this approach has enhanced scalability. More
experimental investigation might be needed to do so.

Another study that has tried to design a hybrid positioning system using RFID and
WSN was engaged by Zhoubing Xiong and others (2011) [4]. This study has
21

RFID based positioning for libraries.

proposed the combination of the two technologies to overcome the cons of


previous studies including obstacle handling, multi-path, and signals interference.
To achieve this, two different approaches were suggested, both are based on a
hybrid of WSN and RFID. The first approach used Extended Kalman Filter (EKF)
algorithm, while the other used a Particle Filter algorithm. The EKF provides an
efficient solution for non-linear systems by linearizing the model around the current
estimated state and assuming both the system noise and the measurement noise
Gaussian distributed. Thus, the EKF shows good performance when the system is
nearly linear and the noise distributions are Gaussian. On the other hand, PF is
able to deal with nonlinear systems and makes indirect approximation on the noise
distribution. However, it requires to compute a large amount of particles which are
used to approximate the distribution of the noise [4]. Both algorithms were
simulated and tested using Matlab. Also, both have proven that they can be
feasible in the field [4]. However, no experimental results were provided to support
this theory so far. Besides, the suggested design and simulation focused on
positioning a mobile object that carries an RFID reader, which is a bit different
from the scope of this study.

Another article that is presented as a hybridization of different technologies was


engaged by Bonifacio Castao and Maria Rodriguez-Moreno (2010) [5]. This
article was dedicated to present a system that can be used to help and monitor
people within large buildings where a sort of attendance control and global
orientation might be needed such as exhibitions halls, museums and medical
centers [5].

22

RFID based positioning for libraries.

The proposed system integrates two systems to achieve its goal. The first is a set
of typical RFID readers that are used for people detection and location. The
second is a typical ZigBee wireless communication system that directs collected
data to the central computer or server through a simple and bandwidth-efficient
system. The first task is achieved by scanning for RFID tags that are provided to
the visitors upon their arrival. This system can be used to provide visitors with
some necessary info in typical conditions, or some emergency guidance and
instructions if an emergency situation takes place using a set of monitors
attached in selected places to show instructions on how to get to a specific point
such as the emergency exit [5].

The executed experiments and simulation showed acceptable results. However,


this type of systems can be seen as a general low accuracy system. It might be
useful when a general positioning scheme is required to define a zone within
which an item or person exists rather than a specific estimated position. This
scheme might be of a real use when accuracy requirements are not high, having
an advantage of low system load and comparatively simple installation. It might
also be useful when the environment is divided to a set of blocks (e.g.: a library
that consists of a number of medium sized rooms) if the customer finds it enough
and helpful to determine the room within which the item can be found rather than
the specific position.

Recently, more researchers have tried to enhance positioning algorithms


[7],[10],[11]. The paper written by HAI-LAN DING and others (2010) [7] is an
example of such work. The researchers tried to overcome some of the main cons
associated with the traditional RFID positioning systems, especially those related
23

RFID based positioning for libraries.

to interference, especially in dynamic environments that do change frequently due


to moving objects within. Hence, the researchers proposed some enhancements
to the traditional algorithm using a Radial Basis Function Neural Network (RBFNN)
which is trained using a minimization of the Localized Minimization Error (L-GEM)
that can be seen as an estimate of the generalization capability of the RBFNN.
Besides using neural networks to overcome interference, this paper used
enhanced RSS positioning discussed earlier. A RBFNN is trained via a
minimization of the L-GEM using the training dataset. New tagged objects in the
warehouse could then be located by the RBFNN based on their tags RSS values.
The L-GEM is particularly important because the new tagged object will have
slightly different in RSS values from training samples. The generalization capability
of the RBFNN on unseen samples is vital to the accuracy of indoor positioning [7].

The proposed methodology has a few advantages. First; it has recorded an


accuracy average thats a bit higher than the ones achieved earlier. Besides, the
proposed method introduces online training which enhances positioning accuracy
whenever a change takes place within the environment. Hence, the process is
protected against the effect of any possible changes. However, theres no proof
that discusses real life performance issues when the system is tested within large
areas like the warehouses or libraries. More investigation and testing of this
methodology within such environments might show whether its capable of
operating with large number of items within large areas.

Another big enhancement is proposed in the article prepared by Junhui Zhao and
others (2010) [10], where the researchers tried to enhance the old LANDMARC
scheme through a new algorithm which is expected to be more reliable and less
24

RFID based positioning for libraries.

prone to errors caused by the NLOS (Non-Line of Sight) phenomena that might be
caused by the presence of obstacles between the RFID reader and the RFID tag.
In such situation, the reader - most probably - still has the ability to read the tag.
However, the distance estimated using the traditional RSS algorithm will suffer
distortion affecting the accuracy. To sort out this issue, the paper suggests
combining a geolocation algorithm with the traditional LANDMARC. The
geolocation algorithm locates RFID tags using three circles centered at the RFID
reader using the radio signal strength (RSS) [10]. k neighbors are located twice to
produce the corrections with which the estimated coordinates of the unknown
tracking tags are modified () algorithm based on the geolocation algorithm and
the LANDMARC algorithm is essentially a hybrid algorithm, but it overcomes some
shortcomings of other algorithms and acquires more accurate localization results
[10].

The hybrid algorithm was tested using numerical simulation. The acquired results
show an enhancement in the positioning accuracy. However, slight performance
degradation was recorded comparing to the traditional algorithms operating in LOS
environments [10]. This degradation might affect the total performance when
operated in larger environments like the one targeted in this project. Theres a
need to more testing experiments that take place under similar conditions test
performance issues. A too slow positioning process will not be feasible in most
cases.

Having a look at some of the major and most recent RFID based positioning
research projects; one can conclude that a relatively good number of research
projects have taken place in the field in the past 10-12 years. Researchers have
25

RFID based positioning for libraries.

started with general schemes which were meant to provide a proof of concept for
using RFID technology in positioning and mapping systems. The earlier trials have
provided some basics for later work, especially LANDMARC which was used later
to develop advanced algorithms.

Later on, the field has witnessed more trials to enhance the work done before.
Those projects can be categorized into a few categories: The first includes
research projects that focused on the positioning of an object carrying a reader like
a car or a robot. Another category includes projects that focused on enhancing the
accuracy of previously suggested systems or proposing new algorithms for the
positioning process of an item carrying an RFID tag. A third category of papers
have tried proposing new positioning some advanced schemes by hybridizing
RFID with other technologies.

Generally, it can be concluded that no one research project has investigated the
probability of using RFID for positioning within a large area/space that contains a
large number of items considering issues like performance, accuracy and
scalability all together at a time. Theres still a need to design a system that takes
all those issues into consideration and prove its feasibility using theoretical and
experimental simulation.

26

RFID based positioning for libraries.

4. Theoretical Development:
4.1 System requirements:
This section is dedicated to clarify the theoretical development of the proposed
design. It starts by defining the system requirements in this operating environment.
Then, a brief explanation of the global RFID technology standard will be explained.
Last but not least, a mathematical model will also be defined - on which simulation
and future evaluations are based.

Generally, five main requirements can be defined. First, the proposed system
should achieve an acceptable level of accuracy. Accurate positioning of the item
is the main goal of the system. If an acceptable level of accuracy has not been
achieved, then the whole systems feasibility will be questioned no matter how
much of the other requirements is achieved. The accuracy level is determined by
the specific description of the operation environment and the customer
requirements.

On the other hand, the first requirement needs to be achieved in with an


acceptable level of performance; how fast can the system output the required
results. This can be more challenging in this study as we are talking about a
comparatively large number of items within a large area. An efficient system can
locate the targeted object within a short time. A maximum of 2 minutes and an
average of 10 seconds were used by previous studies and can be satisfactory for
this study too.
27

RFID based positioning for libraries.

A third necessary requirement that needs to be satisfied is scalability. Many of


the previously proposed schemes discussed in the previous section were efficient
and accurate but not scalable. Performance could be questioned in many cases if
the design was expanded to a larger number of items and a wider area. Some
designs are only feasible within certain limits. Hence, working within our targeted
environment requires awareness of such issues.

Another important requirement that needs to be satisfied is a comparatively


acceptable cost. Cost has been a major concern in some older systems which
were mainly dependent on a large number of readers. As mentioned earlier,
depending mainly on readers in a positioning process increases the cost
tremendously as such readers are totally expensive. Later on, researchers have
been trying to enhance accuracy using lower cost systems. Such systems were
first based on lower number of readers but have also introduced reference tags.
Others suggested the usage of mobile readers or rotating antennas. This led to a
considerable reduction in cost as RFID tags are of much lower cost. Later
researchers kept on developing lower cost RFID systems by enhancing algorithms
too.
Last but not least, systems reliability is among the main RFID positioning
systems requirements. Most of the earlier designed systems recorded an
acceptable level of reliability within usual circumstances. But this was not the case
while dealing with active environments with people and probably items moving
constantly. One of the main challenges that an RFID positioning system needs to
overcome is investigating the probability of NLOS (none line of sight) situations
taking place. In NLOS, radio signals dont travel in a unique straight line. Instead,
28

RFID based positioning for libraries.

they might take multiple paths and even being reflected by obstacles leading to a
high level of inaccuracy. The situation can be even worse if the obstacles move.

Through this paper, the researcher will seek achieving the most possible ratio of
the above mentioned main requirements of accuracy, performance, scalability,
cost and reliability. Achieving 100% of each of the five requirements might be
impossible but a practical solution might be found that achieves reasonable
balance between the five.

29

RFID based positioning for libraries.

4.2 RFID Global Standards:


One of the reasons that helped the wide spread of the RFID technologies was the
standardization process that has developed in various institutions including the
AUTO-ID center at MIT and led to the introduction of the EPCglobal specifications.
It was developed for the EPC/RFID technology that the EPCglobal community has
begun implementing worldwide. This standard has defined various classes of
RFID tags. Namely: 900 MHz Class 0 RFID tag specifications, 13.56 MHz Class 1
RFID tag specifications, and 860 MHz Class 1 RFID tag specifications. A brief
description of each classs hardware specifications, protocols, and communication
channels is provided in the next three sections.

4.2.1 The 900 MHz Class 0 UHF RFID tag specifications:


Class 0 reference tags are the ones used in supply-chain management
applications. Class 0 tags must have the functions of: being easily read by the
reader as factory programmed chips with EPC, 24 bit kill code, and additional
data; ability to be selected as part of a related group of tags; and being individually
destroyed. The tag contains an EPC (Electronic Product Code) used for item
identification, a Cyclic Redundancy Check (CRC) and a destruct code. [17] In the
EPCs so far defined there are four fields which are, in order: a version number,
defining the variety of EPC among a number of possible structures; a domain
manager number, which is effectively a manufacturer number; an object class,
which is equivalent to a product number; and a serial number. [9]
This class uses a protocol based on the concept of singulation, which defines a
process of negotiation which culminates in a single tag being selected by the
30

RFID based positioning for libraries.

interrogator for further processing via interrogator commands [17] - to identify


RFID tags. To execute singulation it uses a binary tree walking anti-collision
protocol [17] singulation is a reader initiated process.

Sometimes, contention happens when simultaneous replies from are received


simultaneously from multiple tags, but usually this does not lead to a loss of data
for many reasons. First, the bits 0 and 1 are encoded with two different subcarrier
frequencies [9]. Thus, the reader can simultaneously receive a zero bit and a one
bit. Also, theres no need to distinguish multiple zeros or multiple ones if they are
received at once. Secondly: destructive interference between tag replies of equal
strength is very unlikely and can only be intermittent. [9].

Regarding the communication channels, the tag reading process uses an AM


(amplitude modulated) wave that operates at a frequency of 900 MHz. In this case,
the passive tag uses the waves energy to reply to the readers request by the
method of modulated RF Backscatter [9] which does not require additional power.
Alternatively, it changes the impedance of the chip port and thus the replies
signals in either of two RF wave frequencies: 2.2 MHz and 3.3 MHz which
respectively stand for binary 0 and 1.
This classs standard also obligates the reader to change its signals frequency
every 50-400 ms using a process known as frequency hopping, which is defined
as jumping to a different frequency that is within 1 MHz of the previous one. But
one cant guarantee that all the passive RFID tags will remain powered after the
frequency hop. Direct Sequence Spread Spectrum technology can also be
exploited by the reader and tags. Using this broadband direct spreading method,

31

RFID based positioning for libraries.

the reader is not required to hop through frequencies, thereby overcoming the tag
power loss issues caused by moving to a different frequency [9].

According to the standard [17] three ID fields are associated with each tag.
Namely: ID0, ID1, and ID2. The latter is the one used to store the actual user data
like version and serial number is combined of 64 or 96 bits, followed by a 16-bit
CRC calculated using all the digit values. Singulation is done using the ID2
number is insecure and computationally and time expensive as it requires keeping
track of all the 96 bits. A number with a smaller number of digits can be efficiently
used instead and will be enough to keep track of a large number of tags without
continuously breaching the probably sensitive (security wise) ID2 data [16].

ID1 is a static 80 bit random number that is mainly generated based on the ID2s
CRC. It consists of 64 generated bits plus 16 parity bits, and remains unchanged
for each reader irrespective of any other factors; While ID0 is a random number
used whenever a high level of security is required [16]. Both ID0 and ID1 are
divided into blocks of 10 bits to save time, and to facilitate the singulation process
by reading only a few blocks enough to distinguish each tag in the system. The
reader starts by reading one block of each tag and increases the number of read
blocks one by one gradually until it reaches a point where all tags in the systems
range are differentiated. Hence, the reader ends reading only a part of ID0 and
ID1 instead of reading the all the bits depending mainly on the number of tags in
the system.

32

RFID based positioning for libraries.

4.2.2 The 13.56 MHz Class 1 standard:


The 13.56 MHz specification is similar to the 900 MHz one, except differences in
the radio waves frequency and the protocol used. The 900 MHz uses a freewalking algorithm with frequent transactions between the reader and the tags, a
large bandwidth is available leading to a high average of reads per second and
low turn around time. However, this doesnt apply to the 13.56 MHz standard
with the obviously significantly lower bandwidth, leading to the introduction of a
different protocol called the Slotted Terminating Adaptive Collection Protocol
(STAC) [17].

STAC protocol is based on the concept of rounds where RFID tags reply in
randomly distributed time intervals referred to as slots. Each group of such slots is
called a round. This protocol is a reader initiated protocol in which the reader
initiates the round by sending a begin round signal that contains a few parameters
like the number of slots in the round just started, a second parameter called the
selection parameter which is used to select the RFID tags participating in the
round using their own contents, and a hash parameter. The selection parameter
defines the number of bits to be compared during the selection process. If the
selection parameter is not sent then ALL the RFID tags receiving the message are
selected. Thus, the begin round message defines within tags - the round size,
selected tags, and the reply slot position. At the beginning of each round, the
counter of slot positions is set to zero and the RFID tag moves from READY state
to SLOTTED READ state. Occupation of random positions by the RFID tags in this
protocol minimizes the possibility of collisions[17]. The slot counter will increment
every time a reader indicates the end of the slot and the beginning of a new slot.
33

RFID based positioning for libraries.

The tag replies with the remaining bits in its EPC omitting all or most of the bits
which were in the selection parameter [9] as they are already known for the
reader.

The reply messages of the RFID tag can be either: no tag reply present, one tag
reply present, and two or more replies present. In the first case, the reader issues
a Close slot sequence that causes all the tags in the SLOTTED READ state to
increment their slot number[9]. If the reader detects a replying RFID tag/tagd ti
tries to keep the slot open for data transfer. Then The reader checks for CRC
values before closing the slot if everything is right allowing the RFID tags to return
to the READY state. Otherwise it transmits a FIX SLOT signal which sets the RFID
tag to a FIXED SLOT state in which the tag keeps replying once per round in a
fixed slot [17].

As explained earlier, the used communication channel for this standard has a
frequency within 13.56 MHz 7 KHz. As in any other passive RFID system, the
reader provides power to the RFID tags and controls the communication process
with them with a baud rate of 26.48 kbit/sec in the reader to tag connection. Again,
the tag reply is also generated though amplitude modulation of the received wave
in the impeded circuit within the tag. The baud rate in the tag to reader connection
is 52.969 kbit/s [17].

4.2.3 The 860MHz 930 MHz Class 1 RFID tags:


The class 1 tag in this specification is designed to communicate only with its
unique identifier. The reader carrier frequency is in the range of 860 MHz 930
Mhz. The tag replies with backscatter modulation. The tags will modulate their
34

RFID based positioning for libraries.

back scatter only when they receive a command from a reader, which they can
properly decode and interpret. The intended free space communication of a tag is
more than 3m . It is 2m in worst case and 10m in best case. The tag contents of
the class 1 tags are slightly different from class 0 tags in that these tags have a
short password in addition to the EPC and CRC. Password is a 8 bit string used by
the kill command [9].

35

RFID based positioning for libraries.

4.3 Design and theory:


This section is dedicated to describing the theoretical bases and the detailed
design of the proposed solution. Two suggested solutions will be proposed,
described and simulated. The next few sections will cover the analysis, testing and
experiment.

The designs are theoretically made to satisfy the main requirements discussed
earlier. Later on; a detailed analysis of the requirement satisfaction will be
provided. Matlab simulation results will be used for this purpose.

The first method is based on a relatively higher accuracy design that uses RFID
readers and passive RFID tags. RFID readers are attached to the ceiling in the
form of a grid of readers. The readers power levels will be used for distance
analysis as shown later.

In this method, passive RFID tags are used to tag the items to be tracked. They
are also used as reference tags. This will enhance the systems accuracy and
cost. As explained earlier, using reference tags helps minimizing the number of
RFID readers and thus minimizes systems total cost. The goal of the whole
system is locating any item within the pre-defined set of targeted items thats
located in a library.

This method can use a Nelder-Mead nonlinear simples optimization method, which
is a known method for minimizing nonlinear functions in many dimensional spaces
to minimize the estimated positions error objective functions - without using
probably time consuming derivatives.
36

RFID based positioning for libraries.

The second approach can be described as a lower accuracy method as it focuses


on more clustered environments where the targeted space like a library is
originally divided into smaller spaces (like rooms) which is the situation in many
libraries and warehouses worldwide. In that case, the first approach can be used,
but might impose considerably higher costs as many readers are needed to
overcome the inner walls. If the blocks/rooms are relatively small, this will be a
huge increment in the systems cost without a promised increased efficiency. Each
block/room will require a few RFID readers (a minimum of four readers) to
accurately locate items. This is a non-efficient application of the design especially
when tens or even hundreds of blocks/rooms are available within the building.
Besides, such setup is prone to accuracy issues as some or all of the readers
might be too close to walls that neither pass the true signals power nor block its
interference, leading to a degree of inaccuracy caused by the lack of distinguishing
the read items that are actually within the room from the ones which happen to be
close within an adjacent room sometimes seen closer to the RFID reader due
to signal power distortion.

To overcome the situation explained above, system requirements need to be redefined to suit the nature of the new environment. This will be discussed later in
details, but generally accuracy and cost requirements are the ones we are
interested in leading to a lower cost system that can be setup within an acceptable
cost probably less than the cost expected in the first approach. One reader will
be placed in the center of each room/block with only a few or none reference tags
to achieve an acceptable level of accuracy and minimize the interference caused
by RFID readers in adjacent cells.

37

RFID based positioning for libraries.

Following a detailed description for each of the above mentioned approaches,


explaining their systems setups, theoretical location process and calculations,
along with further details.

38

RFID based positioning for libraries.

4.3.1 High accuracy positioning approach:


- System Structure:

The system structure for this approach is shown in fig. (5) bellow.

Figure [5]: system setup of the high accuracy positioning approach [8].

As illustrated in the figure above, reference RFID tags with known coordinates are
placed on the ceiling in the form of a mesh. Distance separating each RFID tag
from the other is fixed and predefined depending on a few factors including the
total covered area and the required accuracy level. Theoretically - as shown later decreasing this distance enhances the systems accuracy accordingly. However,
this might be questioned experimentally later on within this project as this direct
proportionality is not expected to survive on too small distances. Besides, such too
small equidistance might increase the systems load specifically on the RFID

39

RFID based positioning for libraries.

readers scanning process without a justifying outcome. On the next section, the
role of this distance and its optimum value will be investigated.

Cost wise, the RFID readers are generally cheap and not expected to affect the
total system cost much. This applies to both passive and active RFID tags in
different degrees. Active RFID tags are generally preferred in positioning
applications within large areas due to their longer transmission range. However, in
our situation, theres a large number of items that need to be located by the
system and changing their tag batteries might cost much time and money not to
mention a probable difficulty in locating the items need new batteries as the RFID
tag will keep working for some time with lower power probably leading to
inaccurate estimations.

One might think of using active RFID tags for reference tags whereas passive
ones are used for the items themselves, but its to use only one standard type of
RFID tags wherever needed in the system either for reference tags or items
tagging. For this reason, and the above explained details well be using passive
RFID tags everywhere on our system.

A local coordinates system is assumed, the placement of the reference tags


should be a highly accurate process. The coordinates of each tag can be stored
either within the tags memory or within a database stored on a central computer
connected to all of the readers. In this system, storing each tags location within its
own memory will help creating some decentralizing within the system hence
helping balancing the load on all the system elements instead of depending solely

40

RFID based positioning for libraries.

on the limited computational power of the central computer holding the database.
This is expected to increase the systems performance.

As shown in fig. (5), a square shaped matrix of RFID reference tags and also the
RFID readers is used to clarify the concept. A hexagonal one can be used for
higher accuracy as shown in fig. (6). In this case, more reference tags (usually six
reference tags) will be surrounding the targeted item. With more reference tags
getting involved in the position estimation process, a higher accuracy is expected.
Besides, this helps overcoming the NLOS (non-line of sight) problem caused by
obstacles surrounding the target item as more reference tags help eliminate the
effect of this situation. More than one matrix of reference tags can be used,
installing an additional one at another level (like the rooms floor). This amendment
using either hexagonal or quadratic matrices can offer more help gaining more of
the above mentioned advantages (accuracy and eliminating NLOS). Again, in this
paper, a single quadratic matrix will be used.

Fig. (6): using a hexagonal matrix of reference tags and readers.

41

RFID based positioning for libraries.

RFID readers are also deployed on the rooms ceiling as shown in fig. (5). The
number of those readers is denoted as N (where N is always > 4). Next section will
discuss the optimum number of readers to be deployed within a sample
environment and the effect of the readers number on systems accuracy,
computing time, and systems total cost. But as explained earlier, RFID readers
are the main constrain in the systems cost as they are very expensive comparing
to the other components. An increased number of readers will dramatically affect
the systems cost. Besides, computing time is also affected by the number of RFID
readers deployed in the system. The more readers deployed, the more the time
needed to collect their data and analyze it. However, system accuracy is increased
when more readers are deployed. The next section will discuss all those factors
and try to achieve a balance between them using the simulation data.

Some RFID readers currently in the market operate within only one signal power
level, which is not feasible for this type of applications. However, some types of
readers can operate at many transmission power levels up to 38 levels [8].
These levels are tunable and can be calibrated. One can determine the required
number of power levels and their calues according to whats best to the
application. In our application, each reader has K transmission power levels
selected globally for the system in a way that creates linearly increasing reading
range for the increment of the power level (the range increases linearly when the
power level is increased, but the power value itself might increase in a non-linear
way).

42

RFID based positioning for libraries.

- Position estimation:

A positioning request is issued using a central computer/server to the RFID


readers to start scanning for the targeted RFID tag and send the contents of the
tags in range to the central computer. As explained earlier, this content can be
either only the tags IDs that can be used to retrieve their function (item tags or
reference tags) and exact position (for reference tags only) from a central
database. But alternatively, the processing time can be decreased to enhance
performance by getting the position details stored within the reference tags and
sent to the central computer to be used immediately in the estimation process.

The readers can start with the lowest power level and gradually increase the
power until the target tag is found. But alternatively, the search process can be
enhanced using binary search [8] within the power levels, where the reader and
the central computer start searching with a power level in the middle between the
minimum and the maximum level (eg.: if 12 power levels are used, it starts with
level 6) before deciding whether it has to keep searching within the higher or lower
levels and repeating the process. (Note that the methodology all over this paper
assumes that the radio waves emitted from the reader take the shape of a circle or
sphere, which is not the situation most of the time due to different propagation and
attenuation and different gains of the antenna in each direction. Other papers used
the concept of Degree of Irregularity (DIO) [8] to quantify this issue; which is
beyond the focus of this project).
While searching for the target tag, the readers scan for reference tags too, Let k
denote he set of tags the reader reads in the power level k, i denote the reader,

43

RFID based positioning for libraries.

and j denote the target tag. If j k, and j k+1 then, the distance between i and j,

denoted as Lij can be estimated by calculating the average of the distance

between the reader and all of reference tags that are activated in this power level
(K+1) but not on the previous on (k). The same process is repeated by each of the
N readers to calculate the average distance between each reader in range and the
target tag; denoted as L1j , L2j ,L3j Lij .LNj. Once all these distances are
estimated, they can be used for an estimation of the target tag location.

Some RFID readers in the market do have enough computational power to do a


part of the calculations; each reader can be setup to calculate its

and send it to

the central computer to do the rest of the process.

The location of the target tag can be estimated by optimizing the error function to
the minimum expressed using the minimum mean square error formula [8]:

Where

.. (1)

denotes the real distance between the reader i and the target tag j.

Note that only the readers that do read the target tag are included in equation (1),
otherwise the readers term is eliminated from this equation.
If the target tags real position is denoted as (xj,yj,zj), and the readers position is
denoted as (xi,yi,zi), then the value of

can be represented by:

................... (2)

44

RFID based positioning for libraries.

An optimization method can be used to minimize the error function and obtain
the target tags coordinates (xj,yj,zj). An example of such methods is Nelder
Mead Simplex method which is a non-linear minimization method that uses
parameters adjustment until a certain convergence criterion is met. Some of these
methods including simplex have their built in modules in Matlab environment.
Besides, for a proof of concept, typical algebra can be used to calculate the exact
position of the target item using the estimated distances calculated by each
reader. This will be clarified in details later on the simulation section; where this
design will be simulated and tested. Positioning accuracy will be tested and
compared under different circumstances by varying either the number of RFID
reference tags and the distance separating adjacent ones, the number of
implemented readers, or the number of power levels used.

45

RFID based positioning for libraries.

4.3.2 Low accuracy positioning approach:


This low accuracy approach is introduced for usage within environments that are
different from those of the high accuracy one. While the previous approach was
designed to work in large indoor areas like some libraries and warehouses, this
approach is designed to be used where the environment is clustered to a large
number of relatively small rooms; which is the situation in other libraries and
warehouses. In most situations, the building is not designed as one open area.
Instead; its divided into a set of rooms and/or halls. In this case, it wont be
efficient to use the high accuracy approach. Each room no matter how small or
large is it will require its own set of four readers minimum. This will dramatically
increase cost and decrease efficiency because of the fact mentioned before that
the reader is the most expensive component of any RFID system. On the other
hand, more signal interference is expected; some readers might also read some
RFID tags in adjacent rooms, especially if the rooms are relatively small.

This system is based on installing only one RFID reader within each room or hall
in the librarys or warehouses building. This reader has a range only enough to
cover the whole room within which it is installed. The reader is installed on the
centre of the room.

In this approach, no reference tags are installed. The positioning estimation is a


general process done using RFID readers only (no reference tags). This might be
of a great use in some situations. A good example of such environments is a large
library that consists of a number of rooms, and has already implemented (or willing
to implement) an RFID system dedicated to manage the borrowing process and
security monitoring - so it has a part of the required infrastructure, and has already
46

RFID based positioning for libraries.

get all its items tagged, usually using passive RFID tags. If this library wants a
user friendly system that be used by the library visitors to eliminate the hassle of
finding a real time position of the item without using complicated codes and maps.
A system that estimates the position even if the item is eventually moved between
the library rooms by the library visitors.

Whenever a positioning request is made using a central computer, all readers


scan for the tag that carries this items ID. Whenever the item is found and
reported to the central computer, ONLY the reported data contains only the room
number where the item can be found. This can be supported by a graphical
interface showing the rooms position to help the library find it. The user has to use
a more detailed search method within that room either using traditional books
numbering or using manual search.
This approach is not suitable when a detailed accurate positioning is required. Its
only feasible under two conditions: firstly the environment has to be clustered to
many units. Secondly; the accuracy requirements are very general and low. As
mentioned earlier, RFID system infrastructure is a plus in this case.

47

RFID based positioning for libraries.

5. Simulation Results & Analysis:


Matlab is a powerful programming language, especially in the field of engineering
and scientific applications. Hence, it was selected to help us having a deeper view
of the proposed methodology. The goal of the simulation is to test how the high
accuracy approach behaves under different setups and the way its accuracy is
affected when each of the following factors is changed: number of RFID readers
installed, number of RFID reference tags and the operating environments area.

This section is dedicated to discuss the simulation methods used and analyzing its
output results. Firstly, a brief description of the Matlab code used is given (the
complete Matlab codes are attached in the appendices at the end of this report).
Next, detailed description of the output results is shown. Those results will be
analyzed in details to show how each of the above mentioned factors affects the
accuracy. The output results have shown a good level of accuracy; it also shows
that the four factors mentioned earlier affect the accuracy in a way thats totally
justified by the theoretical model explained earlier. A detailed plotting of all the
analyzed results will also be provided.

The simulation coded for this purpose reflects exactly the methodology of the
higher accuracy approach. The Matlab code starts with defining the operating
environment. This includes the dimensions of the operating area a square area
is defined, simulated by a square matrix with distance between each two nodes
representing 5cm. An area of 10x10 m was initially defined. Then the number of
RFID readers and reference tags is defined on using as nodes as needed from the
48

RFID based positioning for libraries.

main matrix. Both RFID readers and tags can be defined per dimension instead
of determining their number in the whole area bearing in mind its a square area.
Another variable that needs to be defined is the power levels used by the readers.
This is a global value for all the readers and can be between 1 and 28 levels. A
standard global range of the RFID readers is also defined.

The next step represents the scanning process done by the readers. This is done
starting from the lowest power level, increasing one level a time, scanning for
target tag.

Once the target tag is read, the reader reads all the reference tags within the same
power level, and uses their known positions to calculate the distance separating
each one from the reader before calculating an average distance using all the
tags. This is repeated by an even number of readers (usually 4 or 6) which are
usually the closest to the target tag (the ones that read it in their lower power
levels).

That way, an estimation of the distance separating each reader from the target tag
is known and can be used to estimate the position of the target tag itself. This can
be achieved by minimizing the error function as explained in the previous section.
However, a simplified mathematical method is used in the simulation for a proof of
concept. This is achieved by solving for intersection points of each two circles and
finding the intersection point that is exactly repeated (or repeated by a very close
point). Accuracy is investigated using a mean square error of the real position of
the target tag and the estimated one.

49

RFID based positioning for libraries.

For a deep investigation of the system, each of the above mentioned factors will
be varied (one a time) for a number of steps within a specific range. For each step,
the positioning process will be run for a min of 100 times, calculating a total mean
error function. Then, a curve plotting how accuracy changes versus the variables
of interest is plotted as shown later.

While positioning accuracy will be deeply investigated in this section, it should be


made clear that this simulation cant say much when it comes to performance
issues like the average time the system needs to estimate items positions.
However, the simulation proposed in this section can be used as an indication;
especially when comparing the relative performance of different environments and
setups; this will be clarified later in this section.

1. The number of power levels:


As mentioned earlier, the number of power levels used by an RFID reader can be
configured by the user. It was also taken in consideration that ALL the readers
operating in a specific environment will use the same number of power levels.
Using the Matlab simulation explained earlier, an investigation of the relationship
between the number of power levels against the recorded accuracy. In order to
achieve this, a simulation of a 10mx10m area was built. The number of power
levels was varied between one and 28 power levels; executing the simulation for
100 iterations at each power level. RFID readers were installed in a uniform matrix
like set on the ceiling - four readers in each dimension with a total of 16 readers.
The distance separating each two reference tags was also fixed to 0.5m. Fig. (7)
below shows plots of the simulation results.
50

RFID based positioning for libraries.

Fig. (7): Positioning accuracy vs. the number of power levels.


It can be noticed clearly from the chart above that systems accuracy can witness
much enhancement if the right number of power levels is setup. Systems
accuracy is very low and unstable when three power levels or less are used. At
this point, the system is almost unfeasible. For systems using 4-6 power levels,
the average error still high and above what our systems limit is. This range can be
used for lower accuracy applications, especially when speed becomes a very big
concern.

When the number of power levels is within the area 7-10, the system recorded a
good level of accuracy which remains stable around 50cm average error. This
ranges accuracy is within our systems requirements. Above 10 power levels, the

51

RFID based positioning for libraries.

systems average error keeps converging to a minimum thats a little bit above
zero.
Clearly, using a number of power levels thats in the range of 7-10 levels is
expected to achieve the nest results balancing accuracy with performance. An
average error around 50cm remains acceptable according to our system
requirements. Using a higher number of power levels can slightly enhance the
accuracy but this will be on the account of performance. Using a high number of
power levels is expected to slow down the positioning process. Hence, a good
balance between accuracy and performance can be achieved using a min of 7 and
a max of 10 power levels.

2. Scalability:
Scalability has been one of the major interests of this project since the beginning.
The designed system was meant to work in large environments; hence, theres a
real need for a system that can operate in such environments effectively.
To test scalability, the simulation was run in different environments starting with
64m2 (8m * 8m) up to 2500m2 (50m * 50m) with an increment of 2 meters in each
dimension each time. The number of power levels was fixed at 8 power levels;
while the distance between reference tags was fixed at 0.5m. Fig. (9) bellow
shows the average error obtained for each change in the simulated area
dimensions. While fig.(10) shows how the number of readers increase vs. area.
This can be helpful in estimating the cost of this system.

52

RFID based positioning for libraries.

Fig.(9): The average error variation whenever area dimensions change.

Fig. (10) The number of readers increment vs. total area in m 2.

53

RFID based positioning for libraries.

From the figure above, we can see that the systems accuracy remains acceptable
even whenever the area is very large. Whenever the area is less than 900m 2, the
system achieves a good accuracy level with maximum error not exceeding 60cm
at 900m2. Above 900m2, the accuracy remain acceptable and suitable for many
users with average error not exceeding 90cm at large areas around 2500m 2.
As mentioned earlier, this accuracy level is suitable for many users. Otherwise, it
can be enhanced by clustering the system; i.e. dividing it into a few subsystems
to enhance performance and accuracy. This can be done by two stages
positioning, where the first one determines the subsystem that contains the target
item, while the second stage estimates the specific position of the item. This
approach needs further investigation which is out of the scope of this project.

3. The number of RFID readers:


As mentioned a few times earlier, expensive RFID readers are the major part of
the cost of any RFID based positioning system. Reducing the number of the
readers is among the important goals of our design. A simulation was run to
investigate this issue. During this simulation, the number of power levels was fixed
at eight levels among all the readers in the system. Besides, reference tags are
still separated by 0.5m in both dimensions of the ceiling level. To guarantee
regularity while varying the number of readers, the variation was within the range
of squares of the number of readers per dimension (of the ceiling level). The
number of readers per dimension was varied between two and ten; hence the
resulting number of total readers was between four and a hundred readers. Again,

54

RFID based positioning for libraries.

a hundred random positioning processes took place for each variance of the
number of readers. Fig. (9) shows the results of the simulation.
It was also supposed that the readers reading range is enough to cover the
distance between each two readers; which is the situation in reality as most
commercial RFID readers have enough range.

Fig (9): Average error vs. the number of RFID readers in the system.

Fig. (8) shows that a satisfying level of accuracy is achieved in this environment
whenever four or more readers are used. The distance between each two readers
can be optimized in the range of 5-10 meters, which will reduce the system cost
considerably in such large areas. Besides, theres no serious enhancement on the
system accuracy when the number of readers is further increased. Slight ups and
55

RFID based positioning for libraries.

downs were recorded but the average error kept varying only around the range of
40-50 cm; which is an acceptable average error. This conclusion is an important
one as it proves that the proposed designs accuracy is not too dependent on the
number of readers as long as the used readers do cover the entire environment in
concern, with each point within the environment covered with a few number of
readers enough for positioning (4 or more). Above this point, any added readers
become redundant will affect the system performance. Hence, installing readers
with the maximum possible range can help decreasing the number of readers
needed, maintaining the same level of accuracy.

4. The number of RFID reference tags:


Unlike the readers, RFID tags are inexpensive small entities that can be easy to
install. Hence, one might think of dropping them from investigation thinking that
any suggested number of reference tags might be fine. However, installing extra
tags more than whats actually needed - might add extra processing load on the
system. Not to mention the hassle of installing a very large number of tags in a
ceiling of a large area while maintaining a high level of accuracy to each tags
position. Hence, there is a real need to install only and exactly the number of tags
that is actually needed to achieve satisfactory results. Any redundant tags are
better eliminated.
This time, the simulations goal was to define the relationship between the
distance separating each two reference tags on the ceiling - and hence the total
number of tags, as the total area is fixed - with the systems average accuracy. To
achieve this, the distance separating each two adjacent tags was varied from 0.1m
56

RFID based positioning for libraries.

to 1.8m allowing the number of reference tags to change accordingly. The number
of power levels was again fixed on 8 levels; whereas the number of readers was
fixed on 9, meaning that 5m separate each two adjacent readers on each side.
Fig. (10) below shows the simulation results.

Fig. (10): Average error vs. the number of reference tags.

It can be noticed from the previous figure that the average error varies only within
the range around 50cm whenever the number of reference tags is varied in the
range mentioned above; with an exception of using a very low number of
reference tags, like separating each two adjacent tags with 2 meters or more.
Reference tags separated by around 1-1.2m yield a satisfactory level of accuracy.
This is reasonable according to the theoretical design proposed earlier as a small
number of reference tags but enough to leave a few tags in each power level to

57

RFID based positioning for libraries.

be used for position estimation can yield only an acceptable level of error. This
result is also assisted by the low width power levels used in this simulation.
Whenever a proper number of power levels is used, each power level wont be too
wide and hence wont allow a large average error as the maximum error is
theoretically less than the half of the power levels width.

58

RFID based positioning for libraries.

6. Conclusion and Future Work


RFID based positioning systems have been widely developed and used in the past
decade. Researchers have engaged many projects to use this technology for
various applications. However theres still a need for more investigation in the field,
especially its application in large environment to track a large number of items, like
in libraries and warehouses. Usually, such environments question systems
feasibility when it comes to scalability, cost, accuracy, and systems performance.

To make sure such important requirements are met, two different positioning
schemes were proposed; namely, High Accuracy Positioning Scheme, and Low
Accuracy Positioning Scheme. The first scheme is designed to suit positioning in
large indoor areas that have too many items, while the second is more suitable for
environments that are divided into a relatively large number of smaller rooms
where the first scheme become ineffective, error brone, and considerably
expensive.

The first scheme, which was simulated using Matlab, has achieved satisfying
results. First, it has shown some degree dependency on the number of power
levels used. This relationship is important as it allows optimizing the number of
power levels to enhance cost, accuracy and performance.

Second, this scheme dependence on the number of readers is relatively low


provided the readers ranges are enough to cover the whole room where each
point is covered by a few readers to run the positioning scheme. This can be
enhanced further by installing higher signal range readers. This conclusion is

59

RFID based positioning for libraries.

important; it proves a window for minimizing the systems cost comparing to


older schemes - by optimizing the number of readers, which are the most
expensive components on such systems.
Third; this schemes accuracy was investigated against the number of RFID
reference tags used. The system showed that extra reference tags dont
necessarily enhance systems accuracy. There are a limited number of needed
reference tags; installing more tags than this limit will only increase cost and
computing time without enhancing accuracy; while a much lower number of
reference tags leads to low accuracy. This conclusion helps optimizing the number
of reference tags.
Fourth, the systems scalability is generally satisfying. Its capable of maintaining
average error bellow 60cm with areas up to 30m*30m. Average error still bellow
90cm for much larger areas of 2500m 2 (50m*50m), which is still acceptable by
many users. Besides, the systems accuracy can be enhanced for very large areas
by dividing the system to a set of subsystems as explained later.

Generally, the simulation has proven the feasibility of this scheme cost, accuracy,
and scalability wise.
The second scheme was not a part of the simulation section as its very simplified
with relatively low requirements. Simulation is not expected to explain much about
this method more than what theory does.

60

RFID based positioning for libraries.

Despite this project has achieved its major goals, theres still a room for more
enhancements. Including:

Supporting the concluded results experimentally. Much of the work done so


far has depended mainly on simulation analysis do to the high hardware
costs. Hence, theres still a need for supporting the concluded results and
comparing different schemes experimentally in real life environments.

Experimental investigation of the systems scalability. With Experimental


investigating the possibility of clustering the positioning system for very
large areas. If a big area is divided into a number of subsystems, where the
target item position is determined in two stages, while the first stage is a
general one telling which subsystem contains the item; the second is more
accurate and specific, this can increase positioning speed.

Experimentally investigation what part of the processing and estimation can


be done by the RFID reader itself, and what part has be done by a central
computer. Properly balancing the processing load might lead to faster
positioning process.

Investigating the feasibility of using hexagonal shaped matrices of reference


tags.

Experimentally investigating the feasibility of using active RFID tags in such


applications partially or totally.

Further investigating the feasibility of hybridizing RFID with other wireless


technologies.

Experimentally testing and enhancing the proposed NLOS (Non Line of


Sight) situations. And suggesting further methodologies if required.
61

RFID based positioning for libraries.

7. References:
[1] Lionel M. Ni, Yunhao Liu, Yiu Cho Lau And Abhishek P. Patil, LANDMARC:
Indoor Location Sensing Using Active RFID. Wireless Networks 10, 701
710, 2004.
[2] Norie Uchitomi, Atsuki Inada, Manato Fujimoto, Tomotaka Wada, Kouichi
Mutsuura and Hiromi Okada, Accurate Indoor Position Estimation by SwiftCommunication Range Recognition (S-CRR) Method in Passive RFID
systems, International Conference on Indoor Positioning and Indoor
Navigation (IPIN), 15-17 September 2010, Zrich, Switzerland.
[3] Dian Zhang, Yanyan Yang, Dachao Cheng, Siyuan Liu, and Lionel M. Ni,
COCKTAIL: An RF-based Hybrid Approach for Indoor Localization, IEEE
2010. (Full text paper was peer reviewed at the direction of IEEE
Communications Society subject matter experts for publication in the IEEE
ICC 2010 proceedings).
[4] Zhoubing Xiong, Francesco Sottile, Maurizio A. Spirito and Roberto Garello,
Hybrid Indoor Positioning Approaches Based on WSN and RFID, IEEE,
2011.
[5] Bonifacio Castao and Maria Rodriguez-Moreno, A ZigBee and RFID
Hybrid System for People Monitoring and Helping inside Large Buildings,
2010 IEEE Symposium on Industrial Electronics and Applications (ISIEA
2010), October 3-5, 2010, Penang, Malaysia
[6] Hae Don Chon, Sibum Jun, Heejae Jung and Sang Won An, Using RFID
for Accurate Positioning, Journal of Global Positioning Systems (2004) Vol.
3, No. 1-2: 32-39.
62

RFID based positioning for libraries.

[7] Hai-Lan Ding, Wing W. Y. NG, Patrick P. K.Chan, Dong-Liang Wu, XiaoLing Chen, Daniel S.Yeung, RFID INDOOR POSITIONING USING RBFNN
WITH L-GEM, The Ninth International Conference on Machine Learning
and Cybernetics, Qingdao, 11-14 July 2010.
[8] Chong Wang, Hongyi Wu, and Nian-Feng Tzeng, RFID-Based 3-D
Positioning Schemes, (Full text paper was peer reviewed at the direction of
IEEE Communications Society subject matter experts for publication in the
IEEE INFOCOM 2007 proceedings).
[9] Arini Balakrishnan, Swetha Krishnan, Simulation of RFID platform on NS-2,
University of Wisconsin, Madison December, 2005.
[10]

Junhui Zhao, Cong Zhao and Wei Yang, An Improved Location

Algorithm for RFID System in NLOS Environment, IEEE, 2010.


[11]

Luca Catarinucci, Riccardo Colella, Mario De Blasi, Luigi Patrono,

and Luciano Tarricone, Improving Item-Level Tracing Systems through Ad


Hoc UHF RFID Tags, Department of Innovation Engineering, University of
Salento, Lecce, 73100, Italy, IEEE 2010.
[12]

Abdelmoula Bekkali, Horacio Sanson and Mitsuji Matsumoto,

Member, IEEE, RFID Indoor Positioning based on Probabilistic RFID Map


and Kalman Filtering, Third IEEE International Conference on Wireless and
Mobile Computing, Networking and Communications (WiMob 2007), IEEE,
2007.
[13]

Jeffrey Hightower, Gaetano Borriello and Roy Want, SpotON: An

Indoor 3D Location Sensing Technology Based on RF Signal Strength, UW


CSE Technical Report #2000-02-02, February 18, 2000.
[14]

Diane Marie Ward, The Complete RFID Handbook, pages 1-3, 2004.
63

RFID based positioning for libraries.

[15]

Angus F. C. Errington, Brian L. F. Daku and Arnfinn F. Prugger,

Initial Position Estimation Using RFID Tags: A Least-Squares Approach.


IEEE transactions on instrumentation and measurement, VOL. 59, NO. 11,
november 2010.
[16]

860 mhz - 930 mhz class 1 RFID tag radio frequency and logical

communication interface specification candidate recommendation, version


1.0.1. http://www.epcglobalinc.org/standards technology/Secure/v1.0/UHFClass1.pdf, November 2002.
[17]

900

mhz

class

RFID

tag

specification.

http://www.epcglobalinc.org/standardstechnology/Secure/v1.0/UHFclass0.pdf, February 2003.


[18]

RFID implementation in the UK, Results of an exclusive survey

commissioned by CILIP and conducted by independent consultant David


Haynes, CILIPs RFID in libraries conference, 2006.
[19]

Martin Palmer, Making the most of RFID in libraries, Facet

Publishoing, 2009.
[20]

Atlas RFID solutions website and manuals.

[21]

Eun-Kyu Lee, Sungwon Yang, Soon Y. Oh, and Mario Gerla,

Department of Computer Science, University of California, Los Angeles,


RF-GPS: RFID Assisted Localization in VANETs, IEEE, 2009
[22]

Ching-Sheng Wang and Shyh-Shyan Wu, Department of Computer

Science and Information Engineering, Aletheia University, An Adaptive


RFID Localization Mechanism Supporting 3D Virtual Tour System, IEEE,
2008.

64

RFID based positioning for libraries.

[23]

Weiguang Shi, Kaihua Liu, Ying Ju, Ge Yan, School of Electronic

Information Engineering, Tianjin University, An efficient indoor location


algorithm based on RFID technology, IEEE, 2010.
[24]

Farhan Manzoor, Yi Huang, and Karsten Menzel, Passive RFID-

Based Indoor Positioning System, An Algorithmic Approach, Program for


the IEEE International Conference on RFID-Technology and Applications,
17 - 19 June 2010 Guangzhou, China.
[25]

Jiun-Fu Chen and Chieh-Chih Wang, Simultaneous Localization and

Mapping using a Short-Range Passive RFID Reader with Sparse Tags in


Large Environments, IEEE, 2010.

65

RFID based positioning for libraries.

Appendices:

66

RFID based positioning for libraries.

Appendix A: Matlab Code:


1- Average error vs. Power Levels:
2- %See the power levels against error
3- clear all
4- %close all
5- clc
678- power_levels = [2:1:28];
910for main_index = 1:length(power_levels)
111213for iter_main = 1:100
14clearvars -except iter_main iter_num error main_index
power_levels error_avarage

1516171819202122232425262728293031323334-

%%%%%%%%%%%%% Parameters to be defined %%%%%%%


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Number of power levels
R = power_levels(main_index);
%Number of readers per dimension 2 3 4 5 6
N_d = 4;
%distance between reference tags on the same line
d = 0.5;
%square space
d_space = 10;
%resolution of matrix
res = 1/20;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
35%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
36%%%%%%%%%%%start of calculations %%%%%%%%

373839404142434445-

%number of readers
N = N_d^2;
%Readers involved
%should be an even number
%N_inv = floor(N/2)*2;
if (N<6)
N_inv = 4;

67

RFID based positioning for libraries.

4647484950515253545556575859606162636465-

else
N_inv = 6;
end

%Generate random position


real_target = randi([1 101],1,2);
%generate space matrix
tags_MAT = zeros((d_space/res)+1,(d_space/res)+1);
%number of reference tags in each dimension
num_tags_d = floor((d_space/d)+1);
%distance between reference tags in terms of matrix index
d_in = d/res;

for in = 1:num_tags_d
for in2 = 1:num_tags_d
tags_MAT(d_in*(in-1)+1,d_in*(in2-1)+1) = (in21)*num_tags_d + in ;
66end
67end

68697071727374757677-

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%distance between readres in terms of matrix index
d_readers = floor(d_space/((N_d -1)*res));

for in = 1:N_d
for in2 = 1:N_d
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) =
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) + i*((in2-1)*N_d +
in) ;
78end
79end

8081-

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
82%tags indeces
83[a,b] = find(real(tags_MAT) > 0);
84tags_in = [a,b];
85%readers indeces
86[a,b] = find(imag(tags_MAT) > 0);
87readers_in = [a,b];

8889-

%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%
90%Maximum distance
91max_d = d_space*sqrt(2);

68

RFID based positioning for libraries.

9293949596979899100101102103104-

%level
L = max_d/R;
%levels
levels = [0:L:L*R];

%real distance
for in = 1:N
%[a,b] = find(real(tags_MAT) == 10^6);
a = real_target(1);
b = real_target(2);
d_real(in) = res*sqrt(((readers_in(in,1) a)^2)+((readers_in(in,2) - b)^2));
105end

106107108-

%find level the target is in for each reader


%In reality, the readers do not know which level it is in
from one shot,
109%the perform it level by level.
110%initialize
111L_readers = zeros(1,N);
112for in = 1:N
113for in2 = 2:length(levels)
114if (d_real(in) > levels(in2))
115L_readers(in) = levels(in2);
116end
117end

118119120121122123-

end
%L_reders has the level for each reader

%find tags in the target level for all readeres and find
avarage distance
124for in = 1:N
125d = kron(ones(length(tags_in(:,1)),1),readers_in(in,:)) tags_in;
126d = sqrt(d(:,1).^2 + d(:,2).^2);
127d = d*res;
128ind_d = find(d > L_readers(in) & d < L_readers(in)+L );
129d_avarage(in) = 0;

130131132133134135136137138139140-

if length(ind_d>0)
d_avarage(in) = sum(d(ind_d))/length(ind_d);
end
end
%find readers with min distances
for in = 1:N_inv
index = find(d_avarage == min(d_avarage));
if length(index) > 1

69

RFID based positioning for libraries.

141142143144145146147148149150151-

index = index(1);
end
d_target(in) = d_avarage(index);
readers_target(in,:) = readers_in(index,:);
d_avarage(index) = 10^10;
end
%readers_target = readers_in(1:N_inv,:);
%d_target = d_avarage(1:N_inv);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%

152153154155156157158159160161162-

%Do the first pair of readers


%Calculating position
A = readers_target(1,:); %# center of the first circle
B = readers_target(2,:); %# center of the second circle
a = d_target(2)/res; %# radius of the SECOND circle
b = d_target(1)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second

center

163-

pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to


unit vector
164%# use the cosine of alpha to calculate the length of the
165%# vector along and perpendicular to AB that leads to the
166%# intersection point
167intersect_11 = A + u_AB * (b*cosAlpha) + pu_AB *
(b*sqrt(1-cosAlpha^2));
168intersect_12 = A + u_AB * (b*cosAlpha) - pu_AB *
(b*sqrt(1-cosAlpha^2));

169170171172173174175176177178179180-

intersect1 = [intersect_11;intersect_12];
%Do the second pair of readers
%Calculating position
A = readers_target(3,:); %# center of the first circle
B = readers_target(4,:); %# center of the second circle
a = d_target(4)/res; %# radius of the SECOND circle
b = d_target(3)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second

center

181-

pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to


unit vector
182%# use the cosine of alpha to calculate the length of the
183%# vector along and perpendicular to AB that leads to the
184%# intersection point
185intersect_21 = A + u_AB * (b*cosAlpha) + pu_AB *
(b*sqrt(1-cosAlpha^2));

70

RFID based positioning for libraries.

186-

intersect_22 = A + u_AB * (b*cosAlpha) - pu_AB *


(b*sqrt(1-cosAlpha^2));

187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216-

intersect2 = [intersect_21;intersect_22];
%find the point
%finding the pair
p1 = norm(intersect_11 p2 = norm(intersect_11 p3 = norm(intersect_12 p4 = norm(intersect_12 %Distances
D_p = [p1,p2,p3,p4];
index = find(abs(D_p) ==

intersect_21);
intersect_22);
intersect_21);
intersect_22);

min(abs(D_p)));

if length(index) >1
index = index(1);
end
intersect_MAT(1,:) = intersect1(round(index/2),:);
intersect_MAT(2,:) = intersect2(2-mod(index,2),:);
intersect1;
intersect2;
intersect = sum(intersect_MAT)/2;
for in = 5:2:N_inv-1
%Calculating position
A = readers_target(in,:); %# center of the first circle
B = readers_target(in+1,:); %# center of the second

circle

217218219220221222223-

a = d_target(in+1)/res; %# radius of the SECOND circle


b = d_target(in)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second

center

224-

pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to


unit vector
225%# use the cosine of alpha to calculate the length of the
226%# vector along and perpendicular to AB that leads to the
227%# intersection point
228intersect_1 = A + u_AB * (b*cosAlpha) + pu_AB *
(b*sqrt(1-cosAlpha^2));
229intersect_2 = A + u_AB * (b*cosAlpha) - pu_AB *
(b*sqrt(1-cosAlpha^2));
230intersect_iter = [intersect_1;intersect_2];
231%finding the pair
232p1 = norm(intersect_1 - intersect);

71

RFID based positioning for libraries.

233234235236237238239240241242243244245246247248249250251252253254255256257-

p2 = norm(intersect_2 - intersect);
D_p = [p1,p2];
index = find(abs(D_p) == min(abs(D_p)));
if length(index) >1
index = index(1);
end
intersect_MAT(end+1,:) = intersect_iter(index,:);
end
intersect = sum(intersect_MAT)/(N_inv/2);
%error in cm
error(iter_main) = norm(real_target - intersect)*res*100;
end
error_avarage(main_index) = sum(error)/iter_main;
end

figure
plot(power_levels,error_avarage,'--*',
'Color','black','LineWidth',3)
258axis([-inf inf 0 inf])
259grid on
260title({'Accuracy vs. # of Power Levels'})
261xlabel('Number of Power Levels')
262ylabel('Average error in cm')
263grid on

72

RFID based positioning for libraries.

2- Number of RFID readers vs. average error:


%See the number of readers against error
clear all
%close all
clc

readers_dimension = [2,3,4,5,6,7,8,9,10];
for main_index = 1:length(readers_dimension)

for iter_main = 1:100


clearvars -except iter_main iter_num error main_index readers_dimension
error_avarage
%%%%%%%%%%%%% Parameters to be defined %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Number of power levels
R = 8;
%Number of readers per dimension 2 3 4 5 6
N_d = readers_dimension(main_index);
%distance between reference tags on the same line
d = 0.5;
%square space
d_space = 10;
%resolution of matrix
res = 1/20;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%start of calculations %%%%%%%%
%number of readers
N = N_d^2;
%Readers involved
%should be an even number
N_inv = floor(N/2)*2;
% if (N<6)
%
N_inv = 4;
% else
%
N_inv = 6;
% end

%Generate random position


real_target = randi([1 101],1,2);
%generate space matrix
tags_MAT = zeros((d_space/res)+1,(d_space/res)+1);

73

RFID based positioning for libraries.

%number of reference tags in each dimension


num_tags_d = floor((d_space/d)+1);
%distance between reference tags in terms of matrix index
d_in = d/res;
for in = 1:num_tags_d
for in2 = 1:num_tags_d
tags_MAT(d_in*(in-1)+1,d_in*(in2-1)+1) = (in2-1)*num_tags_d + in
;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%distance between readres in terms of matrix index
d_readers = floor(d_space/((N_d -1)*res));
for in = 1:N_d
for in2 = 1:N_d
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) =
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) + i*((in2-1)*N_d + in) ;
end
end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%tags indeces
[a,b] = find(real(tags_MAT) > 0);
tags_in = [a,b];
%readers indeces
[a,b] = find(imag(tags_MAT) > 0);
readers_in = [a,b];
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Maximum distance
max_d = d_space*sqrt(2);
%level
L = max_d/R;
%levels
levels = [0:L:L*R];
%real distance
for in = 1:N
a = real_target(1);
b = real_target(2);
d_real(in) = res*sqrt(((readers_in(in,1) - a)^2)+((readers_in(in,2) b)^2));
end
%find level the target is in for each reader
%In reality, the readers do not know which level it is in from one shot,
%the perform it level by level.
%initialize

74

RFID based positioning for libraries.

L_readers = zeros(1,N);
for in = 1:N
for in2 = 2:length(levels)
if (d_real(in) > levels(in2))
L_readers(in) = levels(in2);
end
end
end
%L_reders has the level for each reader

%find tags in the target level for all readeres and find avarage distance
for in = 1:N
d = kron(ones(length(tags_in(:,1)),1),readers_in(in,:)) - tags_in;
d = sqrt(d(:,1).^2 + d(:,2).^2);
d = d*res;
ind_d = find(d > L_readers(in) & d < L_readers(in)+L );
d_avarage(in) = 0;
if length(ind_d>0)
d_avarage(in) = sum(d(ind_d))/length(ind_d);
end
end
%find readers with min distances
for in = 1:N_inv
index = find(d_avarage == min(d_avarage));
if length(index) > 1
index = index(1);
end
d_target(in) = d_avarage(index);
readers_target(in,:) = readers_in(index,:);
d_avarage(index) = 10^10;
end
%readers_target = readers_in(1:N_inv,:);
%d_target = d_avarage(1:N_inv);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Do the first pair of readers


%Calculating position
A = readers_target(1,:); %# center of the first circle
B = readers_target(2,:); %# center of the second circle
a = d_target(2)/res; %# radius of the SECOND circle
b = d_target(1)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_11 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));

75

RFID based positioning for libraries.

intersect_12 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));


intersect1 = [intersect_11;intersect_12];
%Do the second pair of readers
%Calculating position
A = readers_target(3,:); %# center of the first circle
B = readers_target(4,:); %# center of the second circle
a = d_target(4)/res; %# radius of the SECOND circle
b = d_target(3)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_21 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_22 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect2 = [intersect_21;intersect_22];
%find the point
%finding the pair
p1 = norm(intersect_11 p2 = norm(intersect_11 p3 = norm(intersect_12 p4 = norm(intersect_12 %Distances
D_p = [p1,p2,p3,p4];
index = find(abs(D_p) ==

intersect_21);
intersect_22);
intersect_21);
intersect_22);
min(abs(D_p)));

if length(index) >1
index = index(1);
end
intersect_MAT(1,:) = intersect1(round(index/2),:);
intersect_MAT(2,:) = intersect2(2-mod(index,2),:);
intersect1;
intersect2;
intersect = sum(intersect_MAT)/2;
for in = 5:2:N_inv-1
%Calculating position
A = readers_target(in,:); %# center of the first circle
B = readers_target(in+1,:); %# center of the second circle
a = d_target(in+1)/res; %# radius of the SECOND circle
b = d_target(in)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);

76

RFID based positioning for libraries.

u_AB = (B - A)/c; %# unit vector from first to second center


pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_1 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_2 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect_iter = [intersect_1;intersect_2];
%finding the pair
p1 = norm(intersect_1 - intersect);
p2 = norm(intersect_2 - intersect);
D_p = [p1,p2];
index = find(abs(D_p) == min(abs(D_p)));
if length(index) >1
index = index(1);
end
intersect_MAT(end+1,:) = intersect_iter(index,:);
end
intersect = sum(intersect_MAT)/(N_inv/2);
%error in cm
error(iter_main) = norm(real_target - intersect)*res*100;
end
error_avarage(main_index) = sum(error)/iter_main;
end
figure
plot(readers_dimension.^2,error_avarage,'--*','Color','k','LineWidth',3)
axis([-inf inf 0 inf])
grid on
title({'Accuracy vs. Number of Readers'})
xlabel('Number of Readers')
ylabel('Error in cm')
grid on

77

RFID based positioning for libraries.

3- Distance between reference tags vs. average error:


%See the number of tags against error
clear all
%close all
clc

tags_distance = [0.1:0.2:1.9];
for main_index = 1:length(tags_distance)

for iter_main = 1:100


clearvars -except iter_main iter_num error main_index tags_distance
error_avarage num_tags
%%%%%%%%%%%%% Parameters to be defined %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Number of power levels
R = 8;
%Number of readers per dimension 2 3 4 5 6
N_d = 3;
%distance between reference tags on the same line
d = tags_distance(main_index);
%square space
d_space = 10;
%resolution of matrix. 1/20 means 5cm between each two adjascent nodes
res = 1/20;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%start of calculations %%%%%%%%
%number of readers
N = N_d^2;
%Readers involved
%should be an even number
%N_inv = floor(N/2)*2;
if (N<6)
N_inv = 4;
else
N_inv = 6;
end

%Generate random position


real_target = randi([1 101],1,2);
%generate space matrix

78

RFID based positioning for libraries.

tags_MAT = zeros((d_space/res)+1,(d_space/res)+1);
%number of reference tags in each dimension
num_tags_d = floor((d_space/d)+1);
num_tags(main_index) = num_tags_d;
%distance between reference tags in terms of matrix index
d_in = floor(d/res);
for in = 1:num_tags_d
for in2 = 1:num_tags_d
tags_MAT(d_in*(in-1)+1,d_in*(in2-1)+1) = (in2-1)*num_tags_d + in
;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%distance between readres in terms of matrix index
d_readers = floor(d_space/((N_d -1)*res));
for in = 1:N_d
for in2 = 1:N_d
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) =
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) + i*((in2-1)*N_d + in) ;
end
end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%tags indeces
[a,b] = find(real(tags_MAT) > 0);
tags_in = [a,b];
%readers indeces
[a,b] = find(imag(tags_MAT) > 0);
readers_in = [a,b];
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Maximum distance
max_d = d_space*sqrt(2);
%level
L = max_d/R;
%levels
levels = [0:L:L*R];
%real distance
for in = 1:N
a = real_target(1);
b = real_target(2);
d_real(in) = res*sqrt(((readers_in(in,1) - a)^2)+((readers_in(in,2) b)^2));
end
%find level the target is in for each reader
%In reality, the readers do not know which level it is in from one shot,

79

RFID based positioning for libraries.

%the perform it level by level.


%initialize
L_readers = zeros(1,N);
for in = 1:N
for in2 = 2:length(levels)
if (d_real(in) > levels(in2))
L_readers(in) = levels(in2);
end
end
end
%L_reders has the level for each reader
%find tags in the target level for all readeres and find avarage distance
for in = 1:N
d = kron(ones(length(tags_in(:,1)),1),readers_in(in,:)) - tags_in;
d = sqrt(d(:,1).^2 + d(:,2).^2);
d = d*res;
ind_d = find(d > L_readers(in) & d < L_readers(in)+L );
d_avarage(in) = 0;
if length(ind_d>0)
d_avarage(in) = sum(d(ind_d))/length(ind_d);
end
end
%
%
%
%
%
%

%get rid of readers with avarage distance equal to zero


zero_index = find (d_avarage == 0);
for in = 1:length(zero_index)
d_avarage(zero_index(in)) = [];
readers_in(zero_index(in),:) = [];
end

%find readers with min distances


for in = 1:N_inv
index = find(d_avarage == min(d_avarage));
if length(index) > 1
index = index(1);
end
d_target(in) = d_avarage(index);
readers_target(in,:) = readers_in(index,:);
d_avarage(index) = 10^10;
end
%readers_target = readers_in(1:N_inv,:);
%d_target = d_avarage(1:N_inv);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Do the first pair of readers


%Calculating position
A = readers_target(1,:); %# center of the first circle
B = readers_target(2,:); %# center of the second circle
a = d_target(2)/res; %# radius of the SECOND circle
b = d_target(1)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles

80

RFID based positioning for libraries.

cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_11 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_12 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect1 = [intersect_11;intersect_12];

%Do the second pair of readers


%Calculating position
A = readers_target(3,:); %# center of the first circle
B = readers_target(4,:); %# center of the second circle
a = d_target(4)/res; %# radius of the SECOND circle
b = d_target(3)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_21 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_22 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect2 = [intersect_21;intersect_22];
%find the point
%finding the pair
p1 = norm(intersect_11 p2 = norm(intersect_11 p3 = norm(intersect_12 p4 = norm(intersect_12 %Distances
D_p = [p1,p2,p3,p4];
index = find(abs(D_p) ==

intersect_21);
intersect_22);
intersect_21);
intersect_22);
min(abs(D_p)));

if length(index) >1
index = index(1);
end
intersect_MAT(1,:) = intersect1(round(index/2),:);
intersect_MAT(2,:) = intersect2(2-mod(index,2),:);
intersect1;
intersect2;
intersect = sum(intersect_MAT)/2;
for in = 5:2:N_inv-1

81

RFID based positioning for libraries.

%Calculating position
A = readers_target(in,:); %# center of the first circle
B = readers_target(in+1,:); %# center of the second circle
a = d_target(in+1)/res; %# radius of the SECOND circle
b = d_target(in)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_1 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_2 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect_iter = [intersect_1;intersect_2];
%finding the pair
p1 = norm(intersect_1 - intersect);
p2 = norm(intersect_2 - intersect);
D_p = [p1,p2];
index = find(abs(D_p) == min(abs(D_p)));
if length(index) >1
index = index(1);
end
intersect_MAT(end+1,:) = intersect_iter(index,:);
end
intersect = sum(intersect_MAT)/(N_inv/2);
%error in cm
error(iter_main) = norm(real_target - intersect)*res*100;
end
error_avarage(main_index) = sum(error)/iter_main;
end
figure
plot(num_tags,error_avarage,'--*','Color','black','LineWidth',3)
axis([-inf inf 0 100])
title({'Accuracy vs. Number of tags'})
xlabel('Number of tags per dimention')
ylabel('Error in cm')
grid on

82

RFID based positioning for libraries.

4- Area vs. average error:


%See the power levels against error
clear all
%close all
clc

dimension = [8:2:50];
for main_index = 1:length(dimension)

for iter_main = 1:100


clearvars -except iter_main iter_num error main_index dimension
error_avarage num_readers
%%%%%%%%%%%%% Parameters to be defined %%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Number of power levels
R = 20;
%Number of readers per dimension 2 3 4 5 6
%N_d = 5;
N_d = ceil(dimension(main_index)/5);
num_readers(main_index) = N_d^2;
%distance between reference tags on the same line
d = 0.5;
%square space
d_space = dimension(main_index);
%resolution of matrix
res = 1/20;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%start of calculations %%%%%%%%
%number of readers
N = N_d^2;
%Readers involved
%should be an even number
%N_inv = floor(N/2)*2;
if (N<6)
N_inv = 4;
else
N_inv = 6;
end

%Generate random position


real_target = randi([1 101],1,2);

83

RFID based positioning for libraries.

%generate space matrix


tags_MAT = zeros((d_space/res)+1,(d_space/res)+1);
%number of reference tags in each dimension
num_tags_d = floor((d_space/d)+1);
%distance between reference tags in terms of matrix index
d_in = d/res;
for in = 1:num_tags_d
for in2 = 1:num_tags_d
tags_MAT(d_in*(in-1)+1,d_in*(in2-1)+1) = (in2-1)*num_tags_d + in
;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%distance between readres in terms of matrix index
d_readers = floor(d_space/((N_d -1)*res));
for in = 1:N_d
for in2 = 1:N_d
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) =
tags_MAT(d_readers*(in-1)+1,d_readers*(in2-1)+1) + i*((in2-1)*N_d + in) ;
end
end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%tags indeces
[a,b] = find(real(tags_MAT) > 0);
tags_in = [a,b];
%readers indeces
[a,b] = find(imag(tags_MAT) > 0);
readers_in = [a,b];
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Maximum distance
max_d = d_space*sqrt(2);
%level
L = max_d/R;
%levels
levels = [0:L:L*R];
%real distance
for in = 1:N
%[a,b] = find(real(tags_MAT) == 10^6);
a = real_target(1);
b = real_target(2);
d_real(in) = res*sqrt(((readers_in(in,1) - a)^2)+((readers_in(in,2) b)^2));
end

84

RFID based positioning for libraries.

%find level the target is in for each reader


%In reality, the readers do not know which level it is in from one shot,
%the perform it level by level.
%initialize
L_readers = zeros(1,N);
for in = 1:N
for in2 = 2:length(levels)
if (d_real(in) > levels(in2))
L_readers(in) = levels(in2);
end
end
end
%L_reders has the level for each reader

%find tags in the target level for all readeres and find avarage distance
for in = 1:N
d = kron(ones(length(tags_in(:,1)),1),readers_in(in,:)) - tags_in;
d = sqrt(d(:,1).^2 + d(:,2).^2);
d = d*res;
ind_d = find(d > L_readers(in) & d < L_readers(in)+L );
d_avarage(in) = 0;
if length(ind_d>0)
d_avarage(in) = sum(d(ind_d))/length(ind_d);
end
end
%find readers with min distances
for in = 1:N_inv
index = find(d_avarage == min(d_avarage));
if length(index) > 1
index = index(1);
end
d_target(in) = d_avarage(index);
readers_target(in,:) = readers_in(index,:);
d_avarage(index) = 10^10;
end
%readers_target = readers_in(1:N_inv,:);
%d_target = d_avarage(1:N_inv);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%Do the first pair of readers


%Calculating position
A = readers_target(1,:); %# center of the first circle
B = readers_target(2,:); %# center of the second circle
a = d_target(2)/res; %# radius of the SECOND circle
b = d_target(1)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the

85

RFID based positioning for libraries.

%# vector along and perpendicular to AB that leads to the


%# intersection point
intersect_11 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_12 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect1 = [intersect_11;intersect_12];
%Do the second pair of readers
%Calculating position
A = readers_target(3,:); %# center of the first circle
B = readers_target(4,:); %# center of the second circle
a = d_target(4)/res; %# radius of the SECOND circle
b = d_target(3)/res; %# radius of the FIRST circle
c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_21 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_22 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect2 = [intersect_21;intersect_22];
%find the point
%finding the pair
p1 = norm(intersect_11 p2 = norm(intersect_11 p3 = norm(intersect_12 p4 = norm(intersect_12 %Distances
D_p = [p1,p2,p3,p4];
index = find(abs(D_p) ==

intersect_21);
intersect_22);
intersect_21);
intersect_22);
min(abs(D_p)));

if length(index) >1
index = index(1);
end
intersect_MAT(1,:) = intersect1(round(index/2),:);
intersect_MAT(2,:) = intersect2(2-mod(index,2),:);
intersect1;
intersect2;
intersect = sum(intersect_MAT)/2;
for in = 5:2:N_inv-1
%Calculating position
A = readers_target(in,:); %# center of the first circle
B = readers_target(in+1,:); %# center of the second circle
a = d_target(in+1)/res; %# radius of the SECOND circle

86

RFID based positioning for libraries.

b = d_target(in)/res; %# radius of the FIRST circle


c = norm(A-B); %# distance between circles
cosAlpha = (b^2+c^2-a^2)/(2*b*c);
u_AB = (B - A)/c; %# unit vector from first to second center
pu_AB = [u_AB(2), -u_AB(1)]; %# perpendicular vector to unit vector
%# use the cosine of alpha to calculate the length of the
%# vector along and perpendicular to AB that leads to the
%# intersection point
intersect_1 = A + u_AB * (b*cosAlpha) + pu_AB * (b*sqrt(1cosAlpha^2));
intersect_2 = A + u_AB * (b*cosAlpha) - pu_AB * (b*sqrt(1cosAlpha^2));
intersect_iter = [intersect_1;intersect_2];
%finding the pair
p1 = norm(intersect_1 - intersect);
p2 = norm(intersect_2 - intersect);
D_p = [p1,p2];
index = find(abs(D_p) == min(abs(D_p)));
if length(index) >1
index = index(1);
end
intersect_MAT(end+1,:) = intersect_iter(index,:);
end
intersect = sum(intersect_MAT)/(N_inv/2);
%error in cm
error(iter_main) = norm(real_target - intersect)*res*100;
end
error_avarage(main_index) = sum(error)/iter_main;
end
figure
plot(dimension.^2,error_avarage,'--*','Color','k','LineWidth',3)
grid on
title({'Accuracy vs. Area'})
xlabel('Area in m^2')
ylabel('Error in cm')
grid on
figure
plot(dimension.^2,num_readers,'--*','Color','k','LineWidth',3)
grid on
xlabel('Area in m^2')
ylabel('Number of Readers')
grid on

87

RFID based positioning for libraries.

Appendix B: Gantt Chart:


Chart Title
4/27/2011

5/17/2011

6/6/2011

6/26/2011

7/16/2011

8/5/2011

8/25/2011

9/14/2011

Literature Review

specification

Simulation
Start date

Analysis & Comparisons

Duration (days)
First Draft

Final Draft

88

You might also like