+ All Categories
Home > Documents > Autonomous Guided Intelligent Lawn-mowing Equipment Senior...

Autonomous Guided Intelligent Lawn-mowing Equipment Senior...

Date post: 22-Aug-2020
Category:
Upload: others
View: 6 times
Download: 0 times
Share this document with a friend
31
Autonomous Guided Intelligent Lawn-mowing Equipment Senior Project Report Brad Ramsey Derek Rodriguez Dane Wielgopolan Advised By Dr. Joel Schipper Dr. James Irwin May 10, 2009 Bradley University Electrical and Computer Engineering
Transcript
Page 1: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Autonomous Guided Intelligent Lawn-mowing Equipment

Senior Project Report

Brad Ramsey Derek Rodriguez Dane Wielgopolan

Advised By Dr. Joel Schipper Dr. James Irwin

May 10, 2009

Bradley University Electrical and Computer Engineering

Page 2: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

TABLE OF CONTENTS: Project Summary .................................................................................................. 4 Previous Literature Work ................................................................................... 4

Detailed Description ............................................................................................. 5 Project Objectives ............................................................................................. 5 Functional Requirements & Performance Specifications................................... 5 Block Diagram ................................................................................................... 6 Key Components ............................................................................................... 7

Platform ................................................................................................................ 8 Chassis & Power Supply ................................................................................... 8 Motors ............................................................................................................... 9 Microcontroller ................................................................................................. 13

Perception .......................................................................................................... 14 Ultrasonic Sensors .......................................................................................... 14 Dog Fence Detectors ...................................................................................... 17 Radio Frequency System ................................................................................ 17 Radio Frequency Circuit .................................................................................. 18 Navigation ....................................................................................................... 20 Digital Compass .............................................................................................. 20 Compass Tracking Control System ................................................................. 21 INTELLIGENCE .............................................................................................. 23 Object Avoidance ............................................................................................ 23 Algorithm ......................................................................................................... 24 Wall Following ................................................................................................. 24 Double Cut ...................................................................................................... 27 Software .......................................................................................................... 28

Safety ................................................................................................................. 29 Bump Switches ............................................................................................... 29 Time Tables .................................................................................................... 30

Works Cited ........................................................................................................ 31

Page 3: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

TABLE OF FIGURES: Figure 1 - System Block Diagram ......................................................................... 6

Figure 2 – Key Components................................................................................. 7

Figure 3 - Chassis Front View .............................................................................. 8

Figure 4 - Chassis Top View ................................................................................ 8

Figure 5 – Power Supply ...................................................................................... 9

Figure 6 – Motor Model ........................................................................................ 9

Figure 7 – Output Diagram ................................................................................ 10

Figure 8 – PWM Flowchart ................................................................................. 11

Figure 9 – PWM Circuit ...................................................................................... 12

Figure 10 - Peripheral I/O ................................................................................... 13

Figure 11 - MicroPAC 535 I/O ............................................................................ 13

Figure 12 – Microcontroller Connections ............................................................ 13

Figure 13 - Ultrasonic Sensor Coverage ............................................................ 14

Figure 14 – Sensor Wiring.................................................................................. 15

Figure 15 – Ultrasonic Sensor ............................................................................ 15

Figure 16 – Sensor range................................................................................... 15

Figure 17 – Sensor Signals ................................................................................ 15

Figure 18 – Ultrasonic Sensor Read Flowchart .................................................. 16

Figure 19 – Ultrasonic Sensor Error Correction Flowchart ................................. 16

Figure 20 – RF Detector Mounts ........................................................................ 17

Figure 21 – Dog Fence System .......................................................................... 18

Figure 22 - Complete Circuit .............................................................................. 18

Figure 23 – Band-pass Simulation ..................................................................... 19

Figure 24 - Stage One ........................................................................................ 19

Figure 25 – Stage 2 and 3 .................................................................................. 20

Figure 26 - Compass Accuracy Effects over Distance ....................................... 20

Figure 27 – Turning Error Diagram .................................................................... 21

Figure 28 – Control System Block Diagram ....................................................... 21

Figure 29 – Control System Flowchart ............................................................... 22

Figure 30 – Obstacle Avoidance ........................................................................ 23

Figure 31 – Ultrasonic Sensor Locations ........................................................... 23

Figure 32 – Intelligence Truth Table ................................................................... 23

Figure 33 – Mowing Algorithm ............................................................................ 24

Figure 34 - High Level Wall Following ................................................................ 25

Figure 35 – Detailed Wall Follow Flowchart ....................................................... 26

Figure 36 - Double Cut ....................................................................................... 27

Figure 37 - Algorithm High Level ........................................................................ 28

Figure 38 - Bump Switch Layout ........................................................................ 29

Figure 39 - Parts List ............................................. Error! Bookmark not defined. Figure 40 – First Semester Schedule ................................................................. 30

Figure 41 – Second Semester Schedule ............................................................ 30

Page 4: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Project Summary AGILE aims to create a proof of concept autonomous lawnmower. The mowing algorithm is designed to mow the lawn as efficiently as possible without missing any parts of the lawn. The lawnmower stays within a boundary and certain orientation. The boundary of the yard is defined by an RF emitting wire, similar to an invisible pet fence. The mower’s navigation system uses a compass for orientation. The sensors on the platform detect and avoid objects by using of an array of ultrasonic sensors. Machine intelligence is needed which consists of an onboard microcontroller for processing the drive system and the sensor data.

Previous Literature Work After researching other autonomous lawnmowers, a series of three projects were selected that most resemble project goals. The three projects were completed at the University of Florida and together culminate into what we are planning to do for our project. The first project, completed in 1996, was called the LawnNibbler. This project consisted of a weed trimming platform that used an RF boundary wire for containment. The project also demonstrated a proof of concept gPS (ground positioning system) (Autonomous Lawn Care Applications 2006). The next project in the series was the LawnShark. This project was based on an electric mowing platform that fully integrated gPS into the system. Ultrasonic sensors were also used on this project for object detection (LawnShark: A New Platform for Autonomous Mowing and Navigation). The third project in the series is the most similar to the AGILE project goals. The student Michael Gregg created a lawn mower called the LawnGator. The lawn mower was contained in a field using an RF containment wire. It was capable of object detection using ultrasonic sensors and collision detection. When an object is presented, the mower will turn randomly between 90 and 270 degrees. (Autonomous Lawn Care Applications 2006) The project consists of the following specifications for the LawnGator with some added functionality. We will add wall following both physically and along the RF containment wire. This will be necessary for our added functionality of a sequential mowing pattern. The lawn mower will not turn a random direction when confronted with an obstacle; rather, it goes around the obstacle and proceeds along its path as necessary. This is demonstrated in Figure 30.

Page 5: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Detailed Description

Project Objectives The objective of this project is to create an autonomous lawnmower that can mow an area inside of an electric dog fence efficiently while mowing around objects that may be in the yard. The following goals must be met to achieve this objective: 1) Obtain a chassis to provide accurate maneuverability 2) Design a drive control system to propel the mower around its environment 3) Build sensors to locate and determine relative distance from the dog-fence 4) Build sensors to detect and avoid objects in the path of the mower 5) Implement an algorithm to efficiently and effectively mow the yard

Functional Requirements & Performance Specifications

Speed and Performance • Maximum speed of 2 ft/s • Mowing coverage of 120 ft²/min @ 2 ft/s • 0 turning radius

Safety Specifications Reaction time faster than a human at less than 215ms* At maximum speed, mower will be able to take evasive action before it travels 4” from when the obstacle was detected by the ultrasonic sensors Bump sensors will detect a collision and quickly shut off the blades and stop the drive motors. A remote shutdown initiated from software as well as a hardware switch are on the mower. *The reaction time was calculated by Humanbenchmark.com

Navigation Accuracy • Relies on compass accuracy • Current compass is accurate to 3 degrees

Page 6: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Block Diagram The block diagram in Figure 1 shows how the individual components are integrated to create the system. The dog fence detectors, digital compass, and ultrasonic sensors are connected to inputs on the microcontroller. The microcontroller interprets the data from the sensors and makes decisions based upon the programmed algorithm. These decisions correspond to modifying the speed and direction of the individual drive motors. The microcontroller outputs two analog voltage levels corresponding to motor speed and two digital outputs representing direction for each motor. The two analog voltages are created using the microcontroller’s onboard digital-to-analog converter, these analog voltage levels are sent to hardware that converts the analog voltage levels to PWM signals. The PWM and direction signals are then driven through H-bridges that power the motors and control their direction.

Figure 1 - System Block Diagram

Page 7: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Key Components There are four key components contributing to the success of the A.G.I.L.E. project. They are navigation, perception, intelligence, and platform. The graphic below, in Figure 2, highlights these key areas that make up the project and illustrate how they all tie together. Platform consists of the chassis, motors and batteries of which the project was built on. Perception includes all of the sensors used to detect the environment, including objects and the electric dog fence. Navigation is controlled by a digital compass, which allows the robot to detect its heading. This data, along with the other sensors’ data, is then sent to the microprocessor for dispensation. Intelligence is controlled by the microprocessor software, which uses all the data collected to make decisions.

Intelligence

Navigation Perception

Platform

A.G.I.L.E.

Figure 2 – Key Components

Page 8: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Platform

Chassis & Power Supply A chassis that can move around objects is essential; therefore, the design of the mower chassis is centered on maneuverability. Figure 3 and Figure 4 show the chassis that is being used. The mower platform is driven by two 12V DC motors. Using this configuration the mower is driven with separate PWM signals. Turning is accomplished by varying the speed of the motors relative to the other.

Specifications Length: 12.5” Width: 18.5” Height: 7” Turning Radius: 0” Wheel Diameter: 6”

These specifications are for the base of the chassis, they do not include the additional components that we added to the mower such as sensors and the microcontroller. The power supply for the platform consists of two 12V - 7.2Ah deep cycle lead acid batteries that are connected in parallel. These batteries are used to power the entire system. Some of our electronics require lower voltages to operate, in this case voltage regulators are used to step down to the appropriate voltages. The system is protected by a 2 amp fuse and manual power shutoff switch. The switch is single pole double throw, (SPDT), and is set up in a configuration that only allows the batteries to be charged when the system is set to the “OFF” position. Figure 5 shows the power switching configuration.

Figure 3 - Chassis Front View

Figure 4 - Chassis Top View

Page 9: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Figure 5 – Power Supply

Motors Two 12V Pittman GM9236S025-R1 motors were used to drive the platform. They are connected directly to the wheels and have a gear ratio of 65.5:1 and a maximum RPM of 4916 at no load. These values constitute a maximum shaft RPM of about 75 which would propel the chassis at a maximum speed of about 118 ft/min or 2 ft/sec with the 6” diameter wheels of the platform. These motors also have dual channel 500CPR rotary encoders attached to them that can allow for a resolution of 1000CPR. However, our control system does not utilize these encoders because of the possibility for wheel slippage in an outdoor environment. Wheel slippage would make dead reckoning using the rotary encoder feedback ineffective. Instead of counting wheel turns and using dead reckoning we decided to use the compass as our feedback source to guide the mower through its environment. The block diagram below is used to model this motor in Simulink. The input is a DC voltage and the output is the speed of the motor before gear reduction.

Figure 6 – Motor Model

Page 10: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Drive Motors Circuitry The motors are driven using two separate PWM signals that are varied dependent on the desired speed of each motor. The microcontroller outputs analog voltages ranging from 0 to 5 volts to represent the speed of the motors. 0 volts corresponds to the stopped position or 0% duty cycle, and 5 volts represents full speed or 100% duty cycle. Circuitry was designed with those specifications in mind to create a system to convert an analog voltage input from 0 to 5 volts that would be linearly proportional to a 0% to 100% duty cycle output signal. A saw-tooth wave is used in conjunction with a comparator to trigger when the DC voltage from the digital-to-analog converter is greater to or equal to the voltage on the saw-tooth wave. Figure 7 shows an illustration of how the system works. The red line is the DC voltage produced by the digital-to-analog converter, the green waveform is the saw-tooth wave generated from a function generator, and the blue waveform is the resultant PWM signal derived from both the DC voltage and saw-tooth wave through the circuitry

Figure 7 – Output Diagram

Page 11: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Figure 8 below shows a block diagram of the analog to PWM circuitry. The circuitry consisted of an XR-2207 function generator which is configured to produce a saw-tooth wave. This saw-tooth wave is fed into 2 LM311 comparators. The 2nd inputs to the LM311 comparators are the respective DC voltage levels from the microcontrollers DAC to represent motor speed. This circuitry will create two separate PWM signals which are then fed to LMD18200T H-bridge chips to add direction control and provide the necessary voltage and current requirements to power the motors.

Figure 8 – PWM Flowchart

Page 12: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

The circuit in Figure 9 is the complete schematic of the PWM generator circuit used to power the motors.

XR-2207

1

20K

.1uF

12V

.1uF

560

.1uF3.9K

5.1K

4.7K

100K

1uF

100K

LM311

1

LM311

1

20K

20K

100K

100K

ADC INPUT 1

ADC INPUT 2

200KCALIBRATION

POT

SAWTOOTH OUT

DA0 DA1DC OFFSET

LMD18200TH-BRIDGE

10nF

DIRECTION

10nF

MOTOR (+)

MOTOR (-)

PWM

+12V

1uF

220uF

1

2

3

4

5

6

7

8

9

10

11

12V

LMD18200TH-BRIDGE

10nF

DIRECTION

10nF

MOTOR (+)

MOTOR (-)

PWM

+12V

1uF

220uF

1

2

3

4

5

6

7

8

9

10

11

11K

22K

11K

22K

Figure 9 – PWM Circuit

Page 13: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Microcontroller The microcontroller was used to control the drive motors, acquire the data from the sensors, and perform the artificial intelligence. The MicroPAC 535 8051 was chosen for the task. It provided enough digital I/O, analog-to-digital converter channels, digital-to-analog converter channels, memory, and speed to accomplish the task. This board was also chosen because it was readily available and lowers cost. A more expensive board was not needed.

Peripheral Input Output

Compass 1-Digital InputMotor #1 Digital-to-Analog ConverterMotor #2 Digital-to-Analog ConverterDog Fence Detector #1 Analog-to-Digital ConverterDog Fence Detector #2 Analog-to-Digital ConverterUltrasonic Sensors 5-Digital Input 5-Digital OutputSoftware Reset 1-Digital InputProgrammer Serial Port 1 Serial Port 1

Figure 10 - Peripheral I/O

Need HaveInput 7 10Output 5 24A/D 2 8D/A 2 8

MICROPAC

Figure 11 - MicroPAC 535 I/O

Figure 10 and Figure 11 show the input/output connections used to operate the lawnmower. Figure 12 shows all the connections used and how many are available on the microcontroller. As shown, the MicroPAC 535 will be sufficient for the project needs.

EMAC MICROCONTROLLER

ADC1ADC0P4.6 P4.7

DOGFENCERF RXers

MOTOR CONTROLLER

DAC0 DAC1

2121

Direction Pins PWM Adjustment

DIGITALCOMPASS

P1.1 P1.2 P1.4 P4.1P1.3 P4.2 P4.3 P4.4

ULTRASONICSENSORS

2 31

Feedback Pins

Pulse P

ins

4 1 2 3 45

P1.5 P4.5

5 1 2

P1.6

PWM

P1.7

RESET

Figure 12 – Microcontroller Connections

Page 14: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

Perception

The next key component, perception, is what allows the platform to detect objects in the environment. This is used as both a functional and a safety feature, allowing the robot to avoid objects and use walls.

Ultrasonic Sensors Ultrasonic sensors will be the primary method of detecting objects. Since the mower will be moving forward, it is important to detect objects in front of the mower. To help ensure accuracy, we will attach three sensors to the front of the mower. This will give us complete coverage in front of the mower and the overlapping coverage will permit more reliable obstacle detection directly in front of the chassis. Figure 13 shows the useable coverage area for each sensor. Sensor C will be the main forward sensor and will be heavily relied upon for forward object detection. Sensors B and D will be mostly utilized for peripheral detection. If either sensor B or D is triggered while C is not, then an object is close to the path of the mower but not directly in it. The mower will then make use of the intelligence algorithms accordingly to handle the obstacle. Sensors A and E are used to follow the edge of an object.

Figure 13 - Ultrasonic Sensor Coverage

Page 15: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

The sensors used were Devantech SRF05 ultrasonic sensors. They have a range of 3 meters and have a coverage pattern that is shown in Figure 16. These sensors work by sending out an ultrasonic pulse, setting the return pin high and holding it high until the ultrasonic pulse has been reflected and received by the listener sensor. If no object is detected, the return pin will timeout after 30ms. This functionality is described by Figure 17. The time it takes for the pulse to return to the sensor is used to determine a distance from the object using the speed of sound. The ultrasonic read function is calibrated to give useful distance values that can be used to keep an accurate distance from an object. The ultrasonic sensors are connected to the microcontroller as described by Figure 14. The capacitor on the init pin was not in the standard configuration, but due to noise issues from the motors the sensors were constantly being triggered. By adding the 1nF capacitor as shown in Figure 14 the noise issues were eliminated and we could get stable readings.

Figure 14 – Sensor Wiring

Figure 15 – Ultrasonic Sensor

Figure 16 – Sensor range

Figure 17 – Sensor Signals

Page 16: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

The sensors are read using a simple software loop. The function selects the correct sensor, initiates a read, increments a value until the sensor return pin goes back low, then computes an acceptable value to return. Figure 18 shows the basic flowchart for the read function.

Figure 18 – Ultrasonic Sensor Read Flowchart

Error correction is necessary for smooth operation of the mower. Also, it is used to detect bogus readings the algorithm uses error checking and correction. It checks to see if the last reading is significantly different than the current reading, and if it is, it ignores the reading once, if the next reading is close to the one that was significantly different it assumes that the sensor reading is correct and keeps it. Figure 19 is the software flowchart for this code.

Figure 19 – Ultrasonic Sensor Error Correction Flowchart

Page 17: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

17

Dog Fence Detectors To detect the dog fence, the mower will use two radio frequency (RF) receiver circuits each mounted on an opposite side, as shown in Figure 20. This is done so that it can detect the location and orientation of the fence by comparing the signal strengths. For example, the mower is perpendicular to the fence when both signals are close to the same strength. This configuration is useful for following the edge of the field and as well as containing the robot within the field. The analog signal strengths from these receivers are transferred to the microcontroller using onboard analog to digital conversion.

Radio Frequency System The two RF circuits use 4 stages for signal conditioning. Figure 21 shows all the stages including the transmission from the dog fence and the transmission to the microcontroller. A sine wave is generated by the dog fence and transmitted to the RF receiver antenna. The output from the antenna is sent through a single-frequency band pass filter (stage 1) in order to reject all other ambient frequencies. It is then sent through a high gain stage to bring the sine wave signal to a useable level. The signal is then rectified (stage 3) to produce a DC voltage that varies according to the sine wave signal strength. The final stage is a unity gain stage which is used to stabilize the DC signal to a constant voltage at all times.

Figure 20 – RF Detector Mounts

Page 18: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

18

Figure 21 – Dog Fence System

Radio Frequency Circuit Figure 22 shows the Orcad simulation of all four stages of the RF circuit, which either use the LM318D High-Speed Operational Amplifier or a germanium diode. Figure 23 is the Band-pass simulation both before and after the gain stage. Figure 24 and Figure 25 show the values used for the individual stages. The final stage is not show since it is simply a unity gain op-amp circuit. Any setup parameters for the LM318D are on the datasheet.

R2

100000

R4

5100

C1100p

C2100p

R10

7.5k

V712

0

U6

LM318

+3

-2

V+

7V-

4

OUT6C28C

35

C11

R6

10k

R7

1k

R8

910

R51k

0

U7

LM318

+3

-2

V+

7V-

4

OUT6C28C

35

C11

0

D1

1N4500

1 2

VV

U5

LM318

+3

-2

V+

7V-

4

OUT6C28C

35

C11

V812vdc

0

100mVac0Vdc

0

C3100p

0V66

R3

270

0

0

C4

100p

R9

11k

Figure 22 - Complete Circuit

Page 19: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

19

Figure 23 – Band-pass Simulation

R11

100000

R12

5100

C5100p

C6100p

U8

LM318

+3

-2

V+

7V-

4

OUT6C28C

35

C11

R13

270

0

100mVac0Vdc

Figure 24 - Stage One

Page 20: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

20

U9

LM318

+3

-2

V+7

V-4

OUT6C28

C35

C11

R14

10k

R15

1k

R16

910

D2

1N4500

1 2

C7100p

0

V96

0

Figure 25 – Stage 2 and 3

Navigation

Digital Compass The mower will rely heavily on the accuracy of the compass for its sense of direction; therefore, obtaining an accurate compass is crucial for the success of the project. Ideally, the compass should be accurate to within ±1 degree. The reason for this is shown in Figure 26. At one degree of error, the lawn mower will not stray more than one foot from its horizontal starting location on a 60 foot field. This amount of error is acceptable and the compass will be adequate for our needs. However, obtaining a compass of this accuracy costs around $300. The current compass being used for testing is accurate to within ±4 degrees. It is hoped that this compass will yield satisfactory results since it costs only $50. By modifying the lawn mowing algorithm and using the less accurate compass, both goals of low cost and effectiveness can be achieved.

Figure 26 - Compass Accuracy Effects over Distance

Page 21: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

21

Compass Tracking Control System The ability of the mower to navigate around its environment is dependent on a control system based on a digital compass. The system is closed-loop with feedback derived from the digital compass. The compass reading function is calibrated to return a value from 0 to 359° based on its measured heading. This value is used along with the desired heading value from 0 to 359° to generate an error signal. Figure 27 below is a diagram of the turning circle. The red arrow shows an example of a compass reading. The green arrow is the desired heading of the mower. The control algorithm uses the difference between these two values to calculate an error. The error signal is then multiplied by a gain value. We use a gain of 2 in our system. This value provided quick response time and stability for our system.

90˚

180˚

270˚

45˚

ERROR = 45°

DESIRED HEADING

COMP

ASS RE

ADING

Figure 27 – Turning Error Diagram

Figure 28 below shows a block diagram for the control system that is implemented on the mower.

Figure 28 – Control System Block Diagram

Page 22: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

22

Figure 29 below shows a flowchart for the control system. It was coded in C and built into a module that takes a single argument of the desired heading. The second argument would be the current heading, but that value was stored as a global variable so the function prototype omitted this argument.

DESIRED HEADING

CURRENT HEADING

IS DESIRED HEADING > 359?

IS DESIRED HEADING < 0?

NO

DESIRED HEADING -=360

DESIRED HEADING +=360

IS DESIRED HEADING –

COMPASS HEADING > 180?

TURN LEFTerror = (360 - desired_heading)

+ compass_heading

NO

YES

IS COMPASS HEADING – DESIRED

HEADING > 180?

TURN RIGHTerror = (360 - compass_heading)

+ desired_headingYES

NO

COMPASS_HEADING > DESIRED HEADING

TURN LEFTerror = compass_heading -

desired_headingYES

NO

COMPASS_HEADING < DESIRED HEADING

TURN RIGHTerror = desired_heading -

compass_headingYES

NO

TURN LEFT

RIGHT MOTOR PWM +=ERROR*GAINLEFT MOTOR PWM -= ERROR*GAIN

DEFAULT PWMS

RETURN

void controlheading(int desired_heading)AI.C

TURN RIGHT

RIGHT MOTOR PWM -=ERROR*GAINLEFT MOTOR PWM += ERROR*GAIN

Figure 29 – Control System Flowchart

Page 23: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

23

INTELLIGENCE

Object Avoidance Avoiding obstacles is a major part of this project. We don’t want to hit any objects or living things that may be in the field and we must not collide into walls. Using the ultrasonic sensors on the mower, objects can be detected if they are within the range of the ultrasonic sensors. The software works through the use of thresholds. If an object is closer than the set threshold, the sensor will be triggered and the software intelligence will take action based on the combination of triggered sensors. Figure 32 to the right shows the truth table that was used to determine which action to take based on the combination of sensors that are detecting objects. In addition to this table, if an object is detected, the software goes into obstacle avoidance mode. This mode has a slightly modified set of actions that allow the mower to successfully navigate around the object. Normally the mower would be in mow mode and strait would correspond to tracking the compass. In obstacle avoidance mode, strait corresponds to setting the motors to the same speed and driving forward until the object is cleared. Figure 30 below illustrates the behavior of the mower as it moves around an object.

Figure 30 – Obstacle Avoidance

DB

MOWER CHASSIS

C

A E

Figure 31 – Ultrasonic Sensor Locations

A B C D E ACTION 0 0 0 0 0 STRAIGHT 0 0 0 0 1 STRAIGHT 0 0 0 1 0 LEFT 0 0 0 1 1 LEFT 0 0 1 0 0 LEFT OR RIGHT 0 0 1 0 1 LEFT 0 0 1 1 0 LEFT 0 0 1 1 1 LEFT 0 1 0 0 0 RIGHT 0 1 0 0 1 STOP, PIVOT RIGHT 0 1 0 1 0 MOW PIVOT 0 1 0 1 1 MOW PIVOT LEFT 0 1 1 0 0 RIGHT 0 1 1 0 1 MOW PIVOT LEFT 0 1 1 1 0 MOW PIVOT 0 1 1 1 1 MOW PIVOT LEFT 1 0 0 0 0 STRAIGHT 1 0 0 0 1 STRAIGHT 1 0 0 1 0 STOP, PIVOT LEFT 1 0 0 1 1 STOP, PIVOT LEFT 1 0 1 0 0 RIGHT 1 0 1 0 1 STOP, PIVOT 1 0 1 1 0 MOW, PIVOT RIGHT 1 0 1 1 1 STOP, PIVOT 1 1 0 0 0 RIGHT 1 1 0 0 1 STOP, PIVOT RIGHT 1 1 0 1 0 MOW, PIVOT RIGHT 1 1 0 1 1 STOP, PIVOT 1 1 1 0 0 RIGHT 1 1 1 0 1 STOP, PIVOT 1 1 1 1 0 MOW PIVOT RIGHT 1 1 1 1 1 STOP, PIVOT

Figure 32 – Intelligence Truth Table

Page 24: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

24

Algorithm The algorithm will be based on a north-south style of mowing pattern. The following algorithm is demonstrated in Figure 33 to the right. The mower will initially follow the border until it has completed the perimeter. (See Wall Following below) After the perimeter is cut, the robot will then proceed to move up and down the field, parallel to the border. This will rely on accurate compass information, therefore error compensation is necessary. To do this, the mower is programmed to include overlap when turning. The mower will be contained by the dog fence border, which indicates when it needs to turn around. When finished, the mower is programmed to continue cutting the field a second time. (See Double Cut below) This approach is acceptable considering that it will not cause the user any grief, if the mower is running longer than it normally would. As long as the lawn is completely cut, the user will not mind the extra time spent in operation. If an object is detected, the mower will either treat the object as a wall and turn around, or it will mow around the attempt to mow around the object if certain intelligence parameters are met.

Wall Following The first objective of the robot is to cut along the border of the field. Cutting the border first is necessary because turns at the border will cause some areas to be missed by the normal mowing pattern. This is done using the dog fence as a boundary. The robot should first be placed at any point in the field facing the fence. It will head forward until the right dog fence detector signal strength reaches the threshold. Next, it will turn right 90 degrees and begin following the wall in a clockwise pattern. At this point, the software will store the compass heading value and begin tracking the total degrees turned. This total will indicate whether or not to continue wall following or begin the mowing routine. Since the robot always follows the fence in a clockwise direction and needs to be able to follow any shape of border, left turns are counted as negative, and right turns are

Figure 33 – Mowing Algorithm

Page 25: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

25

counted as positive. This total is constantly updated. Since there is no way to know where the mower started cutting on the first wall, it will need to be cut twice to ensure a complete perimeter cut. In order to do this, the threshold is set above 360 degrees. The logic behind this is that the sum of the inside angles of any shape; always add up to 360 degrees. Constant error correction uses closed loop control to keep the robot a certain distance from the fence. An ideal signal strength value is set in code, and then the difference from that and the actual signal is calculated as the error. A maximum error assures that the robot will not make extreme adjustments. This error is then added to one motor’s normal speed and subtracted from the other motor’s normal speed, depending on which direction it needs to turn. This enables the robot to stay close to the fence and also makes curved fence following possible. Figure 34 is a high level wall following flow chart, and Figure 35 is a more detailed low level flowchart.

Figure 34 - High Level Wall Following

Page 26: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

26

Start

Mode = mow

Return

First turn =1?

Find wallGo straight

Store initial heading

set = 1

Diff > 180?

Diff < -180?

Turnage = Turnage + Diff

Set = 1?

YES

NO

Error = 140 - LRF

Error > 40?

Error = 40

RRF < 90?

LRF < 40?

OLRF >

(LRF+1) ?

OLRF <

(LRF-1) ?

CloserMotorL=75-errorMotorR=75+error

FartherMotorL=75+errorMotorR=75-error

StraightSet Motors to equal speed

Back upTurn 90 degreesFirst turn = 1

OLRF = LRFORRF = RRF

Diff = Diff - 360

Diff = Diff + 360

Turnage >400?

YES

YES

NO

NO

YES

NO

YES

YES YES

NO

NO

YES

NO

YES

NO

YES

NO

NO

Figure 35 – Detailed Wall Follow Flowchart

Page 27: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

27

Double Cut The next step in the algorithm is to start cutting the center of the field. This is initially done in an up and down pattern, using the dog fence as a boundary. Objects, such as trees, will be avoided if necessary. However, the obstacle avoidance will cause the area behind the object to be missed. This is accounted for by cutting the field a second time, in a perpendicular direction to the first cut. This routine should cover most fields with objects. In the example below, the robot (yellow) would first follow the blue path, followed by the red path. The squares indicate the areas missed on each run. An algorithm to detect the end of each path still needs to be added.

Figure 36 - Double Cut

Page 28: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

28

Software The software for this project will consist of code written for the 8051 architecture in C. A high level flowchart consisting of the decision making process the algorithm must perform is shown below in Figure 37. Every pass through the loop it checks if the reset button has been switched on, if so it resets to the original mode of dog-fence following to cut the border. After the reset is checked the sensors are read and an environment vector is constructed based on the readings. Depending on the mode, it makes decisions according to the environment value.

START

IS RESET SWITCH

ACTIVATED?RESET

IS RESET SWITCH

ACTIVATED?WAITYESYES

READ SENSORS

NO NO

BUILD ENVIRONMENT AWARENESS

IS MODE WALLFOLLOW?

ARE DOGFENCES TRIGGERED?

NOMODE =

DOGFENCE DETECTED

YES

IS MODE MOW?

YES

MOWING ALGORITHM

YES

IS MODE OBJECT AVOIDANCE?

NO

OBJECT AVOIDANCE

YES

IS MODE DOGFENCE DETECTED?

IS MODE WALLFOLLOW?

NO

NO

DOGFENCE AI & SET MODE =

MOWYES

WALLFOLLOW AI YES

Figure 37 – Main Loop

Page 29: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

29

Safety As an additional safety feature, the user will enter the approximate dimensions of the field. The microcontroller will count wheel turns and compare the approximate distance traveled to the given dimensions. If the mower has traveled in one direction for more than the inputted distance, the mower will assume it has missed the dog fence and will shut down. This will not be a very accurate form of distance detection, which is why it is used as a last resort. Also, if the connection to the PC is lost, the mower will shut down. The microcontroller will have a watchdog timer to shut down the mower in case the microcontroller fails.

Bump Switches As a safety feature, several bump switches are applied on the front of the chassis as the last line of defense. These will cause the mower to stop and reverse if it collides with an object that the other sensors did not detect. Once activated, the mower will be instructed to stop forward movement and then reverse for a short distance. The mower will then once again try to locate the object using the ultrasonic sensors. If an object is detected using the ultrasonic sensors it will be handled accordingly. If it does not detect the object, the mower will proceed once more forward and if the bump sensors are triggered again, the mower will shutdown. This routine will most likely be used when the mower comes in contact with a dynamic object, such as a ball or a person.

Figure 38 - Bump Switch Layout

Page 30: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

30

Component On Site Estimated Unit priceMowjoe chassis (motors, frame, batteries) yes 100.00$ C80515 EMAC 8051 bases microcontroller yes 120.00$ Devantech R117 digital compass yes 57.00$ Five Devantech SRF05 ultrasonic sensors no 29.50$ Dog fence components yes 10.00$ Total Cost 316.50$

Figure 39 - Parts List

Time Tables The following Gantt chart, Figure , shows our goals and completion of the past semester. As shown, almost everything was completed for the semester.

Figure 40 – First Semester Schedule

The following chart, Figure , shows our goals and progress for the semester:

Figure 41 – Second Semester Schedule

Page 31: Autonomous Guided Intelligent Lawn-mowing Equipment Senior ...cegt201.bradley.edu/projects/proj2009/agile/deliv/Report_Final.pdf · Autonomous Guided Intelligent Lawn-mowing Equipment

AGILE

31

Works Cited Chandler, Rand C., Katherine A. Meiser, and Antonio Arroyo. LawnShark: A New Platform for Autonomous Mowing and. 30 Apr. 1999. University of Florida. 10 Dec. 2008 <http://www.mil.ufl.edu/publications/fcrar99/lawnshar.pdf>. Chandler, Rand C. The Next Generation Autonomous Lawn Mower. 05 May 2000. University of Florida. 10 Dec. 2008 <http://www.mil.ufl.edu/publications/fcrar00/chandler.pdf>. Gregg, Michael. Autonomous Lawn Care Applications. 26 May 2006. University of Florida. 10 Dec. 2006 <http://www.mil.ufl.edu/publications/fcrar06/fcrar06_gregg.pdf>. Gregg, Michael. Lawn Gator. 26 Apr. 2006. University of Florida. 10 Dec. 2008 <http://www.mil.ufl.edu/courses/eel5666/papers/imdl_report_spring_06/gregg-michael/lawngator.pdf>. "Human Benchmark - Reaction Time Stats." Human Benchmark - Home. 10 May 2009 <http://www.humanbenchmark.com/tests/reactiontime/stats.php>.


Recommended