Development of the Berry Impact Recording Device sensing system: Software

Development of the Berry Impact Recording Device sensing system: Software

Computers and Electronics in Agriculture 77 (2011) 195–203 Contents lists available at ScienceDirect Computers and Electronics in Agriculture journa...

1MB Sizes 3 Downloads 66 Views

Computers and Electronics in Agriculture 77 (2011) 195–203

Contents lists available at ScienceDirect

Computers and Electronics in Agriculture journal homepage: www.elsevier.com/locate/compag

Development of the Berry Impact Recording Device sensing system: Software Pengcheng Yu a, Changying Li a,⇑, Glen Rains a, Takoi Hamrita b a b

Department of Biological and Agricultural Engineering, University of Georgia, Tifton, 31793 GA, USA Department of Biological and Agricultural Engineering, University of Georgia, Athens, 30602 GA, USA

a r t i c l e

i n f o

Article history: Received 27 January 2011 Received in revised form 4 May 2011 Accepted 7 May 2011

Keywords: Accelerometer Microcontroller LabVIEW Software Berry

a b s t r a c t This paper reports a complete impact data acquisition, processing, and analyzing software system that applies on the hardware platform of the Berry Impact Recording Device (BIRD). The software has three major sections that correspond to the hardware: The BIRD sensor program, the interface box program, and the computer software i-BIRD. The sensor program samples acceleration data from three axes and records them as single impacts with a maximum sampling rate of 3.0 kHz. Users can configure the sensor via the i-BIRD computer software, with different options of sampling frequencies (682–3050 Hz) and thresholds (0–205 g, where g is the gravitational acceleration). The data recorded can be downloaded, processed and graphically displayed on the computer. A real time clock was created using the interrupt service routine provided by the microcontroller. The accuracy of the sensor’s clock was calibrated with an error of 0.073%, which was adequate to record impact data in this application. The shape of impact curves recorded by the BIRD sensor at three sampling frequencies (682, 998, and 1480 Hz) matched well with the curves recorded by a high frequency (10 kHz) data logger with the maximum root mean squared error of 4.4 g. The velocity change had a relative error less than 5%. With confirmation of all those performances, the software system enabled the BIRD to be a useful tool to collect impact data during small fruit (such as blueberry) mechanical harvest. Published by Elsevier B.V.

1. Introduction Successful studies have been reported about the use of ‘‘artificial fruit’’ to identify the source of produce damage during mechanical harvest or postharvest handling processes (Bajema and Hyde, 1995; Lin and Brusewitz, 1994; Sober et al., 1990). An ‘‘artificial fruit’’, also known as the instrumented sphere, is subjected to the same mechanical impact as a real fruit. The recorded signals of instruments can be used to identify critical points that exceed the damage boundary of fresh produce and therefore to reduce bruising damages of the produce. Available commercial instrumented sphere sensors can be categorized into two major types: sensors that collect acceleration data or sensors that collect pressure values. One of the earliest instrumented sphere sensors was developed in early 1990s known as the IS100 (Klug et al., 1987; Simami et al., 1987; Zapp et al., 1990). Over the years, it has been improved and commercialized as the Impact Recording Device (IRD) which has the minimal size of 57 mm in diameter to simulate apple size fruits (Techmark Inc., Lansing, MI). The IS100 was successfully used to perform drop tests for different varieties of apples in packing lines to determine the impact conditions that initiate bruising on different surfaces (Sober et al., 1990). ⇑ Corresponding author. Tel.: +1 229 386 3915; fax: +1 229 386 3958. E-mail address: [email protected] (C. Li). 0168-1699/$ - see front matter Published by Elsevier B.V. doi:10.1016/j.compag.2011.05.003

The IS100 was also used for potato handling: it was dropped with potatoes onto different surfaces at selected drop heights to identify the zero damage threshold (Mathew and Hyde, 1997). The damaging thresholds for four cultivars of peaches on the steel surface were also identified using the IS100 (Lin and Brusewitz, 1994; Schulte et al., 1994). The PTR 100, with its later version PTR 200 improved the instrumented sphere design by simulating the shape of a real potato (53  53  83 mm) (Canneyt et al., 2003). It has an ellipsoidal body and is able to sample acceleration data at 100 Hz. The Pressure Measuring Sphere (PMS-60) is a different type of sensor that records pressure data. It weighs 180 g and consists of a rubber sphere body with 62 mm in diameter. It has an elastic surface (Rubber, Shore A80) and internal electronic system for measuring both static and dynamic pressure loads. All three types of instrumented sphere sensors have a relatively large size for large fruits and vegetables. None of them could be used for small fruits simulation. A miniature instrumented sphere sensor (Berry Impact Recording Device), developed by a research team at the University of Georgia, was specifically designed for small fruits such as blueberries. It is a one inch (25.4 mm) sphere with accelerometers and other instruments embedded inside to measure mechanical impacts. The sensor is connected with a computer through an interface box for power recharging and data downloading. To make this sensing system function properly, a

196

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

Nomenclature BIRD I2C SPI VISA MIPS

Berry Impact Recording Device Inter-Integrated Circuit Serial Peripheral Interface Virtual Instrument Standard Architecture million instructions per second

software system that can automatically sample impact data and analyze the data needs to be developed. This paper describes the design process of the software program for the BIRD sensing system and the functions of the program. Corresponding to the BIRD hardware structure, the software has the BIRD sensor program, the interface program, and the computer software i-BIRD. The objectives of this paper were to: 1. Design programs for microcontrollers at the BIRD and the interface box. The sensor program should work standalone to record acceleration data based on single impacts. It should also communicate with a computer for sensor configuration and data downloading via interface program. 2. Develop i-BIRD computer software to configure the sensor, download data, process and display data graphically. 3. Test the software. Verify the sampling rate, impact shape distortion, and timer accuracy. Evaluate the overall speed and efficiency of the BIRD software system. 2. Description of the BIRD hardware system The BIRD hardware platform has three components: the BIRD sensor, the interface box, and the computer (Fig. 1). The BIRD sensor is cast in silicone rubber as an ‘‘instrumented sphere’’ with 25.4 mm (1 in.) in diameter. Inside the sphere is a round circuit board. The circuit board consists of a microcontroller (PIC18LF2520, Microchip, Chandler, AZ, USA), three accelerometers placed in orthogonal directions (ADXL001, Analog Devices, Norwood, MA, USA), one Ferroelectric-Random Access Memory (F-RAM) (FM25V10, Ramtron, Colorado Springs, CO, USA), a Lithium Ion rechargeable battery, and other conditioning circuits. The microcontroller’s three 10-bits analog-to-digital (A/D) converter samples the three axes of accelerometers at a maximum

USART MSSP ISR F-RAM AD

Universal Synchronous/Asynchronous Receiver/Transmitter Master Synchronous Serial Port Interrupt Service Routine Ferroelectric-Random Access Memory Analog to Digital

frequency of 3.0 kHz, and stores the data into a 128 kb F-RAM. The BIRD sensor connects the interface box with a five pin connector, with two of them for the I2C (Inter-Integrated Circuit) communication, and three others for recharging power source, reset the microcontroller in the sensor, and ground, respectively. The interface box provides the communication interface between BIRD sensor and the computer through RS232 and I2C communication, as well as recharges battery in the BIRD sensor. The interface circuit board has one microcontroller (PIC16LF877A), an RS232 communication port and recharging circuits. The LCD on the interface box displays the working status of BIRD sensor when it is connected with the interface box. Detailed description of the hardware system and its performance in calibration are presented in a separate paper (Yu et al., in press). 3. BIRD software development Software of the BIRD system consists of three modules that correspond to three components in the BIRD hardware: the sensor program, the interface box program, and the computer graphical user interface program (i-BIRD). The PICBasic Pro (PBP, MicroEngineering Labs, Colorado Springs, CO, USA) compiler was used to develop embedded programs for microcontrollers. Sensor program codes were programmed into those microcontrollers via an incircuit serial programmer (ICSP programmer, MicroEngineering labs, CO, USA). The graphic user interface program on the computer was designed using LabVIEW 8.2 (National Instruments, Austin, TX, USA). The overall software structure of the BIRD system is shown in Fig. 2. The BIRD sensor program samples data from three axes of accelerometers and records them in its onboard RAM. It communicates with the microcontroller on the interface box via I2C communication using two wires. The interface box program transfers commands from computer to sensor, and uploads data from sensor to computer via a RS232 cable. The i-BIRD computer software provides a graphical user interface for sensor configuration, data download, and data processing. Data can also be graphically displayed for quick view of the test result. 3.1. The BIRD sensor program

Fig. 1. Illustration of the Berry Impact Recording Device (BIRD) sensing system.

The BIRD sensor program has three main functions: sensor configuration, impact data sampling, and data management (Fig. 3(a)). The sensor configuration is processed by receiving commands from the microcontroller in the interface, when the microcontroller in the sensor works in I2C slave mode. By executing each command, the sensor program enters into a corresponding subroutine to execute the specific function. The whole program occupies 5.36 kb of the total 32 kb program memory in the microcontroller. Fig. 3(b) shows the hardware resources that are relevant to BIRD sensor program. Three 10-bit A/D channels samples accelerations from X, Y, and Z axes, respectively. The Master Synchronous Serial Port (MSSP) can be configured into I2C mode to communicate with the microcontroller and the memory in the interface box (I2C

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

197

Fig. 2. Overall structure of the software for the BIRD sensing system.

Fig. 3. Flowchart of the BIRD sensor program (a) and the hardware resources of the microcontroller that are relevant to the BIRD sensor program (adapted from the PIC18LF2520 datasheet) (b).

F-RAM). The I2C communication requires only two wires but can connect with multiple components with a given address. The MSSP module is also configured to hardware SPI (Serial Peripheral Interface) module to communicate with the F-RAM memory chip (SPI-F-RAM) on the sensor. The USART (Universal Synchronous/ Asynchronous Receiver/Transmitter) is set up to establish the RS232 communication protocol. The microcontroller works at 5 million instructions per second (MIPS) based on the resonator frequency (20 MHz). A real time clock is created using software approach. 3.1.1. Sensor configuration The sensor can be configured with users’ selections. The BIRD sensor is configured by receiving commands that are sent out from the computer using the interface box as an intermediate device. Communication between two microcontrollers employs I2C protocol (Fig. 4). The microcontroller in the interface box (Master) sends control commands to the microcontroller in the BIRD sensor in a pre-defined format. Each command comprises 10 digits, in which the first 9 digits contain the command information and the last digit determines the command type. The sensor microcontroller executes each command received from the interface box, which can set up different power modes (sleep, standby, and active modes), sensor sampling threshold, sampling frequency, and sensor clock

synchronization with the computer clock. Setup of different power modes is achieved by executing the corresponding commands. The acceleration sampling threshold has seven options (0, 18, 24, 41, 53, 99, and 205 g, where g stands for gravitational acceleration). The seven threshold values were determined based on preliminary field tests to represent low level to medium level impacts that blueberries experience during mechanical harvest. This range provides adequate options to filter impacts at different levels that are required in the field. There are also five options for sampling frequency (682, 998, 1480, 2210, and 3050 Hz). Between the highest sampling frequency (3050 Hz) and the lowest sampling frequency (668 Hz) that the BIRD could achieve without aliasing, three sampling frequencies were provided for data collection with less sampling resolution. Users could select the sampling frequency depending on how often they want to sample and how many data sets to be saved in sensor’s F-RAM. The sensor’ F-RAM could also be erased with one command. Clock synchronization is achieved by updating microcontroller timer upon receiving real-time information from the computer. 3.1.2. Data storage and memory management The acceleration data are saved into the memory in a given format. Each dataset has 13 bytes including the accelerometer data from X, Y, and Z axes, the time of acquisition, and the impact index

198

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

Fig. 4. I2C Master-Slave communication between the BIRD sensor and the interface box.

Fig. 5. Data structure of each acceleration data set (a) and the hardware SPI Module based on the microcontroller’s MSSP module (b).

(Fig. 5(a)). Each axis of accelerometer data needs two bytes due to 10 bits A/D conversion resolution. The real time in which each impact is created needs to be recorded in order to characterize the mechanical harvest process. To provide adequate timer accuracy for a maximum sampling frequency of 3.0 kHz, the resolution of the timer should be at least 1/3000 s. A real time clock was created

by using Timer 2 module of the interrupt service routine (ISR) from the PIC18LF2520 microcontroller. The clock can record data with the smallest time unit of 0.25 ms which was defined as a ‘‘Tick’’. The second is updated when the Tick equals to 4000. The hour (HH), minute (MM), and second (SS) each occupies one byte, while the Tick uses two bytes. The clock’s error introduced by the ISR was

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

calibrated, which was discussed in a later section. The index of the impact has two bytes counting up to 65,536 impacts, which is adequate to index the impact for most field applications. Data are managed using four subroutines which can perform functions such as data writing, reading, erasing, and uploading. Data are written into the F-RAM memory chip using hardware SPI protocol (Fig. 5(b)). The SPI module transfers the data serially with one byte each time. During the data downloading process, the BIRD microcontroller reads the data from F-RAM (via SPI communication) on the sensor and writes them into F-RAM (via I2C communication) in interface box’s F-RAM. Since both the I2C and SPI communication protocol are established based on the MSSP module, the microcontroller needs to force the MSSP module to either I2C or SPI mode before it communicates with the respective memory. Two subroutines were created to setup the microcontroller to either I2C or SPI mode. The corresponding subroutine needs to be called when either mode is selected. The SPI writes data based on microcontroller bus speed (5 MIPS), which ensures that the microcontroller can record data at a high speed during the data sampling cycle. 3.1.3. Acceleration data sampling and recording The BIRD sensor records data based on actual impacts it experiences. If sampled at a sufficient frequency, each impact can be depicted as a bell-shaped curve with certain time of duration (Fig. 6). The vector summation is calculated based on three axes of acceleration data, and the peak g (g = 9.8 m/s2) is defined as the maximum value of the vector summation. The area under this bell curve, calculated by the integration of the acceleration over time, is defined as the velocity change (the difference between initial and final velocity during an impact). The velocity change is an important index to define the hardness of a contacting surface. A threshold is established such that only the measurements higher than the threshold are recorded to avoid recording too many unimportant trivial impacts. Based on preliminary field tests and the resolution of the accelerometer, a threshold value of 18 g was used for regular test. To characterize the impact curve more completely and calculate the velocity more accurately, certain data points under the threshold are also recorded: three before and six after the impact curve, defined as leaders and trailers, respectively. Three sections of acceleration data (leaders, impacts, and trailers) are recorded into different arrays but belong to the same impact. The LT_F flag was used to sort out impact points that may belong to any of the three sections.

35

Peak G X Y Z Sum

30 Acceleration (g)

25

Leaders

10

The sampling cycle for recording a complete impact starts with A/D conversion of analog accelerometer voltage into digital values (Fig. 7(a)). After converting three axes’ analog signals into digital values, the scalar value of vector sum is calculated by the following equation:

X

¼

qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi X2 þ Y 2 þ Z2

where X, Y, and Z represent accelerations from three single accelerometers. The sum is compared to the threshold value selected by the user and those impacts that are higher than the threshold are written into the memory. The total sampling cycle which records the leaders, impact data and the trailer determines the maximum sampling frequency, which can be up to 3.0 kHz. A breakdown analysis for the time used to record one data set is shown in Fig. 7(b). The AD conversion of three axes of acceleration values takes 60 ls in total, as defined by the AD conversion procedure in the microcontroller. It takes 268 ls for calculation and comparison of summation values, array update, and the timer interrupt, determined by instructional cycles of each command. The void operations, which idles the system clock for a given number of instructional cycles, are used to delay the sampling process for creating lower sampling frequencies. The sampling cycle length could be adjusted by changing the number of void operations (N) with the maximum frequency of 3.0 kHz, when N = 0. Other four lower frequencies (682, 998, 1480, and 2210 Hz) were created by adjusting N heuristically. All frequency options were verified by calculating the number of data points sampled within certain duration of time. 3.2. Interface box program The program on the interface box establishes communication between the BIRD sensor and the computer. It transfers control commands from computer to sensor, uploads data from sensor to computer, and updates the information on LCD (Fig. 8). The program on the interface box also monitors the battery level of the BIRD sensor by sampling an A/D channel connected with the sensor battery. The microcontroller in the interface box works in I2C master mode when it communicates with the BIRD sensor. It receives commands and sends data to the computer via RS232 serial communication. The interface box recharges the battery in the BIRD sensor when battery voltage drops below the cutoff voltage (3.6 V). Users could switch on and off the recharging process. The program receives commands from the computer and executes the command’s request. There are a total of nine commands sent by the computer. Commands about sensor configuration are passed down to the sensor microcontroller via I2C bus. Other commands are executed for data management on the interface box. Data are retrieved from the interface memory via I2C communication and uploaded to the computer via RS232 communication. The interface memory could be erased after the data are uploaded. 3.3. i-BIRD computer software

20 15

199

Trailers Threshold

Velocity Change (Integral of shaded area)

5 0 0.000 0.002 0.004 0.006 0.008 0.010 0.012 0.014 Time (s) Fig. 6. Illustration of one complete impact curve recorded by the BIRD sensor.

The computer software i-BIRD was designed to have three major functions: communication with the BIRD sensor, data processing and display, and generating data reports. The ‘‘Communication and Data Download’’ interface has three components (Fig. 9(a)): RS232 serial communication setup between the i-BIRD and the interface box, configuration of the BIRD sensor, and data downloading and saving. Users can setup RS232 communication through the VISA (Virtual Instrument Standard Architecture) control provided by LabVIEW. To setup the BIRD sensor, users need to erase both the sensor memory and the interface memory, and then synchronize the time between the computer and the BIRD sensor. Predefined sampling frequencies and

200

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

Fig. 7. Flow chart of the impact data sampling cycle of the BIRD sensor program (a) and the breakdown analysis of the duration of one sampling cycle (b).

to the interface box before they are transferred to the computer and saved as ASCII files. A header file will be automatically generated when the data downloading occurs, which includes the synchronization time, sampling frequency, sampling threshold, sensor number, and the file path. Downloaded data can be viewed through ‘‘Read data’’ window in real time. Data processing interface (Fig. 9(b)) processes raw data and saves processed data into spreadsheets. The data being processed can be displayed graphically for users’ quick diagnosis and evaluation of the data. Three graphs in the first row (from left to right) describe the data in three aspects:

Fig. 8. Flow chart of the BIRD interface program.

threshold values can be selected from drop-down lists. The power mode needs to be switched to ‘‘active’’ mode to enable the power supply to all components before starting data recording. The third function of this interface is to manage data downloading process. The power mode can be switched to ‘‘standby’’ mode in order to save battery power. Data are downloaded from the BIRD sensor

1. Raw acceleration data plotted in sequence by impact numbers. Impact data from three axes of accelerometers and their summations are plotted in the first graph. This figure helps to interpret what are raw acceleration values recorded by each axis and shape of each impact curve without time information. It also helps to locate each single data point based on the impact index. For instance, it can track acceleration values generated by high speed rotations of the BIRD sensor, which are not actual dynamic impacts. 2. Acceleration data with the time of acquisition. The second graph shows impact curves against the time of acquisition. Each sampling point is a summation of three axes with the exact time provided by the real time clock on BIRD sensor. The distribution of all single impacts can be identified. From the overall view, groups of impacts can be identified and separated with time information, corresponding to actual impact events recorded by the user. By zooming in this graph, the real impact curve shape can be viewed, the impact duration, and peak-G value can be assessed. During field test operation, it can also be used to identify experimental replicates, or to eliminate irrelative impacts.

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

201

Fig. 9. The i-BIRD computer program: communication and data download interface (a) and data processing and display interface (b).

3. Peak g against velocity change graph. The program integrates the area under each impact curve as the velocity change. The velocity change of each impact curve and its corresponding peak g value are plotted in one graph. Locations of impacts on this graph can be used to predict the probability of bruising of small fruits. Three graphs in the second row from left to right show histograms of peak g, velocity change, and the duration of each impact, respectively. Descriptive statistical results of these parameters are also calculated and displayed. 4. Testing the software The BIRD software was tested and evaluated in following aspects: the accuracy of its real time clock in the BIRD sensor, sampling rate, impact curve shape, and execution speed of the software program.

4.1. Real time clock test The real time clock was created by using the interrupt service routine and Timer 2 module of the microcontroller (PIC18LF2520). Error could be introduced from both the software and the resonator (CSTCE20M0V53Z-R0, Murata Electronics, Kyoto, Japan). The resonator has an initial frequency error of 0.5%. Temperature drift can also introduce error to the resonator speed, with 0.15% variability within 40 to 120 °C. Therefore, the software timer was tested and calibrated to ensure its best performance. The BIRD sensor was mounted on the impact table with Z axis being the sensing axis along the impact direction (up and down) (Fig. 10). The impact table has two vertically mounted sliding tracks. The supporting platform can be released from a given height and hit the base platform. Acceleration values sampled from Z axis were recorded by both the BIRD sensor and the NI-DAQ data logger (NI-6008, National Instruments, Austin, TX, USA) simultaneously. The NI-DAQ data logger has higher sampling frequency

202

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203 60

(a) NI-DAQ BIRD

RMSE=2.6 g

50

Acceleration (g)

40

30

20

10

0

0.000

Fig. 10. Impact table setup for real time clock calibration for the BIRD sensor. 1=BIRD sensor, 2=Supporting platform, 3=Contacting material (rubber ball), 4=NIDAQ, 5=Sliding tracks, 6=Base platform, 7=LabVIEWSignalExpress.

0.005

0.010

0.015

0.020

60

The sampling frequency of the BIRD sensor can be confirmed by checking the number of data points recorded within certain duration of time. Five frequencies were confirmed using this method: 682, 998, 1480, 2210, and 3050 Hz. In order to evaluate the distortion of recorded impact curve, the curves recorded by the BIRD sensor at three sampling frequencies (682, 998, and 1480 Hz) were compared with those recorded by the NI-DAQ with ten replicates. The experimental setup in Fig. 10 was used to generate dynamic impacts. Three lower frequencies of the BIRD sensor (682, 998, and 1480 Hz) were selected because a higher sampling frequency can record one impact event with

0.035

NI-DAQ BIRD

RMSE=4.1 g

Acceleration (g)

50 40 30 20 10 0

0.000

0.005

0.010

0.015

0.020

0.025

0.030

Time (s) 70

(c) 60

NI-DAQ BIRD

RMSE=4.4 g

Acceleration (g)

50 40 30 20 10 0

0.000

4.2. Impact curve shape and sampling frequency test

0.030

70

(b) and accuracy (11 bits input resolution and 14.7 mV absolute accuracy) than the BIRD sensor and therefore was used as a standard to compare with the data collected from the BIRD sensor. SignalExpress (Signal Express 3.0, National Instruments, Austin, TX, USA) accompanied with the NI-DAQ was used to setup the data logger with 10 kHz sampling frequency using the referenced single ended (RSE) signal mode. The computer CPU time that NI-DAQ recorded was regarded as the standard time. To calibrate the BIRD timer, the BIRD sensor was synchronized with the computer time at time 0. The supporting platform of the impact table was released every 5 min to generate impacts, which were recorded by both the NI-DAQ and the BIRD sensor. For the same impact, the difference between the computer clock and the BIRD real time clock was regarded as the error of BIRD sensor clock. The error was calibrated during a 1 h period, as the sensor clock usually can be re-synchronized within 1 h in the field application. The minimum interrupt duration of the sensor was designed to be 0.25 ms (Tick). Therefore, the second should be updated every 4000 Ticks theoretically, the minute should be updated every 60 s, and the hour should be updated every 60 min. Three replicates were performed to calculate the average error of the timer. The Tick was adjusted to 3998 after calibration, resulting in a 2.6 s error in 1 h (0.073% relative error). This accuracy was adequate for the blueberry impact data collection in the field because 0.073% relative error does not lead to misidentification of recorded impacts within an hour and the BIRD sensor can be re-synchronized with the computer time every hour during the data downloading process. The performance of the real time clock was also confirmed in impact curve test, which was discussed in the following section.

0.025

Time (s)

0.005

0.010

0.015

0.020

0.025

Time (s) Fig. 11. Comparison of impact curves recorded by the BIRD sensor and the NI-DAQ data logger using three sampling frequencies: (a)=668 Hz, (b)=998 Hz, (c)=1480 Hz.

better time resolution, and thus allow the reconstruction of the impact value to a higher accuracy. A typical impact curve was selected from 10 replicates of three test frequencies and the impact curve shape recorded by the BIRD sensor and the NI-DAQ matched well with each other (Fig. 11). The root mean squared error (RMSE) of the BIRD sensor measurements were 2.6, 4.1, and 4.4 g for 682, 998, and 1480 Hz, respectively. The velocity change (integration

P. Yu et al. / Computers and Electronics in Agriculture 77 (2011) 195–203

203

the time required for these operations in field operation is not critical and therefore the data uploading speed is acceptable.

Table 1 Operation speed of four procedures in the BIRD sensing system. Operations

Communication protocol

Operating time (s)

Erase the sensor memory Upload sensor data to interface board Upload to PC Write an impact array into SPI memory

SPI SPI, I2C

6 35

RS232 SPI

68 0.0015

area under the impact curve) of the BIRD data was also calculated and compared with that from the NI-DAQ. The BIRD sensor had relative errors of 0.8%, 4.4%, and 2.1%, respectively. In general, the BIRD sensor software accurately recorded impact curves in terms of impact duration and acceleration magnitude. The error of velocity change for the BIRD sensor depends on both the g value and the timer accuracy. The error could also be introduced from human operational variations when the impact table was released from a given height. Previous successful instrumented spheres, like IS100 and PMS60, reported 5–10% error for their peak g under dynamic test, but did not present their performance for velocity changes. 4.3. Speed and efficiency of the software The SPI bus for sensor memory also uses the same bus speed (5 MIPS) as the microcontroller. The I2C communication between BIRD sensor and interface board uses I2C Master Slave mode, which transmits data at 400 kHz bus speed. Communication between interface board and computer software uses RS232 at a Baud rate of 19,200. To evaluate the system’s performance on its speed and efficiency, four operation procedures were measured and compared: erasing sensor memory, uploading sensor data to the interface box, uploading sensor data to the computer, and writing an impact array to the SPI memory (Table 1). The operating speed of the first three procedures were calculated by the start and end time of each procedure showing on the LCD panel of the interface box. The last procedure was estimated based on the programming commands used. It was found that the speed of erasing sensor memory was much faster than uploading sensor data to the interface board and uploading data to the computer since the SPI protocol is faster than I2C and RS232. The I2C and RS232 communication were the bottle neck of the overall data downloading process. However,

5. Conclusion The BIRD software met initial design criteria both in functionality and performance. It can record accelerations from three axes of each single impact with a maximum sampling frequency of 3.0 kHz. The dynamic impacts recorded by the BIRD sensor were verified by the NI-DAQ data logger using a higher sampling frequency. The interface program can establish the communication between the sensor and the computer. The i-BIRD software was designed and applied for data downloading and analysis. The software’s operation speed was also evaluated to provide guidance for field applications. The BIRD software is a complete data acquisition, processing, and analyzing system. It enables the BIRD sensing system to be a useful tool to collect impact data during the mechanical harvest process of small fruits like blueberries. Acknowledgements This project was funded by the United States Department of Agriculture National Institute for Food and Agriculture Specialty Crop Research Initiative (Award No. 2008-51180-19579). Authors would like to thank Mr. Gary Burnham and Tim Rutland’s technical support. References Bajema, R.W., Hyde, G.M., 1995. Packing line bruise evaluation for ‘Wallla Walla’ summer sweet onions. Transactions of ASAE 38, 1167–1171. Canneyt, T.V., Tijskens, E., Ramon, H., Verschoore, R., Sonck, B., 2003. Characterisation of a potato-shaped instrumented device. Biosystems Engineering 86, 275–285. Klug, B.A., Tennes, B.R., Zapp, H.R., Siyami, S., Clements, J.R., 1987. Software for a miniature impact data acquisition device. Transactions of ASAE 30, 1818–1821. Lin, X., Brusewitz, G.H., 1994. Peach bruise thresholds using the instrumented sphere. Applied Engineering in Agriculture 10, 509–513. Mathew, R., Hyde, G.M., 1997. Potato impact damage thresholds. Transactions of ASAE 40, 705–709. Schulte, N.L., Timm, E.J., Brown, G.K., 1994. ‘Redhaven’ peach impact damage thresholds. HortScience 29, 1052–1055. Simami, S., Tennes, B.R., Zapp, H.R., Brown, G.K., Klug, B.A., Clemens, J.R., 1987. Microcontroller-based data acquisition system for impact measurement. Transactions of ASAE 30, 1822–1826. Sober, S.S., Zapp, H.R., Brown, G.K., 1990. Simulated packing line impacts for apple bruise prediction. Transactions of ASAE 33, 629–636. Yu, P., Li, C., Rains, G., Hamrita, T., in press. Development of the Berry Impact Recording Device sensing system: hardware design and calibration. Computers and Electronics in Agriculture. Zapp, H.R., Ehlert, S.H., Brown, G.K., Armstrong, P.R., Sober, S.S., 1990. Advanced Instrumented Sphere (IS) for impact measurement. Transactions of ASAE 32, 955–960.