34th INTERNATIONAL CONFERENCE ON PRODUCTION ENGINEERING 29. - 30. September 2011, Niš, Serbia University of Niš, Faculty of Mechanical Engineering WIRELESS SENSOR NETWORK APPLICATION IN MONITORING OF MACHINING OPERATIONS Zivana Jakovljevica, Ph.D., Assistant Professor, Miroslav Pajicb, Ph.D. Candidate, Dragan Aleksendricc, Ph.D., Assistant Professor, Dragan Milkovicc, M.Sc., Assistant a Department of Production Engineering, Faculty of Mechanical Engineering, University of Belgrade, Kraljice Marije 16, 11 000 Belgrade, Serbia, bDepartment of Electrical and Systems Engineering, University of Pennsylvania, PA 19104, USA, cFaculty of Mechanical Engineering, University of Belgrade, Kraljice Marije 16, 11 000 Belgrade, Serbia zjakovljevic@mas.bg.ac.rs, pajic@seas.upenn.edu, daleksendric@mas.bg.ac.rs, dmilkovic@mas.bg.ac.rs Abstract: The scope of this paper is the research of the possibilities of application of Wireless Sensor Networks (WSNs) for monitoring of machining operations. Due to the limited battery lifetime, WSNs are energy constrained networks and energy efficiency of the network is a very important issue. Since communication requires significantly more energy then processing, instead of sending raw data through the network, data processing and decision making should be performed in the node. Consequently, as a basis for WSN design we consider IEEE 802.15.4 Wireless Networking Standard, created for low data rates and very low power consumption which makes it suitable for remote monitoring and control. In this paper, a prototype of the node, designed for acceleration monitoring, has been developed. The node has been created at the Faculty of Mechanical Engineering in Belgrade and it is based on low power Atmel Atmega16 microcontroller and IEEE 802.15.4 compatible transceiver. Key words: Wireless sensor networks, machining operations monitoring 1. INTRODUCTION In-situ sensor monitoring of machining operations has attracted significant attention in the last decade. During machining, cutting forces, vibrations, acoustic emission, temperature, audible sound, etc. are influenced by cutting tool state and conditions of the material removal process. The aforementioned process quantities can be measured and acquired signals can be processed to extract features correlated with the process and tool condition. These features carry information for on-line decision making and diagnosis of the cutting process state. After the diagnosis, the appropriate actions are executed by human operator or control system. A number of techniques for tool condition and process parameters monitoring using the described procedure have been proposed [1]. Nevertheless, the industrial application of on-line condition-based monitoring systems is still sporadic. The most significant limiting factors for implementation of the proposed techniques are sensor deployment and wiring. It is necessary to place the sensor very close to the cutting zone; on the tool would be the best. Nevertheless, the tools are placed in spindles or on moving platforms, which makes them difficult or impossible to access by wiring. Besides, when wiring is feasible, its cost is estimated to 10-100$ per sensor [2]. Recent developments in wireless technology have opened up new possibilities. Communication between the sensor and the supervisory or control system can be wireless, which enables sensor placement at very inaccessible locations, such as tool (Fig. 1). In this scenario, the sensor operates as a node in a Wireless Sensor Network (WSN). It has embedded processor and radio transceiver. The node is battery charged and energy efficient operation of the sensor is of critical importance. Fig. 1. Mounting of the wireless sensor to the tool It is worth noting that radio communication (including both transmissions and receptions) of a sensor node is significantly more energy consuming than in-node computation. To exploit benefits of wireless communication, the sensor should be made intelligent. It should carry out not only the measurements, but also data acquisition, signal processing, features generation and decision making. Instead performing a batch wireless transmission of the raw signal and the processing at central computer, the whole diagnosis process should be performed at the node. In this case, only the information about the decision (diagnosis) should be transmitted. Machining operations monitoring assumes high sampling rates. Sensor integrated tooling for monitoring of tool vibration and temperature in milling using wireless communication was studied in [3]. Nevertheless, contrary to the above given observation, instead of in-node signal processing, the raw data (20KHz) were sent to PC using intensive Bluetooth (IEEE 802.15.1) communication. In [4], the machine tool vibrations were monitored using wireless accelerometer. The less communication intensive IEEE 802.15.4 wireless standard was used for raw signal transmission to the PC. Signal processing and decision making were carried out in PC. Due to the bandwidth constraint, the sampling rate was restricted to only 1000 Hz. In both applications, the communication is very intensive which has repercussions on battery lifetime. The utilization of wireless sensors assumes the in-node signal processing using low-power microcontrollers. There have been some approaches [5, 6] that used microcontroller based systems for tool breakage detection in end milling. Instead of transmitting a large amount of data, the signal is analyzed at the node. On abnormal event (tool breakage) detection, the message is sent to the PC using SMS [5] or wired communication (Ethernet) [6]. Bluetooth (IEEE 802.15.1) and IrDA are designed for high data rate applications such as voice, video and LAN communication. They are very communication intensive and thus suffer from high energy consumption, making them unsuitable for wireless sensor applications such as one at hand. GSM and GPRS are even less appropriate. The energy consumption is also very high and there are additional costs related to the GSM or GPRS modules (~100$) and SIM card purchase and operation. On the other hand, IEEE 802.15.4 standard offers low data rate and low power. It is characterized by long battery life. For these reasons this standard is used as a basis for WSN. In this paper, the possibilities to employ WSNs in machining operations monitoring have been investigated. An overview of WSN was presented as well as a prototype node developed at Faculty of Mechanical Engineering, University of Belgrade (FME). The node is employed in tool acceleration measurements in turning. In this example, the decision making is carried out at the node and only the information about significant event is transmitted to the coordinator. 2. INTRODUCTION TO WSNs In a Wireless Sensor Network (WSN) each node has one or more sensors, embedded processors and low-power radio. All the nodes coordinate in order to perform a common task. In-network data processing greatly reduces the energy consumption. It can be additionally reduced by applying appropriate communication protocols. IEEE 802.15.4 can operate at star or peer to peer topology. IEEE 802.15.4 has three operating frequency bands with different number of channels and transfer rates: 868 MHz 1 channel – 0 (20Kb/s); 915 MHz 10 channels – 110 (40Kb/s); 2.4 GHz 16 channels – 11-26 (250Kb/s). In the IEEE 802.15.4 architecture three layers can be distinguished (Fig. 2). These are: 1) Physical (PHY) layer, 2) Medium Access Control (MAC) layer and 3) Network and Application layer. Fig. 2. IEEE 802.15.4 architecture Physical layer has the following functionalities [7]: 1) activation and deactivation of the radio transceiver, 2) energy detection within the current channel, 3) link quality indication for received packets, 4) clear channel assessment (CCA), 5) channel frequency selection, 6) data transmission and reception. PHY frame structure of transmitted data is shown in Fig. 3. Fig. 3. PHY frame structure [7] In IEEE 802.15.4 MAC layer two modes of operation are defined: 1) beacon enabled network, 2) non-beacon enabled network. In the beacon mode (Fig. 4a) the device waits for the coordinator’s beacon to start transmission. When the transmission is complete, the coordinator schedules the next beacon and the device goes to sleep. All the devices in the network know when to communicate with each other. The timing circuits of the nodes have to be synchronized. In the non-beacon mode all nodes, except the coordinator, are almost always ‘asleep’. The device wakes up on event and sends a message to the coordinator. Beacon mode is used when sink runs on batteries, while non-beacon is preferred when the sink is non energy constrained (in this mode the coordinator has to always ‘listen’). IEEE 802.15.4 MAC layer enables the creation of different MAC protocols that define the communication procedure between nodes. The MAC protocols must be energy efficient. There are many sources of energy waste in WSN, and the most important are [8]: 1) Collided packets: when more than one packet is sent to a node at the same time; since the receiver can not receive both packets, these packets are rejected and should be retransmitted; 2) Overhearing: node receives packets intended to other nodes; 3) Control packet overhead: minimal control packets should be used in transmission; 4) Idle listening: listening of the idle channel to receive possible traffic; 5) Overemitting: sending the message when the destination node is not ready. There are many different MAC protocols [8]: B-MAC, Sensor-MAC, WiseMAC, Traffic Adaptive MAC protocol, D-MAC, etc. Nevertheless, no MAC protocol is accepted as a standard and it is application dependant. In monitoring operations, communication is usually triggered by a sensing event. Therefore, if no sensing event occurs the nodes could stay idle for a long time. To preserve energy, radio transceivers are programmed to stay in the sleep mode, thus avoiding idle listening. This can be easily implemented in star topologies, where all nodes communicate with the coordinator (i.e., gateway) in a single hop. Nevertheless, the reach and the presence of obstacles in the node’s vicinity usually demand the multihop between the sensor node and the sink. In this case, the objective is to reliably deliver data to the sink (i.e., gateway), with minimum latency, while consuming the minimal amount of energy. B-MAC protocol [9], used in this paper, is designed for monitoring operations. It provides nodes with duty cycle mechanism in order to eliminate idle listening which is very important in multi-hop networks. It is convenient for monitoring of machining operations as well as for machine tools control. Radio duty cycling [9] is very important for the reliable data transmission with low latency. In B-MAC it is carried out by periodic channel sampling. Normally, a node is in the sleep mode. It wakes up after a predefined time has elapsed and checks for the network activity. If activity is detected, the node powers up and stays awake to receive the incoming packet. After the reception the node returns the sleep mode. If no packet is received after timeout, the node goes back to sleep as well. Before sending the data, the transmitter sends a preamble. To reliably receive the data the preamble should be at least as long as the interval between two subsequent checking for channel activity. The length of the preamble has to give enough time to node to wake up, detect the activity in the channel, and receive the preamble. After receiving the preamble, the node receives the message. If the node wakes up and there is no activity at the channel, the idle listening occurs only for a short duration of time. The length of the period between two subsequent channel activity sampling is the result of the trade-off between the latency and the energy efficiency of the network. 3. DEVELOPMENT OF WIRELESS NODE The block diagram of the experimental nodes developed at FME is shown in Fig. 4. It is based on low power Atmel Atmega16 microcontroller [10] and Microchip MRF24J40 radio transceiver [11]. Atmega16 [10] is 8-bit microcontroller with 1 KB SRAM and 16 KB of program memory. It is a low power microcontroller with power consumption of 1.1mA in the active mode at (frequency) 1MHz, (voltage) 3V and (temperature) 25C, and 0.35mA in the idle mode. Furthermore, the microcontroller has 8 single ended channels for 10-bit ADC, 32 bidirectional DIO, one 16-bit and two 8-bit timer/counters with compare modes. The oscillator frequency is up to 16MHz. In our platform 8MHz has been used. MRF24J40 [11] transceiver is compliant with IEEE802.15.4 standard. Its operating frequency band is 2.4GHz and the data rate is 250 Kb/s. It has integrated 20MHz oscillator. Its typical power consumption is 19mA in receive (Rx), 23mA in transmit (Tx) and 2A in the sleep mode. Thus, the transceiver’s power consumption in active modes (Tx or Rx) is around 20 times higher than the power consumption of the microcontroller. MCF24J40 operates within Mikroelektronika ZigBee3 development board. Fig. 4. FME WSN node The communication between the microcontroller and the transceiver is carried out using 4-wire SPI interface. SPI functions in full duplex master/slave configuration. The microcontroller (master) sends data to the transceiver trough MOSI, and the transceiver (slave) sends data to the microcontroller on MISO line. Serial clock (SCLK) is output from the master. SPI is used not only for data transfers, but also for transceiver programming using protocol defined by the manufacturer. Besides SPI lines, there are three additional lines between the microcontroller and the transceiver. These are RESET, WAKE and INT. RESET and WAKE are used for transceiver reset and wake. Using INT line MRF24J40 transceiver can signal one of 8 available interrupts to the microcontroller. The most interesting interrupts for our application are receive interrupt and transmit interrupts for normal transmission and guarantied time slots transmissions in a beacon mode. 4. EXPERIMENTAL VALIDATION The described wireless node, developed at FME, has been implemented for acceleration monitoring in turning. Fig. 5 shows the experimental setup. The accelerometer is mounted on a tool holder and it is wired to the wireless node that is placed on toolpost. The other node is connected to the PC via DIO. Since the sink (PC) is mains powered and there is no need for multi-hop configuration, the non-beacon mode of operation has been chosen. Although not used in this setup, B-MAC protocol was implemented to allow extensions to multi-hop configurations (i.e., topologies) in industrial environments where physical constraints prohibit use of a single-hop communication between the sensor and the gateway. ADXL311 Analog Devices dual-axes measurement system, with measuring range 2g was used. It is powered from microcontroller by 5V. In our setup, only vertical acceleration component is measured. Accelerometer signal is linked to microcontroller port A0. Microcontroller performs 10-bit ADC. In the given installation the maximum sampling rate is 15kHz. Acceleration measurements have been widely used for tool condition monitoring and a number of methods for tool breakage and tool wear have been proposed [1]. These methods were usually based on Discrete Wavelet Transform, Hilbert-Huang Transform and other sophisticated techniques. Nevertheless, in this paper the WSN are in focus, rather than diagnosis techniques. This is the reason that it was decided to simply employ in-node signal tresholding. Fig. 5. Experimental setup To provide a significant change of acceleration on the tool holder, we use intermittent turning of grooved part (Fig 5). On the cutting process stop at surface A the high vibrations occur. In the given setup the acceleration signal below the value that corresponds to 2.71V is considered as the event which has to be detected. On this event the microcontroller wakes up the transceiver and sends a message containing the signal value (2 bytes) and the number of occurrences (1 byte). In order to avoid the detection of transients after the cutting process stops, we introduce a waiting period of 50ms after an event is detected, before we allow the detection of the next event. At least 50ms have to pass between two subsequent events regardless of the value of the acceleration signal. On data reception, the sink node puts the port D high and keeps it high for 20ms. To verify the performance of nodes, the voltage level of port D and acceleration signal are acquired using DAQ with 500Hz sampling rate. In this setup, the DAQ is used as a kind of digital oscilloscope. The sent data package contains only 3 bytes of data, while the whole frame for sending the data package contains 22 bytes (Fig. 3). The short addresses that give the addressing field of 8 bytes are used. The data transmission assumes SPI communication (2Mbps) of these bytes between microcontroller and transceiver on both (Rx and Tx) sides, as well as radio communication (250 Kb/s). Besides, the microcontroller and the transceiver exchange control sequences via SPI. This leads to latency of event detection of 4ms on the receiver’s side. Fig. 6. Experimental results Fig. 6 shows the accelerometer signal (acquired by DAQ) along with the voltage level on the port D of the receiver. A number of experiments were carried out on Hasse & Werde lathe. In the experiment shown in Fig. 6 the cutting parameters were: n=300rpm, s=0.05mm/r and a=0.7mm. The experimental results indicate a reliable performance of the developed wireless node. 5. CONCLUSION In this paper, the application of WSN in machining operations monitoring has been investigated. Initially, the communication reliability was questioned. The concern was that a huge amount of ferrous materials in the communication area could lead to electro-magnetic disturbances, causing communication failures and packet drops. Nevertheless, the experiments have shown that the communication was reliable. As the distance between the nodes (connected to the sensor and to the PC) was 2m, there was no need for multi-hop network deployment. Using WSNs the placement of sensors at otherwise inaccessible/difficulty accessible locations such as tool or even workpiece becomes easily feasible. This opens up the new possibility in machining process monitoring and control. Acknowledgement: The authors express the gratitude to the Serbian Ministry of Education and Science, research grants TR35007, TR35020, TR35045, TR35030. REFERENCES [1] TETI, R., JEMIELNIAK, K., O’DONNELL, G., DORNFELD, D. (2010) Advanced monitoring of machining operations, CIRP Annals – Manufacturing Technology, Vol. 59, pp 717-739 [2] TIWARI, A., LEWIS, F., L., GE, S., S. (2008) Wireless Sensor Network for Machine Condition Based Maintenance, 8th Int. Conference on Control, Automation, Robotics and Vision,,pp 461-467 [3] SUPROCK, C., A., NICHOLS J., S. (2009) A Low Cost Wireless High Bandwidth Transmitter for Sensor-Integrated Metal Cutting Tools and Process Monitoring, International Journal of Mechatronics and Manuf. Systems, Vol. 2, No. 4, pp 441-454 [4] WRIGHT, P., DORNFELD, D., OTA, N. (2008) Condition Monitoring in End-Milling using Wireless Sensor Networks (WSNs), Transactions of NAMRI/SME, Vol. 36, pp 177-183 [5] PRICKETT, P., SIDDIQUI, R., A., GROSVENOR, R., I. (2011) A microcontroller-based end milling cutter monitoring and management system, International Journal of Advanced Manufacturing Technology, doi 10.1007/s00170-010-3135-z [6] SIDDIQUI, R., A., AMER, W., AHSAN, Q., GROSVENOR, R., I., PRICKETT, P. (2007) Multiband infinite impulse response filtering using microcontrollers for e-monitoring applications, Microprocess and Microsystems, Vol. 31, pp 370-380 [7] IEEE 802.15.4 Standard [8] DEMIRKOL, I., ERSOY, C., ALAGROEZ, F. (2006) MAC Protocols for Wireless Sensor Networks: a Survey, IEEE Communications Magazine, Vol. 44, No. 4, pp 115-121 [9] POLASTRE, J., HILL, J., CULLER, D. (2004) Versatile Low Power Media Access for Wireless Sensor networks, SenSys '04 Proceedings of the 2nd international conference on Embedded networked sensor systems, pp 95-107 [10] Atmel (2010) Atmega16 Datasheet [11] Microchip (2008) MRF24J40 Datasheet