Il1Williillilljlnllllu: ' 1'" r [‘VQ< .I'N.‘ This is to certify that the thesis entitled AN AUTOMATIC STEERING CONTROLLER FOR A ROBOTIC LAWN TRACTOR presented by Ronald Earl Squires has been accepted towards fulfillment of the requirements for Wegmein A°E°T° fl 2 / C/flM/fcczm C /ZL flog/004 Major professor Date ////3 /6’/ 0-7 639 MSU RETURNING MATERIALS: ace 1n oo rop to remove this checkout from LIBR 1...;352E:_ your record. FINES will be charged if book 15 returned after the date stamped below. .“I s _ x 15'2”” if 'z/ 1/" I f V 042617 I!“ (7* q Lt'd -' 1 23! (.37 _..__—_————-~ AN AUTOMATIC STEERING CONTROLLER FOR A ROBOTIC LAWN TRACTOR Ronald Earl Squires A THESIS Submitted to Michigan State University in partial fulfillment of the requirements for the degree of MASTER OF SCIENCE Department of Agricultural Engineering 1981 ABSTRACT AN AUTOMATIC STEERING CONTROLLER FOR A ROBOTIC LAWN TRACTOR By Ronald Earl Squires As a first step towards the development of a robotic agricultural vehicle, an automatic steering system was developed for a robotic lawn tractor. The steering controller guided the tractor around an ever decreasing rectangular area to mow a lawn without operator assistance. The microprocessor-based controller utilized no sensor or device located separate from the tractor. The micro- processor "learned" the size'of the rectangle as the tractor mowed the perimeter. The controller guided the tractor along one side of the rectangle, performed a 270 degree turn, then continued with the adjacent side. The controller used information as to the location of the grass cut edge, the position of the steering wheels, and the distance traveled to determine when a steering algorithm needed to be implemented. The robotic tractor mowed all of a rectangular lawn automatically except for the outside cut and the final swath. ACKNOWLEDGEMENTS I would like to thank Dr. Truman Surbrook for his help and encouragement in the development of the controller and in the writing of this thesis. I would also like to thank Dr. John Gerrish and Dr. Michael Shanblatt for their input to the development of the controller. The support of the Detroit Edison Company, both financial and in locating and repairing the lawn tractor was vital in this research. Finally, I would like to thank my wife, Kathy, and my son, Steve, for their understanding, encouragement and assistance throughout my graduate study. ii LIST OF LIST OF Chapter I. VI. VII. <. H H P! O H 4 TABLE TABLES . . . . . . FIGURES . . . . . INTRODUCTION . . . OBJECTIVES . . . . LITERATURE REVIEW . SYSTEM GENERAL DESCR SYSTEM DEVELOPMENT - Linear Actuator . Initial Control Bo Microprocessor Control . Distance Traveled Grass Edge Sensors Drive Relay . . Operator Controlled Inputs SYSTEM DEVELOPMENT - RESULTS AND DISCUSSI Grass Edge Sensor Distance Traveled Wheel Position Sensor . . . Microprocessor . CONCLUSION . . . . LIST OF REFERENCES OF CONTENTS IPTION . . HARDWARE AND X 0 0 Input . O O O O Q C O O O O O O O O O 0 SOFTWARE . ON . . . . O O O 0 O Circuitry O O O O O O O O O 0 iii MECHANICAL iv 11 18 19 26 4 32 40 43 L9 71 80 83 84 85 88 9O {N \A) N 0 LIST OF TABLES Input Port Assignments . Output Port Assignments Register Allocation Memory Allocation iv 44 45 50 52 12. 13. 14. 15. 16. 17. 18. 19. LIST OF FIGURES Positioning of Major System Components upon the TraCtor O O O O O O O “O O O O O O O 0 Typical Pattern Cut by Tractor in Automatic Linear Actuator Mounting . . . . . . . . . Linear Actuator Control Circuit . . . . . . Initial Control Box Schematic . . . . . . . RCA COSMAC VIP Simplified Block Diagram . . Front Wheel Position Decoding Circuit . . . Distance Traveled Circuit . . . . . . . . . Grass Edge Averaging Circuit . . . . . . . Drive Relay Circuit . . . . . . . . . . . . Rotary Switch Schematic . . . . . . . . . System Flow Chart . . . . . . . . . . . . . Initialization Flow Chart . . . . . . . . . Main Loop Flow Chart . . . . . . . . . . . Turn Selection Flow Chart . . . . . . . . . Correction Right Flow Chart Correction Left Flow Chart . . . . . . . . Corner Turn Flow Chart . . . . . . . . . . Shutdown Flow Chart . . . . . . . . . . . . Learn Flow Chart . . . . . . . . . . . . . 13 15 21 23 27 28 3O 33 38 42 47 54 56 57 if 1'} 61 63 66 67 CHAPTER I INTRODUCTION Safety, machine efficiency and energy efficiency are important factors that can be maximized by use of robotic agricultural equipment. A decrease in the availability of trained agricultural equipment operators, combined with the increase in energy and machinery costs may shift the industry towards robotics as a way of lowering operating costs while decreasing the demand for highly trained operators. The development of a practical, yet versatile, robotic agricultural machine was well beyond the scope of this project. This project was, however, viewed as an initial step towards the final goal of a robotic agricultural machine. One of the functions that a robotic agricultural machine must be able to do is to move about the field following an efficient pattern. The machine must be capable of following the desired path within the accuracy specifications of the task being performed. As dead reckoning has been attempted and proved unsatisfactory for all but the simplest of jobs (Gilmour 1960), the robotic machine must be capable of performing steering functions to maintain the desired work pattern. This 1 work, therefore, concentrated upon the development of an automatic steering system. At the start of the project, it was decided that for a unit to be practical it must be capable of obtaining all necessary information without the use of external devices. Several types of automatic steering systems have been utilized by various researchers in an attempt to make a vehicle steer itself. These major types are documented in the literature review, however, only the ones that utilize physical parameters of the field itself were capable of meeting the requirement of no external devices. Once the method of primary location sensing had been determined, a specific machine and function were required. Several types were considered. A lawn tractor was chosen because the space requirements for the lawn tractor were less than that of a conventional agricultural tractor. Also, the tractor could be tested on campus, the time of year during which the tractor could be tested was quite large, and finally, the cost of acquiring and developing the system would be less when compared with a conventional agricultural machine. It was felt that all information obtained from this lawn tractor could be easily transferred to a conventional farm tractor when needed. With the help of a local electrical power supplier, a General Electric lawn tractor was acquired. This vehicle was totally electric. An electric vehicle was not required for this project, however it was determined that it would be an asset in future energy related studies. The ability to mow a given lawn of any size and shape would be the final goal of the project. This type of versatility would require sophisticated robotics. There- fore, the development was divided into a series of smaller steps of which this thesis reports the first. Detailed in the following sections of this thesis is the description of the lawn tractor automatic steering controller that was designed. CHAPTER II OBJECTIVES The general objective of the robotic lawn tractor project was to build and test a lawn tractor which would mow a lawn without an operator in direct control. For the initial development covered in this thesis, the lawn was assumed to be rectangular, of uniform height and density, and free of obstructions. The lawn tractor would mow the lawn by following one side of the rectangle, performing a 270 degree turn, reacquiring the grass cut edge and then mowing the adjacent side. Repeating these steps took the tractor around the rectangle until one dimension of the uncut area had been reduced to less than one meter. At that time, the controller would direct the tractor to stop, shutdown the mower, and await the return of the operator. The specific objectives of this portion of the project were: 1. The tractor must follow the grass cut edge such that a minimum of 85 percent of the cutting width of the mower is utilized and a minimum of 99 percent of the total area attempted is mowed; 2. On dry grass the controller must execute a 270 degree turn at the required time, in such a way that the adjacent grass edge could be reacquired in less than one meter of travel along that edge; The microprocessor must learn the dimensions of the initial lawn and perform the necessary mathematical operations required to reduce the learned dimensions such that they represent the remaining uncut portion of the lawn, as the lawn is mowed: The controller must halt tractor forward travel and disable the mower whenever any dimension of the uncut lawn is reduced to less than one meter: The operator interface with the controller must be such that a person unfamiliar with the controller can operate the system after less than five minutes of instruction; All systems of the lawn tractor must also be operable in the manual mode. CHAPTER III LITERATURE REVIEW The desire to eliminate the operator from the tedium of steering an agricultural vehicle has resulted in the development of several experimental controllers. Grovum and Zoerb (1969) classified guidance systems into three basic types; semi-automatic, automatic command and automatic preset. The semi-automatic category included radio controlled vehicles and also master-slave arrange- ments. The semi-automatic type of controller was capable of removing the operator from a hazardous location but did nothing to lessen the burden upon the operator. The automatic command group utilized external systems to monitor the position of the vehicle and issued instructions to the vehicle to cause it to follow a desired course. A major disadvantage of the command type of guidance was the required high degree of component accuracy and the resultant high cost. The last category, automatic preset, was where the vehicle had the necessary equipment to evaluate sensed data and to perform steering functions based upon the data. This category of guidance systems has received the most study. Gilmour (1960) utilized a dead reckoning system that proved to be impractical due to the effects of slippage and other mechanical errors. The two most common systems that have been studied involve the vehicle following a physical parameter. The first involved a current-carrying conductor buried in the ground. The vehicle followed the conductor by observing the strength and orientation of the produced magnetic field. Rushing (1971) described an antenna that was capable of sensing the buried wire and of providing information as to the orientation of the wire with respect to the antenna. A considerable amount of work utilizing the buried wire technology has been performed at the National Tillage Machine Laboratory located at Auburn, Alabama by R. E. Young and R. L. Schafer (1974). Young, et al., (1980) described the use of an Intel 8085 microprocessor to replace the digital logic controller used by Schafer and Young in earlier experiments. The change to a microprocessor was made to improve flexibility and expand the system's capabilities. This technique was capable of giving good results. In fact, a lawn mower is commercially available from a company in Alpharetta, Georgia that utilized the buried wire technique (Marley 1981). However, the use of this type of controller is limited to only those areas that have been fitted with the wire network. Schafer and Young (1978) state, "We believe that the development of any practical automatic guidance system must include a consideration of the elimination of the buried wire". The second system utilized a physical property of the field itself to provide guidance information. This type might use a furrow in the ground or the crop itself as the source of information. A furrow following system was built and tested by Kirk, et al., (1976). This system utilized both the on-off and the proportional type of steering control. The two systems provided adequate tracking, however the prOportional system had a slightly lower tracking error and was more stable at higher speeds. Kirk and Krause (1975) utilized the edge of the uncut crop to guide a swather. The developed unit worked under normal conditions, but it was subject to oscillations that caused it to miss crop afterrepeated passes. These oscillations were partially attributed to the 'play' in the swather steering mechanism. A combine was also fitted with sensors that allowed it to follow a corn row (Busse, et al., 1977). These sensors were such that if the corn row was too far towards one side, the corn would push against a mechanical arm, indicating the relative position of the corn row. The problems encountered with this system were as follows: (1) The responsiveness of the steering system, (2) the sensitivity of the controller to row skips, (3) the inability of the sensing system to be applied to grain crops and (4) the system would not permit easy backing up. Upchurch, et al., (1980) designed and built an automatic steering controller for an over the row apple harvester. This controller sensed the trees by means of mechanical arms contacting the trees. This controller utilized five different types of steering; automatic, front only, four way, crab, and rear only. An RCA 1802 microprocessor was capable of performing all five steering modes. Accuracy of the system was considered adequate. A commercial form of this type of controller, utilizing the furrow following technique, is available from a company in Modesto, California (Baxter 1981). It should be noted that all the systems so far described utilize only one input in determining the required response of the steering. Ambler, Harries and Cox (1980) utilized two different input forms. However, only one was utilized at any given instant in time. An optical furrow following system was used to guide the tractor across the field and an optical ranging method was used to turn corners. The-ranging sensor required that special reflective posts be placed in a line about 90 degrees to the direction of the furrow and about 15 meters apart. This system for turning resulted in 80 percent of the turns ending less than 30 centimeters from the desired point. The ranger used a microprocessor to evaluate the location of the tractor near the end of the field and throughout the turn. Kanetoh (1976) described a driverless combine that 10 had six automatic functions. This combine used a mechanical arm to sense the position of the grain edge, which controlled the direction of steering. Another mechanical arm sensed the presence of grain and started a turn routine when grain had been lost for a preset distance of travel. If no grain was found after the completion of a turn, the machine stopped forward travel. All six automatic functions operated in isolation from each other, except the turn and the stop controllers shared the input of the plant stalk sensor, and the automatic steering controller was disabled during a turn. This system worked on a rectangular field and used a pattern that took the machine around the ever decreasing rectangle. Turning was done by rotating about 45 degrees to the left, backing up and then turning another 45 degrees. Utilization of microprocessor-based systems for automatic steering controllers has resulted in more versatile controllers. Microprocessor-based systems can incorporate self-diagnostic features and can respond to a variety of inputs to determine the best type and amount of correction. Young, et al., (1980) reported the development of a steering algorithm to allow for the controller to adjust the system output to compensate for changes in ground speed. When the automatic steering controllers are provided with more relevant information, the quality of control is sure to improve. CHAPTER IV SYSTEM GENERAL DESCRIPTION The robotic lawn tractor was a General Electric lawn tractor fitted with a microprocessor-based control system. The control system utilized an RCA 1802 as the central processor unit. Sensors and conditioning circuits provided the microprocessor with digital inputs that represented the status of the two grass edge sensors, the position of the steering wheels and the completion of another unit of distance traveled. The microprocessor controlled the tractor by producing output voltage levels that initiated changes in the tractor's mechanical steering system and electrical power system. The Detroit Edison Company provided the General Electric lawn tractor and funded necessary repairs. The General Electric lawn tractor had a 36 volt battery system as the source of energy. A 36 volt direct current variable speed motor combined with a four speed mechanical trans- mission provided a range of tractor speeds. The front mounted mower had three blades, each powered with a separate 36 volt direct current motor. The mower had a maximum cut width of 1.07 meters. The ability of the tractor to turn sharply was 11 12 typical of this size of lawn tractor. The minimum radius was 1.5 meters. Control of the mechanical steering system was obtained by means of a linear actuator. When the tractor was moving on dry grass, one second was required to move the steering wheels from straight to a maximum turn. Based upon limitations of the tractor, a set of project objectives were developed. The restraints upon the lawn were not changed- They were that the rectangular lawn was uniform, free of obstacles and no larger than 38 meters on any one side. The restraints were placed upon the lawn to allow the effort to be directed toward the steering controller itself rather than the development of sensors to handle thin or eneven lawn, obstacles or other special problems. These problems must be investigated before a practical lawn tractor can be built. The location of the major controller components with respect to the tractor is shown in Figure 1. Three alternatives for the mowing pattern were considered. The first required the tractor to go around the rectangle using a 90 degree turn at the corners. The mounting position of the mower combined with the mobility of the tractor made the use of the 90 degree turn impractical. The second alternative required the tractor to start at one edge of the lawn and work across the lawn doing 180 degree turns on both ends. This pattern is referred to as a switchback pattern- The switchback pattern was not 13 ho¢0893 map cog: masocomaoo sopmzm home: we MGH=OHufimom w mmonm momzmm Homm mm moev 22 position (off), the linear actuator was held in its present condition. There was no allowance for the steering system to return to straight automatically. A double pole double throw switch selected either the automatic or manual steering modes. This was necessary to prevent the possiblilty of contradictory information from both the manual and the automatic controls at the same time. If the steering control system select switch were not present, a direct short from the 12 volt supply to ground could result. In the automatic mode, the switching of the linear actuator currents was accomplished by two 12 volt relays each rated at 25 amperes. Each relay was single pole double throw with the common connected to the motor lead. The normally open contact was connected to 12 volts, and the normally closed contact was connected to ground. Energizing one relay would create a complete circuit and caused the linear actuator motor to turn. Energizing the other relay would cause the motor to turn in the opposite direction. If both relays were to be erronously energized, a complete circuit would not be made and damage could not occur. Under such conditions, the motor would not turn. The schematic of the linear actuator control circuit is shown in Figure 4. 23 panopfio achusoo pogm3p0< macaw: w mmaon >Ne hopo: hopozpo< mmocfiq J . whom Av - 9:99.30 scam w\fl\o lo . . 9H. - comma . . >NP Io\_\h q Fl. s w 8m 1‘ mcwnooum pooaom o. Hosea: opz<\am::mz comzm > NP 24 Initial Control Box Once the linear actuator was installed and working, it was necessary to determine the accuracy and stability of the system. In order to do this, a control box was built that utilized three one shots to provide three different times for wheel movement. A one shot is an electronic device that when triggered goes to a differnet logic state for a.unit of time, dependent upon the value of programming components. The control box contained nine push buttons which were arranged in a row along the front of the box. The center button reset all one shots to the stable condition and thus stopped all wheel movement. Buttons to the left of center caused the wheels to turn towards the left, buttons to the right of center caused the wheels to turn towards the right. The buttons on either side of the center button caused the wheels to turn for the output period of the shortest one shot. The next outward pair of buttons caused.the wheels to turn for the output period of the medium one shot. Progressing outward, the longest one shot was next, followed by a pair of variable buttons. The variable push buttons were wired such that the wheels turned as long as the buttons were pushed. The short, medium and long one shots were set to about 0.3 seconds, 0.8 seconds and 1.5 second respectively. The unit was installed on the tractor and information as to the response of the tractor to various timed turns was 25 observed. The control box was then modified to accept infor- mation as to the position of the front wheels. Anytime the front wheels were not centered and no button was pushed, output voltages were produced which would cause the wheels to return to center. Thus the linear actuator could be activated for a unit of time, be held any desired length of time and then would automatically return the wheels to center. The position of the wheels was obtained by mounting a 50 kilo ohm potentiometer to the axle such that the case of the potentiometer was held still, while the wiper of the potentiometer was rotated by the turning wheels. The potentiometer position was sensed by connecting the wiper and one end of the potentiometer to ground, while the other end of the potentiometer was connected through a resistor to the five volt supply. As the wheels moved, the resistance of the lower arm of the voltage divider changed resulting in a voltage change between the potentiometer and the resistor. This voltage was compared with two preset values by two voltage comparators. If the voltage was greater than the upper reference voltage of the upper comparator, the comparator would have a high output that would cause the wheels to be turned left as soon as all one shot time periods were over and if no buttons were yet pushed. The voltage being less than the lower reference.voltage would cause 26 a right turn under the similar conditions. The two reference voltages were adjusted so that the wheels were straight and the dead band was as small as possible to provide stable operation. Satisfactory operation occurred when the dead band was about 0.2 volts wide and centered around 2.6 volts. The schematic of this initial controller is shown in Figure 5. Microprocessor Control Once the testing of the initial controller was finished, the next step was to put the tractor under microprocessor control. A COSMAC VIP CDP18S711 was selected. The COSMAC VIP is a single board video inter- face processor. The VIP utilizes an RCA 1802 central processing unit. The board contains two kilo bytes of RAM, 512 bytes of ROM, a keyboard, cassette tape and video terminal interfaces, and a buffered eight bit input and output port. A block diagram of the microprocessor is shown in Figure 6. The processor was to control the motion of the wheels by creating a control word- One bit of this control word being high would move the steering wheels to the right, another bit would move them to the left. By generating a series of control words, the processor could produce any required steering algorithm- The processor also sensed wheel position by'a method similar to that used in the initial controller. A schematic of the wheel position 27 owpaaogom xom Hospeoo HefipneH m mmaoHa moor I unopmfimon coxhwans HH< Foqqzm unhopwflmsmhp.woxwwszs HH< «oovze n madcap weakness HH< 28 RAM , ROM , RCA 2 KBTTE<<§§§§512 BTTE<:§§§I:: 1802 4 OF TMS CDP1832 CPU 2.01.5 Q... T” ‘ “3‘ Lg DATA BUS j U U U F__L OUTPUT INPUT VIDEO KEY TAPE LATCHED LATCHED INTER- BOARD INTER- AND FACE INTER- FACE BUFFERED FIGURE 6 RCA COSMAC VIP Simplified Block Diagram (RCA CDP18S711) 29 decoding circuit is shown in Figure 7. Data describing the wheel position was presented to the processor by means of the buffered input port. A specific bit being high indicated a wheel position left of center. Another bit indicated right of center. Both bits low indicated that the wheels were centered. A third bit went high whenever the wheels were turned to the extreme left or right. A program was written that caused the microprocessor to wait for a unit of time, produce the turn right signal, wait, stop the linear actuator, produce the left turn signal, wait until the wheels are centered, stop the linear actuator, and then repeat the same series.over again. All the time delays necessary for this program were generated by using counting loops. The count was stored in a 16 bit register inside the microprocessor. As the maximum count was dictated by the 16 bit register's capacity, a turn of about 30 degrees was all that could be obtained from this program. With this program in control of the-tractor, the tractor went in a large.multi-sided closed figure. The program was changed to one that performed the same type of control, but utilized nested delay loops to generate the delay sequences- A nested delay loop works by using two registers for counting. Each time the first loop was done, one of the registers was incremented. When this register reached the desired value, the second register was incremented and the first was reset to zero. 30 To Microprocessor panopfio mcflcoooa coapamom H0623 pconm a mmsoHa + pom cognac: on< acopm new mom 2mm on V so. so. go. com com om mam - >m >m >m 31 The first loop was then entered again. The nested loop was continued until the second register was to the desired value. This technique allowed delays of minutes or even hours to be created. The program was adjusted so that the tractor performed a 90 degree turn, went straight for about three meters and then did another 90 degree turn. This program caused the tractor to follow a pattern that was essentially a square with rounded corners. Distance Traveled Input Once direct microprocessor control of the steering function was demonstrated, the tractor was fitted with a system to inform the processor of the distance traveled by the tractor. This was accomplished by placing a reed switch on the tractor frame. As the drive wheel rotated, magnets moved past the reed switch causing it to open and close. In theory, the output wave form from the reed switch should consist of six pulses.per revolution. In reality only onermagnet caused only one reed switch cycle. The other five magnets caused two or three pulses. To overcome this problem, a one shot was used. The time between two adjacent distance pulses was about 1.8 seconds. The one shot was set to a period of 1.5 seconds. The first high to low transition of the reed switch wave form caused the one shot to start its timing cycle. It would not accept another trigger for 1.5 seconds. By that time, all of the spurious signals had occurred and been 32 ignored. The first pulse from the next magnet, however, was accepted. The output wave form from the one shot was applied to a D-type flip-flop at the clock input. The D input was tied high so the negative to positive transition of the clock set the Q output high. The Q output was used to inform the microprocessor of the fact that another distance pulse had occurred. The Q output was tied to one bit of the buffered input port. When the microprocessor sensed the presence of the distance signal, it incremented the distance value stored in memory. The processor also delivers a high to a specific output port that resets the flip-flop. The reset signal was then removed. The program that resulted in the tractor following a square pattern was modified so that rather than going straight for so much time, the tractor would go straight for so much distance. The changes resulted in the same pattern, however the length of.the straight portion of the square was less affected by small changes in ground speed. A schematic of the distance traveled circuitry is shown in Figure 8. Grass Edge Sensors Once it was proven that the tractor could be made to follow a desired path, the next step was to fine tune the path by providing information as to the location of the grass edge with respect to the tractor. A grass edge 33 pfizopfio ocao>wpe mocwpmfia m mmDon whom 9.35:0 scum VIII! shoe pzmcH OBATIIII mac Au sopwzm ease H mocmpmwm a. 34 sensor that attempted to use the presence of grass to capacitively couple a signal across the sensor proved unsatisfactory. The capacitive reactance of grass is quite high and dependent upon the moisture content of the grass. The two most promising alternatives left were mechanical or optical sensing of the grass. Optical sensing of the grass may prove to be.more practical for a later grass edge sensor, but the development of this sensor was not the primary goal of this research. A mechanical sensor was used that consisted of a microswitch that required only about .28 newtons of force to be activated. The selection of the microswitches as sensors simplified the design of the.grass edge sensor because the output of the switch was ground when the switch was closed or pulled up to five volts when the switch was open. The microswitches were mounted to the front of the mower unit. A gauge wheel that adjusts the cut height of the mower was moved inward to permit the microswitches to be mounted on the right front corner of the mower. The switch mountings were designed such that each switch could be moved up, down or across a mounting bracket. This allowed the locating of the switches with respect to one another. In addition, the entire mounting bracket could be moved up or down for vertical adjustment of the pair of switches. A distance between the two switches of about eight centimeters gave a good compromise between the amount 35 of error and the number of corrections. A smaller spacing between the sensors would result in more precise control; however more frequent corrections of a smaller amount per correction would be required for stable operation. The opposite effect occurred when the spacing was increased; larger, less frequent corrections would be required to obtain stable operation. Several types and mounting orientations of the surfaces used to activate the microswitches were tried. The range of sensing surfaces tried varied from a small 'L' shaped wire to a sled shaped surface of about 39 square centimeters designed to ride on top of the grass. All the sensor surfaces having in excess of six square centimeters were capable of providing necessary sensing surface. A sensor mounting position in the vertical plane was used in all subsequent tests. This sensor was seven centimeters long and two centimeters high. This configuration was chosen for its ease of mounting. The sensor surface was constructed from ten gauge aluminum. As it was not possible to weld the aluminum plate to the microswitch sense wire and because the plate was required to be removable from the switch, the aluminum plate was backed with paperboard and then mounted to the switches with tape. This method provided adequate reliability without permanently fixing the size of the sensor plates. The output of the two grass edge sensing microswitches 36 represented four logic states. The desired or normal state consisted of the inside switch sensing tall or uncut grass, the outside switch sensing short or cut grass. If the tractor was too far to the right, the width of grass being cut would be less than the desired value. This condition was indicated by both switches sensing low grass. In order to correct this error the microprocessor caused the tractor to turn left. If the tractor was too far to the left, the mower would start to miss grass. This condition was indicated by both switches sensing high grass. This error was corrected by the microprocessor having the tractor turn right. The final possible condition was for the inside switch to sense low grass while the outside switch sensed high grass. This condition could not occur under normal operation. If ideal conditions were used, the height of the grass as sensed by the microswitch would be the desired logic levels. The reality for any lawn was that the switches do provide erroneous information. Tall grass might have been knocked down or a low growing weed might have been present in the tall grass, that pushed the grass away resulting in tall grass being sensed as cut grass. Weeds that were not trimmed at the time the grass was out can cause the sensor to go momentarily high. In order for the system to be able to ignor the momentary erroneous information, the outputs of the switches were "averaged". ‘The averaging circuit 37 was required to (1) produce a digital logic level that represented "average", (2) respond faster to an error to normal change when compared with a normal to error change, and (3) be stable for small changes in the "average". To accomplish the required outputs, the circuit shown in Figure 9 was developed. Under normal conditions, the averaging capacitors are charged to the full five volt supply voltage. When an error condition was sensed, the microswitch caused the charge stored in the averaging capacitor to be removed thus lowering the voltage across the capacitor. This voltage level was applied to a Schmitt trigger through a buffer. When the voltage across the capacitor reached the lower trip level of the Schmitt trigger, the output became low allowing the 2N4401 pull up resistor to pull to a high logic level. One signal was inverted before going to the microprocessor's input port. The other signal went directly to the input port. The return to normal followed much the same path except the RC time constant was shorter because the parallel diode arrangement made the effective resistance for large differences less. As the charge on the capacitor approached five volts, the diode was no longer forward biased and the RC time constant was the same as discharge. In this instance, the logic level output changed when the voltage across the capacitor was at the Schmitt trigger's upper trip level. 38 pfizonfio mcfimmno>< omcm mmmuo b p mmm Aoe 0% a... Po vzm pa.m mus asdaH 09 D D > , xmw or 41" AE"! mo? Po ezm‘ x3 whom pzch 09 o mmDUHm oom >m MOP aoom >m MOP soaHSm some“: >m ocflmcH MOFF W nowwzmohowz :NN ocfimpso mom A sea . mm >m 39 The Schmitt trigger was set so that the lower trip point was at 1.02 volts. The upper trip point was set to 1.75 volts. The circuit that utilized the inside micro- switch and sent a signal to the microprocessor that represented a grass cut that was too small, required 2.0 seconds to go from a stable normal condition to the error state. The same circuit would go from the error state to the normal state in about 0.7 seconds. The other circuit utilized the outside microswitch and sent a too large signal. This circuit required about 0.7 seconds to go from normal to error and about 0.3 seconds to go from error to normal. The times selected were chosen to allow for correction to occur as soon as required while still responding as much as possible to an averaged input. The inside microswitch frequently encountered grass that was too sparse to continuously deflect the sensor plate. Common reasons for this type of error were the density of the grass becoming less or the grass having been knocked down. The times required for tractor response were made long so that the tractor would ignore, as much as possible, the erroneous inputs. A delay in responding to a true error condition resulted in the swath cut by the mower being less than the desired. For the inside microswitch, the averaging function took precedence over the response function. For the outside microswitch, the frequency of 40 erroneous inputs was much less than that of the inside switch. The outside microswitch was senSing where the grass had already been cut and was further assisted by the fact that the tires of the tractor flatten the cut grass. This resulted in a stable normal input and allowed errors to be detected more quickly. This was fortunate since the the result of failure to respond adequately to this type of error was uncut grass being missed. In both cases, the circuits responded more quickly to a return to normal than to a deviation from normal. In order for a system to be stable, the return from an error condition to normal had to be capable of being detected and correction stopped before the normal condition was lost. Failure to do this resulted in the system becoming oscillatory. The response time required for this system to be stable was observed to be about 0.8 seconds. The inside microswitch circuit would occasionally allow an over correction to occur due to its 0.7 second response time. Oscillation was stopped by the 0.3 second response time of the outside microswitch circuit. Drive Relay The final interface provided for the microprocessor to allow or prohibit travel by the tractor and mower operation. This was accomplished by placing a normally open relay in series with the existing safety interlock system of the tractor. The microprocessor completed the 41 safety interlock system by presenting a 1 to a specific bit of the output port. The presence of the 1 would cause the normally open relay to close. If all other interlocks were in the required state, the circuit was completed and power was supplied to the tractor system. The schematic of this circuit is shown in Figure 10. With the completion of the drive relay circuit, the microprocessor was connected with all the interface circuits required to control the tractor. In addition to the previously described inputs and outputs, several logic level signals were provided to the microprocessor to complete the interface with the outside world. One bit of the input word was allotted to a logic level input that represented future obstacle inputs. This bit was normally low. When it went high, all machine operation was halted under regular program control. A second input bit informed the microprocessor of the operator's desire to have the microprocessor "learn" the size of the lawn. In addition, one of the microprocessor's sense lines (EFA) was utilized to inform the microprocessor if the first or the second side was being learned. This same sense line was used to signal the microprocessor to return from a machine generated shutdown, thus allowing normal operation to resume. A final input to the microprocessor was via the interrupt line. When this line was pulled true, the microprocessor immediately jumped to the 42 Hfioo awamm nosom nopowpe oe e. >©m pnzocflo madam o. mmeoHe b. .D «I Fosezm .N\‘ so? w seams swam NP cough >NP o>Hnn voo zr voo.zP \ / whom unease scum ccpfizm auspom scum 43 shutdown routine regardless of normal program operation. Table 1 shows the bit assignments of the input port and Table 2 shows the bit assignments of the output port. Operator Controlled Inputs Six switches were used by the tractor operator to interface with the automatic steering system. The first switch was the main power on-off switch. This switch was turned on at the start of operation and remained on until operation was complete. The second operator used switch selected manual or microprocessor control of the linear actuator. This switch was mounted in the box that also contained the linear actuator drive relays. This switch was in the manual position whenever the operator desired direct control of the steering. In the auto position, the microprocessor had full control of the steering system. The switch had a center off position that disabled both manual and automatic steering. This switch was a double pole double throw toggle with three stable states. When the steering select switch was set to manual, the operator controlled the linear actuator by the use of a toggle switch mounted in the dash. Moving the toggle to the left would cause the tractor to turn the wheels towards the left. Similarily, moving the switch to the right caused motion of the wheels towards the right. In the center, the wheels were held in their current position. The switch was a double pole double throw toggle switch Bit Number 44 TABLE 1 INPUT PORT ASSIGNMENTS Low Logic Level No obstacle present Wheels not turned maximum Wheels not right of center Wheels not left of center No new distance pulse Learn mode Outside grass edge sensor normal Inside grass edge sensor normal High Logic Level Obstacle present Wheels turned maximum Wheels right of center Wheels left of center Distance pulse received Not learn mode Outside grass edge sensor abnormal Inside grass edge sensor abnormal Bit Number 45 TABLE 2 OUTPUT PORT ASSIGNMENTS Low Logic Level High Logic Level Open safety Complete safety interlock circuit interlock circuit No turning left Turning left No turning right Turning right Distance input normal Reset distance flip-flop Operation normal Shutdown exists Not used in present system Not used in present system Not used in present system 46 with one stable state and two momentary states. The fourth switch was a four pole six position rotary switch. This switch was used to inform the microprocessor of the start and end of sides to be learned and to initiate automatic operation. The connections to the rotary switch are shown in Figure 11. The operator drove the tractor to the lawn in position one. While still in position one, the operator cut the first two sides of the rectangle and positioned the tractor at the start of the third side. The microprocessor was then informed of the fact that it should "learn" the length of this side when the operator placed the rotary switch into position two. As the third side was being cut, the microprocessor learned the length of that side by counting distance pulses. Just before the end of the third side, the microprocessor was told of the completion of that side by moving the rotary switch to position three. The last side of the rectangle was "learned" by placing the rotary switch into position four at the start of the side and to position five at the completion of that side. After the tractor had been positioned back at the start of the first side, the steering selector switch was placed into the auto mode and the rotary switch was placed into position six. The tractor was now under microprocessor control. Upon completion of the lawn, the rotary switch was returned to position one and the steering select switch returned to 47 capmamnom nowfizm mumpom PF mmaon \ eel]. .39; E om. / o/ . om o—om Q0 on Achmoqv AM aw i atom .39: as [a olllL O— N 00 call peachflo mmamm.h, ow 03.5 3. / Lt/cmll on filllL E: molIIL nommooonQOAOHz \\ am on mo pomom\csm ca // AY/ll v 48 manual so that the tractor could be transported to storage or to another lawn. The final two switches available to the operator were both momentary push buttons. One was mounted atop the microprocessor box and caused an immediate machine shut- down. The second was mounted near the rotary switch and caused the microprocessor to leave shutdown and return to normal operation. CHAPTER VI SYSTEM DEVELOPMENT - SOFTWARE The concept in the development of the software was to keep sections of program independent. This was accomplished by making use of five registers as program counters for various blocks of program. The program moved from one block to another by changing the program counter to a different register. In the RCA 1802 microprocessor, a total of sixteen registers were available. The software utilized ten of the sixteen registers. The first five registers were program counters for the various blocks of program. Register two was called the X register and its function was to point to various locations in memory. An output function, for instance, sent the value of a memory location pointed to by the X register. Five other registers were used to store data and serve as a counter for delay loops. The register allocation is shown in Table 3. The VIP system used in this project stored the entire program in RAM. The system contained two kilo bytes of memory. When operation of the program began, the first location read was location 0000 (hex). For that reason, the first portion of the prOgram to be executed must start 49 R(0) R(1) R(2) R(3) RU.) R(5) R(6) R(7) R(8) R(9) R(A) R(B) R(C) R(D) R(E) R(F) 50 TABLE 3 REGISTER ALLOCATION Main and initial program counter Shutdown program counter X Register, pointer Steering function program counter Learn program counter Not used Not used Not used Not used Not used Not used Output word Distance 1 0:0 Distance 2 Q=1 Outer loop counter Inner loop counter 51 at 0000 (hex). The location of the remainder of the program inside the available memory was arbitrary. Hex locations 03F9, 03FA and 03FB contained a copy of the contents of three registers internal to the microprocessor. This was necessary because the internal register contents could not be displayed. In order to verify the contents of these registers, their contents had to be copied to RAM and then the contents of the RAM location displayed. These three locations served no purpose other than an aid in evaluating system operation. In all cases, the amount of memory space allocated to the program block was more than the amount that was actually used. The allocation of memory to various blocks of the program is shown in Table 4. This figure also contains the actual number of memory locations used by the program. Discussion of the software itself can be conducted in two ways. In one way, the actual mnemonics of the specific microprocessor can be referenced. This type of discussion tends to be very detail oriented and required a fairly good understanding of the microprocessor and its language. The other basic way to discuss does not utilize the mnemonics but instead uses a statement to represent the function of a small group of individual mnemonics. In most cases, the use of descriptive statements allows the logic and flow of the program to be more clearly presented. This discussion will not use mnemonics to describe the software. Location (Hex) 0000-003F 0040-00FF 0100-02FF 0300-0389 0390-O3BF 03C0-03EF 03F0-03F8 03F9 03FA 03FB 03FC 03FD 03FE 03FF 52 TABLE 4 MEMORY ALLOCATION Assignment Initialize program Main program loop Turn programs Open Learn Shutdown Data storage open Contents of B register Contents of O register Contents of D register Required distance side Required distance side Output word Input word Number of Locations Used 58 54 278 47 11 53 The program was divided into eight main blocks shown in Figure 12. The program started at memory location 0000 (hex) with the initialization program. This program performed the bookkeeping functions necessary to the proper operation of the remaining blocks of program. If the microprocessor sensed that bit 5 of the input word was low, the program counter was changed to register four. This caused the learn program to be executed. In the event that bit 5 was to go high after the learn program had been entered, the program branched to shutdown. In the event that the initialization program did find that bit 5 of the input word was high, the program executed next was the main loop program. This program read a data word from the input port and examined certain bits of the word. If bit 0 was high, the program branched to shutdown. If bits 6 or 7 were high, the program branched to the turn selection program. If bit 4 was high, the distance count was incremented by one and the acknowledge bit was made high for a short amount of time. If none of the bits mentioned were high, the program returned to get a new data word and the whole process started over again. The shutdown program was entered by changing the program counter to register one. The shutdown routine removed the output that kept the safety interlock system closed, thus stopping the tractor. The program then waited for the sense line EF4 to become true. When that happened, 54 C START D INITIALIZATION < PROGRAM LEARN 3’ PROGRAM .MAIN LOOP ‘ ' 9 PROGRAM ‘ 7E I SHUTDOWN ' - ' ' >1 PROGRAM AL TURN SELECTION PROGRAM CORRECTION RIGHT PROGRAM CORRECTION LEFT ‘5’ PROGRAM CORNER TURN IE’ PROGRAM FIGURE 12 System Floijhart 55 the program continued with the initialization routine. The turn selection routine was entered by changing the program counter to register three. The turn selection looked at the type of error that had been sensed by the grass edge sensor. It then selected one of three steering algorithms based upon the type of error and the distance remaining to be cut. The appropriate algorithm was executed and control returned to the main loop program. A more detailed flow chart of the initialization program is shown in Figure 13. When the central processing unit was first turned on, the contents of the various registers were unknown. In order to assure proper operation of the program, the registers must be loaded with the correct values. This was the bulk of the work of the initial- ization program. This program also put out the signal required to close the tractor's safety interlock system. Finally, the program branched to either the main loop program or the learn program, depending upon the condition of bit 5 of the input word. Figure 14 shows a more detailed flow chart of the main loop program. The program read a data word. If bit 0 was high, the program counter was changed to register one causing the shutdown program to be executed. If bit 6 or 7 was high, the grass edge sensors had detected an error. The main loop program responded by changing the program counter to register three where the error was evaluated and C START? I R3 = 0101 TURN PROGRAM R1 = 03DF SHUTDOWN PROGRAM J7 R2 = 03FC X REGISTER AL ZERO RC AND RD OUTPUT INITIAL WORD AND STORE L. I . ENTER FROM SHUTDOWN I R4 = 0399 LEARN PROGRAM IS BIT 5 HI-LEARN BRANCH TO LEARN PROGRAM BRANCH TO MAIN LOOP FIGURE 13 Initialization Flow Chart 57 C START) ‘ NV INPUT DATA WORD < TO 03FF IS BIT 0 H YES BRANCH TO SHUTDOWN SHUTDOWN PROGRAM NO YES BRANCH TO TURN SELECT PROGRAM IS BIT 4 HI YES INCREMENT DISTANCE SELECTED DISTANCE NO OUTPUT ACKNOWLEDGE / FIGURE-14 Main Loop Flow Chart 58 corrective steering functions executed. Bit 4 high indicated that another distance sensor had been closed, setting the distance flip-flop. The main loop responded to this occurrence by incrementing either register 0 or register D. Register 0 was incremented if the internal flip-flop of the processor was reset, otherwise register D was incremented. Following this, the microprocessor sent a high to bit 4 of the output port. This reset the distance flip-flop. Bit 4 was then returned to its normal low position. Failure to find any of the bits checked to be high, resulted in the main loop program returning to its start to read a new data word. A detailed flow chart of the turn selection routine is shown in Figure 15. This routine was entered whenever any error had been detected by the grass edge sensors. If bit 6 of the input was high, the error was that the mower was attempting to out too much grass. In response to this error, the correction right program was executed. If bit 6 was not high, the turn selection program compared the distance traveled on the current side to the length of that side. If the distance traveled was not greater than or equal to the length of the side, the turn selection program branched to the correction left program. If the tractor had traveled the length of the side, the edge was assumed to have been lost due to the tractor reaching the corner. The turn selection program responded by starting the corner 59 C START j BRANCH TO CORRECTION RIGHT BRANCH TO CORNER TURN IS SELECTED BRANCH TO CORRECTION LEFT FIGURE 15 Turn Selection Flow Chart 60 turn program. The program, as described, allowed the microprocessor to choose one of three different steering functions. Two were essentially mirror images of each other. They were the correction right and the correction left programs. The flow charts for both programs are shown in Figure 16. For both turns, the microprocessor produced a signal to start the wheels turning in the appropriate direction. The wheels were allowed to turn for an amount of time controlled by the program. The wheels were then held in that position for another microprocessor controlled period and finally the wheels were returned to straight forward. The periods actually used were about 0.5 seconds, 0.7 seconds and 0.5 seconds, respectively. The entire process must be completed before 1.8 seconds had elapsed. This was because at the given ground speed of the tractor, a distance pulse would occur every 1.8 seconds. If the turn sequence was allowed to take more than 1.8 seconds, the first distance pulse would set the distance flip-flop, the next distance pulse would have no effect upon the set flip- flop and thus be lost. A system that gave good control but failed due to this 1.8 second requirement, was one that turned the wheels for a unit of time and then left them there until the grass edge sensors reported normal conditions. Under ideal grass conditions, this type of control was acceptable. However, distance pulses were lost C START? \E OUTPUT RIGHT TURN FOR UNIT TIME LSTART ) OUTPUT LEFT TURN FOR UNIT TIME l Al/ DELAY FOR. UNIT TIME DELAY FOR UNIT TIME I OUTPUT LEFT TURN UNTIL.CENTER I OUTPUT RIGHT TURN UNTIL CENTER l BRANCH TO MAIN LOOP PROGRAM Correction Right Flow Chart BRANCH TO MAIN LOOP PROGRAM FIGURE 16 Correction Left Flow Chart 62 under more common grass conditions resulting in inaccurate distance traveled counts. The main problem with an inaccurate distance traveled count was that the corner of the uncut lawn was no longer where the microprocessor calculated that it should be. Each pass through the correction program resulted in a correction of about three centimeters. Errors that required more than that amount of correction resulted in the wheels appearing to turn out, stop, return to center and then immediately turn back out. In reality, the microprocessor had updated the distance input, read a new data word, checked all other input bits necessary and then the main loop program returned control to the correction program. The corner turn was one of the more critical portions of the software. The turning of the corner required about one minute. In order for the turn to be considered successful, the tractor had to be brought back to the uncut grass edge with enough accuracy to permit the grass cut edge to be located by the sensors within a reasonable amount of time. The flow chart of the program that gave acceptable results is shown in Figure 17. The program called for the tractor to travel with the wheels held in the straight position for a period of time controlled by the microprocessor. The tractor traveled about 2.1 meters in this time. The wheels were then turned for nearly a maximum right turn. The wheels were not turned full 63 C START j - I GO STRAIGHT FOR UNIT TIME AD OUTPUT RIGHT TURN UNTIL LIMIT \I/ TURN FOR UNIT DISTANCE T OUTPUT LEFT TURN UNTIL CENTER \l/ DECREASE VALUE OF SIDE BY 3 UNITS A POINT TO OTHER SIDE A RETURN TO MAIN LOOP FIGURE 17 Corner Turn Flow Chart 64 maximum for fear that a slight shift in the sensing system could result in full linear actuator force being applied to an immobile system. Damage to both the linear actuator and the steering system could result. Once the wheels were fully turned, the tractor followed the circular path for 24 distance pulses. Sensing the distance traveled pulses from the outside turning wheel gave the largest count possible. The measurement was initially attempted upon a time basis. The time-based method proved to be very sensitive to ground speed varia- tions caused by changes in battery voltage or differences in the force to move the lawn mower through varying lawn conditions. For instance, a turn going up a slight hill will be longer in time than one on level ground. Once the tractor had been repositioned near the corner of the uncut grass, the microprocessor performed operations that decreased the value of the side by three distance units and and changed the flip-flop internal to the microprocessor so that the other side length would be used next. Control then returned to the main loop program that caused the tractor to locate and follow the grass cut edge using the two correction programs. When the grass was wet, it was possible for the slip of the drive wheel to be such that substantial errors were created. At the same time, the steering wheels could not provide adequate traction to provide the desired amount of turn for each unit of travel. 65 The combined effects of the two errors resulted in an unacceptable turn on wet grass. The shutdown program flow chart is shown in Figure 18. This program was reached by changing the program counter to be register one. This could occur under program control or by application of an external interrupt signal. The first event that happened was the output signal that kept the safety interlock circuit closed was removed. This caused both tractor and mower operation to cease. The micro- processor then waited at one program location until a reset signal was applied to one of the sense lines called EF4. Upon receipt of this signal, the program control was transferred to the initialization program that put out a new control word to allow machine operation, checked for learn mode, and if learn mode was not required, transferred control to the main loop program. The final block was the program that learned the size of the lawn. This program was entered by changing the program counter to register four. The flow chart of the program is shown in Figure 19. This program started by reading a new data word and checking to see if a distance pulse had occurred. If no data pulse was present, the program read a new data word. When a pulse was present, the microprocessor incremented the appropriate count. The microprocessor selected the count to increment based upon the status of the EF4 line. When EF4 was high, side one 66 C STARTQ \l/ 'OUTPUT SHUTDOWN WORD IS EF4 NO TRUE YES BRANCH TO INITIALIZATION FIGURE 18 Shutdown Flow Chart 67 C START ) IS BIT 4 HI DISTANCE INCREMENT SIDE INCREMENT SIDE ONE COUNT ‘5’ TWO COUNT lJ OUTPUT ACKNOWLEDGE IS BIT 5 H BRANCH TO LEARN SHUTDOWN PROGRAM FIGURE 19 Learn Fl ow Chart 68 was used. Grounding EF4 would cause side two to be used. The distance flip-flop was then reset by the acknowledge signal; the microprocessor then verified that the learn mode was still selected. In order to prevent learn mode problems from going unnoticed, the program caused the shutdown routine to occur whenever the learn mode signal was removed. The normal operation of this program was halted by moving the rotary switch. This halted all microprocessor activity and returned full manual control. The microprocessor considered the most recently updated value to be the length. When the microprocessor activity was halted, the most recent value was the one retained. The retained value was used to determine the location of the corner in automatic mowing. Because the tractor was driven farther on the programming cut than was the actual length of the side that was to be cut, the value stored must be adjusted. The method selected to do the adjust- ment was to start the count as a value of negative six. The figure of negative six was selected by combining the possible errors. An error of three resulted from the side being shortened by one swath width. As the distance flip- flop was set due to the tractor travel during the turn, one distance unit was removed to compensate for this initial error. Finally, both the initial learn cut and the actual automatic cut would not usually be even distance increments 69 which resulted in an error. For instance, if the actual length of the side was 10.4 units, the tractor could measure this side to be either 10 or 11 units, depending upon where the first distance pulse occurred in relation to the start of the edge. If the distance pulse occurred after 0.1 units of travel, a length of 10.4 units would involve 11 pulses. They would occur at 0.1, 1.1, 2.1, .... 9.1 and 10.1. If on the other hand, the first distance pulse did not occur until after 0.8 units of travel, a total of 10 pulses would occur at 0.8, 1.8, 2.8, .... 8.8 and 9.8. The eleventh distance pulse at 10.8 was never reached. In order to insure that the measured length was not greater that the actual length, one was deducted from the count. This type of error resulted in the tractor possibly entering the turn too soon. In reality, the problem was not as severe as might be expected because the actual turn program did not start until both the distance had been traveled and the grass edge sensors both sensed low grass. In the event that the grass edge sensors determined what was actually an error in following the grass edge after the distance had been traveled but before the actual corner had arrived, the tractor would enter the corner turn program too soon. In most cases a triangular shaped piece of lawn was missed. If the 270 degree turn was started 0.3 meters too soon, an area of grass would be left uncut that would total about 0.3 square meters. A 7O substantial portion of the grass missed in the previous turn was cut during the next 270 degree turn. The entire software package was composed of various blocks of code that were treated by the main loop program as subroutines. This enabled the development of software that was easily understood, but that tended to have lesser microprocessor efficiency and control system efficiency. The software as described was capable of controlling the tractor to the desired specifications. CHAPTER VIII RESULTS AND DISCUSSION The goal of this project was to produce a lawn tractor that was capable of (1) learning the size of the lawn, (2) cutting the lawn, (3) shutting itself off, and (4) of operation in other than the automatic mode. The tractor as described was able to meet the goal. There is much room though, for improvement. The tractor was not tested on nearly as many rectangular lawns as would have been preferred. The main reason for the lack of testing was cold wet weather that inhibited the growth of grass. The tractor has been operated enough to allow conclusions as to the ability of the system to mow an idealized rectangular lawn. In total, twenty rectangles of lawn were mowed. Few of the tests were performed to evaluate the total perfor- mance, most of the tests were conducted to evaluate specific portions of the tractor's operation. For instance, some test areas were only three swath widths wide and were used to observe the shutdown function. The ability of the tractor to do some specific task was tested by situations other than normal operation. Two tests were run to evaluate the ability of the tractor to follow the grass cut edge. In one test, a grass edge of about 30 71 72 meters was established. The tractor was positioned on the edge and allowed to follow for the total length. The tractor was then manually returned to the original end and allowed to follow the newly created edge. In the first series of runs, the tractor followed a straight path. After five passes, the edge was no longer exactly straight. However, the actual path was never more than 30 centimeters from the ideal path. The edge contained two major varia- tions from the desired straight line. In both cases these errors resulted from a correction to the left that was the result of errors by the grass edge sensors to correctly determine the location of the grass cut edge. One error was caused by a bare spot, the other by an initial paper sensing plate failure. When these two problems were removed, the final cut edge varied no more than ten centi- meters from the ideal. 0f the attempted grass area, 100 percent was out. A second edge was created that included a jog to the right of about 30 centimeters. This jog occurred in about two meters of travel. After eight passes, the jog was still present, but had "moved" in the direction of tractor travel. During this test, the lawn tractor cut in excess of 99 percent of the attempted lawn. One narrow sliver of lawn was left uncut when a bare spot caused the tractor to correct left twice. In reality, no correction should have occurred. The tractor was unable to return to the correct 73 grass cut edge in time to avoid missing grass. The missed spot was about 250 square centimeters. A second test was performed using a similar method except that this time the total length of cut was about 15 meters. For this test, the deviation from the desired path was measured at 61 centimeter intervals. The initial cut edge varied no more than three centimeters from straight. The total of individual errors divided by the number of measurements gave an average error of less than two centi- meters for the first automatic cut. The maximum deviation was eight centimeters. The second pass had an average error of two centimeters and a maximum deviation of ten centimeters. The third through seventh passes had average errors of 0.3, -0.3, 2.0, -0.4 and 2.0 centimeters respec- tively. The maximum deviation was 10, 13, 13, 15 and 18 centimeters respectively. The maximum deviation that resulted tended to occur in about the same point in the distance from the origin. For instance, the maximum negative deviation occurred at both 7.9 and 8.5 meters from the origin for the first pass. The maximum negative deviation for the seventh pass occurred at 9.7 and 10.3 meters from the origin. In general, the edge shape tended to "move" along the direction of travel. The mower cut 99.95 percent of the total grass attempted. When the mower missed grass, it was due to a response to invalid grass edge error signals. A grass edge sensor that would 74 differentiate between cut grass and no grass would provide a means to greatly reduce this type of error. Other tests performed on only parts of the system included Operating the tractor over a fixed course while in the learn mode. As the dimensions of the course were known, the count that should be stored in the two length registers could be predicted upon completion of the course. The actual value held in memory was compared with the predicted value. The actual value was equal to, or one less than the predicted value in all but one case. In that one case, the actual value was one greater than the predicted value. The plus or minus one error is a result of the method used to measure distance traveled. A distance pulse was generated by the circuitry for each unit of travel. The unit of measure for the tractor was very close to 0.3 meters. The distance pulse could occur at any time during the first unit of travel, and was dependent upon the location of the magnet with respect to the reed switch at the start. If the magnet was close to the reed switch, the distance pulse would come at the beginning of the unit of travel. Thus, for each full unit of travel, one distance pulse would occur. For a partial unit of travel, one distance pulse may or may not occur depending upon the positioning of the pulse within the travel time. Frequently, the distance measured count was one less than expected due to the timing errors just described. The one 75 measurement that was too large was attributed to the tractor being driven just slightly longer than the desired length. The distance pulse must have occurred very soon after the start of travel, allowing the final distance pulse to occur in the slight overshoot. Another way in which the tractor was operated without actually being in full automatic control was to manually control the grass edge sensors such that an idealized grass edge was simulated. This method was used to test the ability of the system to start and execute the 270 degree turn. With the portion of the program that caused the side length to be decremented three times disabled, the tractor would follow a fixed rectangular pattern. With the program modified, the ability of the tractor to do multiple accurate 270 degree turns was evaluated. A square of about three meters on each side was outlined on a lawn with string. The grass edge sensors were manually operated to provide the signals that would have occurred if an ideal grass edge was on the string. The size of the square was selected to represent conditions that would occur when the lawn was approaching completion of mowing. After one complete revolution only about 1.5 square meters remained. As the length of the lawn became smaller, the error created by the 270 degree turn not being exact.became more apparent. This was because less time was available to allow the tractor to orient itself correctly upon the grass 76 cut edge. If the tractor had not fully corrected the error resulting from one turn when another turn begins, the second turn would have the sum of the initial error and the turn error. The amount of distance traveled to overcome a turn error was directly related to the magnitude of the error. A turn that resulted in 15 centimeters of offset and a few degrees of misalignment would usually be corrected in about two meters of travel. The three meter square was thus a severe, but not the worse possible test of the 270 degree turn. With the grass edge signals being controlled, the tractor went three times around the square for a total of twelve turns. After the twelve turns, the tractor was still on course and capable of continued travel. The test was stopped because only six turns would be required to finish this size lawn. At the time of this test, the 270 degree turn program was conducted entirely on a timed basis. As shown, this worked well under some conditions. However, the quality of the turn was very dependent upon the speed stability of the tractor. Accuracy similar to that just described was not consistantly possible. For that reason, the turn program was changed to where the turn was executed using a fixed number of distance units. This change resulted in more consistant but less accurate turns. This was a result of the distance measuring problems that were previously described. The turn ended when the final distance pulse 77 occurred. As the distance pulse occurred anywhere during the unit of travel, the turn could be finished at any point. The total number of distance pulses required for the turn was 25. The turn could thus end anywhere between 24 and 25 actual units traveled. This error appeared acceptable when viewed in the total accuracy of the system. The test just described was not repeated for the revised 270 degree turn. Only six rectangular lawns were attempted under full operating conditions. 0f the six, only one was fully out without a substantial error occurring. In one case, the outside grass edge sensor plate shifted and would not allow the microswitch to return to the normal condition. Another attempt was hampered by the misadjustment of the grass edge microswitches with respect to the cut height. The sensors were set low enough that cut grass was deter- mined to be uncut grass when the tractor went through a slight dip. This error resulted in three undesired right corrections occurring. In both cases just described the tractor was stopped, corrections made and the tractor restarted from the same point. In one attempt, the size of the lawn was such that the third turn took the tractor in such a way that the front left hand corner struck a sign post located near the test sight. The tractor was stopped in such a way that the tractor could not simply be freed and returned to automatic operation. The size of the lawn 78 had to be relearned before the return to automatic could occur. The tractor finished the lawn. Another attempt was marred when a piece of cut grass landed and remained across the potentiometer leads. This resulted in the wheels not being straight when indicated by the potentiometer and the 270 degree turn not being as sharp as desired. The tractor returned to normal operation when the grass was removed. Prior to the location of the problem, three 270 degree turns were executed. As the distance between the second and third turn was not long enough to allow the effects of the second turn error to be eliminated before the third turn began, the third turn resulted in a large positioning error. The tractor was stopped, and repositioned manually, as well as the problem located and corrected before automatic operation resumed. The tractor finished the lawn. In the final attempt, the problem resulted from two 270 degree turns separated by about two meters both starting the turn too soon. This occurred when the tractor was not stabilized upon the grass edge. The turn began when the tractor had traveled the required distance and the grass edge sensors both sensed cut grass. Due to the distance measurement problem previously discussed, in order to insure that the distance held in memory would be reached before the actual corner was reached, the memory distance was less than the actual distance. Under certain 79 conditions, the memory distance could be reached almost 61 centimeters before the corner. When the tractor was not on the grass edge, the turn could start almost 61 centimeters early. Two of these errors in rapid succession created the problem. The tractor was stopped, manually positioned on the grass edge and automatic Operation resumed. The tractor finished the lawn. For all the six cases, the goal of actually mowing in excess of 95 percent of the attempted amount was obtained. In spite of the problems just described, the tractor was able to prove that the concept used in the development of this tractor was valid. From the beginning, it was felt that the microswitch grass edge sensors were not the best choice. They were, however, the simplest choice. If the problems to which the microswitch grass edge sensors contributed were eliminated, two more complete lawns would have resulted. Physical problems unrelated to the concept of the controller caused two problems. Neither problem should occur again. The final problem, while not caused directly by the grass edge sensors, would be avoided by a grass edge sensor design that looked over a broader area for the grass edge and directed the controller to perform one of several correction algorithms that would eliminate the error based upon its size. With an improved grass edge sensor and the knowledge gained from the first six tests, at least five and probably all six rectangles could have 80 been mowed without any more than the minimum required assistance from the operator. Grass Edge_Sensor The grass edge sensors as described and utilized would never be suitable for any more than the demonstration of the Concept. What the microswitches actually responded to was the ability of the grass to push the sensor plates back. The correlation between the ability to push the sensor plate back and the height of the grass was not all that good. Uncut grass that had a low number of blades per unit area might not have the strength required to overcome the resistance of the microswitch. Clover or other plants growing in the lawn could force the grass out while not themselves growing tall enough to operate the microswitch. The microprocessor did not need to know if the grass can push back, it needed to know if the location was cut or uncut. A non-contact form of sensor would best achieve this requirement. Systems that have been discussed as possible solutions to this problem included several optical systems and an ultrasonic system. The optical systems ranged from a simple light beam sensor where the grass breaks the beam to a digital camera whose output is inter- rupted by the microprocessor. An advantage of optical systems over the microswitch was that there were no moving parts. The ability of the microswitch to withstand 'years of use was questionable. 81 Another problem with the grass edge sensors as described was the ability to provide useful information. The microswitches could only provide information as to the direction of the error. With only this information avail- able, just one COrrection in each direction could be utilized. The correction had to be small enough to provide stable operation when the error was the smallest detectable error. Thus when the tractor was faced with a step change of fairly large proportions, the tractor responded with multiple small corrections. The addition of just two more sensors would allow the microprocessor to determine if the error was large or small. The microprocessor could respond to a large error with a much larger relatively crude correction. This could be followed if necessary with a small correction to fine turn the following of the grass edge. Once the grass edge was located and the tractor on course, only the small corrections would be required to follow the edge. The tractor would be able to respond quicker to a large error of the type that might occur when a 270 degree turn was executed, for example. Another problem with the grass edge sensors as utilized in this development was that no information as to heading errors was available. A different correction was required to correct an error that had the tractor going parallel to the desired path when compared to an askew heading. A heading correction required only that a turn in 82 one direction be executed and then the wheels returned to straight. The offset error required that the heading of the tractor be changed twice. The first eliminated the offset, then the second restored the tractor to its original heading. Information as to heading errors could be obtained by having two pairs of sensors located such that the first pair was in front of the second pair. Offset errors would be indicated by both pairs of sensors showing the same error condition. If only one of the two pairs showed an error, the error would be a heading error. Both types of errors could be corrected by heading correc- tions. However, a correction designed for offset errors could correct the problem with one correction, whereas at least two heading error corrections were required. A logical way to determine offset and heading errors would be to utilize a four by two matrix of sensing devices. The final problem with the grass edge sensors was that the sensors could not differentiate between cut grass and bare spots. If a bare spot was encountered in the lawn, the tractor should ignore the normal tendency to do a correction. The tractor should continue straight if it was on the grass cut edge when all grass was lost. The tractor should stop if no grass is found after some fixed amount of travel had occurred. This information could be gained by placing an optical sensor below the normal cut height of the lawn mower. This sensor would normally be 83 blocked by the grass, however the beam would be completed when a bare spot was present. Another possible approach would be to use a special digital camera to look for the grass edge. This technique appears promising, but will require considerable work to deveIOp. The use of an ultrasonic sensor does not appear to be very promising at this time. Distance Traveled Circuitry Magnets and a reed switch of the type used in a home burglar alarm were used to provide the pulse train that indicated travel. This arrangement resulted in one pulse for every 0.3 meters of travel. The problem with this arrangement was that the best accuracy that could be obtained was plus or minus one distance unit. As this error occurred in both the learn measurement and the length of travel measurement, the total error could be as much as two distance pulses (about 0.6 meters). To compensate for this problem, the distance at which the tractor could start its turn could be as much as 0.6 meters from the corner. One way to limit the effect of this problem would have been to increase the number of pulses that occurred for a unit of travel. If the number of distance pulses were increased by a factor of ten, the maximum error would be reduced to six centimeters. This was not possible with the current concept for two reasons. First, it was not possible to place nine magnets between the existing ones and have them 84 all work the same reed switch. Secondly, the micro- processor was required to respond to each distance pulse which would now occur every 0.18 seconds. This, in itself, was no problem but making all other routines less than 0.18 seconds would be a nearly impossible task. No worthwhile correction of a steering error could be accomplished in 0.18 seconds. The first problem can be solved by doing the sensing of distance before the transmission. The input signal would thus be multiplied by the reduction of the transmission. A different type of sensor may be required -to work at the new speeds. The second problem required a change in concept to solve. As the number of pulses was increased to improve accuracy, the use of a system to divide the number of pulses down was unproductive. The only logical way was to allow an external circuit to keep track of the number of pulses and report that number to the microprocessor upon command. This arrangement would allow the accuracy of the higher number of pulses while not using any more microprocessor time than was required by the old system. Wheel Position Sensor This system worked and provided the required amount of accuracy. A two wire shielded cable was utilized in this situation. A better alternative might have been to use a three wire cable. This would allow a separate wire to be 85 used to return the wiper voltage to the control unit. This change would have a couple of advantages. The system as previously described was not a linear system. The two extreme conditions produced output voltages of 0.2 and 3.2 volts. The straight forward position produced 2.6 volts. The amount of wheel rotation required to change the output voltage a fixed amount was dependent upon starting wheel position. With the three wire system, the voltage change per unit of rotation would be constant. The linear voltage that represented wheel position could be analyzed by comparators as is now being done, or could be converted to a digital number that represented wheel position by an analog to digital converter. Once the digital number was obtained, the microprocessor could perform an analysis of the recent corrections and alter the number that it considered center to insure straight forward travel. Microprocessor If the aforementioned changes in the system sensors were made, the VIP single board system would have to be modified. The VIP has one eight bit input port and one eight bit output port. This was adequate for the original system but was not enough for the improved system. Only one output port would be required, but at least four input ports would be required. Two would supply the distance count, one for the upper eight bits and the other for the lower eight bits. A third input would be required to 86 supply the wheel position number. The last would supply the remaining data such as learn mode select. The VIP stored the total program in RAM. A practical system would store the actual program in some form of ROM, most likely EPROM. For these reasons, the next generation of the auto— matic steering controller will need a different system. The RCA 1802 has functioned well as a central processor unit. Because it is a full CMOS microprocessor, it is well adapted to the noisy tractor environment. In the development process, several problems including memory being changed were blamed on noise. In an attempt to stop the supposed noise problem; a separate 12 volt supply was used for the electronics. While this did lower the noise content of the supply, this step might mot have been necessary. The real problem was found to be that when a switch mounted on the VIP board was moved, the board would flex, shorting the five volt supply to the metal enclosure. The regulator would go into its over current protection state and return to normal when the short was removed. In the meantime, some of the memory locations had been changed. This problem was overcome by moving the switch to the enclosure and by insulating underneath the VIP board. The improvements that were just listed will result in more accurate and dependable control of the steering function. Suggestions have been made for most of the major 87 system components. These suggestions, however, should not detract from the fact that the system as described was capable of mowing a lawn without an operator in direct control. The microprocessor was capable of determining its location on the grass cut edge and performing steering corrections based upon that position. Ten specific requirements of the system were stated in the system general description. All ten of the requirements were met by the original syStem. The concept used in the develop- ment of the tractor was capable of automatic control of the steering of a lawn tractor. Future work utilizing the knowledge gained from this development, should result in the development of a practical robotic tractor. CHAPTER VIII CONCLUSION The robotic lawn tractor as described was capable of mowing a rectangular lawn without operator assistance once the programming out had been completed. The controller performed all necessary functions to guide the tractor along the desired pattern and was capable of halting tractor and mower operations. Specific conclusions drawn from the testing of the described controller are: 1)’ 2) 3) 4) 5) 6) The controller was able to maintain a minimum of 85 percent of the maximum mower cut width with a lawn of uniform height and density; In all testing of the ability of the controller to guide the tractor along the grass cut edge, a minimum of 99 percent of the grass was out under automatic operation: On dry grass, the controller could execute a 270 degree turn and reacquire the adjacent grass cut edge in less than one meter of travel providing the turn was started within 0.1 meters of the corner; The microprocesser was able to learn the dimensions of the initial lawn with a maximum error of 0.3 meters; The microprocessor reduced the length of the side of the rectangular lawn by one meter after mowing the side. The microprocessor was capable of continued operation as the lawn plot was reduced in size; The microprocessor was capable of halting forward travel of the tractor and lawn mower operation: 88 89 7) A person unfamiliar with the machine would be capable of operation with no more than five minutes of instructions: ' 8) The machine was capable of complete manual operation. LIST OF REFERENCES LIST OF REFERENCES Ambler, Harries, and Cox, Optical Ranging for Tractor Guidance. 1980. ASAE Paper No. 80-1558. Baxter, J., ed. Agricultural Engineer's Yearbook. 1981. pp. 21 and 73. Busse, W., Coenenberg, H., Feldman, F. and Crusinberry, T. F., The First Serial Produced Automatic Steering System for Corn Combines and Forage Harvesters. 1977. Grain and Forage Harvesting Conference Procedings ASAE. Gilmour, W. D., An Automatic Control System for Farm Tractors. 1960. Journal of Agricultural Engineering Research. 5:(4). pp. 418-432. Grovum, M. A. and Zoerb, G. C., An Automatic Guidance System for Farm Tractors. 1969. ASAE Paper No. 69-1170 Kanetoh, Yuuji, Driverless Combine Harvester. 1976. Grain and Forage Harvesting Conference Proceedings ASAE. Kirk, T. G. and Krause, A. E., Swather Edge Guide Steering Control System. 1975. ASAE Paper No. 75-1029. Kirk, T. G., Zoerb, G. C. and Wilson, J. N., A Furrow- Following Tractor Guidance System. 1976. ASAE Paper No. 76-001. Marley, C. F., Driverless Mower 'Sniffs' Underground Guide Wire. Farm Show Magazine. 5-22-81. Rushing, Karl, Developing the Driverless Tractor. 1971. Agricultural Engineering. 52:260-262. Schafer, R. L. and Young, R. E., An Automatic Guidance SySEem for Tractors. 1978. ASAE Paper No. 76‘10680 Upchurch, B. L., Tennes, B. R. and Surbrook, T. G., Development of a Microprocessor Based Steering Controller for an Over-the-row Apple Harvester. 90 91 1980. ASAE Paper No. 80-1556. Young, R. E. and Schafer, R. L., Direct Digital Control Young, for Automatic Steering of Agricultural Tractors. 1974. IFAC Symposium on Automatic Control for Agriculture, Saskatoon, Saskatchewan, Canada. S. 0., Schafer, R. L. and Johnson, C. E., A Microcomputer-Based Vehicle Guidance Controller. 1980. ASAE Paper No. 80-1557. "IllTAIWANWT