. 11. , W11 111.111 11111111111111.11 11'. 111111111111 . .,‘,1.111”,_., , 1111111111 l111111111 1:11 .1 1111 '1 11111111111111: H 11.111111. 1.1. 1.1.... 11. 111111111111 11111111 1 1 1 . .111 1 1111-1.) 1 111.1111 .11 111111 . .11 1111 11. 11 11 11" 111111111 111 1111111111111 111 1 111111 111 11111 111111 111111111. 1'11111111111 11111111111111.111 ' 11 " 1 1 11’1 11* 1 1|11,.11'111,1'”"‘1: 11 111111111111111 1111111 1 "1 11 11 1.1 11111’11'111 1’" 1’ 111111111 11 1.1111 111 1 111111111111111111111 11111111111111 111 111 1'1 1. 1111111.1111111111111111 111 11111111111 11111111 1111111111 1111111111 11’ 111111111 1‘ 111111 11111111111111. 111 1 .'...‘ 1’ 1 11. 1111.1 1 . 11 .11' N 111111, 1111.1 111 .11 111111111111 11111 1111 11.1 1 . .1111 ' I 11 11 1111111111 1111 111 1 1 .1111 111' 111 1’11 11 ’11 I ., ' '1 11’ 111 1 1111 .1 111111111111111111 , 1111111111 111 .11» w 11. -.. 11111 ”[11 111111111111 111111111 11111111 11111111 [I 11.11.111.11 ,1 1.1 1111111 1 11111 11 1’ " ’ ’1 1111111 . j. ‘ * .11 1'11 3' ’ ~ :11 1".1111 , w . 1'1 1’ I , 111,1 11,1111 1111111 1 11 , ', 1 ‘ 311 11111 1 11,11. 1111111111111111111111111111111111111 H . 111111: :11 1:111 11 1.11.1 1111’11 1 1'1. 1111117111111111111111111111111-11111 111111111 1111101 1 1., 1111111 111! 11 111111 1111 1'11, 1 1.1.11 111 113.111'1'1111 11 111111111111111111111111111111111111111 11’1' ' ‘ 11.1 1'111111' 1111111111 1111 1111111111 111111 11111111111111 .111 1111114111111.:'1111111 111 11111111111111111111111 11111111 1111:111’1‘ . '1 {1&1 «1 . .1 . 11. I . .111 111 . 1 11111.1 11 111 1111 11 1 111 1:111 11.1111 .16. 5111211 '..u11.11-1.11.1111‘111‘21. 111111111111 1’ 11111111111 1111111111“ 1111111 11"111 h»— THEb.- This is to certify that the thesis entitled A MICROPROCESSOR—BASED APPLE SCAB DISEASE PREDICTOR presented by David Louis Neuder has been accepted towards fulfillment of the requirements for Masters degree in Engineering Wa/ZK/M Major professor MW 0-7 639 r:- > 3.; is .3. 1 I ham; L Mn». ‘ I ~‘ ~53. of!!! 1 . I ‘1‘ l I, it ,v ?’ i F1 6109? OVERDUE FINES: 25¢ per day per item RETURNING LIBRARY MATERIALS: Place in book return to remove charge from circulation records ‘lt iviu. , .i- I've." if... l.i(,. Lw‘t Ifti Q. .l,lt. C Iii. A MICROPROCESSOR-BASED APPLE SCAB DISEASE PREDICTOR BY David Louis Neuder A THESIS Submitted to Michigan State University in partial fulfilhment of the requirements for the degree of MASTER OF SCIENCE Department of Electrical Engineering and Systems Science 1979 ABSTRACT A MICROPROCESSORFBASED APPLE SCAB DISEASE PREDICTOR By David Louis Neuder A microprocessor-based instrument predicts the growth and severity of the apple scab producing fungus venturia inaequalis. Air temperature, relative humidity, rainfall, and leaf wetness serve as the weather data inputs to a table of growth curves that function as the basis for the prediction algorithm. The predicted scab severity level (1-of-4 levels), along with current date and time, sensor status, and eradicant spray recommendation, i.e., time left to apply any one of five different fun- gicides in order to avoid crop damage, is available via a keyboard and alphanumeric display. Also, a complete history of the sixteen most recent fungicidal infection periods and six most recent wetting periods is available for inspection. The instrument has been evaluated in the field and has proved to be extremely useful to both researchers and growers. Currently, the prediction algorithm is being reprogrammed to adapt the instrument to other pest management applications. ACKNOWLEDGEMENTS I would like to extend my sincere thanks to the following people for their supportive efforts in the project: Sig Lillevik, for consulting with me on the requirements of the ASDP, Tom Flynn and Kevin Pokallus for wiring the circuit boards of the ASDP, and Bonnie Beck for typing and proofreading the material. Furthermore, I would like to thank Dr. A.L. Jones for assisting me in the develop- ment of an apple scab prediction algorithm suitable for incorporation in the instrument. In addition, I would like to extend a special thanks to Dr. P.D. Fisher, whose constant encouragement and direc- tion have made this work enjoyable and educational. ii Chapter I. II. III. TABLE OF CONTENTS INTRODUCTION PHYSICAL AND OPERATIONAL CONSIDERATIONS 2.1 2.2 2.3 2.4 2.5 Physical Considerations Algorithm Requirements Data Storage Requirements Operator Interaction Requirements Debug Interaction Requirements HARDWARE ORGANIZATION 3.1 3.2 3.3 3.4 Control Section 3.1.1 Processor 3. 1. 2 Memory 3.1.3 Control Circuit Input Circuits 3.2.1 Input Via Interrupts 3.2.1.1 Rain 3.2.1.2 Keyboard 3.2.1.3 Clock 3.2.1.4 Debug 3.2.2 Input Via Flags 3.2.2.1 Leaf Wetness 3.2.2.2 Power Condition 3.2.2.3 Debug Microterminal 3.2.3 Input Via DMA Output 3.3.1 Display Support 3.4.1 Debug iii 12 14 16 29 29 31 33 35 4O 4O 43 43 44 44 46 46 47 52 52 59 S9 62 62 Chapter IV. VI. 3.4.2 Power 3.4.3 Noanircuitboard Hardware Components SOFTWARE ORGANIZATION 4.1 4.2 4.3 4.4 4.5 4.6 Hardware/Software Initialization Interrupt Service Data Acquisition Data Evaluation Data Display Hardware/Software Debug DEVELOPMENT AND EVALUATION 5.1 5.2 5.3 5.4 5.5 Study Design Construction Software Development Field Evaluation CONCLUSION FOOTNOTES APPENDIX A - Apple Scab Program Two A.1 Statements of Routine A.2 Keyboard Sequence APPENDIX B -- Instrument Pictures 3.1 Apple Scab Disease Predictor in Field 3.2 Entire ASDP Package Including Sensors 8.3 ASDP with Cover Open 8.4 Circuitboard of ASDP 3.5 ASDP in Debug Arrangement REFERENCES iv 67 69 69 71 76 81 84 88 88 89 89 90 90 96 100 101 103 105 106 107 108 109 110 Table II III IV VI VII VIII IX XI XII XIII XIV XVII XVIII XIX XXI XXII XXIII XXIV XXVI XXVII XXVIII XXIX LIST OF TABLES Modified Mills Table Infection Period States Infection Period Termination Requirement Infection Period Computation Keyboard Operation Example Keyboard Selected Display Functions Control Switches Significant Operational Modes Microterminal Control/Debug Functions Additional Features of the 1802 Memory Blocks Selected Address Bits for Decoding Machine Modes Description of Random Interrupt Events Design Constraints for Interrupt Control Circuit Interrupt Priority Levels R(0) Counts Per Degree Procedure to Output One Full Character Interrupt Status Words Temperature Calculation Process Current Infection States Operations to Update Infection Period Prediction II Example ' Keyboard Display Activities Temperature Measurements Leaf Wetness Measurements Rainfall Records Total Infection Periods Component Costs LIST OF FIGURES Figure 2.1 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16 3.17 4.1 4.2 4.3 4.4 4.5 4.6 4.7 8.1 B.2 B.3 Interrelationship of Physical and Operational Considerations Block Diagram of ASDP ‘ Processor Section and Example Block Diagram of Memory Circuit Control and Debug Circuit Interrupt Control Block Diagram Specialized Event Circuits Sensor wetness vs. Sensor Resistance Leaf Wetness Interpreting Circuit Hysteresis of Leaf Wetness Circuit Power Condition Circuit , Procedure for Temperature Measurement Percision Thermistor Resistance vs. Temperature Temperature Measurement Circuit Non-Linear Effects of Temperature Circuit Detail of Thermistor Circuit Display Driving Circuitry Power Supply Circuit General Software Organization Interrupt Service Routine Clock Routine Prediction I Routine Prediction II Routine Keyboard Routine Debug Routine Apple Scab Disease Prediction in Field Entire ASDP Package Including Sensors ASDP with Cover Open vi Page 4 30 34 36 39 42 45 48 49 50 51 53 54 57 58 60 61 64 68 70 73 79 80 85 86 105 106 107 Figure B.4 Circuit Board of ASDP B.5 ASDP in Debug Arrangement vii CHAPTER I INTRODUCTION The control of pest populations is an important aspect of agricul- tural production, forest management, and general improvement of human habitats. And pest management programs have long existed in a variety of forms. Unfortunately, the vast majority of these programs in well developed countries evolved to the point where there was excessive reliance on the use of chemicals for pest control. And, today, we know that many of these chemicals pose serious side-effects to both man and his environment. 80, alternative pest management programs are being developed. Some rely on biological or natural control processes. Others recognize the long-term need for chemicals but are designed to reduce their use to a minimum. The purpose of this work is to describe one such approach in which a microprocessor-based instrument alerts apple growers of pending apple scab infection periods. This instrument resides in an orchard and con- tinuously monitors air temperature, relative humidity, rainfall, leaf wetness, time-of-day, and date. The grower uses a keyboard and a four- digit alphanumeric display to interrogate the instrument and determine if an infection period is likely to occur. Also, it informs the grower how many hours he has left to apply any one of five different fungi- cides on his crop in order to eradicate the apply scab fungus without incurring crop damage. In a normal year, this approach will reduce the grower's use of fungicides by 2-to-3 spray applications with reduction of 75 percent or more possible in some years, depending upon the weather. And this savings means that the average grower can recover his capital investment in the instrument within a couple of growing seasons. This thesis presents the design and evaluation of this microprocessor-based approach. Chapter II details the design consider- ations and operational procedures that were incorporated into the instrument. Chapter III presents the hardware organization and imple- mentation, including block diagrams of the major circuits, while the software organization and structure is included in Chapter IV. Chapter V summarizes the results and suggests further improvements for the instrument and this general approach to pest management. CHAPTER II PHYSICAL AND OPERATIONAL CONSIDERATIONS This chapter establishes both the physical and operational require- ments for the Apple Scab Disease Predictor (ASDP). The first section describes the physical considerations or general environmental and user oriented constraints that form the foundation of the instrument's design. The operational considerations, described in the succeeding four sec- tions, then build upon these physical considerations to fully character- ize the requirements of the ASDP. The first section of the operational considerations, the algorithm.requirements, establishes the routine that must be implemented to predict apple scab infection. Following the pre- diction of an infection, the data storage requirement section specifies the amount of space that must be allotted to the recording of infection information. The operator interaction section then details the format and procedure in which stored data is to be displayed to the user. Finally, the debug interaction section specifies the debug functions that must be incorporated into the design to assist in hardware and soft- ware debug. Figure 2.1 details the interrelationship of the ASDP's requirements. In general, the design is an interactive process with knowledge gained while designing one aspect of the system affecting the design elsewhere. unsouu maoaumuoofimaoo Hmsowumuoao one Hmuwmmam mo mesm:0fiumaouuoucH II ~.N ouswam wanna Illllllllnl maofiumuooamcoo Hmofimxnm muomuoucH .- omeOum — payphone mama afiflom? muomaom 2.1 Physical Considerations In the development of an Apple Scab Disease Predictor numerous physical considerations must be taken into account. First of all, the unit must be designed to be mounted on a post at a representative loca- tion in an orchard. This location must provide the natural meteorologi- cal conditions that lead to accurate scab infection information. On the other hand, this location may not provide the environmental protection an unshielded instrument requires. Therefore, the instrument must be designed to operate through the various conditions of an uncontrolled environment. These may include: all possible atmospheric temperature and humidity conditions; dust and snow stoma; rain, hail, or sleet; lightning or RF interference from farm machinery. In addition, a repre- sentative field location may not provide adequate power support for an instrument. Therefore, the unit must be battery powered, preferably with a battery supply capable of powering the instrument through the entire growing season from early spring to late fall. Second of all, utility to the apple grower must be considered in the design of this instrument. Many of the features that a grower would look for in pur- chasing heavy duty equipment should be incorporated into the design. Typically these features include: easy operation with minimal training; easy installation; minimal time commitment for routine maintenance; ruggedly built to withstand transportation forces; and use of inexpen- sive standard components throughout to facilitate repair if the need arises. In addition, the overall unit should be compact and inexpensive. These two conditions are necessities if the instrument is to be sold in numbers. Finally, the unit should be easily reconfigured for other applications or adding new functions. This feature eliminates the capital investment involved in the purchase of an entirely new instru- ment when a new algorithm is developed or a different pest is to be recorded. 2.2 Algorithm Requirements The apple scab prediction routine directs the operation of the ASDP through the computation of meteorological intervals and prediction of fungal development. The scab routine predicts apple scab infection via an evaluation of meteorological conditions. These infection periods are predicted at the time of estimated fungus exposure which occurs 9-17 days before visible scab lesions occur.1 ‘The degree of scab infection predicted depends upon the amount of scab lesion formation expected. A predicted level of "low" scab infection indicates that scab development will most probably be light. Predicted scab severity levels include none, low, moderate, and high. Once the predicted level of scab severity is know, effective action (such as applying an appropriate spray) can be taken to reduce scab formation. But to determine a scab infection occurrence and the corresponding scab severity level the apple scab routine must monitor the environment to determine an infection period and an average air temperature during the infection period. The infec- tion period and average air temperature are then utilized to determine a scab severity level via the modified Mills table (see Table I).2 As an example: If an infection period listed nine hours with an average temperature of 69° F the predicted scab severity would be "low" and the expected crop damage would be light. In brief summary, the apple scab routine consists of computation of an infection period, average air temperature, and the actual scab TABLE I MODIFIED MILLS TABLE Degree of Infection as Average‘Air a Function of Lapsed Time‘(hrs.) Temperature (OF) Low ‘ Moderate High 78 13 17 26 77 11 14 21 76 9a 12 19. 63-75 9 12 18 62 9 12 19 61 9 . 13 20 60 9a 13 20 59 1o 13 21 58 1o 14 21 57 1o 14 22 56 . 11 15 22 55 11 16 24 54 113 16 24 53 12 17 25 52 12 18 26 51 13 18 27 50 14 19 29 49 14a 20 30 48 15 20 3o 47 15 23 35 46 16 24 37 45 17 26 4o 44 19 28 43 43 21 3o 47 42 23 33 50 41 26 37 53 4o 29 41 56 39 33 45 6o 38 37 50 64 37 41 55 68 33-36 48 72 96 level. Computing an infection period is the major task for the apple scab routine. The infection period as listed by the Mills table con- sists of the number of hours in which the leaves are continuously wet. Nevertheless, a typical day may include wet, dry, and humid periods all within a few hours. In order to compensate for these various environ- mental effects, Jones has developed an algorithm to compute the infec- tion period;3 Through the use of this algorithm the infection period is composed of durations of time in which the climate is in one of the three states (see Table II). The infection period begins with the occurrence of State A or wet leaves. No other state can start an infection period. All subsequent State A time durations and occurrences are summed into an ongoing infec- tion period provided it has not been terminated. In this case, a new infection period will be started. Each occurrence of State A.will ex- tend an infection period and reset the termination period. The termination period is the amount of accumulated time in State C (dry leaves, low humidity) which can be applied toward the termination requirements of the infection period. The predicted level of scab severity determines the termination requirements as indicated in Table III. Therefore, with low level scab severity, an accumulated termina- tion period of six hours will curtail the infection period. The duration of time in State B (dry leaves, high humidity) will only be accumulated into the infection period time if the predicted scab severity level is none. Once the none scab level has been passed, State B places the machine in a holding mode. In this mode State B will not be accumulated along with the infection period or termination period time. An infection period will not be extended or terminated. TABLE II INFECTION PERIOD STATES State A Wet leaves State A begins when 75% deflection of full scale is noted on the DeWit leaf wetness sensor. State A ends after deflection is within 10% of the dry resting position. State B Dry leaves Dry leaves occur whenver the leaves are High Relative not defined as wet. High humidity occurs Humidity when humidity is greater than or equal to 90%. State C ~ Dry leaves Dry leaves occur whenever the leaves are not Low Relative defined as wet. Low humidity occurs when Humidity the humidity is less than 90%. TABLE III INFECTION PERIOD TERMENATION REQUIREMENTS Predicted Scab Severity j Termination Requirements None I 8 continuous hours of State C Low 6 hours of State C Moderate 4 hours of State C High 4 hours of State C 10 Contrary to terminating an infection period, the duration of time in State C (dry leaves, low humidity) can extend an infection period if all three of the following conditions are met: the predicted scab severity level is none; the continuous period of time in State C is preceeded and followed by States A or B; the time in State C does not extend beyond the termination requirements of eight hours. Once the predicted scab severity level has passed the none level, short periods of State C (less than the termination requirement) followed by States A or B will not extend the infection period. The example in Table IV illustrates usage of the Jones algorithm for computing the infection period. The average air temperature is computed utilizing data points throughout the total period of time in which the infection period occurs. These data points are recorded each half hour regardless of the clima- tic state or scab severity level. The mean of the stored data points then provides the apple scab routine with an average air temperature for the infection period. The computation of the scab severity level as described earlier involves utilization of the infection period duration along with the average air temperature to address the modified Mills table and obtain a scab severity level. This severity level is then compared with earlier levels of the same infection period to determine the highest level of infection. The highest level is then selected as the new pre- dicted scab severity level. If this selection process were not per- formed, a change in temperature could display a lower scab level when conditions had actually existed for a higher level infection to have occurred. In addition, the scab prediction routine operates every ten 11 .uomou ma moaned .moH .muoon c wafinooou mafia Goa: mmuoofiauou ooauoa coauoomcu .oooe vac: ca mofiuoou moooad m oumum .ooauod coauooashou ouoo mood o ououm .ummou ooauoe coaumofianoa .woauoa .mow coco poo mm>moH ups hHoo .mooa vac: cw ocfiuoou moomad m oumum .oofiuoa .oaahou coco moon 0 oumum .oooa vac: as mofiuoou moomaa m oumum .oo« loom .moa monouxo howooa on m mumum .uomou ma ooauoe .oaauoa .oowuma .maw ouoo vow mo>ooH ask one hum .oofiuoe oofiumoaauou coco woo mo>ooH hum .soauma .mas 68:6 «use spouses; ems: .ooquod oofiuoomoa uumum mo>ooa no: .eoaumuasmauaeH mezmzzoo cowoouso HmuOu n nonmm ZOHH¢ZHZMMH ZOHHH mam<9 mason mm mooz ououoooz ououoooz oumuoooz oumuoooz 304 Boa 304 363 mooz mooz oooz mooz m Figure 3.2 -- Processor Section and Example 35 (electrically programmable Uvéerasable read only memory) and low power CMOS RAM (random access memory) in conjunction with a decoding circuit perform this function (Figure 3.3). The total memory space when two EPROM chips (Intel 2716, 8-bit x 2048 word) and four RAM chips (RCA 1822 4-bit x 256 word) are coupled is 4608 8-bit words. The 4096 ROM words are dedicated to program storage, while the 512 RAM words are almost exclusively used for prediction data storage. Specifically, the RAM stores all current weather, prediction, display and buffer (des- cribed in Section 2.3) data. In addition, two of the RAM locations store program instructions to execute a continuous loop between inter- rupts. This loop reduces the power consumed by the entire ASDP by 60 percent by placing the EPROMs in a power down mode. The decoding cir- cuit segments the memory into four blocks as listed in Table XI. These blocks are defined by a memory addressing scheme which is compatible with the memory size. Two chips, 1859 and 4076 implement this decoding scheme by keying on selected address bits to produce chip enable pulses. These selected address bits are listed in Table XII. The block of memory which is enabled is then allowed to utilize the data bus for data input and output. 3.1.3 Control Circuit The function of the control circuit is to initiate program execu- tion and facilitate hardware and software debugging. Three switches perform this function by placing the machine into one of the three modes listed in Table XIII. Proper initialization of the program in- volves depressing the circuit board mounted momentary reset switch followed by the momentary run switch. Depression of the reset switch as 36 \ \ ufiooufio auoaoz mo amuwofin xooam II m.m ouomwm mom mama J e :33 . ~ow~ 4 #/\V 4 v A v ALP. ( If Hommoooua cmuxm ommxm msomxw wqouxw tonne: . zm I...|l|.l|_ mead w mama m mama m mama m A. 4&9 L noumuocou Booeaz rlgL fiz1|..|l..l1.nnu._ . _ . _ _ oJI _ . e L. - w K 1 - Ammum — .Ilol.lol .aa mom II . ,rlllnv m m _ . _ I11. 1 33 _ F - _ 1| 1|.. . . e 82 I. .488 I. . ououm- _ll 1.. J + cocoon—on K O \ _. muououoooo 6A.. . Houuoou m m Homewoou.uwo3 0 Soon“: _ \ none“: 0 1|:FI mam \ a 1:1 .4 mmouoo< .Nm — nah m _ - 4&9 O 1IL1IIIFIILIIIIFIIHIIIIPIIHIIIJIII mmH 1lIFhIIlIIlHHIIIIIIHHIIIIIIFWIIIIII mmocuoz Homoom II n.m ouomfim ass monoumwmom zcog . 26“ SH Moog Mod X a . . . a awn uoa .um uom hauoouuso mum muououodaoo onu umnu muofioa _ . soauo>auoo saw one uoz ecu mum mmoouo3 Sea was xmfim .owaou possum may no masouuxo onu mum maco 260 new xm 49 ufiaouao mcwuoueuouoH museum: wood II m.m muswfim .rfiMONN . mucoumwmom mowoonu ououmfioz . acumumaaoo _ ~oo¢ m Unmoooue WE no.3 «mm A 1832 3: «mm m m mamas hanaam noomam . 36> ...+ es: 3. uomsom mucous: 50 Example Statements a) Refer to Figure 3. 8 for circuit block diagram. b) V1 in represents sensor voltage as determined by ‘ 3 5 220 x 10 n ’3 i 220 x 10 + Rsensor Volts c) L and H represent comparators reference voltages of .05 and 2.0 volts. d) L and H voltages correspond to 24M and 315K ohm resistances respectively. Actual Leaf Comparators Comparators Flip Flop Machine Condition Inputs Outputs Output Interpretation dry Vin L low . low wet V11?“ high damp Vi&?>1. . low low wet ' V <11 16w 1 in dry Vin o 20 ’ 4o 60 80 100 120 Temperature 0 ( F) Figure 3.12 -- Percision Thermistor Resistance vs. Temperature 55 executed or the count in R(0)., This count is then converted into the temperature by way of division and a look-up table. Typical R(O) counts per degree are listed in Table XVII. The calculation of the temperature from this R(O) count will be explained in the next chapter. The remainder of this section will dis- cuss various attributes and problems of the circuit. One feature of the circuit is that it is fully microprocessor-controlled. The micropro- cessor selects which temperature (dry bulb, wet bulb) is to be measured by choosing the appropriate thermistor via a selection circuit. The selection circuit, composed of a flip flop and transmission gates places the thermistor in the circuit with the monostable and capacitor as shown in Figure 3.13. Triggering of the monostable is then performed by the microprocessor when it is ready. A second feature of the circuit is that the temperature measurement process is exceedingly short. The duration of the temperature-regulated pulse depends on temperature and can last anywhere from 3.1 ms at 120 F to 6.8 ms at 0 F. These calcula- tions are based on the fact that each DMA cycle requires 3.8147 micro- seconds and that there are 812 and 1780 cycles at each of the respective degrees. One problem with the circuit is that linear temperature vari- ation yields slightly non-linear pulse width variation as shown in Figure 3.14. This is due to the non-linear effects of the circuitry components. In particular, the transmission gates and capacitor together increase the pulse width by an amount equivalent to a 4'F error at low temperatures. On the other hand, the monostable will decrease the pulse width by an amount equivalent to a 1‘F error at low temperatures. This leads to a three degree net decrease in temperature (Figure 3.14) or non-linear effect which must be compensated for through software. 56 TABLE XVII R(O) COUNTS PER DEGREE Temperature R(O) Count (DMA cycles completed) 0 ' 1820 10 1738 20 1656 30 - 1573 40 1489 50 1407 60 1324 70 1242 80 1161 90 1080 100 1000 110 920 120 839 57 ufiooufiu uooaouammoz unpumuoaaoe II m~.m ousmfim east ease uooamm Houmfiauose IIIILe ououmuoeame naomluoz uommoooum Laos .m. 11 1 mm m o a ouauouoaaoa eflem1aee m a usage 01m uoo <29 I.oHAMumo:oz VA [I 4. ummmaufi 1H1! 0 ocufioodmo scamwouom 58 ufioouwu muououoeaoe mo muoowmm umosfiqlooz II q~.m unamfim Amov ououmumaaoe CN~ cog on so as on o AL I u u I I .1Mn .uxm .1M- muoumfiaumnu o o>u=o Housed m 11Mm~ Hmofiuouoonh muaooeroo mo muoommo umocaalooz omomno powwow m 1Mm~ 1Mm~ ermd e Aazov moomumamom 59 In addition, one feature of the circuit involves the use of trim- pots for offset and calibration adjustments. Small 20011trimpots pro- vide a means of removing the temperature offsets which occur due to the slight resistance variances between transmission gates and thermi- stors. Since each of these components are different, slight temperature offsets of one or two degrees could occur if no compensation is provided. Also, larger 20K trimpots can be switched into the circuit in place of the thermistors as shown in Figure 3.15. This provides a means of verifying and calibrating the circuit without the use of thermistors. 3.3 Output ,The output section utilizes only one mechanism to output data. This mechanism makes use of the display section circuit along with pro- cessor software to arrange data into a user comprehensive format. 3.3.1 Display The display section forms the output portion of the communication link between the user and the machine. All of the apple scab program's accumulated data and predictions are presented to the user via a low power, high contrast, four character alphanumeric LCD and the associated driving circuitry. The display driving circuitry, shown in Figure 3.16 directs the character data transfer, stores the input character data, and outputs the character illuminating signals. Each execution of the display output routine transfers four 16 segment characters to the display. During this execution, four bits of character selection code route, by way of a 4 to 16 decoders, each % character (eight bits) of data to the proper LCD driving chips. This 60 beeches houmashmee we demure 11 ma.m enemas .eoaemueaaeu UH nouHBm uoaafiuh\uoumfiauwnh UH , Houmwsuose sowummcoeaou 61 banshee wea>aue seaemee 11 es.m enemas anaemfia Hmommu01oaoowq oauossz afiea< wouomuonu a Houooumno was: no 11 1|. 1|..II \\\ RN 11.111 111.11. \@ Hmoq : m. Ollllllln u o omouum m w 1. 6111...... w e o o o a cannon m z m _E_ oumuoooo new rooms newswom Hooooon heads“: nouomuono was: 62 character data is then latched into the respective driving chips upon termination of the routing signal. The actual in-phase and out-of—phase square wave LCD segment illumination signals are then produced by the LCD driving chips according to this stored data. The example listed in Table XVIII illustrates the output procedure to output one character. 3.4 Support The support section provides the ASDP circuit with power, environ- mental protection, and hardware debug facilities. Three subsections, debug, power and other non-circuit board hardware, (refer to Figure 3.1) provide this support. 3.4.1 Debug . The debug section allows hardware and software to be evaluated through the use of a microterminal and evaluation kit processor board. A complete hardware description of these components can be found in the RCA COSMAC Evaluation Kit Manual.10 3.4.2 Power The power supply circuitry provides continuous regulated power to all of the circuitry, including the debug microterminal and processor board. This performance is made possible by dual low voltage power supplies, two diodes and a regulator. The dual power supplies, a 12 Volt battery at 200 AH and an 8.7 Volt battery at 2.3 AH, in combination with two germanium diodes as diagrammed in Figure 3.17 insure continuous glitch free power. The 12 Volt or main source is responsible for power- ing the circuit and trickle charging the 8.7 Volt source. During fail- ure, the 8.7 Volt auxillary supply takes over and the user is notified 63 TABLE XVIII PROCEDURE TO OUTPUT ONE FULL CHARACTER Output the half character selection number eight to the 4 to 16 decoder, but do not decode it. Output the half character segment data to the LCD driving chips as selected by the decoder (line eight). Repeat Step One except use number nine. Repeat Step Two. 64 Power Switch 4% I l V (Trickle Charge Resistor 5V Regulator +5V EL— 10K11 12.0V ”HM— . V .222; 8 7 - Germanium Diodes IN60 Figure 3.17 - Power Supply Circuit 65 by a message-power flag. In addition, the germanium diodes provide the necessary power sup- ply isolation, yet allow each source to power the circuit with minimal voltage and power loss. The regulator completes the power supply circuitry by regulating the dual source variable voltage inputs to the required flat five Volt circuit supply. Typical power drawn by the entire circuit during normal operating mode is 30 mA at 12 Volts or .36 Watts. 3.4.3 Non-Circuitboard Hardware Components The non-Circuitboard hardware components form the backbone of the predictor machine by supporting and protecting the internal circuitry. The components which provide this support include the enclosure, the wire connectors, and the instrument package support. The enclosure, a Hoffman Nema type 4 clamp cover box, provides the circuitry with a water and air tight seal. This seal, along with a moisture-absorbing desicant protect the circuitry from.condensation and its detrimental effects. The desicant is housed in a holder with humidity indicator which connects through the box to allow visual in- spection of the humidity level and desicant condition. The cover of the enclosure supports the keyboard and LCD. The key- board fits directly into a rectangular hole cut into the cover and forms a moisture-tight seal with the cover. The LCD is viewed through a plexiglass window in the cover. Both the LCD and keyboard are securely attached to the cover. The enclosure interior supports various components. Directly in the center of the enclosure is the regulator support hardware. To the 66 left side of the box are the internal batteries which provide the auxillary source of 8.7 Volts. Throughout the interior of the box are the main circuit board supports. Scotch Flex and Cannon connectors solve the wire connection prob- lem by providing mass termination and a weather-proof seal. The Scotch Flex connectors terminate the 73 LCD and keyboard leads to the circuit board, while the Cannon connectors provide an airtight means of con- necting the external sensors and 12 Volt power source with the internal circuitry. The entire instrument package is supported and protected by a white wooden instrument support. This support, as shown in Figure B.2, shields the instument from sun and rain and houses the temperature sensors. CHAPTER IV SOFTWARE ORGANIZATION The operational character of the ASDP is determined by the apple scab program or software package (illustrated in Figure 4.1). Three functions are encompassed within this software to enable the ASDP hard- ware to acquire, evaluate, and display data. Three additional functions are also included to facilitate hardware/software initialization, inter- rupt handling, and hardware/software debug. The hardware/software initialization or start up-and wait function, discussed in Section 4.1, occurs first after the ASDP is activated and is responsible for placing the instrument in an operational mode. The occurrenee of an interrupt then activates the interrupt service function, Section 4.2, to distin- guish which of four interrupt routines must be executed. Two of these four interrupt routines (Clock/Prediction and Rainfall) form the data acquisition function, Section 4.3, of the ASDP and operate to transmit environmental data to the ASDP. The transmitted data is then evaluated through the data evaluation function, Section 4.4. A third interrupt routine (Keyboard) then implements the data display function, Section 4.5, to transfer data and results to the user. Finally, the hardware/ software debug function, Section 4.6, incorporates the fourth interrupt routine (Debug) to simplify the task of developing new software and trouble-shooting existing hardware. 67 68 soaumnwommuo oum3uwom Houoooo 11 ~.c shaman HHchamm a coauoaooum manna ouoonhox a u % outflow unannouaH '1 Bass asluuoum m o 69 4.1 Hardware/Software Initialization The start-up and wait function performs two operations as suggested by its name. The first of these, start-up, initiates the program after the reset and run switches have been activated properly. This initiali- zation procedure includes setting up the internal microprocessor regi- sters, clearing the prediction storage locations, setting the date, time, dry and wet bulb temperatures, humidity, and leaf wetness (JA01,000,0°F and GOP, high, and wet), reseting the buffer pointers, and clearing each of the history buffers. Following the start-up operation, or after an interrupt is completed, the wait operation is executed. This operation simply writes a branch-to-itself loop into RAM memory and jumps to it. With this loop in RAM, power consumption is considerably reduced as mentioned earlier because the power consume ing ROM are deselected. The microprocessor will then continue to exe- cute this wait branch loop until an interrupt occurs. 4.2 Interrupt Service The interrupt service function performs all service operations associated with hardware interrupt requests. These operations include saving critical registers upon a stack, directing the hardware to input an interrupt status word, decoding the status word to determine which of the interrupt routines should be activated, outputing a new interrupt mask to disable further interrupts, and directing the microprocessor to one of the interrupt routines (refer to Figure 4.2). Presently, one of four interrupt routines-—Rainfall, Keyboard, Clock/Prediction, and Debug—-can be activated as determined by the interrupt status word (see Table XIX). The interrupt service function decodes this status C > 1 Save critical registers 1 Input status word -first bit 1? second bi 1? 70 Yes Execute rainfall routine Set—up for ke yboard ’- routine Set-up for clock/pred. -. routine Set-up for debug Disable clock & keyboard interrupts routine Figure 4.2 -- Interrupt Service Routine a 1 Restore critical registers V Return to wait or interrupt routine 71 TABLE XIX INTERRUPT STATUS WORDS Status WOrd Interrupt (msb) (lsb) XXXX XXXl Rainfall XXXX XX10 Keyboard XXXX X100 Clock/Prediction XXXX 1000 Debug (X's represent don't cares) word by looking for the first bit position which contains a one, reading from right to left. The bit position where the first one is found then specifies which interrupt routine must be executed. An interrupt priority is obviously defined.with this to be Rainfall highest,.Keyboard second highest, Clock third highest, and Debug lowest. 4.3 Data Acquisition The data acquisition function receives weather data via the two interrupt routines; Rainfall and Clock/Prediction. The Rainfall routine records rainfall in hundredths of inches by incrementing a counter (microprocessor register) upon the occurrence of each rainfall inter— rupt (1/100 of an inch of rain). The rainfall data is then stored at ten minute intervals through the Clock/Prediction routine. The Clock/Prediction routine completes the data acquisition function by recording dry and wet bulb air temperatures, humidity, and leaf wetness. Specifically, the Clock portion of this routine updates the current date and time, and records the current temperature and humidity level. The stepwise operation of this Clock routine, 72 Figure 4.3, includes reseting the clock interrupt, incrementing the current time, checking for a new day (1440 minutes), checking for a new month (reached last day of month), and checking for a new year (reached December 31). At this point the date and time operation is complete and the temperature calculation is begun. The Clock routine continues by incrementing a temperature timing register (RE.O), determining if this time is odd or even, setting up the temperature circuitry for either wet or dry bulb as specified by odd or even time, triggering the temperature circuitry (number of temperature/DMA cycles are recorded in R0), and summing the temperature/DMA cycles onto a dry or wet bulb storage location. The temperature timing register, RE.O, is now in- spected to determine if a ten minute interval is complete. A negative result (less than ten minutes) from this inspection will terminate the Clock routine at this junction, while a positive result will continue the routine toward the computation of average dry and wet bulb tempera- tures. The dry and wet bulb temperature computation process involves dividing both the dry and wet bulb total number of temperature/DMA cycles by 20 and subtracting a constant to determine a temperature table location in the range of 0-255. The selected temperature table location then presents the microprocessor with a value that corresponds to twice the actual temperature (refer to Table XX for an example). The microprocessor stores and computes temperatures with this double magnitude value to gain accuracy to within one-half of a degree fahrenheit. On the occurrence of an output operation this double magni- tude temperature is divided by two to produce a valid single magnitude temperature for display. The temperatures are software calibrated by Input Wet Bulb Temperature (cycles) l 73 C > Reset clock interrupt I Calculate date & time INC RE.O RE.O Even 7 Yes Input Dry Bulb Temperature (cycles) Compute . Temperature and Humidity .Prediction I Figure 4.3 -- Clock Routine 74 TABLE XX TEMPERATURE CALCULATION PROCESS Time Actual Temperature DMA Cycle Tempgrature El E5 (F) pry flap (cycles) 1 70.5 1238 2 64 1291 3 71 1234 4 63.5 1295 5 70.5 1238 6 64 1291 7 72 1226 8 63 1299 9 71.5 1230 10 63.5 1295 Totals 355.5 318.0 6166 6471 Averages 71.1 63.6 (Unit T) Divide by twenty Dry 6166/20 8 308.3 Wet 6471/20 3 323.6 Subtract Constant (210) Dry 308-210 a 98 Wet 324-210 = 114 Temperature Table Value Dry 98 yields 142 Wet 114 yields 127 Display Temperatureo Dry 142/2 - 71°F Wet 127/2 - 64 F Computer Routine Rounding (.5 and above is rounded up) 308 324 (Stored Value) 75 tuning the temperature table values and subtraction constant to produce accuracy within i one degree F over a temperature range of 0-1200F. After the temperature calculations, the Clock routine continues by determining if an infection period is in progress and if a thirty minute interval as determined by RE.0 has passed. A positive response to both of these questions places the current dry bulb temperature into location RTEMP for eventual averaging to produce an average air tempera- ture for the entire infection period. On the other hand, a negative response to only the RE.0 interval question places a value of zero into RTEMP. A negative response to the infection in progress question places the current temperature into RTEMP on each occurrence of this sequence (every ten minutes). In summary, this result places the cur- rent air temperature into RTEMP every ten minutes if no infection is in progress and every half hour if one is in progress. This procedure allows a temperature to be recorded when an infection period begins, while not allowing excessive temperature data to overflow the average temperature summing location. The last portion of the Clock routine, finally, calculates the humidity level by determining if the current dry and wet bulb tempera- tures differ by less than three degree fahrenheit. A high humidity (greater than or equal to 90%) result is recorded if the temperatures differ by less than three degrees F, while a low humidity (less than 90%) result is recorded if the temperatures differ by three degrees or more. These two humidity levels are recorded as three for high and one for low to simplify the display routine. The Prediction portion of the Clock/Prediction routine completes the data acquisition function by determining if the leaves are wet. 76 This simply involves testing a flag and storing the result as four for wet and five for dry, again for ease of display. 4.4 Data Evaluation The data evaluation function processes the input weather in accord- ance with Jones Alogrithm (Section 2.3) to predict the likelihood of apple scab formation. The computed results along with the input weather conditions are then stored for later display to the user. The Predic- tion portion of the Clock/Prediction routine totally encompasses and partitions the data evaluation function into two routines; Prediction I, determination of an infection period, and Prediction II, determination of a scab severity level. Prediction I determines the occurrence, length, and termination of an infection period by selectively controlling the amount of time which contributes toward it. This selective process is accomplished by utilizing the past and present weather data to choose one of ten cur- rent infection states or paths of operation (see Table XXI). This operational path then dictates the operations to be performed to update the infection (see Table XXII). As an example: If it suddenly started to rain after two days of dry low humidity weather, Prediction I would select State A (new infection period) as the path of Operation. The operations then performed as directed by this path include: advance short buffer (6) one unit (16 data locations); clear the old data in buffer 6; store the current date and time into buffer 6; in- crement the total amount of time and the wet leaf time for this infec- tion to ten minutes; store the wet leaf time and the rainfall amount into buffer 6; and branch to Prediction II routine. The entire layout 77 TABLE XXI CURRENT INFECTION STATES §pgpg Conditions A Wet Leaves, First Occurence (New Infection Period) B Wet Leaves, Following Wet Leaves, Scab-None C Wet Leaves, Following Wet Leaves, ScabiNone (Low,Mod,High) D g wet Leaves, Following Dry Leaves, Scab-None E Wet Leaves, Following Dry Leaves, ScabiNone (Low,Mod,High) F Dry Leaves, No Infection in Progress G Dry Leaves, High Humidity, Scab-None H Dry Leaves, High Humidity, Scab¥None (Low,Mod,High) I . Dry Leaves, Low Humidity, Scab-None J Dry Leaves, Low Humidity, ScabiNone (Low,Mod,High) of Prediction I software is illustrated in Figure 4.4. As shown in the figure all Prediction I sequences terminate on one of two paths, exit or Prediction II. Each exit path terminates the routine while each Predic- tion II path directs the microprocessor to the Prediction II routine. The Prediction II routine determines the scab severity level from an infection period (developed by Prediction I) and an average air . temperature for the infection period. The stepwise procedure of the Prediction II routine (Figure 4.5) includes, first determining if the scab severity should be calculated. This involves testing to see if the total period of time in which this infection period is occurred greater than or equal to five hours. A negative test result causes the routine State 1,3 78 TABLE XXII OPERATIONS TO UPDATE INFECTION PERIOD Operations Store current date and time into buffer 6 Increment Total and Wet Leaf Store Wet Leaf and Rain in buffer 6 Branch Prediction II Increment Total and Wet Leaf Store Wet Leaf and Rain in buffer 6 Branch Prediction II Increment Total and Wet Leaf Branch Prediction II Increment Total and Wet Leaf Add wait time onto Total, zero wait .Store Wet Leaf, Dry Leaf, High Relative Humidity, and Rain into buffer 6 Branch Prediction II Increment Total and Wet Leaf Add wait time onto Total, zero Wait Branch Prediction II Branch Exit Increment Total and High Relative Humidity Add Wait time onto Total, zero Wait Store Dry Leaf, High Relative Humidity, and Rain into buffer 6 Branch Prediction II Increment Total and High Relative Humidity Branch Exit Increment Wait and Dry Leaf Check Dry Leaf to establish if termination requirements are met (8 hours None, No, Branch Exit 6 hours Low, Yes, Reset Prediction Loc. 4 hours Moderate, Branch Exit 4 hours High) 79 seaweed H coauofiwoum 11 a... madman at.“ oz = .3283on e no 533—3.... . .3... .95... 02 an cannedvoum Human our ou< . er... . . 4.... fin... . «and ma , :0: I Adam sun“ 7 11 as"... no: or 3 HQ. .3: o 2... 23m 2.... ea... .3. 0 use ououm awash gaseous..— uaug no: oz ~36... ace-onus ago... «:3 126... m A. . 1:.“ in": >HG u«fl3 .=.m find: . I «II I. usolouunn Uzi-303 Duo-.933 or 3 oz oz oz 0...: .32. _. 0.3m, cl: one: ~. 3 a. .. . .. e r... 3:33. 2; :3... .=... a”; 1 .. 1 seem an 3 no» a .. o 1 in: new 330 359.... 233 an; an: uu>u . 5 6.....— 3 3...... 31 one: oz 3 uqxu oz u up: no>s our 9: a :oauufivufw 80 @ediction 19 Total 5 hrs. No . Exit Compute ave. air temp. Bound temp. 1 Compute time for prediction 1 Read Mills table Compute scab 1 Save all data in buffer 4/5 . Exit Rigure 4.5 -- Prediction II Routine 81 to terminate, while a positive result leads to a second test in which the number of times through this routine is questioned. A result to this second test of zero times then directs the set up of buffer 4/5 and the subsequent storing of infection date and time. With the re- sult of the above test being greater than zero or after buffer 4/5 set up, the Prediction II routine continues by calculating an average tem- perature for the infection period. This temperature is achieved by directly averaging the stored sum of half hour temperature data which had been collected throughout the total time period in which an infec- tion period is compiled. The temperature is then conditioned to insure that it does not exceed the bounds of the scab table (33-780 F). The infection period (total time leaves are wet, plus all times leaves are dry with high humidity and none scab severity level, plus all dry leaf periods of time enclosed by either wet leaf or high humi- dity and dry leaf occurrences with none scab severity level--total wet leaf time, plus dry leaf and high humidity times stored in buffer 6) is then converted into half hour units and compared with Modified Mills Table values for the calculated average temperature to yield a scab severity level (see example Table XXIII). This new scab severity level is then compared with the previous level to determine which is highest. The highest level is finally stored as the predicted level of scab severity. The closing sequences of the prediction routine then store calculated temperature and scab severity level along with most of the weather data into the long buffer (4/5) for later display to the user. 4.5 Data Display The data display function transfers the input weather data and 82 TABLE XXIII PREDICTION II EXAMPLE Condition Duration Wet Leaf 8.00 (hours) Dry Leaf (buffer 6) 2.00 High Relative Humidity (buffer 6) 4.00 Total 14.00 Infection Period - 28 ha%f hours Average Temperature 68 F Modified Mills Table (excerpt) Temp Low Moderate High 68 F 18 ' 24 36 half hours Computed Scab Severity - Moderate evaluated results to the user via the Keyboard interrupt routine. This operation is completed by three divisions of this routine: control; display activity; and display sequence. The Keyboard control division is responsible for interpreting what information the user desires by the sequence of keys he depresses on the keyboard. Upon depressing the set up key (#) control division understands that the next numerical key (0-9) is the command which the user desires to execute. Each command contains a sequence of display activities of which only one is executed upon each depression of the continue (*) key. The sequence of display activities for each command are stored in the display sequence section and function as a look up table as to what must happen next. The true elements of the data display function are then the display activities. 83 Each of the nineteen display activities performs a specialized opera- tion which results in displayed information of some sort. A partial discription of each of these activities or display routines is listed in Table XXIV. TABLE XXIV KEYBOARD DISPLAY ACTIVITIES Routine Description 1 Displays WOrds (four alphanumeric characters) 2 Displays Rainfall in hundredths of inches 3 Displays Times in hours and minutes 4 Displays Dates in month and date format 5 Displays Temperatures in degrees fahrenheit 6 Displays Scab Levels, Humidity Levels, Leaf wet Levels 7 Displays XXXX and sets machine to receive password 8 Checks the passwords 9 Resets the prediétion 10 Checks input dates and times 11 Sets up each buffer 4/5 history unit (16 locations) for display 12 Sets up each buffer 6 history unit (16 locations) for display 14 Displays bbb + (b - blank) 15 Calculates Time until infection 16 Set up routine for Eradicant Display 17 Calculates time to apply Eradicants 18 Set up for number of sprays 19 Set up routine for rainfall density 20 Sets up each Rainfall density history for display Other features of the Keyboard routine include the ability for it to accept numbers, when they are required by the command being executed, 84 and the ability to recognize illegal key sequences. A partial software flowchart is listed in Figure 4.6. 4.6 Hardware/Software Debug The major operations of the debug interrupt routine include memory and internal register inspection and modification, program resumption with start point selection, and hardware execution. These operations comprise the debug function, the last function of the ASDP. Figure 4.7 illustrates the software structure which implements these routines. Four command keys--$P,1ee1, CA, INC--on the microterminal direct the entire operation of this routine. The SP command directs the micropro- cessor to return to the main apple scab program via an interrupt return. Program execution resumes with all registers restored at the point where it ended or at a new location specified by the user. The 69 command switches the location of the decimal points from the right four digits to the left four digits of the microterminal and visa versa. Their position then informs the Debug program that the decimal portion of the display is not to be modified by incoming digit data. The CA command steps to and enters the next one of five possible modes (Display/ Modify Memory, Display/Modify Registers, Display/Modify DF-XP-D Output to 4514, and Output to 4508). Upon entering a selected mode a pointing register (R8), which points to where the mode data is stored, is initialized. This register is then utilized in various ways to fill an 8-byte display character storage (8 bytes of RAM). With this last com- mand the CA command is completed and the operation of the microprocessor is returned to the display multiplexing and keyboard polling routine. A numerical keyboard input (O—F) then modifies the pointing register 85 (:fiKeyboard 1 Reset Keyboard Interrupt Set-up Key 1 D Exit Yes isplay bbb+ ‘ No Determine 13 Yes command Command Ke Set-up display H ' sequence No Is Continue Ke Yes . #? No Use display sequence to .D t Ii; t Yes Input data find display a a , up“ Shift display activity , No 1‘ Execute E Kit display 1115831 activity key entry Display ILGL ‘III.’Exit Figure 4.6 - Keyboard Routine {III'IEXit 86 U 1 Display Display Multiplex 1 Keyboard 1 A Is Return to Key $P Main Program I, Switch decimal point C Debug D Initialize pointing register R8 960 Is Input Key Data character ’- into R8 Store display E Z storage ’ Increment —_"__—1 R8 ' Develop dis 1a Display stogagz locations ‘lll'fisphnr Figure 4.7 -- Debug Routine 87 (decimal to left) or the display character storage locations (decimal to right) dependent upon which type of memory is protected. Finally, the INC command either decodes the 8 bit display memory, stores it via the pointing register, and increments the pointing register, or acti- vates the hardware as specified by the display memory. CHAPTER V DEVELOPMENT AND EVALUATION This chapter presents an outline of the procedures used to develop and evaluate the ASDP. And results of this evaluation are summarized. Each of the sections of this chapter focus on one of the following phases of development; study (Section 5.1), design (Section 5.2), con- struction (Section 5.3), software development (Section 5.4), and field evaluation (Section 5.5). These phases have played a major role in the development of the ASDP and represent a substantial portion of the over- all development time. 5.1 Study The study phase focused on developing an understanding of apple scab and learning the RCA microprocessor. This required approximately two man-weeks (40 hour week) devoted to the study of apple scab for the purpose of determining how to record the necessary environmental data and implement the scab routine. Specifically, this portion of the- study dealt with defining the sensors needed, the states of the scab routine, the user interface functions, and the physical considerations of the instrument for the environment in which it must operate. Simi- larly, approximately three man-weeks were devoted to the tasks of studying the general architecture, simple programs, and hardware config- urations for the microprocessor. Through this study many of the soft- ware and hardware problems associated with interfacing the 88 89 microprocessor with any instrument were examined. A few of the soft- ware problems included interrupt handling, subroutine branching, and mathematical routine implementathmi(multiplication, BCD conversion, and addition). Similarly, hardware configurations focused on the problems associated with interrupt debounce, memory addressing, and input/output control. Upon the completion of this study phase the microprocessor had been thoroughly studied and the design phase begun. 5.2 Design The predictor design phase contrary to the study phase dealt speci- fically with designing the hardware architecture of the ASDP. Prelimi- nary work included both studying a progenitor and consultation with the designer, Sig Lillevik, to determine the features to be incorporated into the ASDP.110ther preliminary work involved deciding hardware versus software tradeoffs. A few of the specific functions involved with this included interrupt debounce and decoding, temperature measurement, and leaf wetness measurement. The results of this preliminary work (1 man- week) were then incorporated into the ASDP hardware design. The total design process (including preliminary work) required two iterations and lasted 1 man-month before a third and final hardware design was settled upon. Parts were then ordered and construction begun. 5.3 Construction The construction phase lasted approximately two man-months. During this time the entire unit was constructed and tested. Construction was segmented into four tasks. These included circuit board, display and keyboard interface, enclosure support, and sensor construction. Testing 90 was performed at the conclusion of each of these tasks to verify their operation. Some of this testing was augmented by the use of short microprocessor test programs. These test programs were significant in that they placed the machine in an operational mode and provided actual data as to the performance of circuit sections. 5.4 Software Development The software development phase was the final phase of construction of the ASDP. Four tasks segmented this development and simplified the overall process. These were flowchart development, flowchart to code translation, code assembly and simulation, and code execution upon the ASDP. Of these tasks, code assembly and simulation required the most time, one man-month. On the other hand, it yielded the most informa- _tion as to if a specific routine was functionally correct. This code assembly and simulation task was complete by way of the MSU time-sharing and the RCA COSMAC cross assembler and simulator. Code execution upon the ASDP hardware then acted as the final test for proper software operation. After two man-months of software development, the ASDP program was completed and the unit was readied for field evaluation. 5.5 Field Evaluation The field evaluation began on August 25, 1978 when the two ASDP units (unit T and unit K) were installed in the MSU research apple orchard. During the following months at least one of the two units was in the field until November 16, 1978. Over this time span, the ASDP's operation was nearly perfect. Three small problems occurred during the evaluation period. The first occurred on September 25 when unit K 91 scrambled the stored data when the temperature dropped below 44°F. As temperature dropped, two of the RAM socket pins became disconnected from the RAM, causing data to be misinterpreted. Re-soldering this intermittent connection solved this problem. A second problem occurred on October 5 when unit K's wet bulb temperature rose three degrees above its dry bulb temperature. The problem was diagnosed to be caused by the thermistor element. Water had penetrated the thermistor protection and corroded the element in such a way so as to raise the temperature by three degrees. This effect was compensated by the addition of resist- ance into the circuit by way of a 500 ohm trimpot in place of the 200 ohm compensation trimpot (refer to Figure 3.15). Another problem in- volving both units was due to slight errors in the software. This fre- quently occurred after new routines or programs were implemented. Although most corrections were reasonably simple software modification was still a time-consuming process. Despite minor problems, the ASDP functioned exceptionally as exem- plified in the following comparisons that compare recorded meteorologi- cal data with the equivalent ASDP data. The categories in which these comparisons were made include temperature (dry and wet bulb), leaf wetness, rainfall, and scab infection period. Dry and wet bulb tempera- ture measurements were usually within 1 F of those recorded by a strip chart recorder and sling pychrometer (see Table XXV). Atypical data occurred on cool bright sunny days where the sunshine heated the tem- perature sensors enclosure. This result is denoted by the words "bright sun" in the table. A modification in the sensor enclosure is in the design phase to reduce this sunshine heating effect. 92 TABLE XXV TEMPERATURE MEASUREMENTS Instrument Alternate Method _Date _Time D_rz w_e:-. 21:2 Fe_t. 0C12 1942 54 F 54 F OC16 1731 49 43 F 48 42 F OC17 2136 40 40 OC18 1736 54 53 OC19 1917 50 50 OCZO 1644* 70 59 68 56* OC22 1059 67 60 66 59 OC23 1640 48 41 47 42 OC24 1650 42 41 OC25 1326 49 49 OC29 1540* 61 52 53 45* *Bright Sun Alternate Method Dry Temperatures from Strip Chart Recorder Wet Temperatures from Sling Pychrometer TABLE XXVI LEAF WETNESS MEASUREMENTS Hours of Wet Leaves Date Time Instrument deWit Leaf Wetness Recorder SP15 2304 11.66 hours 11.00 hours SP17 454 6.66 hours 6.00 hours SP18 2404 11.50 hours 12.00 hours OC22 2344 10.50 hours 10.30 hours 0C25 1314 21.50 hours 21.00 hours NV01 943 1.00 hours 1.00 hours NV02 633 2.66 hours 3.00 hours 93 The ASDP leaf wetness sensor typically recorded leaf wetness periods within 40 minutes of those recorded by the DeWit leaf wetness recorder. This 40 minute accuracy is considered quite satisfactory for a leaf wetness sensor. A sample of these recordings and their compari— sons are listed in Table XXVI. On the other hand, the ASDP leaf wetness sensor did not record many heavy dew wetting periods. This was unsatisfactory and was subsequently corrected by reducing the wet- ness threshold of the leaf wetness circuit. The rainfall totals recorded by the ASDP were fairly accurate as listed in Table XXVII. Note however, that the ASDP records were occa- sionally lower than those recorded by the alternate raingage method. This is believed to be due to heavy dew collection in the raingage , before a rainfall. Currently no method except emptying the raingage before a rainfall has been developed to remove this effect. TABLE XXVII RAINFALL RECORDS Date and Time of Measurement Rainfall in Hundreths of Inches .Qppg .Tipp_ Instrument Alternate Method SP27 1536 16 18 SP28 1044 17 19 SP30 1851 6 7 OC03 1741 25 26 OCO4 1818 4 4 OC05 1522 14 14 OC16 1731 79 81 OC23 1644 32 34 OC25 2035 20 21 0C26 1326 15 15 94 The scab total infection period computed by the ASDP is accurate when compared with the length of total infection periods calculated by hand. Table XXVIII which compares both strip chart data with the ASDP data illustrates this point. These infection periods, determined by the scab routine, then lead to the prediction of a scab severity level of fungus growth. At this time there is no data to establish how well the routine performs. Earlier studies with the progenitor do indicate that a similar routine works remarkably well. This fact coupled with the sensor accuracy should lead to precise apple scab severity level predictions. 95 TABLE XXVIII TOTAL INFECTION PERIODS First Period Strip Chart Recorded Weather Data Infection period began SP21 at 4:30 (24 hour clock) Wet leaves from 4:30 to 14:00 (9 hours, 30 minutes) Dry leaves from 14:00 to 21:00 (7 hours) Infection period ended Temperatures 4:00 6:00 8:00 10:00 12:00 14:00 70 7o 32 56 55 58 (0F) Temperature average - 61.8 F Instrument Interpretation Infection period began SP21 at 4:33 Wet leaves for 9 hours 20 minutes Infection period ended 0 Temperature average - 62 F Second Period Strip Chart Recorded Weather Data Infection period began SP20 at 12:40 Wet leaves from 13:00 to 16:00 (3 hours) Dry leaves from 16:00 to 19:00 (3 hours) High Humidity from 19:00 to 10:00, NV01 (15 hours) Dry leaves from 10:00 to 20:00 (10 hours) Infection period ended Temperatures 13:00 15:00 17:00 19:00 21:00 23:00 0 62 60 o 64 62 56 53 ( F) Temperature average . 58.4 F Instrument Interpretation Infection period began SP21 at 12:53 Wet leaves for 3 hours, 40 minutes Dry leaves for 3 hours, 10 minutes High Humidity from 6 hours, 20 minutes Infection period ended Temperature average - 59°F CHAPTER VI CONCLUSION The purpose of this research effort was to develop, design, con- struct, and evaluate a microprocessor-based instrument to predict apple scab producing fungal growth. This instrument was to be mounted in a representative orchard location to monitor the weather for the purpose of determining the likelihood of scab infection outbreak. The repre- sentative location was to provide the natural meteorological conditions for accurate scab level predictions. Similarly, this location was not necessarily going to provide the indoor conveniences of regulated power and a stable environment. In addition, the unit was to be designed as a prototype of a marketable instrument. This required that ease of set-up, usage, maintenance, repair, and reconfiguration for upgrade or implementation of new functions be considered. A scab severity prediction and data display routine were the two main software algorithms that had to be developed. The prediction routine was to compile an infection period based on current and past weather states. The resultant infection period was then to be applied to a scab severity table to predict a new level of scab infection. The data display rdutine was then required to display this contrived level of severity to the user upon proper activation of an instrument front panel mounted keyboard and liquid crystal display. Other information that the user was to receive from this display keyboard interface 96 97 included current date and time, current weather conditions, current apple scab predictions, hours remaining to apply any one of five dif- ferent fungicides to avoid crop damage, and a history of the parameters associated with the last sixteen infection periods. Finally, two identical instruments were to be built and evaluated in a research apple orchard for the entire growing season. Each of these objectives have been met and completed. Currently (April 1979), one unit is located at Cornell University Experimental Station in Geneva, New York, while the other is located in the Botany research apple orchard here at MSU}2 Performance of both of the units has been outstanding with only minor difficulties as described in Chapter V. Figure 3.1 illustrates the field mounting arrangement. Cost for each unit for parts averages around $970. This can be divided into the various component costs listed in Table XXIX. Further modifications could be implemented on the current design to reduce the unit cost and improve overall performance. Specifically, the chip count can be reduced by incorporating larger (state of the art) memory chips and by employing alternate methods to implement interrupt handling and liquid crystal display driving. This reduction should decrease the cost and construction time of the unit. Additional savings could also be brought about through the use of cheaper wire-wrap sockets and plastic enclosed integrated circuits. These changes should not degrade the instrument operation. The overall performance of the instrument could be improved through the development of a new leaf wetness seneor which would simulate the wetting properties of the leaf more accurately. Finally, the calibration and performance of the temperature measurement operation could also be improved through the use of a temperature stable 98 TABLE XXIX COMPONENT COSTS Microprocessor Memory 1800 Chips All other IC's LCD display Keyboard Augat sockets Flat cable connectors Crystals Five volt regulator Precision capacitor Round cable connectors Switches Batteries Enclosure Flat cable Round cable Fenwal thermistors Capicitors, diodes, resistors Tipping bucket rain gage Leaf wetness sensor Miscellaneous hardware TOTAL INSTRUMENT COST (excluding labor) $186.18 114.06 32.00 24.00 68.20 37.25 14.65 13.50 5.00 57.32 14.84 72.80 21.94 7.12, 6.80 25.72 5.86 $707.24 200.00 5.00 $912.24 50.00 $972.24 99 circuit. In general, research with this instrument will continue in an attempt to further optimize hardware and software. Simultaneously, new instruments will be developed to control other orchard pests. FOOTNOTES 10. 11. 12. FOOTNOTES Jones in reference 1, page 2, lists the days of incubation vs. temperature. The Modified Mills Table, developed by Dr. Alan L. Jones (Department of Botany and Plant Pathology, MSU),is an extension of the Mills Table. Reference 1, page 2 and reference 2. Dr. Alan L. Jones (Department of Botany and Plant Pathology, MSU) developed the prediction algorithm. Refer to Appendix A.1. The RCA Evaluation Kit (CDP18SOZO), referred to as a processor board, is essentially a miniature computer minus a means of input. By coupling the kit with a teletypewriter, microterminal (CDP188021), or other type of input/output device the computer system is complete. Refer to reference 3 and 4 for complete descriptions. Refer to reference 5. Support chips refer to the CDP 1800 series chips. Refer to refer- ence 6. The cross-assembler simulator uses a host timesharing computer system to assemble RCA source code and then simulate microprocessor operation using the assembled object code. Refer to reference 7. Refer to references 3 and 4. Refer to reference 8. Refer to references 3 and 4. Sig Lillevik, a professor at Utah State University, was a doctoral student at Michigan State University at this time. Refer to ref- erence 9. Both units are under the care of the Botany Research teams of the respective universities. Dr. Alan Jones - Michigan State University Dr. Robert Seem - Cornell University 100 APPENDIX,A APPLE SCAB PROGRAM TWO 101 A.1 -- Apple Scab Routine Two (DNPDRZ) Statements of Routine. 8) b) e) d) e) f) 8) h) ,1) Apple scab severity is divided into four levels: none, low, moderate, and high. Routine distinguishes between three meteorological conditions or states. I Wet Leaves and High or Low Humidity II Dry Leaves and High Humidity III Dry Leaves and Low Humidity Infection period refers to the time which is used to compute scab severity. Total period refers to the total time in which an infection period occurs. An infection period begins upon the occurrence of State I or wet leaves. The infection period until "low" level severity consists of the total duration of time the weather is in States I, II, III. Note: State III is summed onto the infection period only if it is preceeded and followed by States I or II and if the time in State III does not violate the termination requirement. (Example: Any dry period will be added onto the infection period if it is less than 8 hours and the scab severity is "none". After reaching "low" level scab severity, the infection period can only be extended by the occurrence of State I or wet leaves. The infection period is terminated upon the passing of X con- tinuous hours of State III. X is determined by current scab severity level of the machine. Scab Severiry .X None 8 Low 6 Moderate 4 High 4 State II will not terminate or extend the infection period once the machine reaches "low" infection. Average temperature is computed throughout the total period regardless of the meteorological state or scab severity levels. 102 j) Average temperature and infection period duration are then applied to a table to determine scab severity. Note: Once a higher scab severity level is reached, the severity cannot be decreased to a lower level. k) Scab severity status is examined each 10 minutes. 103 A.2 -- Apple Scab Routine Two Keyboard Sequence Function Button Calender 1 Scab 2 Sensors 3 History Down 4 History Up History until Low 6 Level Eradicants 7 (Back-action sprays) ERDl ERD2 Prediction StOp 8 Rain 9 Display Current Date Current Time Scab Severity Level Time until Infection Air Temperature Wet-Bulb Temperature Humidity 90% Leaf Wetness Rain in 1/100 of Inches Date of Infection Time of Infection Average Temperature over Entire Period Scab Severity Level Total Period Time Wet Leaf Time Dry Leaf Time High Relative Humidity Time Rainfall in 1/100 of Inches Date of Infection Time of Infection . Average Temperature until Low Level Partial Wet Leaf Time Partial Dry Leaf Time Partial High Relative Humidity Time Partial Rainfall in 1/100 of Inches Date of Infection Period Start Time of Infection Period Start 1-5 Sprays followed by the time re- maining for the eradicants to be applied. Date of Infection Period Reaching Low Time of Infection Period Reaching Low 1-5 Sprays followed by the time re- maining for the eradicants to be applied. PW XXXXF1234 (XXXX must be reached before the password number can be entered) FRED STOP-STOP (curtails current infection period) Date of 3/100 inches of rain or more occurring in 10 minute interval. Time of 3/100 inches of rain or more occurring in 10 minute interval. 104 Apple Scab Routine Two (Continued) Function Button Display Set Calender 0 PW XXXX35678 DATE JA01=0101 TIME 1200-1200 APPENDIX B INSTRUMENT PICTURES 105 Figure 3.1 —- Apple Scab Disease Predictor in Field 106 muomcmw wcfiooaoaH owmxomm mam< phenom 11 N.m ouswam 107 6.1.0 :58 fit. .89. 11 m... use»... .61 ...»11. . J, ... ... 1.. . r , .HHMWNK.I H .8!!! 15:14:25 . .1141 . 1 1194090.! . .m . c". “fiwquv . .1. .. sham. ... HH ackofiwwmm wm