Group SD0626

From ECE Department Wiki

Jump to: navigation, search

RFID MEASUREMENT SYSTEM

Aaron Scherbing
Gregory Owen
Tucker Smith
Advisor: Dr. Glower

Image:Group_Picture.JPG


Contents

Introduction

In recent years, the United States Department of Agriculture has been investigating numerous means of safeguarding America’s food supply. New technologies related to food safety have recently evolved, allowing the focus of this research to use the cutting edge of today’s available knowledge. An interesting avenue of research has been the use of Radio Frequency Identification (RFID) to more accurately monitor the status and movement of livestock, from “feedlot to fork”.

At the Center for Nanoscale Science and Engineering (CNSE), located in the Research and Technology Park on the campus of North Dakota State University (NDSU), new designs for RFID tags were developed to be implemented in the identification of cattle. However, the RFID testing facilities at CNSE were not suitable for repeatable, accurate measurements of the RFID tags’ performance, specifically the maximum read range of the tags. A solution for more accurate testing was presented, resulting in the creation of vertical antenna testing structure.

Requirements

The main requirement for our group was to assign a Quality Number (QN) to an RFID tag. The QN would be an indication of the tag’s performance. Our group was given freedom to choose the method of assessing performance, assuming the method would result in a repeatable QN.

Options for assigning a QN included holding the tag at a fixed distance and varying the output power of the reader until the tag could no longer be read. The QN in this instance would be the power attenuation level of the reader (i.e. -50 dB would be considered a 50 tag). Alternatively, the attenuation of the reader could remain constant while the tag was raised and lowered above the reader until it could no longer be read. The QN would then be a distance measurement; a reading of 550mm would be considered a 550 tag. Based on the available antenna stand and its great height capabilities, we chose the latter option to assign Quality Numbers.

Design

In order to produce the most accurate Quality Number possible, a few considerations had to be addressed. For repeatable, reliable results, we decided to set a goal of accurate distance measurements between the reader and the tag to be within ±1 cm. To further enhance our measurement reliability, no metal was to be used above ground level. Using the existing antenna stand and Alien™ 9780 RFID reader, we were ready to begin the design process. The following sections describe the process of our design work.

Block Diagram
Image:Block_diagram.png

Communication between the computer, RFID reader, and PIC is facilitated by 74155, 74151, and two MAX232 chips located on the right most section of the board. The PIC is read in from the top serial port, the RFID is read in from the bottom left serial port, and the computer data is output through the bottom right serial port.

Power for the entire project is comes from the power supply that plugs into the left most portion of the board. This gives the board ±12 V, 5V, and Ground. The 5V and Ground is used throughout the entire board.

The motor gets power from the power operation amplifier located directly to the upper right side of the power supply connection and to the left of the PIC serial port. This output cannot be directly attached to the motor as there will be negative start-up voltages that will affect the position of the tag.

To compensate for this problem a 7404 inverter and 8001 chip were added to run only when the voltages levels are where we want them to be. The 8001 is a relay that turns on when the voltage levels are opposite of what we need. The 7404 inverts this to make the levels what we desire. A red LED indicates a usable voltage level.

The output voltage to the motor is located to the left of the RFID serial port and runs from the top most of the two pins directly to the positive connection of the motor. The negative connection of the motor is connected to the ground plane on the PCB or any negative on the board, as they are all connected.

PLEASE NOTE: A non-conductive device must be placed between the connections of the motor and other metal on the motor as the power and ground could be shorted together.

The optical encoder is read in on the bottom left connection on the board. This counts the pulses (distance the motor moves) and sends the information to the PIC using a four wire connection that connects the pulses (RB0 and RB1) as well as supplies the controls board with a 5V and Ground.

A switch is located directly above the RFID serial port that can be connected to either ground or the control pin of the PIC. The PIC is connected via wire soldered to the bottom of the board. This switch is grounded during normal operation and set to control to download new code to the PIC.

PCB Design Considerations

Many optional limitations were put on the PCB that we were designing. We wanted to make efficient use of the board as it will then be as small as possible for a smaller enclosure. Another reason is that the traces would then be shorter making the board easier to make and less likely to have flaws.

For enclosure considerations we wanted all the connections on one side of the board making it easy to pug in and get ready. This was accomplished but there were problems hooking up to the PIC on the other board. This problem along with the fact that the reset button was on the controls board, the one we were going to put on the bottom, so we were not able to make an enclosure for our boards.

We also had to consider all the powers and grounds we had and to connect them all as they would be no floating ground and a constant 5v to where we needed to go. The power supply took care of this along with connecting wires but also added to the issue of an enclosure as the power supply was sufficiently larger than the boards.

Structure Design Considerations

Our project is to lift a small tag. In our design then we wanted to make a sctucture as small and simple as possible. Due to the height of the project and the need to use only non-conductive materials, four inch PVC pipe was used. This insured stability, strength, and would not interfere with antenna readings caused by reflections. The original PVC arm to hold the tag was downsized to half inch PVC. Small wooden dowels were also considered but with slight conductivity we decided to use only PVC piping.

Looking into non-metal pulleys was more difficult that seemed at first. After designing a Teflon pulley, we decided not to use it now that the PVC arm was lighter than it was previously. The extra pulley on the system would not help anymore to lessen resistance as the rope would just slide over it.

The half inch PVC was used for several reasons. This was non-conductive as stated before but also light enough now to where we could use a smaller string. This light arm could now be lifted by fishing line. This helped out tremendously measuring distance as the diameter of the spool that fed the line changed so little from when the line was maxed out or at its minimum. This made finding the right spooling mechanism obsolete, as any spool would now work.


Software, Flow Charts

Software Flow Chart
Image:SoftwareFlowChart.JPG

The Motor Control Software is comprised of a single main.c file and a few auxiliary files: d2a.c, function.c, bootloader.c, and sci.c. The auxiliary files should not need to be adjusted. A complete copy of the code can be found in the appendix.

Software Considerations

The software is meant for communications. Its primary responsibility is to keep track of the state of the motor, the height of the bar, and the measurement of the antenna. It has to do all of this while recording the data to the computer.

Communications were obviously a major part of the considerations for the software design. The main question we had is how to talk to the computer and the RFID reader from the same serial port. We decided to borrow an idea from computer architecture. Computer buses utilize a main data line. It’s through this data line that the processor communicates with all of the devices.

We decided to do something similar to this. We designed a bus that had a single control line. When the PIC sent 0 to the control line, all the communications went to the PC. When the PIC sent 1 to the control line, all the communications went to the RFID reader. This was a very effective way to control communications from the software inside the PIC.

Also we had to consider what we were going to output to the user. We initially had the idea of making a GUI that the user could click on to make certain activities happen. This turned out to be too large of a task for the limited amount of time and man hours that we had here during the course. We eventually decided to use HyperTerminal as a way to communicate to the PIC. This allowed us to see what was going on as well as control some activities of the PIC program.

Power Supply

Our system requires ±12V and +5V to properly power every component. Initial studies showed the OPA2544 would be a good operational amplifier to drive the motor. The OPA2544 is a dual package high voltage, high current op amp that is used in typical motor control applications.

The op amp is designed to push current either direction through the motor, thereby controlling the motor’s direction of rotation and speed. Below is a typical circuit used for this type of application.

After investigation into using this circuit, proper control of the motor proved to be difficult. The “zero” point, or point where the motor is not rotating, would actually correspond to +6V delivered to each op amp. Keeping the motor at 0 rpm would require an exact balance of input voltages to each op amp. This proved to be difficult. Also, our distance calculation algorithm depended on the voltage level being sent to the motor. Initially, the algorithm was developed with a voltage range from -5 to +5 V; a new range of 0 to 12 V would require reworking the algorithm.

Our solution to this challenge was to investigate other sources of power, and we decided to use a PC power supply. The supply we chose delivered all of the proper voltage levels at the corresponding current requirements. Protection was also built-in to the unit, providing us with short-circuit, over-voltage, under-voltage, and overload protection we otherwise would not have had. The PC power supply solved our power issues, and proved to be a cost effective choice.

Testing and Evaluation

There were a few distinct areas we needed to test. We needed to measure the distance movement of the arm. This needs to be exact in order to get reasonable measurement results. We needed to test our structure under ideal conditions to make sure that the RFID Tag reading was performing to expectation. We also needed to test the integration of all the parts.

Distance Measurement

There were a few measurement tests that we conducted. We obviously had to test to make sure that the distance movement was as expected. We did this by telling the motor to move an exact known distance and then measuring that distance with a ruler. If the two matches, we concluded that he motor was keeping track of distance correctly.

Secondly, we had to make sure that pulses from the optical encoder were not being missed. We did this by running the arm up the full length of the stand and back down. We then verified that the arm stopped at the same place it started. If this is the case, the arm will not have missed any pulses.

Ideal Conditions

We tested our stand outside under what we considered ideal conditions. The purpose of these tests was to confirm that the reader would function as designed in a location with minimal interference. We tested outside in a location that was far from metal.

We found that the RFID reader was accurate within 10 cm, which is slightly less than expected. Since we did not design the reader, we did not have the ability to change this.

Integration

We tested the integration as part of the software design phase. This was essential at the time of software development because the software wouldn’t run without the hardware working. We found that there were a few issues with communications, but these issues were fixed by adding a ground plane and making sure the chain of hardware going to the computer was minimal.

Comments

Tips to Incoming Students

If you can get something done with the materials you have (making a board for example), do it immediately as you can bank on it not working the first time and you will have to have time to trouble shoot and/or make more boards. Time is the most valuable thing you have at the beginning of the year.

An important aspect in design is to order parts and start work before you think you are ready. Trying to get everything perfect before you start will never get you started. There will be many ideas floating around, try and take the best ones and get them materialized. Lessons learned through building are much better than just scratching an idea out after thinking it will not be the best for you.

Issues

We ran into issues with dependability of the PIC. We found that pins would tend to switch from high to low if they had enough “persuasion” from outside sources. Even if the PIC was set up for output, we found that the pins would switch value before shorting out.

We also ran into accuracy issues within the floating point division and multiplication. It is reasonable to keep data in large integers and just move the decimal point if you have a fixed accuracy that you would like the outcome to be.

Problems

We found that the PIC tends to be very sketchy during startup. When you are first powering the PIC up, it is best not to rely on the output of the pins. The pins tend to go haywire for 6 seconds. This is a major problem if you rely on the pins in those starting situations. We fixed out problem by integrating a relay that turns on when the input is normal.

Design Flaws

Initially we had a design flaw with the calculation of our distance. We were getting distances that were close but only because we estimated some parameters in our algorithm. It is crucial to determine measurements ahead of time, before implementing algorithms in code.

We had a design flaw integrating with hardware when it came to motor speed. Our D2A wasn’t output the voltage that we had initially expected. This would require a redesign of the PIC board to use a different D2A chip which output a higher voltage. Lessons Learned We learned that the software is very much more reliable than hardware. We think this is because software execution has already been tested by the compiler creators. Hardware is so much integration that it’s tough to test ahead of time. This is where troubleshooting skills come in.

Future Work

Motor Speed

One of the primary issues we faced this year was getting the motor to move at the speed we desired. Some things affecting this were the undesired effect of missing pulses when the motor is moving too fast. Also the D2A started to malfunction later on in the year, resulting in slower motor speeds.

We would like to address this issue, fixing the speed. We would like to also add a transfer function to control the motor speed.

RFID Reader Attenuation

As of now, the RFID reader only outputs at full power. We think it would be a valuable measurement to see how tags work at less than maximum power. One such measurement could be to move the tag to a designated height. Then adjust the attenuation until the tag cannot be read anymore. This would give us a good idea of how the tags react to attenuation and not just distance.

GUI/Computer Software

Another downfall that we have discussed is that HyperTerminal is not exactly the most user friendly input/output environment. It would be nice to sit down and make a user friendly graphical user interface for the user to interact with our measurement system.

Another possible addition would be to calculate statistics based on the past reads of a specific tag. It would also be worthwhile to compare trends as new tags are created. This would require a database collecting tag data for statistical analysis.

Software functionality in PIC

We don’t currently have the full-scale compiler of the PIC. This is severely limiting our ability to make some useful features. Some things that we would like to put in the PIC software that we were unable to because of size limitations are the ability to adjust variable inside the program (maximum read distance, attenuation vs. distance), and we would like to add the ability for more error checking. Right now if you put in letters, our system will have very unexpected results. This is because the PIC is only reading the value stored in the ascii byte combination, not checking to see if the 8-bit ascii code is numeric.

Summary

The control system we designed and built performs its desired function. An RFID tag can be inserted into the system, one button is pushed, the system performs its routine, and a Quality Number is assigned to the tag. Because the requirement of our project was to assign a QN to a tag, we feel we have accomplished our goal. We have used knowledge from almost every Electrical Engineering course we have taken, which incorporates many concepts, theories, and practices used in industry. Our system does have its limitations and room for improvement, but we feel our efforts have produced an overall successful product.

Budget

Proposed Budget: $876.00
Total Research Expenses: $463.40
Unused Budget: $412.60
Retail Value: $524.85 (Without Alien Equipment)
Total Retail Value: $2,293.20 (All Components)

Personal tools