Professional Documents
Culture Documents
Abstract
Introduction
There are many good reasons to use CAN data bus technology in textile industries,
chemical industries, green house etc. A most important reason is noisy environment
and long distances between the main control unit and sensor unit. This long distance
means long, expensive and unreliable cables. There are two different ways to solve
these problems. The control system can be distributed to suitable parts, which are
112 Milind S. Patil et al
connected together via a data bus. Another way is to use components, which can be
connected to control system via a data bus.
The Controller Area Network (CAN) is a high-integrity serial data communication
bus for real-time applications for networking "intelligent" devices as well as sensors
within a system or sub-system, which operates at baud rates up to 1 Mbps. The CAN-
bus was originally developed by the German company Robert Bosch GmbH for use in
the car industry to provide a cost effective communication bus. In car electronics
CAN bus is as an alternative to expensive and cumbersome wiring looms in the mid
1980s. Nowadays CAN is being used in an increasing number of applications in the
automotive industry [10] and in many other industrial applications where noise is the
major problem.
Pressure sensors are used for control and monitoring in thousands of everyday
applications. Pressure sensors can also be used to indirectly measure other variables
such as fluid/gas flow, speed, water level, and altitude.
The MPX series piezoresistive transducer is a state-of-the-art monolithic silicon
pressure sensor designed for a wide range of applications, but particularly those
employing a microcontroller with A/D inputs. This patented, single element
transducer combines advanced micromachining techniques, thin-film metallization,
and bipolar processing to provide an accurate, high level analog output signal that is
proportional to the applied pressure. This is employed in the system as a pressure
transducer.
Block Diagram
The complete block diagram of measurement and data communication scheme is
shown in Fig. 1.
CAN LOW
120E 120E
CAN HIGH
CAN CAN
TRANSCEIVER TRANSCEIVER
PIC PIC
CONTROLLER CONTROLLER
DISPLAY
SENSOR
UNIT
The pressure is measured using Keller’s pressure Transmitter Series 21MC [3].
The two-wire current output for 10 bar is selected. The output signal from pressure is
analog current. It gives output 4 to 20 mA current.
The analog current output of pressure transmitter is converted into analog voltage
that is processed in digital domain. The PIC18F2480 microcontroller [2] with built in
10 bit successive approximation ADC module suits this purpose, as the conversion
time is adequate to measure pressure. The digital data equivalent of measured
pressure is transmitted through CAN bus system to a remote processor. This
controller in turn converts the received digital data into the corresponding pressure
value and displays it on an LCD display.
The Hardware
The detail structure of hardware is shown in Fig. 2.
Microcontroller PIC18F2480
Microcontroller used in each node as an intelligent device. It is a programmable
device that’s why in first node microcontroller receives the analog signal from sensor
converts in digital form, and packets transmitted on CAN bus through CAN
transceiver. In this way another node receives the packets through CAN bus and
displays on Display unit. It can also be stored on memory and can be used for
controlling output like solenoid valve, motor etc. [4]. For this working flow
initialization, baud rate generation conversion of analog to digital signal, data packet
transmission, reception and lot of tasks are done in all the nodes. Microcontroller in
each node is PIC18F2480 from Microchip. Its features are as follows. The PIC
18F2480 is an enhanced flash microcontroller, with one CAN module. It operates on
Single Supply of 5V DC.
The Software
The software has two parts: one for the transmitter side and another for the receiver
side.
Pressure Measurement and CAN Bus Implementation 115
Transmitter Side
The appropriate algorithm required for sensing the analog input from sensor,
converting it to digital equivalent data and then transmitting the same is shown in the
proceeding section.
In transmitter section, two main subroutines are used. One subroutine is to initialize
CAN as transmitter and the ADC module. The microcontroller software selects the rate of
transmission as 100 kbps. This is sufficient for this pressure measurement. The other
subroutine is to transmit the data using CAN through CAN transceiver MCP2551. In this
subroutine, before transmitting, the digital data is obtained from ADC module of the PIC
18F2480. Fig. 3 depicts the main transmitter flow chart.
Receiver Side
Firstly the 16 x 2 LCD is initialized. Before initializing LCD, it is necessary to
configure the appropriate port pins as output. It is done in the main program. Then the
command words are given to LCD, to clear the display and to place the cursor in the
home position, etc. The main program calls two subroutines, one for initializing CAN
module of PIC controller 18F2480, which acts as receiver. Here also the baud rate of
100 kbps is selected. The other subroutine is used to receive the transmitted data,
manipulate it in to the pressure value and then display it as pressure on the LCD. Fig.
4 depicts the main receiver flow chart.
S TART
S TART
If ADC NO
Conve rs ion Read the data through
Ove r ? CAN Bus
YES
Results
Pressure measurement
The technical specifications of pressure sensor are as follows-
Supply voltage for Series 21 MC is 12 V.
The sensitivity is +-0.04%/0c.
The current is converted into voltage using I to V convertor. The resistor of 25
ohm is connected in between output pin and ground.
Practical Observations
A set of readings with the designed unit is shown in Table 1.
The error between actual and observed pressure under different noise levels by
system is computed and plotted, which are shown in Fig. 5-8.
Pressure Measurement and CAN Bus Implementation 117
Figure 5: Error for different samples at Figure 6: Error at noise level I for
normal conditions. different samples.
Figure 7: Error at noise level II for Figure 8: Error at noise level III for
different samples. different samples.
Conclusion
At normal conditions the error level is less compared to noisy environment (fig. 5).
For noise level-I the change in actual and measured readings is plotted as shown fig.
6. For noise level-II error is increased compared to normal conditions, which is shown
in fig. 7. As shown in fig. 8 the noise level is increased however error has remained
within acceptable limits. In this way CAN bus is operates fairly well in noisy
environment.
The real time problem to measure and transmit the pressure in different locations
in industry like textile and other can be solved by the solution discussed in the paper.
Pressure measurement is most important in applications such as chemical
industries, textile industries, leakage testing instrument, and so on. Keller’s Series 21
MC quite suitable and affordable for this task upto 10 bar. The output of sensor is
calibrated. The observed error is less than 1% in the measured value. It is within the
acceptable range for most of practical application. In most cases the measured sensor
data is required for distant receiver that is far from measuring unit. Besides noise
tolerance CAN bus offer advantages like high speed, low cost, easy to install.
118 Milind S. Patil et al
CAN Bus having numerous advantages, but it has also some restrictions. CAN
work reliably upto 1Mbps for the maximum possible bus length 40 meters.
References
[1] Robert Bosch GmbH. Control Area Network specification version 2, Sept.
1991.
[2] Microchip Technology Inc.
[3] www.keller-druck.com
[4] K. M. Zuberi and K. G. Shin, “Non-Preemptive Scheduling of messages on
Controller Area Network for Real-Time Control Applications”, Technical
Report, University of Michigan, 1995.
[5] J. Rufino and P. Veríssimo: “A Study on the Inaccessibility Characteristics of
the Controller Area Network”, 2nd International CAN Conference 95,
Oct.1995.
[6] H. Kopetz and G. Grünsteidl: “TTP - A Time-Triggered Protocol for Fault-
Tolerant Real-Time Systems”, Res.Report 12/92, Inst. f. Techn. Informatik,
Technical University of Vienna, 1992.
[7] M.A. Livani and J. Kaiser: “EDF Consensus on CANBus Access in Dynamic
Real-Time Systems”, Technical Report No. 97-17, University of Ulm, 1997.
[8] L.B. Fredriksson: “A CAN Kingdom (Rev. 3.01)”, Published by KVASER
AB, Box 4076, S-51104 Kinnahult, Sweden, 1996.
[9] CiA Draft Standard 301 version 3.0, “CANopen Communication Profile for
Industrial Systems”.
[10] Kim, K., et al. “Integrating subscription-based and connection-oriented
communications into the embedded CORBA for the CAN bus”, in Proc. of the
Sixth IEEE Real-Time Technology and Applications Symp.,Washington,
D.C., June 2000, p. 178-187.
[11] Kirrmann, H. & Zuber, P.A.,“The IEC/IEEE train communication network”,
IEEE Micro, vol. 21 #2, March-April 2001, pp. 81-92.