Intelligent Sensor

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Intelligent Sensors - Overview, Design Hints and Examples by Jrg Bttcher

b+ Prof. Dr.-Ing. Jrg Bttcher Engineering Consultants Haslacher Str. 93 D-94469 Deggendorf phone +49 991 340 897 fax +49 991 340 447 email [email protected] or [email protected]

Intelligent Sensors - Overview, Design Hints and Examples by Jrg Bttcher

The common way of connecting analog sensors to P-NET (or to other fieldbus systems) is to take a coupling box with a P-NET port on one side and various analog inputs on the other. Typically for such modules in the P-NET world is the availability of additional process functions allowing the implementation of local process algorithms. Because of decreasing costs for coupling hardware like microcontrollers there is a trend towards so called intelligent sensors with on-board P-NET coupler. Although smart sensor seems to be the better name we should speak of an intelligent sensor because smart usually stands for devices with so called HART protocol being not a real fieldbus but a 4...20 mA interface with low speed binary signals in superposition.

1. Intelligent Sensors: Structures and Requirements (Figures 1-3) Fig. 1 shows the basic structure of an intelligent sensor. Analog Signal Conditioning in this context means circuits like amplifiers, filters etc. After an Analog Digital Conversion (ADC) the process value is stored inside the memory of a controller (typically micro controller) where also some digital signal conditioning algorithms may run. Via a bus coupling device the value or a value being calculated can be read out from the bus.
Whereas conventional sensors only support data traffic in one direction - from the sensor to the host or to the coupling fieldbus box - intelligent sensors allow data to be send in both direction. Not only pure process data is sent but also derived data, status information and various parameters (Fig. 2). Looking on typical bus structures within the area of process industry leads to the requirements shown in Fig. 3. One can recognize that P-NET completely fulfills those requirements. In accordance to Fig. 3 P-NET has the following characteristics: access time: 2.8 ms about 300 analog transfers per s can be handled length of data package: 1...63 bytes within one frame, more with LONG commands up to 125 nodes within single P-NET segment, more with multi-segment structure

2. Main Function Blocks (Figures 4-6)


Function blocks in the analog part of the intelligent sensor are shown in Fig. 4. Very often voltage output is used where an amplifier is producing a signal correlated to the input range of the ADC. Instead of this it may be cheaper and more accurate in many cases to take an oscillator circuit with the sensors resistor, capacity or inductance as frequency determining element. In Fig. 5 the ADC methods for the two basic output signals of the analog part are described. For frequency signals two internal timers of the micro controller can be used to measure the frequency.

Fig. 6 is showing three possible structures of combining the controller and the bus coupler. In the P-NET world of today the standardized method is to take a 8 bit micro controller with integrated UART. Whereas the controller then calculates all procedures of layer 2 and 7 of the P-NET protocol - the main layers for slave implementations - an external driver is used for implementing layer 1. Another method can be to take a micro controller with external P-

NET protocol chip and driver. Or - for very simple sensors - one take a special programmable fieldbus chip (IX-1) as single chip solution. 3. Cost-effective Implementation of P-NET In this chapter the above mentiond three methods of implementing P-NET into a sensor will be described. When using the first method - called software protocol - the UART of the micro controller should be configured in a way that it will produce an interrupt on signal 1 of the 10th bit of the frame because this is the address/data bit signalling that the first 11 bit group of the master request frame is coming in (Fig. 7). Then the complete rest of the frame will be read in within the Interrupt Service Routine (ISR) followed by the building up of the response frame. Of course when the first 11 bit group representing the slave node adress is not identical to the sensors address the ISR can be finished very fast. The timing requirements being a little bit critical because of the need for immediate response are listed in Fig. 8. When using the P-NET Chip (PNC) like shown in Fig. 9 the data handling can be controlled by interrupt leading to a lower controller load for managing the fieldbus traffic (Fig. 10). From P-NET side some Softwire Numbers are predefined (Fig. 11). Others can be defined and handled within the host CPU. Taking the IX-1 (designed by DELTA t, produced by SGS-Thomson) means that the P-NET protocol has to be loaded into a serial (EE)PROM from which it can be read in into the IX-1 internal program memory after reset (Fig. 12). Of course an additional RS-485 driver must be used. The register model in Fig. 13 shows that the IX-1 has a so called Harvard architecture with programm and data memory physically decoupled. In Fig. 14 the principal coupling of the application - being ADC and sensor device with analog hardware - is shown. Of course when developping intelligent P-NET sensors the rules for designing the channels and registers must be followed too. The minimum solution being in accordance to the Standardized General Purpose Channel Types (published by the International P-NET User Organization) is defined in Fig. 15. In many cases it is possible to add some more process functions like PID or Fuzzy Control etc. without any new hardware. Then additional channels must be defined.

4. Examples from P-NET World


In Fig. 16 some examples of intelligent P-NET sensors being on the market for a longer time are given. Here intelligent sensor means that the complete electronics including all PNET coupling devices are inside the housing of the sensor. In addition there are many other sensors with external electronic box including the P-NET interface available. Specialized coupling devices making a conventional sensor intelligent - but not having a real intelligent sensor then - are listed in part B) of Fig. 16.

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Basic Structure of Intelligent Sensors

g og in al al on An gn diti Si on C

Process
Sensor Device

s plin Bu ou C

C on

ADC

tro lle r

Fieldbus
2 46  +,4

Intelligent Sensors

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Communication Data From Sensor: Process Data (e.g. Pressure, Temperature, Humidity, ...) Derived Data (e.g. Average, Integral: Flow from Speed etc., Output of PID Algorithm, ...) Status (e.g. Fault Messages, Self Monitoring, etc.) To Sensor: Parameter for Digital Signal Conditioning (Linearization, Compensation of Temperature, Manufacturing Jittering, ...) Parameter for the Calculation of Derived Process Data Bus specific Parameters (e.g. Node Address, ...)

46

+,4

Intelligent Sensors

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Requirements on the Fieldbus System


E.g. Intelligent Sensors for analog Process Data in Process Industry: Single Sensor: Access Time: max. 10 ms Time Gap between two Accesses changeable: typ. 100 ms (e.g. fast Measurements of Flow) ... 1 min (Monitoring of Temperature) Length of Data Package changeable: 1 Byte (e.g. Error Status) ... 4 Byte (e.g. Process Data) ... 1 kByte (e.g. Complete Signal Conditioning Algorithms) Whole System: typ. up to 50 Bus Nodes Data Through Put: typ. up to 100 Process Data per s
2 46 ! +,4

Intelligent Sensors

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Analog Signal Conditioning


Sensor Device Output: A) In most cases: Impedance (Resistor, Capacity, Inductance) B) Sometimes: Electrical Charge (Piezo Sensor), Voltage (Thermo Couple) Signal Conditioning for Type A): - D.C. or A.C. Bridge with Voltage Output, if need be A.C./D.C. Converter, D.C. Amplifier (Voltage to Voltage) - Oscillator with Frequency Output Signal Conditioning for Type B) - D.C. Amplifier (Charge/Voltage to Voltage)
2 46 " +,4

Intelligent Sensors: Main Function Blocks

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Analog Digital Conversion


ADC for Frequency Signals: Algorithm for Frequency Measurement within the Micro Controller - Lower Frequencies: Time Measurement of 1 Period or n Periods, f = 1/T - Higher Frequencies: Counting of Periods per Tmeasure = const. - Resolution Changeable by Parameters n or Tmeasure (typ. 10, 12, 14, 16, 18 Bit) ADC for Voltage Signals: External or built-in Converters - Various Methods (very often: Successive Approximation, Sigma-Delta) - Resolution in most cases fixed (typ. 8, 10, 12, 14 Bit)
2 46 # +,4

Intelligent Sensors: Main Function Blocks

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Controller & Bus Coupling


Micro Controller with P-NET Software Protocol - typ. 8 Bit type with integrated UART (8051, 6805, 68HC11, ...) - UART should be able to initiate Interrupt on 10th bit (adress/data bit of the P-NET frame) - external RS-485 driver, galvanically decoupled (see standard) Micro Controller with external P-NET Protocol Chip - P-NET Chip (PNC) and RS-485 driver - IX-1 with P-NET firmware Single Chip Solution - IX-1 with P-NET firmware (including application)
2 46 $ +,4

or

Intelligent Sensors: Main Function Blocks

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Software Protocol (Flow Chart)


Interrupt from UART on 10th Bit (Address/Data Bit is 1)
Interrupt Service Routine: Read in Slave Address

If Slave Adress <> Own Address RETI Read in Master Address Read in Control Read in Info Length and Info Field Read in and proof Checksum

Back to Main Routine


2 46 % +,4

Case LOAD/ LONG LOAD: : - if need be call service routine (e.g. for transformation internal data format into P-NET data type) - send out response frame - RETI others : - if TAS: make TAS operation - send out response frame - put adress of service routine on stack and RETI - call service routine (e.g. for transformation P-NET data type into internal format) - RET

Master Request

Slave Response

Intelligent Sensors: Implementation of P-NET

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Software Protocol (Timing Requirements)


Two basic Limits: Slave must not answer before 11 Bit Periods after Receiving of the last Bit of the Master Request Slave must answer not later than 30 Bit Periods after Receiving of the last Bit of the Master Request With P-NET Bitrate 76.800 Bit/s (1 Bit about 13 s): 11 Bit: 143 s 30 Bit: 390 s

Typically a Timer is used for Supervision


2 46 & +,4

Intelligent Sensors: Implementation of P-NET

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Hardware Protocol (P-NET Chip)


Structure:
SPI-Interface

RS-232-Interface

General Purpose I/O P-NET

To Host Micro Controller

46

' +,4

Intelligent Sensors: Implementation of P-NET

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Hardware Protocol (P-NET Chip)


Data Handling:
Ck ec ks um ma na ge db yP NC
2 46  +,4

- P-NET Chip (PNC) receives Request Frame from Master and built up Slave_Request_Packet - Slave_Request_Packet is put into Slave_Request_FIFO (Depth is 4 Bytes) - Host CPU reads out Slave_Request_FIFO whenever it is full and the PNC has generated Interrupt ("FIFO full") - After receiving the complete Packet the Host CPU has to built up Slave_Response_Packet - Host CPU sends Slave_Response_Packet to PNCs Slave_Response_FIFO; controlled by interrupt ("FIFO empty") - PNC sends out Response Frame

Intelligent Sensors: Implementation of P-NET

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Hardware Protocol (P-NET Chip)


Registers:
To Host CPU Reg.No 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Register FIFO_Out_A FIFO_Out_B FIFO_Out_C FIFO_Out_D FIFO_In_A FIFO_In_B FIFO_In_C FIFO_In_D FIFO_A_Status FIFO_B_Status FIFO_C_Status FIFO_D_Status Interrupt_Status Interrupt_Mask Mode (unused)

To P-NET SWNo 01 02 03 04 05 06 07 Register ModePort1 ModePort2 DigIO Port_C Data DigIO Port_C Data_Direction Handshake Port RTC EEPROM

46

 +,4

Intelligent Sensors: Implementation of P-NET

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Minimum Registers for an Intelligent P-NET Sensor


Service Channel (Channel 0) SWNo 00 01 04 0D 0E 0F Identifier NumberOfSWNo DeviceID PNETSerialNo WriteEnable ChType CommonError Type Integer Record Record Boolean Record Record Analog Channel (Channel 1) SWNo 10 19 1B 1C 1D 1E 1F Identifier AnalogIn ChConfig Fullscale Zeropoint Maintenance ChType ChError Type Real Record Real Real Record Record Record

46

+,4

Intelligent Sensors: Basic Channel Structure

International P-NET User Organization ApS


P.O.Box 192 . 8600 Silkeborg . Denmark

Some Intelligent Sensors from P-NET World


A) Intelligent Sensors Manufacturer PROCES-DATA ULTRAKUST INFRA SENSOR Perhaps You ! What is measured ? Flow Humidity, Temperature (with/without contact), Flow Temperature (without contact) XYZ

B) Intelligent P-NET Coupling Devices for analog Sensors E.g. from PROCES-DATA, ULTRAKUST, IPH Marine Automation, Tilse, ...
2 46 ! +,4

Intelligent Sensors: Examples from P-NET World

You might also like