<<

CWRU CUTTER: DESIGN AND CONTROL OF AN AUTONOMOUS

MOWING

by

JONATHAN ANTHONY BENO

Submitted in partial fulfillment of the requirements

For the degree of Master of Science

Thesis Adviser: Dr. Roger Quinn

Department of Mechanical and Aerospace Engineering

CASE WESTERN RESERVE UNIVERSITY

May 2010

CASE WESTERN RESERVE UNIVERSITY

SCHOOL OF GRADUATE STUDIES

We hereby approve the thesis/dissertation of

Jonathan Anthony Beno______

candidate for the __Master of Science______degree.

(signed)____Roger Quinn______

(Chair of the Committee)

____Francis Merat______

____Joseph M. Mansour______

______

______

______

(Date) __3/17/2010______

I grant to Case Western Reserve University the right to use this work, irrespective of any copyright, for the University‟s own purposes without cost to the University or to its students, agents and employees. I further agree that the

University may reproduce and provide single copies of the work, in any format other than in or from microforms, to the public for the cost of reproduction.

Jonathan A. Beno

(sign)

TABLE OF CONTENTS

TABLE OF CONTENTS...... 1 LIST OF TABLES ...... 3 LIST OF FIGURES...... 4 CHAPTER 1: INTRODUCTION...... 6 CHAPTER 2: CWRU Cutter’s Components ...... 9 MECHANICAL HARDWARE ...... 9 MOWING HARDWARE ...... 9 DRIVETRAIN ...... 10 ELECTRONICS ...... 11 ENCLOSURE...... 11 SAFETY SYSTEM AND POWER DISTRIBUTION ...... 11 SPEED CONTROLLER SELECTION ...... 13 BATTERY SELECTION ...... 14 COMPUTATIONAL PLATFORM ...... 16 SENSORS ...... 17 ENCODERS ...... 17 IMU ...... 17 GPS ...... 17 LIDAR ...... 18 CAMERA ...... 19 CHAPTER 3: PATH DRIVER ...... 20 WHEEL VELOCITY CONTROL LOOP ...... 20 PHYSICAL STATE OBSERVER ...... 21 KINEMATICS ...... 21 PATH DRIVER ...... 23 VELOCITY DRIVER ...... 26 CHAPTER 4: 3D GIMBALED LIDAR MOUNT ...... 27 SYSTEM REQUIREMENTS ...... 27

1

CONTROL ...... 31 COORDINATE TRANSFORMATION ...... 32 CALIBRATION ...... 34 RESULTS ...... 36 CHAPTER 5: ULTRASONIC SENSOR EVALUATION...... 38 SRF05 ...... 39 SRF235 ...... 41 SODAR (Sound Detection And Ranging) ...... 41 POTENTIAL FOR FUTURE WORK ...... 42 CHAPTER 6: CONCLUSIONS ...... 43 APPENDIX A ...... 45 REFERENCES ...... 46

2

LIST OF TABLES Table 1: Power consumption for each component of the mower – Page 18

Table 2: CompactRIO modules used on the mower and usages – Page 19

3

LIST OF FIGURES Figure 1: Competition Field for the advanced mowing category of the ION Autonomous Lawnmower Competition...... 8 Figure 2: CWRU Cutter side view ...... 9 Figure 3: Electronics hardware mounted in the enclosure ...... 11 Figure 4: Master and blade motor emergency stop schematic diagram ...... 13 Figure 5: Overview of path driver function ...... 20 Figure 6: Wheel velocity PID control loop ...... 20 Figure 7: Actual gimbaled LIDAR mount on mower ...... 28 Figure 8: CAD model of gimbaled LIDAR mount ...... 28 Figure 9: 3D LIDAR Euler angles plotted vs. time for the full sweep mode shape...... 29 Figure 10: Tilt (Beta) angle detail ...... 30 Figure 11: Pan(Alpha) angle detail ...... 30 Figure 12: Scan angle range (theta) ...... 31 Figure 13: Geometry for tilt axis calibration ...... 35 Figure 14: Geometry for alpha axis calibration ...... 36 Figure 15: 3D LIDAR data displayed in an intensity plot...... 37 Figure 16: Photoshoot time ...... 37 Figure 17: SRF05 Sensor ...... 39 Figure 18: Edges of detectable area in an open room ...... 40 Figure 19: Cross correlation chart for SODAR ...... 42 Figure 20: No dogs were harmed in the making of this robot ...... 44

4

CWRU CUTTER: DESIGN AND CONTROL OF AN AUTONOMOUS LAWN

MOWING ROBOT

Abstract

by

JONATHAN ANTHONY BENO

CWRU Cutter was designed to compete in the 2008 and 2009 ION Autonomous

Lawnmower Competitions. CWRU Cutter tests the feasibility of autonomously mowing grass with a high quality of cut using commercially available sensors and computers.

The primary objective was to accurately and robustly mow predefined paths and perform reactive edging around stationary obstacles. The secondary objective of CWRU Cutter is to provide a platform to test less expensive, commercially viable sensors that will allow a safe and robust autonomous lawn mower to be brought to market. This thesis describes the mower hardware and mechanical design, the path driver, a 3D gimbaled LIDAR mount, and the potential for ultrasonic sensors on future mowers.

5

CHAPTER 1: INTRODUCTION

The earliest walk-behind style lawnmower was the reel type with both motive and cutting power being supplied by the operator. Modern rotary mowers began appearing in the

1930s, when light and powerful enough engines became available to spin a blade at high enough speeds. Powered versions and riding mowers have become ubiquitous but the technology has not fundamentally changed. That is, until very recently when modern electronics has made it possible to completely automate the machine.

In 1995, Husqvarna released the first version of its Automower. Since then, they have sold over 100,000 around the world (1). It would seem that they have pretty much figured out how to build autonomous lawnmowers, but how well do they perform? One of the key features of a freshly cut lawn is the regular pattern or parallel lines left behind on the grass. The Automower zigzags randomly around the lawn, which will probably eventually cut all the grass but is far from efficient about it and doesn‟t leave behind a high quality of cut or visually pleasing pattern. The boundary of the lawn must be defined by a guide wire buried in the ground, which can be cumbersome to install and restricts future changes to the landscape. This is also the only way for it to mow up next to obstacles such as the house or flowerbeds. The last resort for an unexpected obstacle in the mower‟s path must be dealt with by physical bump sensors. If the obstacle is a tree or rock, this is a satisfactory solution. It bumps it, backs up and finds its way around it.

If the „obstacle‟ happens to be a small child or pet, this is a much less acceptable solution.

6

CWRU Cutter addresses the problems with the current generation of autonomous lawnmowers. It eliminates the use of a guide wire by using a combination of a global positioning system (GPS), an inertial measurement unit (IMU), and wheel encoders to keep track of its current position and velocity, or physical state. In order to edge obstacles such as flowerbeds closely, it must detect these boundaries from a distance and have real-time local feedback to use for control. Both LIDAR and a camera have been employed to detect obstacles in the mower‟s field of view and keep track of them using a local polar freespace observer. A global map of the obstacle field can be stored in the mower‟s memory generated with the aid of user interface software to mark which obstacles should be edged closely and which should not. Unexpected obstacles are treated as a person that the mower will drive around and maintain a safe distance.

CWRU Cutter was designed to compete in the 2008 and 2009 ION Autonomous

Lawnmower Competitions. The competition field can be seen below in Figure 1.

Scoring of the mowing portion of the event is accomplished by partitioning the field into three zones. The bulk of the field is considered Zone 1, which is only worth thirty percent of the available points. Most of the small area in the lower right corner of the field is Zone 2 which accounts for forty percent of the score. The remaining thirty percent is the one foot wide buffer adjacent to the flowerbed obstacle and fence. The flowerbed obstacle is bordered by black edging material and is placed somewhat randomly in the field while maintaining a two meter buffer between it and the edge of the field. The white picket fence bordered two sides of Zone 2. It is easy to see that most of

7

the points are scored by mowing the areas close to the obstacles, but there is a ten point penalty for each collision with an obstacle. There is also a moving obstacle that randomly appears in the field in front of the mower that must be avoided.

Figure 1: Competition Field for the advanced mowing category of the ION

Autonomous Lawnmower Competition.

My personal contributions to the CWRU Cutter, and therefore the topics found in this thesis, include the following.

(1) The design and construction of the mower‟s electrical and mechanical hardware

(2) Path Driver

(3) 3D Gimbaled LIDAR mount

(4) Testing of ultrasonic sensors

8

CHAPTER 2: CWRU Cutter’s Components

MECHANICAL HARDWARE

Figure 2: CWRU Cutter side view MOWING HARDWARE

CWRU Cutter is built around an MTD battery-powered walk-behind lawnmower. Like all of their mowers, the deck has been engineered by MTD to mow grass with a high quality of cut. Powering the blade with an rather than an internal combustion engine has several advantages, including much less vibration, noise, heat, and emissions produced. An electric motor is also greatly simplifies the task of starting and stopping the cutting blades. The competition field represents only a rather small area, only about 150 square meters, easing the mower runtime and therefore energy 9

requirements. However, our system could be moved to a much larger -powered commercial mower and mow very large areas such as golf courses or recreational fields.

An electric is mounted to one side of the deck. This allows CWRU Cutter to edge all the way up to vertical obstacles greatly increasing the final quality of cut. The string trimmer is a modified version of a 12V battery-powered unit provided by MTD.

These have already proven their reliability and robustness of design. An automatic feed string reel would be required for long term use, but single replaceable strings proved to have sufficient durability for our testing purposes.

DRIVETRAIN

The drive motors used on CWRU Cutter were sourced from Invacare, a power wheelchair manufacturer. These powerful motors are capable of driving the mower over ruts and bumps with little hesitation. An earlier version of the CWRU Cutter used smaller motors that struggled to move over rough terrain and in thick grass. This is no longer an issue with the Invacare motors. The wheels and hubs chosen are also available from Invacare for use with these motors. The diameter, width, and tread pattern are appropriate for use on grass. Wheel slip and rutting are only a problem in wet grass, when the grass should not be mowed anyways.

10

ELECTRONICS

Figure 3: Electronics hardware mounted in the enclosure ENCLOSURE

A Pelican case houses all the electronics to run the mower with the exception of the batteries. This solved the problem of keeping water out of the box in the event of rain, which occurred at both competitions. All connectors were bulkhead mounted to the box, so the electronics could be entirely separated from the rest of the base if work needed to be done to the base and for ease of transportation. Two 120 mm fans were added to the box to provide cooling air circulation for the computers, motor controllers, and power supplies.

SAFETY SYSTEM AND POWER DISTRIBUTION

The CWRU Cutter has two emergency stop safety chains. If any one component in either chain is disabled, the corresponding system is deactivated. The master emergency stop

11

disables power delivered to all motors on the robot. The blade emergency stop disables the blade and string trimmer motors only. The blade emergency stop acts more as a disable function for safety reasons during testing. These are not inputs to the computer; each input represents a link in the chain controlling a normally open solenoid that physically disconnects power to the speed controllers.

In addition, the robot has a safety state machine that governs the software-activated emergency stop. A heartbeat is triggered from the real time controller at 10 Hz, at the completion of each control loop period, to indicate an error has not occurred and the program is still running. This is monitored by a watchdog timer on the FPGA. If this is not received in 0.25 seconds, the software emergency stop is engaged. The watchdog timer runs on the FPGA because if there is a problem on the real time controller, the watchdog timer continues to run beneath the main control loop and has direct access to the solenoid output used in the safety chain. When the robot enters the enabled state, the safety state machine waits an additional five seconds while a warning siren sounds to indicate the mower is about to be powered up.

12

Figure 4: Master and blade motor emergency stop schematic diagram

SPEED CONTROLLER SELECTION

The selection of the motor speed controller for the drive wheels directly affects several factors of CWRU Cutter including controllability, durability, and safety. A few different models of speed controllers have been tested. Victor speed controllers are robust against failure but exhibit a highly nonlinear characteristic response which makes fine control difficult. Dimension Engineering Sabertooth 2x25 speed controllers are very linear and have a variety of input options. However, the Sabertooth controllers are less robust as they are not enclosed and do not include a . After some reliability issues with the

Sabertooth controller, we chose to upgrade to a Roboteq AX2550 speed controller. The

Roboteq controller features a variety of input options, internal circuit protection, a robust form factor, and excellent response characteristics.

13

BATTERY SELECTION

All power on the vehicle comes from 12 8.5Ah 12V sealed lead acid batteries wired in two separate banks. Eight batteries are wired in series-parallel providing 34 Ah at 24 V.

The remaining four are wired in series providing 8.5 Ah at 48 V to power the blade motor. Battery chargers are installed on the robot to simplify recharging as well as allow continuous operation of the mower by recharging between tests without having to shut down the mower. This battery configuration was chosen by building a table of power requirements for all components on the mower (Table 1). The battery life was then estimated by interpolating the specifications found on the battery datasheet. In light grass, the mower should cut for about an hour and only about 30 minutes in heavy grass with many turns. The competition is limited to 20 minutes of operation and only takes a fraction of that time with a properly functioning mower.

14

Electronics only Average Peak Component (W) Power(W) Power(W) NI CompactRIO controller 12 12 20 Mac Mini 75 75 110 Linksys Wireless Broadband Router 3 3 3 Novatel Propak V3 GPS Receiver 3 3 3 Serial Packet Radio 3 3 6 SICK LIDAR 20 20 20 Light Stack Bar 24 24 36 Remote E-Stop System 0.5 0.5 0.5 Crista IMU 0.5 0.5 0.75 Drive Motors 0 120 250 Total Power (W) 141 261 449.25 Current draw from 24V batteries (A) 5.88 10.88 18.72 Estimated life - 100% DOD (minutes) 126.22 60.66 31.79

Blade Motor 500 750 Current draw from 48V batteries (A) 10.42 15.63 Estimated life - 100% DOD (minutes) 63.85 39.41 Table 1: Power consumption for each component of the mower

Batteries with alternative chemistries can offer more capacity and power for equal volume and mass. However, this comes at an increased cost for both the batteries and chargers. The size and weight of our robot was not an important requirement for the purposes of development and the competition, so we saved the money and used the less expensive lead acid batteries, which were provided by MTD Inc..

15

COMPUTATIONAL PLATFORM

The CWRU Cutter features a National Instruments CompactRIO RT (real-time) programmable automation controller and an Apple Mac Mini NRT (non-real-time) computer running Windows XP. The NI cRIO (National Instruments Compact

Reconfigurable Input/Output Controller) platform includes two computation subsystems: a FPGA (Field Programmable Gate Array) and a 500MHz real-time processor. The

FPGA is a common digital logic device that implements application specific high-speed timing, data acquisition, and control functionality. The real-time processor, using data acquired by the FPGA, implements higher level computations and outputs the subsequent control commands back to the FPGA. The combination of these two devices allow for a robust software platform. The FPGA interfaces to pluggable modules, defining the RIO functionality. A brief description of the modules used can be found in the table below.

Component Usages NI-9411 DI DIFF/TTL High high speed encoder Speed measurement NI-9401 DIO 5V TTL High Speed speed controller communication NI-9481 RLY 250 VAC Form A (SPST) Light status bar, E-stop chain GPS, LIDAR, IMU NI-9870 4-Port RS232 communication Table 2: CompactRIO modules used on the mower and usages

The Mac Mini facilitates an interface with standard Firewire cameras for vision processing. A solid state hard drive was chosen to maximize system robustness. This computer was also used for onboard data logging to collect data for simulation and post processing.

16

SENSORS

ENCODERS

Encoders attached to the motor shaft of the drive wheels provide wheel speed and wheel position information. The encoders chosen for the application are Grayhill 63R256 256- count quadrature encoders. A 24:1 gearbox on the output of the motor provides a measured 22,542 ticks per meter on a hard, smooth surface. The large number of ticks allow for backwards differentiation of the position with respect to time. This differenced value can be used directly as a wheel velocity for control purposes. The large number of counts per meter also allows accurate integration of the robot‟s position over short periods of time on hard surfaces. However, on grass, the wheel velocity did not correlate well with the mower‟s velocity, especially while turning. Discussion on dealing with this problem can be found in the path driver section.

IMU

An IMU (Inertial Measurement Unit) is mounted directly above the center of the drive axle of the robot. The selected IMU, a Cloud Cap Technology Christa IMU is a six-axis unit that provides angular velocity and acceleration in each Cartesian axis. The unit is temperature compensated and in an enclosure. The IMU provides real time inertial measurement at 100Hz to the controller via RS-232 serial.

GPS

Two GPS (Global Positioning System) receivers are used to provide the robot with a global estimate of position, velocity, and heading. Differential GPS has been selected to

17

minimize the effects of ionospheric lensing and stratospheric bias. Omnistar HP corrections were used on both receivers. The selected GPS receivers for our robot are

Novatel ProPak-V3 units. The robot‟s GPS antenna is located directly above the IMU to allow for minimal calibration of the lever arm between the two sensor centers. The secondary GPS antenna, used for real time differential GPS corrections, is mounted on a fiberglass surveying tripod and is anchored within fifty meters of the course. A set of

Freewave FGR-115RC RS-232 serial packet radios periodically transmit corrections from the differential GPS receiver to the robot.

LIDAR

CWRU Cutter originally used a fixed LIDAR mounted with the laser just above and parallel to the top of the grass. Theoretically, this would allow the low flowerbed obstacle to be observed while the grass is not seen. In practice tall tufts of grass and robot pitching/rolling prevent this and the LIDAR observes the grass. Subsequently, the robot senses an obstacle and stops immediately, to avoid crashing into the ground. To remedy this, the LIDAR was raised during the competition so the moving obstacle and fence were still detected, and CWRU Cutter planned to stay far enough away from the flowerbed to avoid collisions.

Several variations of a gimbaled mount were considered before the final design was chosen and manufactured, but all shared a common feature. The LIDAR mirror center is mounted well above the height of the grass and looks down. This gives the sensor a better perspective and allows for the creation of a local polar height array. The edge of

18

the obstacle can be determined from this data and the mower will never be startled by grass immediately in front of it. The design, kinematics, and control method for this mount will be presented in a later section.

The LIDAR unit chosen is a SICK LMS291-S14. It provides a 90 degree sweep of data directly in front of the sensor in 0.5 degree increments. At each point, the reflectivity of the surface is also returned, which can be valuable in differentiating between objects.

The distance at each scan is reported to 1 millimeter resolution up to 8 meters. The sensor outputs data at a rate of 75 scans per second.

CAMERA

CWRU Cutter utilizes a Unibrain Fire-i Firewire camera to capture images on the Mac

Mini. The camera is mounted on the robot to maximize a specific region of interest that will interact and edge obstacles. The camera outputs 320x240 pixel images at a frame rate of up to 30 frames per second. A wide-angle lens was employed to maximize the observable area around the robot.

19

CHAPTER 3: PATH DRIVER

The path driver module takes the current physical state estimate and outputs an updated intended curvature to drive the mower back towards the intended path. The velocity driver ramps the commanded velocity up and down when changes are required to stay well within the operating envelope of the robot without wheel slippage. This new curvature and velocity are then converted into the new wheel angular velocity commands.

This loop function runs once per control loop at 10 Hz.

Figure 5: Overview of path driver function

WHEEL VELOCITY CONTROL LOOP

Figure 6: Wheel velocity PID control loop The wheel angular velocity is controlled with a PID loop that operates on the FPGA at

100 Hz. Wheel velocity commands are fedback at a rate of 10 Hz from the Path Driver in the real time control loop. Encoder measurements are also input to this FPGA, producing a tight and robust control loop on the wheel velocity. The control also takes advantage of the open-loop feed forward response characteristics of the system. The output of the PID loop is added to this value which is then output to the speed controller. The gains for the

20

PID loop were then tuned manually on the robot by commanding step changes in velocity and plotting the response. The gains chosen provided quick response time with little overshoot and no steady state error.

PHYSICAL STATE OBSERVER

Since a variety of sensors are available for use in state estimation and each sensor has its own downfall, the Kalman filter can be used to probabilistically determine the most accurate state estimate. Moreover, the Kalman filter will estimate the state recursively and iteratively in real time – constantly driving the uncertainty of the solution downward.

The state estimate that is output by this method includes the mower position, velocity, and heading. Calculating this estimate in real-time is the topic for another paper.

KINEMATICS

The new desired velocity (v) and curvature (k) must now be mapped to the left and right wheel angular velocity commands. These can be related to the angular velocity of the mower (ωz) and to the radius of curvature (ρ).

  vk z (1)

v   (2)  z

The linear velocity of the left wheel can then be found by subtracting half the track width from the radius of curvature. From this we can get

21

t vLz (3) 2

Substituting Eq. 2 into Eq. 3

 t vvz (4) L 2

To convert from linear velocity ( vL ) to angular velocity (L ) for the wheel, where rL is the radius of the wheel,

vrLLL  (5)

The left wheel angular velocity can now be expressed as a function of only v and z .

 t v  z 2 L  (6) rL

To get to the set point for the control loop, L must now be multiplied by the transmission ratio, the number of encoder ticks per radian, and the time step for the control loop.

 t v  z 2 encvelLset **/*TransmissionRatio Ticks Radian t (7) rL

A similar equation can be developed for the right wheel velocity set point.

 t v  z 2 encvelRset **/*TransmissionRatio Ticks Radian t (8) rR

22

PATH DRIVER

A priority for the CWRU Cutter is to mow very straight and parallel paths rather than random paths similar to those driven by current commercial autonomous mowers. In addition to line segments, the mower also needs to be able to either pivot or arc to get between lines. Pivoting (attempting to maintain a zero net velocity while turning) is especially important in tight spaces. In addition to making complex cutting shapes possible, arcs are necessary for turning in thick grass where pivots were found to cause wheel slip. Our path driver follows sets of three different types of path segments: lines, arcs, and pivots. The path driver is based on a control rule developed by

Kanayama in [8], where he shows the combination of coefficients required to achieve critically damped motion back towards the path.

LINES

d d The curvature, , is defined as  and is the path derivative of curvature . ds v ds

is calculated as a linear combination of current path curvature, heading error, and lateral positional error. There is only one coefficient to tune,  , which changes how aggressively the robot will return back to the path. The control becomes unstable if this value is pushed too low, as was later shown using simulation and testing on the robot.

The optimum value lies just above this instability. The steering function can be expressed as

23

dd3     3  (9) ds  23 

However, it is noted that when the initial state of the robot is very different from the states along the path, undesirable instabilities occur which may not converge to the desired line. For example: in our simulation testing, when the robot was far from the path and facing the wrong direction it spiraled many times before starting to approach the path. This is because there is a discontinuity at  =  and, if the d term is large, it can cause the robot to rotate beyond an orientation perpendicular to the path. We fixed this by including a cos() factor into the third term of the equation thus changing the steering function provided to:

dd3     cos(   )   3  (10) ds  23 

Note that this change does not affect the stability calculations of the linearized system since the Taylor Series Expansion of cos() near  = 0 is 1 minus higher order terms.

The desired curvature, , can be determined from  = current + d/ds·|vcurrent|·t.

d   vt  (11) currentds current

The path driver continues to the next segment whenever the remaining progress to the endpoint reached a set threshold. If the threshold is small, then the robot may stall at the end of the path. In practice, the opposite can become a problem where the mower would overshoot a tight arc following a line segment. The tolerance and deceleration rates proved to be important tuning parameters to precisely and consistently follow the intended path and accurately place the mower at the beginning of the next path segment

24

on the correct heading.

PIVOTS AND ARCS

For pivots, the path driver specifies v = 0 and controls  with a PID on orientation. For the first CWRU Cutter, requesting a pivot sometimes caused the motors to stall in thick grass, since the casters would often be facing the wrong way. Therefore we only use pivots when they are absolutely necessary. For the most part a small arc can replace a pivot without consequence.

Circular arcs are a modification of the line following algorithm. The arc‟s curvature is added as a constant to the desired mower curvature, and the steering algorithm can now be used to steer along an arc. By changing the  in the first term to a , where  is the difference between the current curvature and the desired arc curvature, lines are converted to arcs.

An important difference from line-following is the end condition. Since the primary purpose of our arcs and pivots is to re-orient the robot, the path driver moves onto the next segment when the orientation is within a certain tolerance, rather than the linear progress. If long arcs are given, both types of thresholds can be enforced. Once again, this angular tolerance was important to get the robot at the correct position and heading for the next path segment, minimizing future path errors.

25

VELOCITY DRIVER

Once the desired curvature is determined, we pick a velocity by choosing the minimum:

1. The desired speed specified for the path.

2. The velocity required to stop by the end of the path.

3. An acceleration limit on the current velocity

4. A lateral acceleration limit which limits velocity based on commanded curvature.

Once the velocity is determined, the angular velocity isv . After this calculation, the resulting angular velocity should be checked to ensure it is within a reasonable range, since large values for  are not invalid.

26

CHAPTER 4: 3D GIMBALED LIDAR MOUNT

One proposed solution to robustly observe low obstacles in tall, rough grass was to obtain

3D LIDAR information of the obstacle field around the robot. Obstacles can then be detected by applying a threshold just above the height of the grass. This information can be filtered to remove any small tufts of grass. Anything above this height is considered an obstacle, and an obstacle point is filtered into the local polar free space array.

Velodyne produces a commercially available sensor for mounting on top of a robot that produces high speed, 3D LIDAR data 360 degrees around the robot. While this would be perfect and would give us more high quality data than we‟d ever know what to do with, it costs around $75,000, making it impractical for use on our robot. It is overkill for the

CWRU Cutter as it was designed for use on autonomous vehicles moving at highway speeds. Design objectives were created based on the competition and mowing requirements that would give the team accurate and robust obstacle fields that will be used to edge the low obstacle.

SYSTEM REQUIREMENTS

1. Field of view should be the 180 degrees directly in front of the mower.

2. The elevation angle should go from just above the horizon to 30 degrees below the horizon.

3. To include a mode of operation that scans just to the left or right of the mower to give a higher data rate while edging.

27

4. Continuous rotation speed of motors using a crank-rocker mechanism for each axis to ease timing and control synchronization issues.

Figure 8: CAD model of gimbaled Figure 7: Actual gimbaled LIDAR LIDAR mount mount on mower A CAD model and the actual device after construction are shown in figures 7 and 8, respectively. The final design pivots about the mirror center to simplify the coordinate transform required. The outer axis of rotation pans the LIDAR 45 degrees to each side.

The inner axis tilts from 3 degrees above the horizon to 30 degrees below. The motion is generated using a crank rocker mechanism which vastly simplifies timing and control requirements. An inductive proximity sensor was added to each stage to home the device when it is first turned on. RE40 Maxon brushed DC motors with 74:1 gearboxes and encoders mounted on the motor shaft were used to drive each axis. A Dimension

Engineering Sabertooth 2x25 Motor Controller was used to drive the motors. Maxon motors are very low inductance motors by design, which means the motor controller will

28

drive a ripple current through the motor at the switched frequency, in our case 32 kHz.

This will dissipate a lot of heat in the motor windings, and the motors were getting quite hot. We added a 220 microHenry shunt inductor to solve the problem, and the motors are now cold to the touch while in operation. More details regarding the problem can be found in Appendix A.

The main mode of operation envisioned for the device was to run in a figure-eight pattern where the tilt axis runs twice as fast as the pan axis. This tilts the LIDAR vertically to the left, center and right of the mower. This is to be used during general mowing operation and will observe the fence, low obstacle, and moving obstacle from a distance.

3D LIDAR Sweep Mode Shape 50 40 30 20 10 0 Alpha -10 0 1 2 3 4 5 Beta

Angle (degrees) Angle -20 -30 -40 -50 Time (sec)

Figure 9: 3D LIDAR Euler angles plotted vs. time for the full sweep mode shape

29

Figure 10: Tilt (Beta) angle detail

Figure 11: Pan(Alpha) angle detail

30

Figure 12: Scan angle range (theta)

The secondary mode of operation is used for close edging. The pan axis turns the

LIDAR to the side the mower intends to edge. The tilt axis is run continuously as before to scan alternately between the grass and the obstacle.

CONTROL

The two must now be controlled such that both are in the correct position at the time of each scan update. It is important to know the set of positions that will be swept through prior to running the sensor in real time. It would be wasteful or even impossible to calculate all the sines and cosines necessary to convert the LIDAR scan data into the robot frame. Most of the multiplications necessary to perform the coordinate

31

transformation can also be precalculated and stored in a lookup table if the set of pan and tilt angles that will be scanned through are known.

The device is controlled with a PID on position and is chained to a PID on velocity. The velocity PID was tuned first to give good dynamic response for a step command in velocity. The position PID is used to lock the phase of the axes together and drive the steady state error of the ramped position commands to zero.

COORDINATE TRANSFORMATION

In order to make use of the LIDAR data, it must be transformed from the LIDAR frame and into the robot frame. This is accomplished by using a series of coordinate transformations.

When   0 and   0 , the LIDAR points straight ahead and parallel to the ground. As can be seen in figures 4 and 5, positive  angles pan the LIDAR to the left and positive

 angles tilt the LIDAR above the horizon. In figure 6, the range of scan angles can be seen. This coordinate system is fixed to the LIDAR. The L array is an array of 181 values representing the distance measured along each ray from  45 to 135 in half degree increments. The subscript denotes the reference frame, where 1 is fixed to the

LIDAR, 2 is fixed to the inner gimbal, 3 is fixed to the outer gimbal, and 4 is fixed to the robot coordinate system.

32

r L (,,)rz  (12) 1  0 i

This can be converted from its native cylindrical form to Cartesian coordinates.

r cos( ) L (x , y , z )  r sin( ) (13) 1  0 i

The coordinate transformation matrix to go from frame 1 to 2 and from 2 to 3 can be written as

1 0 0 A 0 cos( ) sin( ) (14) 12  0 sin( ) cos( )

cos( ) sin( ) 0 A  sin( ) cos( ) 0 (15) 23  0 0 1

Premultiplying these matrices with L transforms the coordinates from the LIDAR frame to the robot frame.

LAAL3 23 12 1 (16)

Giving us the vector as a function of r, ,  , and  .

rrcos cos  sin  cos  sin  L rrsin cos  cos  cos  sin  (17) 3  r sin sin

Which now just needs to be translated by the offsets down and back to the robot frame, located at the center of the rear axle on the ground plane.

33

rcos cos  r sin  cos  sin  xOffset L rsin cos   r cos  cos  sin   yOffset (18) 3  rsin sin zOffset

CALIBRATION

The motor position must now be mapped to the LIDAR tilt and pan angles. The motion of each axis is approximately sinusoidal, and this assumption could be made to find the

Euler angles from the motor position. However, the motion is not exactly sinusoidal since the connecting rods are of finite length. Also, there is a bit of phase lag between obtaining a scan from the LIDAR and the position of the gimbals. To compensate for these issues, a dynamic calibration technique was developed for the device.

To calibrate the tilt axis, the mower was positioned on a flat, horizontal plane with at least 30 meters of open space in front of the mower. The tilt axis was run continuously while the pan axis looked straight ahead. The LIDAR observes the ground directly in front of the mower. The center ten data points in each scan were averaged and this was used for the length of the hypotenuse of triangle in the diagram. The height of the

LIDAR above the ground is known. The tilt angle can be calculated for each scan, and the values where the LIDAR is looking above the ground can be found by interpolation.

34

Figure 13: Geometry for tilt axis calibration

1 h   sin  (19) r

A similar procedure is used to calibrate the pan axis. The robot is positioned directly facing a wall that is roughly one meter away. The pan axis is run while the tilt axis holds the LIDAR parallel to the ground plane. The pan angle can be found by fitting a line through the LIDAR data for each scan and finding the slope. The wall can be observed throughout the entire range, so no interpolation is necessary as was necessary for the tilt angle.

35

Figure 14: Geometry for alpha axis calibration

After making sure none of the data on the edges misses the intended wall, a linear fit is performed on each scan. The pan angle can then be calculated using the slope from the line fit.

y mx b (20)

 tan m (21)

RESULTS

A fully functional, accurately calibrated, 3D LIDAR was built and tested for use at the

2009 ION Autonomous Lawnmower competition. Figure 15 shows two pictures of sample output from the sensor. The left image is a top view and the right is as the mower would see the obstacles looking forward. The walls are very clearly visible and well defined. You can see the fence posts up against the right wall and the low segment of fence that extends further into the center of the hallway. The dog‟s legs are clearly seen 36

to the left.

Dog Fence

Dog Fence

Figure 15: 3D LIDAR data displayed in an intensity plot

For fun, I laid down in front of the mower and had it take a picture of me. You can see the floor to either side of me, my arms folded, and my head in Figure 16.

37

Figure 16: Photoshoot time

CHAPTER 5: ULTRASONIC SENSOR EVALUATION

Two ultrasonic sensors were to be evaluated to determine suitability for use on the mower. These sensors were the Devantech SRF05 and SRF235. The SRF05 is a low frequency model, at about 40 kHz, which gives it a much wider field of view. The

SRF235 runs at a much higher frequency of 235 kHz, which greatly limits its range down to just over a meter, but has a much narrower field of view. This sensor might be less sensitive to the grass and still be able to detect low obstacles. Perhaps we could sweep the sensor back and forth and get LIDAR-like scans, or just point it sideways and use it for edging.

38

SRF05

Figure 17: SRF05 Sensor Three cases were run to get a feel for the sensor‟s characteristics. The first two tests were carried out using a 2 ft wide by 4 ft high piece of plywood. The first case was to hold the board perpendicular to the line to the sensor origin. The second case was to hold the board parallel to the ultrasonic sensor‟s primary axis. The final case was to have a person stand in front of the sensor with their feet together and arms to their side. The results are plotted in Figure 18.

39

Devantech SRF05 sensor detectable area 20 18 16 Flat wall parallel to X 14 axis 12 10 8 Flat wall perpendicular 6 to sensor origin (best 4 case scenario) 2 Person standing 0 -10 -5 0 5 10 Distance (ft)

Figure 18: Edges of detectable area in an open room

The two cases using the plywood board demonstrates the SRF05‟s sensitivity to the angle of the surface presented towards the sensor. If the board is rotated so it is always perpendicular to the line towards the sensor origin, a wide cone is observable to the sensor. When the board is held perpendicular to the sensor‟s primary axis and translated to the side, the obstacle is only observable if placed directly in front of the sensor. This could be a problem if the robot approached a wall at an angle, as it would be complete invisible to the sensor.

A person presents a soft, contoured surface to the sensor, reducing the maximum observable range by roughly half. The detectable area was roughly 4 feet wide by 10 feet deep. This represents a reasonable safety buffer for a mower travelling at normal walking speeds. In simple environments it can tell you if something is there or not, and how far away, but not much more than that. The accuracy of the distance reported was very good, and moving the plywood just a few millimeters would be detected by the 40

sensor. With the correct scaling factor for the speed of sound, the measurements were very linear and accurate through its range. However, compensation for changes in the speed of sound may be necessary if this accuracy is to be maintained.

SRF235

We were very hopeful that this sensor could solve the obstacle sensing problem for the mower. By mounting the sensor to the servo and panning back and forth, we should have

LIDAR like data at less than ten percent of the price. The update rate and resolution will be much worse, but how well does it see obstacles?

The answer is not very well. Flat surfaces normal to the sensor are about all it can see.

An aluminum can is visible to the sensor most of the time, getting more reliable the closer the sensor is to the can. Standing in front of the sensor proved even less reliable, with the reflectivity dropping off substantially off of clothes and shoes. This sensor may do well following a wall, as long as the wall remains in a fairly straight line. If the robot approached the wall from more than 10 degrees, the sensor may never report the wall as a hit ad the robot will drive right into the wall.

SODAR (Sound Detection And Ranging)

A custom designed SODAR system has been built and tested by a senior project group at

Case Western Reserve University as a feasibility study of SODAR and autonomous lawnmowing. Instead of a classic ping and response SODAR system, a band-limited

(30kHz-60kHz) pink noise signal is transmitted continuously by an electrostatic transducer. The secondary transducer, a MEMS ultrasound microphone, is used to 41

continuously measure the response. A FPGA-based DSP platform designed for the project is used to cross correlate the two signals, resulting in multiple distance peaks.

Multiple obstacles were held in front of the prototype while capturing data. The corresponding cross correlation chart is shown in figure 19. The three dominant peaks at

.38m and .75m correspond to the ruler and notebook. The peak at 1.79m corresponds to the ceiling. More work will be done on this project as a graduate thesis to determine feasibility on a production robotic lawnmower.

Figure 19: Cross correlation chart for SODAR

POTENTIAL FOR FUTURE WORK

Basic pinging techniques do not seem to be a strong solution for obstacle sensing for our purposes. However, perhaps using multiple transducers and phased array techniques angular resolution and reliability would drastically improve. The limiting factor is that the transmission of ultrasonic frequency in air is much worse than water or skin and bone, where they are currently widely used for imaging. The SODAR project holds some promise to do this as well and may be able to create a 2D obstacle field well enough for use on the mower. 42

CHAPTER 6: CONCLUSIONS

The mechanical and electrical hardware for an autonomous lawn mower was developed for CWRU Cutter. Its path driver was developed, tested and tuned for use in relatively flat, grassy fields. A 3D LIDAR mount was developed and tested for capturing point cloud data in the area of interest in front of the mower. Two ultrasonic sensors were evaluated for potential use on future iterations of the mower. This work contributed towards the team‟s competition entry into the ION Autonomous Lawnmower

Competition, where we placed 2nd in 2008 and 1st in 2009.

Cutting the lawn is a mundane chore, but a necessary one to maintain a proper lawn. If a robot was given the task, you could sit back and relax as it did all the work. We showed that the technology is available to do the task, although a key component, the GPS system, is a very expensive limiting factor that is necessary to the function of the mower.

The level of technology and price tag is more appropriate for large scale operations such as farm equipment, where it is already on the market. In wide open areas, such as recreation fields, mowers could be used that have less accurate GPS receivers, at the risk of missing spots in the field. Alternative methods of localization are required to greatly reduce the price of a mower with the capabilities of CWRU Cutter. Localization using

RF beacons and vision-based odometry have been proposed and are being developed by the team.

Safety of such a system is very important, which remains a problem that is not yet solved.

DARPA urban challenge cars had to solve a similar problem and spent millions of dollars

43

on R&D and hardware. Keeping a residential lawnmower safe around obstacles and potentially people and pets relies on keeping the blades or strings well protected under the deck, and including robust bump sensors around the deck that immediately stop the mower. Keeping it small and lightweight also addresses this problem so it would only be able to bump into you rather than cause any serious injuries like a power wheelchair might be able to do. However, this does greatly increase the likelihood someone will simply walk off with your fancy new lawnmower.

Figure 20: No dogs were harmed in the making of this robot

44

APPENDIX A

A note on using low inductance motors such as these Maxon coreless, spiral wound motors with switched controllers. We noticed our motors were getting very warm under light loads and after burning up a motor driving in grass needed to look into the issue further. The controller relies on the inductance of the motor to limit AC ripple current and output smooth, continuous current flow through the motor. With this setup, we measured as much as 3.5 amps of AC current flowing through the motor with 0% output commanded. This equates to many watts of power being dissipated as heat when the motor is sitting idle, plus whatever would be generated in normal use. This is compounded by the fact that there is limited heat conduction from the windings to the motor case, making it difficult to keep cool. Our solution was to add a 220 microHenry shunt inductor in series with the motor with a rated continuous current of 20 amps. This dropped the idle current to essentially zero, and the motors were now cold to the touch.

45

REFERENCES

[1] “7 Secrets to a Perfect Lawn and Yard,” Consumer Reports, May 2008, pp. 23.

[2] Ritzmann, R.E., "The Neural Organization of Cockroach Escape and Its Role in

Context Dependent Orientation," Chapter VI in Biological Neural Networks in

Invertebrate Neuroethology and Robotics, R. Beer, R. E. Ritzmann, and T. Mckenna,

Eds.: Academic Press, 1993.

[3] Chen C., Quinn R., and Ritzmann R., "A Crash Avoidance System Based Upon the Cockroach Escape Response Circuit," in IEEE International Conference on Robotics and Automation (ICRA) Albuquerque, NM, USA, 1997.

[4] http://svnbook.red-bean.com/en/1.2/svn.advanced.locking.html

[5] http://en.wikipedia.org/wiki/Image:Kalman_filter_model.png

[6] Kalman, R.E. "A New Approach to Linear Filtering and Prediction Problems."

Transactions of the ASME--Journal of Basic Engineering D ser. 82 (1960): 35-45.

[7] Grewal, M., et. all. Global Positioning Systems, Inertial Navigation, and

Integration. 2. Hoboken, NJ: Wiley, 2008, pp. 394.

[8] Kanayama, Y. and Fahroo, F., “A New Line Tracking Method for Nonholonomic

Vehicles,” Proceedings of the 1997 IEEE International Conference on Robotics and

Automation, Albuquerque, New Mexico, April 1997, pp. 2910-2911.

[9] Kyodo America. Kyodo America - LawnBott - How LawnBott works. Kyodo

America - LawnBott. [Online] Kyodo America, 2009. [Cited: May 1, 2009.] http://www.lawnbott.com/products/howitworks/.

46

[10] RoboMow Canada. RoboMow Canada FAQ. RoboMow Canada - It Mows. You

Don't. [Online] Friendly Robotics, 2009. [Cited: May 1, 2009.] http://www.robomowercanada.com/faq.html.

[11] Friendly Robotics. Safety Warnings & Precautions. Safety Warnings & Precautions

- Friendly Robotics. [Online] Friendly Robotics, 2009. [Cited: May 1, 2009.] http://www.friendlyrobotics.com/cservice/manuals/?pg=1.

[12] Husqvarna: Over 100,000 Robotic Lawn Mowers sold. [Online]. Husvarna. 2009. http://corporate.husqvarna.com/index.php?p=ir&s=press&t=detail&afw_id=1142707&af w_lang=en.

[13] Meirovitch, Leonard. Methods of Analytical Dynamics. New York: Dover. 1998.

Print.

47