Practical Approach of using Embedded Controllers 2008/PDFs/20 Mircea RISTEIU.pdf · Practical...
Transcript of Practical Approach of using Embedded Controllers 2008/PDFs/20 Mircea RISTEIU.pdf · Practical...
CONFERINŢA NAŢIONALĂ DE INSTRUMENTAŢIE VIRTUALĂ, EDIŢIA A V-A, BUCURE�TI, 20 MAI 2008
Practical Approach of using Embedded Controllers as Expansion System for Virtual
Instrument over TCP/IP and 802.11 b/g protocols
Mircea RISTEIU, Bogdan CROITOR, Loredana BOCA
Abstract - We are developing a real time remote measuring system based on cRIO 9004 reconfigurable controller system for wind energy measurement. We use two modules, in chassis. We measure many heterogeneous types of parameters. The purpose of our approach is to exploit the performances of high speed FPGA and/or real time implementation via TCP/IP and 802.11g. Based on these aspects we have developed LabVIEW- based virtual instruments and we have tried to optimize measurements performances taking into account the sampling time, measurements delay, time delay processing, and desktop applications behavior. Running these VI for one criterion the main related expectations have been fulfilled. For combined criteria, some improvements have to be developed into the software side. Because of the desktop configuration, into remote measuring implementation some actual facilities of LabVIEW programming philosophy must be canceled. Index Terms - remote measurements, reconfigurable controller, virtual instrumentation, measurement delay, time delay processing, desktop configuration, wind energy.
—————————— � ——————————
1. Introduction
We have started using LabVIEW implementation
for wind energy evaluation taking into account the
power of G-based programming.
The main requirement for using real time
measurement around LabVIEW implementation was
the demand for adding some environment
monitoring parameters to the main wind energy
parameters list. This aspect requested to mix together
some heterogeneous parameters. For that matter we
expect some parameters measurements to interfere
each other.
In our approach we use some sensors as follow:
• We have realised measurements of
enviromental parameters: temperature, wind
speed;
• Wind direction, noise level, stroboscopic
effect and 2 axes vibrations;
• Wind direction sensor (Wilmers);
• Wind speed sensor – anemomether (Thies);
• Atmospheric pressure sensor;
• Humidity sensor;
• Temperature sensor attached on the metallic
wind direction support;
• Crossbow Tilt Sensor (this sensor includes
vibration and temperature measurement
parameters);
Although we are measuring the level of solar
radiation and the electric energy generated by the
solar panel used for powering on the entire system.
Fig. 1 Deployed system
In Fig. 1 on a big steel pilon are attached two
solar panels, one temperature sensor and the data
acquisition device used for collecting data from
sensors. The data is sent to a computer through a
wireless connection.
The main advantage of this implementation is
based on the fact that the TCP/IP- based
reconfigurable controller allows us to organize a
CONFERINŢA NAŢIONALĂ DE INSTRUMENTAŢIE VIRTUALĂ, EDIŢIA A V-A, BUCURE�TI, 20 MAI 2008
2
mobile measuring system with remote control
facilities.
For such issue, we have access to buss controller
and monitor, and remote terminal.
2. Using cRIO 9004
Fig. 2 cRIO 9004 device (controller)
A brief description of the reconfigurable controller
we use here will be figured next.
• cRIO-xxxx is a very performant data
acquisition device of NI;
• Extended work capacity;
• 512 MB of Nonvolatile memory enough for
any application running on cRIO controller
and for storing all the external recorded
parameters for many months;
• Power consumption: 7 W max only the
controller and 17 W max with 8 cRIO
modules;
• Real-time data transmition;
• Local and remote working capability;
• Both analog and digital input signals for
attached modules on cRIO chassis;
• Possibility of sending recorded data over a
large distance (remotely) through a secured
wireless connection (802.11 b/g);
• Configurated and programmed using the
FPGA and Real-Time Modules of Lab View
8.5;
• The Ethernet interface of cRIO directly
connected to a Wireless Access Point (D-link)
for sending data remotely;
• NI 9221 for data acquisition (analog I/O +/-
60V) plugged into cRIO chassis and in it’s 8
channels can be connected external signals;
• cRIO was programmed with NI-RIO 2.3
software package with all required
subcomponents (Visa server, Lab View 8.5,
etc…).
3. Network Configuration
With all fizical connections made, with all
equipements powered on and properly functioning,
we focused on other important aspect of the project –
Network Configuraton.
To transmit all recorded environmental data
from cRIO to a PC over a large distance (remotely)
we implemented a wireless network for this purpose.
cRIO was directly connected to a Wireless Acces
Point using an UTP cable, because both WAP and
cRIO were deployed close to each other and because
cRIO has only a TCP/IP Ethernet port for a network
cable connection.
The computer has been also connected to a
second WAP + a second antenna with the same
caracteristics as the first WAP.
For better wireless range we attached a very
powerfull antenna (25db power) to WAP, so in this
way data can be transmited over a bigger distance.
Fig. 3 cRIO – fizical connections
Figure 3 shows how external sensors have been
connected to cRIO. Every wire wich is plugged into
NI 9221 module represents an external sensor, so
each wire is transporting a signal from external
sensor to NI 9221 and each sensor is recording
different environmental parameters (different analog
signals).
Fig. 4 cRIO configured with MAX
(Measurement and Automation Explorer)
CONFERINŢA NAŢIONALĂ DE INSTRUMENTAŢIE VIRTUALĂ, EDIŢIA A V-A, BUCURE�TI, 20 MAI 2008
3
We used MAX (fig. 4) to configure the Ethernet
interface of cRIO, to assign an IP and a name to the
device to be able to work in the network.
Both WAPs, cRIO and PC have IPs in the same
class and subnet. We gave a name to the network and
the wireless connection is protected using WPA 2
encrytion solution for high level of security . After
this step done we tested the conectivity and the link
between all devices in the network (PING command)
to see if the network is functioning or not.
Another aspect of the project was testing the
transmiting distance from the remote sensor to PC.
4. LabView Application
The most interesting and challenging part of the
project was the creation of a small application in
LabView 8.5 to effectively display and manipulate
the read data from all connected sensors.
And to do this we needed to create a new Lab
View project on a target device (in our case cRIO
named as “myRioK”).
We created two VIs: one on FPGA Target and
second on the REAL-TIME part (see Fig. 5).
Fig. 5 Project Explorer
The first VI called “FPGA buf read 2.vi” on
FPGA Target is reading the data from the channels of
NI9221 and store it into a FIFO for each channel
(buffer).
We used a FPGA I/O node to be able to read data
(signals) from NI9221 – cRIO. Four channels have
been read, each channel for different sensor (see Fig.
6).
CONFERINŢA NAŢIONALĂ DE INSTRUMENTAŢIE VIRTUALĂ, EDIŢIA A V-A, BUCURE�TI, 20 MAI 2008
4
Fig. 6 “FPGA buf read 2.vi” Block Diagram on
FPGA Target
Each “FIFO – read” has a numeric indicator
where data is displayed and these indicators are
invoked in the second VI to manipulate the contained
data (in real-time mode).
The second VI, named “Real time read-scalare
2.vi” (see Fig. 5), is realised on the REAL-TIME part
of the project and invokes the first VI and to be more
precise the four indicators (Element 4, Element 5,
Element 6, Element 7) are used and invoked as a VI
reference object on FPGA Target.
In this VI we made a few mathematic
calculations that are called calibrations wich means
we used a few linear transformations to adjust the
displayed value to the real value.
Generally these kind of sensors that we have
used are not factory default scaled, so the values
recorded and transmited needs a linear
transformation to display the real value.
For example we used a Crossbow Tilt Sensor
CXTLA 02 to measure the temperature and the
rotations on two ortogonal axes.
Without scalling the results, the sensor measured
a temperature value of 67 (not Fahrenheit - numeric
value), but outside were 18 degrees Celsius, so we
had to adjust the read value (67) to 18 (the real value)
using a simple linear transformation.
Fig. 7 “Real time read-scalare 2.vi” Block Diagram
on Real-Time part
The formula was found only with many tryes
and the accuracy of this formula is 95%. The general
formula used by NI to scale the results is:
(data_read_from_a_channel *
(the_addition_without_sign_of_the_inferior_and_s
uperior_limit_of_module_voltage / 2^
bit_resolution_module)). But this formula we had to
change it a little bit.
Depending on different sensors and different
signals, each channel might be scaled with different
formulas (see Fig. 7).
After that the results were displayed on the Front
Panel of the application in a few ways.
It was attached to this VI (inside it) a loop timer
to read data from cRIO only in specified time
intervals (dinamic control), because the speed of the
FPGA is 40Mhz (250 ns) and is a very big speed. You
cannot see the displayed data (numeric value)
because is changing very quickly.
A very important aspect is the oscillation of the
displayed value. That value is permanently changing
in a small interval. For example if the real recorded
temperature value is 18 degrees Celsius then the
application will display a value between 17,75 and
18,25.
5. Conclusions
Data acquisition system cRIO-9004 proves it’s
efficiency in acquiring a large variety of signals from
all external sensors directly connected to it’s modules
channels (in our case NI 9221).
CONFERINŢA NAŢIONALĂ DE INSTRUMENTAŢIE VIRTUALĂ, EDIŢIA A V-A, BUCURE�TI, 20 MAI 2008
5
Although cRIO-9004 extends the boundaries of
sensoristic measurements and the remote
transmission aspect.
Using cRIO-9004 remotely with a lot of different
sensors deployed close to it and with a powerful
wireless connection you can very easy monitor a
large variety of environmental parameters in a
custom area. In this way you are able to make
predictions on collected / recorded data.
cRIO-9004 has 8 slots for attaching 8 different
data acquisition modules and, basically, you can use
almost any type of external sensor with cRIO without
problems.
In the future cRIO will be used in a pilot project
with a lot of environmental parameters sensors to
monitor a large area and after a year, based on
collected and analyzed data to choose building
between a farm of solar panels or a farm of wind
generators, as a free electric, nonpolluting,
regenerating energy source.
Fig. 8 Wind direction sensor with an attached
temperature sensor
All sensors in figures 8, 9, 10 have been used
with cRIO-9004. Parameters measured wind
direction, wind speed, temperature, light intensity
and rotations on 2 axes (vibrations).
Fig. 9 Solar Panel
Fig. 10 cRIO-9004 & Crossbow Tilt Sensor CXTLA
02 (rotations in two AXES and temperature)
BIBLIOGRAPHY
[1] *** LabVIEW 8.5 Development Guidelines; April 2007
Edition; National Instruments Corp. Austin, Texas,
U.S.A.
[2] *** LabVIEW 8.5 User Manual; April 2007 Edition;
National Instruments Corp. Austin, Texas, U.S.A.
[3] *** www.ni.com/support ;
[4] *** www.xbow.com ;
[5] *** T. Savu, G. Savu, “Informatică – Tehnologii
Asistate de Calculator”, Editura ALL, Bucureşti, 2000