Non-Collocated Control of an Autonomous Vehicle-Trailer System Using State Estimation by Michael L. Payne A thesis submitted to the Graduate Faculty of Auburn University in partial ful llment of the requirements for the Degree of Master of Science Auburn, Alabama May 07, 2012 Keywords: state estimation, non-collocated control, autonomous vehicles Copyright 2012 by Michael L. Payne Approved by John Y. Hung, Co-Chair, Professor of Electrical and Computer Engineering David M. Bevly, Co-Chair, Albert Smith Jr. Professor of Mechanical Engineering Thaddeus A. Roppel, Associate Professor of Electrical and Computer Engineering Abstract In this work, the author develops an observer and non-collocated controller for a robot-trailer system in which only the position of the trailer is measured. A lin- earized state-space model of the system is derived using kinematic equations that have previously proven su cient for state feedback control. Optimal observer gains are cal- culated using the known measurement noise variance. Simulation results suggest that the non-collocated position measurements are su cient to accurately estimate the full system states while successfully regulating the trailer to the desired path. Experimen- tal results show that the estimator is capable of tracking the system states and that the robot and trailer system can be made to follow a typical geophysical surveying path. ii Acknowledgments This work was supported by the US Army Corps of Engineers. The author thanks his advising professors, who provided invaluable guidance; and David Hodo, whose extensive previous work on the vehicle discussed in this thesis made this research possible. iii Table of Contents Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iii List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi List of Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 Geophysical Surveying . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2 Autonomous Path-Following . . . . . . . . . . . . . . . . . . . . . . . 2 1.3 Autonomous Sensing Strategies . . . . . . . . . . . . . . . . . . . . . 3 1.4 A New Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 System Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1 System Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Parameter De nitions . . . . . . . . . . . . . . . . . . . . . . 5 2.1.2 Kinematic Model . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.1.3 Error Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1.4 Linearization and Matrix De nitions . . . . . . . . . . . . . . 8 3 Estimator Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.1 Simulation of the Estimator . . . . . . . . . . . . . . . . . . . . . . . 11 3.1.1 Estimator with Linear Plant . . . . . . . . . . . . . . . . . . . 12 3.1.2 Estimator with Nonlinear Plant . . . . . . . . . . . . . . . . . 13 3.2 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 4 Controller Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1 Selection of Control Method . . . . . . . . . . . . . . . . . . . . . . . 15 4.1.1 Feedback Gains . . . . . . . . . . . . . . . . . . . . . . . . . . 15 iv 4.2 Simulation of the Controller . . . . . . . . . . . . . . . . . . . . . . . 16 4.2.1 Controller with Nonlinear Plant . . . . . . . . . . . . . . . . . 17 4.2.2 Controller and Estimator with Linear Plant . . . . . . . . . . 17 4.2.3 Controller and Estimator with Nonlinear Plant . . . . . . . . 18 4.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5 Experimental Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.1 The AUXOS System . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 5.2 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.3 Open Loop Estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.4 Controller and Estimator . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.4.1 Controller Tuning via Monte Carlo Simulation . . . . . . . . . 24 5.4.2 Path Following Ability . . . . . . . . . . . . . . . . . . . . . . 25 5.4.3 State Estimate Accuracy . . . . . . . . . . . . . . . . . . . . . 27 5.4.4 Steady-State Controller Accuracy . . . . . . . . . . . . . . . . 29 5.4.5 Comparison with the Full State Feedback System . . . . . . . 30 6 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 6.1 E ectiveness of the State Estimator . . . . . . . . . . . . . . . . . . . 32 6.2 E ectiveness of the Control Algorithm . . . . . . . . . . . . . . . . . 33 6.3 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 6.3.1 Inclusion of Unmodeled Dynamic E ects . . . . . . . . . . . . 33 6.3.2 Design of a Reduced-Order Observer . . . . . . . . . . . . . . 34 6.3.3 Further Tuning of the LQR Controller . . . . . . . . . . . . . 34 6.3.4 Design of a Nonlinear Estimator and Controller . . . . . . . . 34 Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 A MATLAB code used to generate simulations . . . . . . . . . . . . . . . . 39 B SIMULINK model block diagrams . . . . . . . . . . . . . . . . . . . . . . 41 v List of Figures 1.1 Geophysical surveying system towed by a human operator . . . . . . . . 2 2.1 Kinematic model of the robot-trailer system . . . . . . . . . . . . . . . . 7 3.1 Estimation errors when tracking a linear plant model . . . . . . . . . . . 13 3.2 Estimation errors when tracking a nonlinear plant model . . . . . . . . . 14 4.1 Nonlinear plant response to the LQR controller . . . . . . . . . . . . . . 17 4.2 Nonlinear plant response to the combined estimator and controller . . . 18 4.3 State estimation errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.1 Autonomous geophysical surveying system described in this thesis . . . . 22 5.2 Open loop estimated and measured trailer lateral error . . . . . . . . . . 23 5.3 Open loop estimated and measured trailer heading error . . . . . . . . . 24 5.4 Screenshot of the trailer path (black) overlaid on top of the desired path (blue) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 5.5 Comparison of measured and estimated trailer lateral error during path regulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.6 State estimate errors versus time during path regulation . . . . . . . . . 28 5.7 System response when regulating to a line . . . . . . . . . . . . . . . . . 29 vi 5.8 A comparison between the full state feedback and state estimation methods 31 B.1 Simulation of the linear observer for the linear plant . . . . . . . . . . . 41 B.2 Simulation of the linear observer for the nonlinear plant . . . . . . . . . 42 B.3 Simulation of the LQR controller for the nonlinear plant . . . . . . . . . 42 B.4 Simulation of the combined observer and controller for the nonlinear plant 43 vii List of Tables 2.1 Robot and trailer system parameters . . . . . . . . . . . . . . . . . . . . 6 viii Chapter 1 Introduction 1.1 Geophysical Surveying In recent years, the application of geophysical surveying has grown signi cantly. For example, mapping of unexploded ordnance (UXO) could require surveying up to 10 million acres in the United States alone [1]. These surveys involve a variety of sensing systems that are carried or towed [2] by highly-trained personnel. These man-towed systems have their drawbacks: they are relatively slow, expensive for the amount of ground covered, and especially in the case of UXO surveying can expose the operators to signi cant danger. Remotely-driven ground vehicles [3] protect the operator from the danger of unexploded ordnance, and airborne surveying systems [4] can survey an area much faster than ground-based systems. But these methods are not without their limitations. Airborne surveys are expensive, impossible for smaller survey areas, and not suitable for some sensor technologies. Remotely-driven vehicles, while increasing safety, still require a human operator to drive them. In an e ort to reduce the cost, necessary personnel, and to more precisely follow survey paths, autonomous geophysical surveying systems have been designed that range in complexity from single vehicles following a pre-de ned path [5] to swarm systems [6] that can not only detect but also retrieve objects. Autonomous systems represent a tremendous step forward for geophysical surveying applications, but their use presents an entirely new set of challenges. 1 Figure 1.1: Geophysical surveying system towed by a human operator 1.2 Autonomous Path-Following Geophysical surveying often requires the complete surveying of a speci c area or collection of interesting regions. Coverage paths [7] are often used to cover an area and much research has been performed on their generation and e ciency. Real-time generation of trajectories between individiual points [8] allows for the connection of separate survey areas and waypoints but requires more computation e ort during operation. Once a survey path has been generated, the autonomous system must be controlled to track the path. Leader-follower systems have been proven e ective at following paths [9] but require a second actuated vehicle, considerably increasing the overall system cost and control complexity. Regulating lateral error from a path [10] both simpli es the overall control complexity and provides an e ective means of forcing a robot to follow a pre-de ned path. 2 1.3 Autonomous Sensing Strategies Regulating an autonomous robot to a path requires accurate measurements of the robot states, including but not limited to position, orientation, speed, and turn rate. Global-positioning system (GPS) receivers have relatively high position mea- surement errors [11], but di erential measurements between two or more sensor can signi cantly increase the accuracy of a path-following system [12]. GPS receivers also output velocity measurements that can be used to measure vehicle velocity to high accuracy [13] and have even been proven e ective for measuring vehicle side-slip [14] in applications where signi cant slip can occur. Blending GPS receiver measurements with inertial navigation systems (INS) results in a highly accurate measurement of vehicle movement and position due to the two systems having uncorrelated mea- surement errors [11]. Blended GPS/INS systems such as the NovAtel SPANTM are commercially available and not only improve position accuracy, but also allow for faster GPS signal reacquisition [15]. For geophysical surveying applications, the state of the towed sensor trailer is often more important than that of the robot. Hitch angle sensors can be used to directly measure [16] trailer heading when combined with robot heading information. However, noisy measurements of the hitch angle can decrease the accuracy of trailer heading calculations [16, 17]. Alternatively, the hitch angle can be estimated based on the combination of one or more other robot and trailer state measurements [18]. State estimation can not only accurately track the hitch angle, but can also result in a \smoother" reported hitch angle as compared with direct measurements [19]. This smoothed state estimate could be considered preferable for purposes of control, as it would result in a less erratic control e ort compared with a noisy state measurement. Alternatively, a blended GPS/INS system could be directly installed on the sensor trailer to directly measure position and heading [20], bypassing many of the problems associated with attempting to measure hitch angle and infer trailer orientation. But 3 the use of blended GPS/INS systems can signi cantly increase instrumentation costs compared with the use of a simpler GPS receiver. 1.4 A New Approach A review of the available literature makes it apparent that the problem of ac- curately controlling and measuring a towed trailer is complex, but not impossible. The direct instrumentation of the towed trailer can provide a controller with highly- accurate knowledge of the trailer states. However, the cost and complexity involved in instrumenting both the robot and trailer can be prohibitive for some applica- tions. In this work, the author explores the possibility of using a single GPS sensor mounted on the trailer to not only measure trailer lateral error from a path, but also estimate trailer heading and robot heading for the purposes of controlling the combined robot-trailer system. Nonlinear kinematic model equations are derived that describe the robot-trailer system and these equations are linearized around the path trajectory in order to achieve e ective path regulation [17]. Due to the numerous nonlinearities present in kinematic trailer models [21], unmodeled dynamic e ects may negatively a ect estimator and controller performance. However, the linearized kinematic model has proven su cient for state feedback control of the robot-trailer system being studied [5] and thus the author has reason to believe that it may also work for non-collocated state estimation and control of the same system. No direct measurements will be made of the robot or trailer yaw rates or lateral accelerations, unlike in [18]. The author believes that this is the rst time that a single non- collocated position sensor has been used to estimate robot and trailer system states as well as control a robot-trailer system to a survey path. This work has also been submitted for peer review to the 2012 IEEE International Conference on Industrial Informatics (INDIN-2012, Beijing, China) [22]. 4 Chapter 2 System Model Previous work developed an autonomous vehicle to tow geophysical sensor arrays for customers using a linear controller with full state feedback [5, 20]. The author uses this system as a research platform to explore the possibility of controlling the vehicle with a reduced sensor package while still maintaining accurate knowledge of the towed sensor position, which is of the utmost importance to the geophysical surveying customer. In this thesis, the robot steers by di erential drive of the left and right wheels. The robot speed is constant. 2.1 System Model Before an estimator and controller can be designed, a mathematical model of the robot-trailer system must be developed. This model will ignore dynamic e ects such as momentum and slip, as previous work [5] has shown a purely kinematic model can be su cient for system control at low speeds. 2.1.1 Parameter De nitions The parameters used to describe the robot-trailer system need to be de ned before any equations are presented. Table 2.1 shows the system parameters and their de nitions, with values where applicable. In the current con guration of the robot- trailer system being studied, the robot speed is kept constant. Trailer speed matches robot speed on straight lines, but is slightly less than robot speed when turning. 5 Table 2.1: Robot and trailer system parameters Variable Description Value Lt Length of trailer tongue 3.495 m Lr Length of robot hitch 0.0 m Vt Speed of trailer Vr Speed of robot 1.3 m/s te Heading error of trailer re Heading error of robot yte Lateral position error of trailer tact Actual heading of trailer ract Actual heading of robot ytact Lateral position of trailer tdes Desired heading of trailer rdes Desired heading of robot ytdes Desired lateral position of trailer !r Yaw rate of robot and system input 2.1.2 Kinematic Model Figure 2.1 shows a kinematic diagram of the robot-trailer system being studied. From this diagram, a set of continuous-time nonlinear dynamic equations can be derived for the trailer lateral position, trailer heading, and robot heading _yt = Vt sin( t) (2.1) _ t = Vr Lt sin( t r) Lr Lt!r cos( t r) (2.2) _ r = !r: (2.3) Since the error states have been proven to be equal to the actual states, these equations also de ne the error states. From these equations one can see the non-collocated aspect of the system: the position and heading of the trailer is what is ultimately being controlled, but the only input to the system is the yaw rate of the robot, !r. 6 nullnull nullnull null null nullnull nullnull null nullnull nullnull nullnull Figure 2.1: Kinematic model of the robot-trailer system 2.1.3 Error Model To simplify the control algorithm, an error model is created that de nes the system states as being the di erence between the actual value and a desired value, de ned as: yte = ytdes ytact (2.4) te = rdes tact (2.5) re = rdes ract (2.6) With this model, regulating the error states to zero will force the vehicle to follow the desired path. This model avoids the need for reference scaling techniques. To further simplify the control of the system, the survey paths are transformed using a nonlinear transform [5] to appear as a straight line at 0 meters Easting, moving in the north direction. If the heading in the north direction is de ned as 0 radians, 7 the desired values become ytdes = 0 (2.7) tdes = 0 (2.8) rdes = 0 (2.9) and therefore yte = ytact (2.10) te = tact (2.11) re = ract: (2.12) 2.1.4 Linearization and Matrix De nitions Though techniques exist for designing stable control laws and estimators for nonlinear systems, it is far easier to ensure stability for a linear system of the form _x = Ax(t) +Bu(t) (2.13) y(t) = Cx(t) +Du(t) (2.14) where x(t) is the state vector and y(t) is the system output [23,24]. To linearize the nonlinear system model, the Jacobian of the nonlinear equations is calculated and evaluated at the equilibrium point xe = 2 66 66 4 0 m 0 rad 0 rad 3 77 77 5 ; (2.15) 8 which corresponds to the state of the robot-trailer system when it is travelling along the transformed survey path. This linearization produces the state space matrices A = 2 66 66 64 0 Vt 0 0 VrL t Vr Lt 0 0 0 3 77 77 75 B = 2 66 66 64 0 LrL t 1 3 77 77 75 C = 1 0 0 D = 0 : (2.16) The C matrix is determined by the characteristics of the system outputs. In the method being developed in this thesis, only the position of the trailer is being mea- sured by a single global position system (GPS) receiver. Thus the only measured state is x1, or the lateral error of the trailer. The input to the system, !r, does not directly a ect the output so the D matrix is zero. 9 Chapter 3 Estimator Design Since only trailer lateral error is being measured, variables x2 and x3 must be estimated in real time for full state feedback control. The linearized system meets the observability criterion and thus a linear state space estimator can be designed to estimate the unknown states. The estimator has the form _^x = A^x(t) +Bu(t) +L(y(t) C^x(t)) (3.1) ^y(t) = C^x(t) (3.2) where ^x(t) and ^y(t) are estimates of the states and output, respectively, and matrix L being a set of gains on the output error y(t) C^x(t) [23,24]. If the eigenvalues of the matrix A LC are in the left half of the s-plane, the estimator will be stable and the estimates will converge to the true states in exponential time. Measurement Characteristics To improve estimator performance, the noise characteristics of the output mea- surement must be considered. In the system being studied, the position of the trailer is being measured by a single GPS receiver that is receiving real-time kinematic (RTK) corrections from a nearby GPS base station. These corrections allow the trailer GPS receiver to measure its position with an accuracy of 1 = 0:02 meters. The variance of this measurement, 2 = 0:0004, can be used to calculate the estimator gains. 10 Estimator Gains Though many methods exist for calculating estimator gains, the steady-state Kalman method is chosen to compensate for the measurement noise of characteristic R = 2 = 0:0004. The calculation of steady-state Kalman gains requires knowledge of any process disturbance Q in order to determine the relative con dence in the system model and output measurements. However, an accurate value of Q is unknown for the system being studied, and thus Q is used as a tuning parameter to adjust the estimator gains to achieve the best performance. Using the kalman() method in MATLABR , steady-state Kalman gains L were calculated for a Q of 0:001, resulting in the estimator gain matrix L = 2 66 66 64 1:50628 0:87264 1:58114 3 77 77 75 (3.3) and estimator eigenvalues of s = 2 66 66 64 0:469 +|0:770 0:469 |0:770 0:941 3 77 77 75: (3.4) Since these poles all lie in the left-half s-plane, the linear estimator is considered stable. 3.1 Simulation of the Estimator To con rm that the steady-state Kalman estimator is capable of accurately track- ing the state x(t), the estimator is simulated with both the linear and the nonlinear plant models. A white Gaussian noise with 2 = 0:0004 is added to the output of the 11 plants to simulate the noisy measurements, and a white Gaussian noise with 2 = 0:01 is added to the plant inputs to simulate the process disturbance. The input to the system is a step of amplitude 2 and the plant has initial conditions x0 = 2 66 66 64 0:2147 m 0:4249 rad 0:3906 rad 3 77 77 75: (3.5) Since the estimator will have access to GPS measurements when the system begins operation, the estimator has initial states ^x0 = 2 66 66 64 x0(1) 0 0 3 77 77 75: (3.6) 3.1.1 Estimator with Linear Plant Linear estimator theory states that, if the poles of the estimator A LC are stable, the estimator should be able to accurately track the linear plant state in nite time. To con rm the theory, the estimator is simulated with the open loop continuous- time linearized system plant. Figure 3.1 shows that the estimator is indeed able to track the state of the linear plant. Since the model equations of the estimator and the plant are identical and the poles of A LC are stable, this result is to be expected. Recall that the initial conditions of the estimator included knowledge of yt but no knowledge of t or r. The plot shows that the initially-correct estimate of yt is pulled away from the true value by the incorrect estimates of t and r. This behavior is due to model equations, in which yt is dependent upon t, which is in turn a ected by itself and r. Errors in these estimates create an error in the yt estimate that takes approximately six seconds for the estimator to eliminate. 12 0 1 2 3 4 5 6?0.5 0 0.5 1 Time (s) Estimate Error (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 3.1: Estimation errors when tracking a linear plant model 3.1.2 Estimator with Nonlinear Plant Simulating the open loop nonlinear system yields more insight into estimator performance. In this simulation, the estimator does not have a completely accurate model of the plant dynamics and is instead using a linearized version of the plant. As Figure 3.2 shows, the ability of the estimator to track the nonlinear plant is nearly identical to the performance in the linear case. 3.2 Conclusions These simulation results seem to indicate that a linearized estimator should be su cient to estimate the full system states with an acceptable degree of accuracy, thus making a more advanced estimator implementation such as an Extended Kalman Filter (EKF) or particle lter unnecessary. 13 0 1 2 3 4 5 6?0.5 0 0.5 1 Time (s) Estimate Error (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 3.2: Estimation errors when tracking a nonlinear plant model 14 Chapter 4 Controller Design Now that the designed estimator has been shown to be capable of tracking the system states, a controller must be designed that regulates the robot-trailer system to the desired survey path. This controller must not only be stable, but it must also be capable of regulating the system to the path in an acceptable time period for practical geophysical surveying. 4.1 Selection of Control Method Previous works have used pole placement [5] to design a stable state feedback controller. This method is perfectly acceptable for designing a stable linear controller, but it does not allow for intuitive tuning of control e ort for individual error variables. To satisfy this design preference, a linear quadratic regulator (LQR) controller is designed in order to precisely control the relative importance of regulating estimation errors in trailer lateral error and the two headings errors. 4.1.1 Feedback Gains A LQR controller uses a state feedback input of the type u = Kx, where K is calculated to minimize the cost function J(u) = Z 1 0 xTQx +uTRu dt: (4.1) The matrices Qx and Ru are used to assign weights to the system variables and to the input, respectively [24]. A higher weight value for a state variable results in 15 a larger control e ort directed toward that variable, and a higher weight value for the input represents a penalty for large system inputs. In the system being studied, the regulation of the measured trailer position error from the path is of the utmost importance and the highest weight is therefore assigned to that variable. The resulting weighting matrices are Qx = 2 66 66 64 1000 0 0 0 1 0 0 0 1 3 77 77 75 Ru = 1 : (4.2) The low weight on the input, !r, may result in an excessive turn rate being com- manded to the robot. Using these weighting matrices results in closed loop controller eigenvalues s1 = 2:559 (4.3) s2 = 1:279 +|2:083 (4.4) s3 = 1:279 |2:083: (4.5) Simulation should yield some insight into the practicality of the system performance resulting from these weighting matrix choices. 4.2 Simulation of the Controller Before combining the controller with the estimator, the controller must rst be shown to be capable of regulating the system to the desired path. A simulation is performed that uses the same initial conditions as the previous simulations. 16 0 0.5 1 1.5 2 2.5 3 3.5 4 ?0.4 ?0.2 0 0.2 0.4 0.6 0.8 1 Time (s) System Response (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 4.1: Nonlinear plant response to the LQR controller 4.2.1 Controller with Nonlinear Plant LQR control theory says that the calculated gains K for the state feedback equations u = Kx should yield a stable system response for a linear plant. No guarantee can be made for the original nonlinear plant, but Figure 4.1 shows that the system response is stable for thsi set of initial conditions.. 4.2.2 Controller and Estimator with Linear Plant The separation principle [25] states that a stable estimator and stable controller can be designed separately and when combined in the form ^_x = [A LC BK]^x+Ly (4.6) ^y = C^x (4.7) 17 0 1 2 3 4 5 6 7 8 9?1 ?0.5 0 0.5 1 1.5 2 Time (s) System Response (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 4.2: Nonlinear plant response to the combined estimator and controller will yield a stable feedback controller that is able to accurately track the system state in exponential time. As the estimator and controller designs have already been shown to be stable for the linear case, the separation principle makes a combined simulation with the linear system plant unnecessary. 4.2.3 Controller and Estimator with Nonlinear Plant However, the separation principle only applies to the linear plant case and makes no statements regarding stability when a nonlinear plant is considered. Figure 4.2 shows the nonlinear system response to the combined estimator and controller. Notice that the regulation to the path takes longer than in full state feedback case of Fig- ure 4.1. This extended regulation period is due to initial errors in the state estimates that thwart the e orts of the controller. A plot of the state estimate errors, de ned as x ^x, is shown in Figure 4.3. The time needed for the estimator to accurately track the system states is almost identical to that of the open-loop case because the core 18 0 1 2 3 4 5 6 7 8 9?0.6 ?0.4 ?0.2 0 0.2 0.4 0.6 0.8 Time (s) Estimate Error (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 4.3: State estimation errors dynamics remain unchanged: measurements are made of the lateral error, yt, and these measurements are used to calculate the three system states. But when the con- troller tries to regulate the system using state feedback, it is initially using incorrect estimates and thus has some di culty. However, the estimates are not so incorrect as to make progress toward regulation impossible and the system performance improves as the estimates improve, so regulation can and does occur. 4.3 Conclusions A stable LQR controller has been designed that is capable of regulating the robot- trailer system to the desired path in simulation, even when using initially incorrect state estimates. These results are encouraging, but experiments must be performed to con rm that the actual robot-trailer system will perform similarly to the simulations. Neither plant model took into account dynamic e ects such as slip or momentum, 19 and the vehicle may not be able to perform the commanded yaw rates, !r, that the controller produces. 20 Chapter 5 Experimental Results 5.1 The AUXOS System The Autonomous UneXploded Ordnance Surveyor (AUXOS) system is built upon a Segway Robotics Mobility Platform (RMP) 400. This four-wheeled, di erential- drive platform is rugged enough to traverse the types of terrain typically involved in unexploded ordnance (UXO) surveys and has ample payload capacity for electron- ics [26]. Communication with the robot is achieved via a radio link to the operator control unit (OCU). A NovAtel SPANTM Global Navigation Satellite System/Inertial Navigation System (GNSS/INS), which uses real-time kinematic (RTK) position cor- rections from a surveyed global-positioning system (GPS) base station, provides ac- curate knowledge of the vehicle position and orientation in the global reference frame. A rotary encoder attached to a trailer hitch extending up from the center of the ve- hicle provides knowledge of the angle of a towed trailer with respect to the heading of the robot. If the length of the trailer tongue is known, the position and orien- tation of the towed sensor array can then be calculated. As previously mentioned, the encoder is not used in this thesis (except for validation of estimates). The trailer frame is constructed of berglass to minimize geophysical sensor interference and a single Novatel GPS antenna is mounted in the center of the trailer. This antenna is used to measure the trailer lateral error from the desired path and is the only sensor used by the algorithm developed in this thesis. The trailer lateral error is found by calculating the perpendicular distance from the current trailer position to the current survey path line segment. 21 Figure 5.1: Autonomous geophysical surveying system described in this thesis Figure 5.1 shows the AUXOS system. The AUXOS system is an ideal experi- mental platform for this research, as its onboard sensors allow for some measure of \truth" when analyzing the controller developed in this work. Also, the onboard sen- sors allow for a direct comparison between the single-GPS method developed in this work and the combination of SPANTM and rotary encoder that was previously used to determine trailer position. This comparison will be useful for analysing performance of the developed controller. 5.2 Experimental Setup Experiments were performed at the eld immediately adjacent to the Auburn University Solar House. The AUXOS system was used as the experimental platform, and an approximately 100-by-30 meter survey grid was created to test the ability of the controller to regulate the robot-trailer system to the desired survey path. 22 0 5 10 15 20 25 30 35 40 0 0.05 0.1 0.15 0.2 Time (s) Trailer Lateral Error (m) Measured Estimated Figure 5.2: Open loop estimated and measured trailer lateral error 5.3 Open Loop Estimator Before implementing the full controller and estimator on the experimental plat- form,the estimator was tested on the full state feedback system developed in [5]. The system autonomously followed a survey path using robot position, robot heading, and hitch angle measurements, while the estimator attempted to estimate the sys- tem state using only trailer position measurements. Figure 5.2 shows a plot of the estimated and measured trailer lateral error. The estimator starts with perfect initial knowledge of the lateral error, but the estimate is pulled incorrect due to the errors in the initial trailer and robot heading estimates. As these estimates improve, the lateral error estimate quickly tracks the actual values to a high degree of accuracy. But accurately estimating the trailer lateral error is relatively simple, as this state is the one being directly measured. Examining the estimated trailer heading shows the ability of the estimator to track states that are not directly measured. Figure 5.3 23 0 5 10 15 20 25 30 35 40 45 50?0.08 ?0.06 ?0.04 ?0.02 0 0.02 0.04 0.06 0.08 Time (s) Trailer Heading Error (rad) Measured Estimated Figure 5.3: Open loop estimated and measured trailer heading error shows the ability of the estimator to quickly track trailer heading error. The general curve of the trailer heading error is tracked well by the estimator, and the ltering e ect of the estimation provides a much \cleaner" knowledge of the trailer heading error. The open loop results are encouraging, and suggest that the linearized model does seem to prove su ciently accurate to allow for full state estimation. 5.4 Controller and Estimator 5.4.1 Controller Tuning via Monte Carlo Simulation Initial experiments using the combined controller and estimator showed that the controller oscillated in steady-state, indicating marginal system stability. In an e ort to improve the LQR controller design, a Monte Carlo simulation was developed and performed. This simulation generated 1,000 random Qx weighting matrices and sub- sequent LQR controller gains, then simulated the combined controller and estimator 24 for a random set of initial conditions. Steady-state statistics of the trailer lateral error variable such as standard deviation, mean, and maximum were then plotted. Promis- ing con gurations were then simulated for a range of random initial conditions to test their viability. An LQR design was found that seemed to show improved steady-state stability over the original design. This new design had weighting matrices Qx = 2 66 66 64 949 0 0 0 174 0 0 0 1:9 3 77 77 75 Ru = 1 (5.1) which resulted in controller eigenvalues s1 = 2:306 (5.2) s2 = 1:553 +|2:013 (5.3) s3 = 1:553 |2:013: (5.4) By increasing the weight for the trailer heading error variable, the new controller design focuses slightly less on regulating the trailer to the path and slightly more on aligning the trailer heading with the path direction. 5.4.2 Path Following Ability The combined controller and estimator was implemented on the experimental platform and the vehicle was instructed to follow a pre-de ned survey path. To test the ability of the controller to regulate to the path, the trailer was positioned at a non-zero lateral error from the path. Figure 5.4 shows the path of the trailer overlaid on top of the desired path. Not only is the trailer regulated to the desired survey path line segments, but the controller is also able to track the various curve shapes present in the path. As the non-linear model was linearized around the line segment 25 Figure 5.4: Screenshot of the trailer path (black) overlaid on top of the desired path (blue) 26 0 10 20 30 40 50 60?0.5 ?0.4 ?0.3 ?0.2 ?0.1 0 0.1 0.2 0.3 0.4 Time (s) Trailer Lateral Error (m) Measured Estimated Figure 5.5: Comparison of measured and estimated trailer lateral error during path regulation trajectories, the ability of the controller to regulate the trailer around the curves is a testament to the e ectiveness of the LQR controller. 5.4.3 State Estimate Accuracy However, the ability of the controller to regulate to the path is of little conse- quence to the geophysical surveying client if the system state is not being accurately estimated. In Figure 5.5, the measured and estimated trailer lateral errors are plot- ted versus time. The peaks of the initial oscillations are di cult for the estimator to track, as the dynamics of the trailer when turning undoubtedly contain nonlinear and unmodeled e ects unavailable to the linearized model. But as the oscillations dampen and the trailer reaches a steady-state of negligible lateral error, the discrep- ancies between estimates and measurements approach zero and the estimator appears to track the true values of the system. As the trailer lateral error is the only variable 27 0 10 20 30 40 50 60?0.8 ?0.6 ?0.4 ?0.2 0 0.2 0.4 Time (s) Estimate Error (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 5.6: State estimate errors versus time during path regulation being directly measured, this result in unsurprising. The real question concerns the ability of the estimator to track the trailer and robot heading errors, neither of which is directly measured. Figure 5.6 shows an enlarged view of the three state estimate errors versus time. The accuracy of the trailer heading error estimate closely mirrors that of the trailer lateral error estimate, which is to be expected due to their strongly intertwined dy- namics. The robot heading error estimate, while initially almost three times less accurate than the trailer state estimates, is eventually able to track the true state after approximately 35 seconds. It might be expected that the robot heading error estimate would be more accurate due to the state variable dynamic equation being based solely on the system input, !r. However, delays in input response and dynamic e ects such as robot momentum and slip are unaccounted for in the linearized model. Therefore future attempts to incorporate these dynamics may very well yield more accurate robot state estimates. 28 0 10 20 30 40 50 60?0.5 ?0.4 ?0.3 ?0.2 ?0.1 0 0.1 0.2 0.3 0.4 Time (s) System Response (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) Figure 5.7: System response when regulating to a line 5.4.4 Steady-State Controller Accuracy The regulator has been shown capable of following the survey path and accurately tracking the system states, but the steady-state response of the controller remains an important factor in analysing design e ectiveness. Figure 5.7 shows the full system response as the controller attempts to regulate the robot-trailer system to a line. Initial large oscillations, exacerbated by estimate errors, soon dampen down into a stable steady-state response that accurately tracks the line to within 2 centimeters of lateral error. As the standard deviation, 1 , of the GPS measurement noise is 2 centimeters, this regulation is considered more than acceptable. Though the controller forces the robot to perform initially aggressive maneuvers when attempting path regulation, the response shows that the model of the robot is close enough that unmodeled dynamic e ects do not prevent successful regulation. 29 5.4.5 Comparison with the Full State Feedback System To put the performance of the combined estimator and controller in perspective, it is helpful to examine a comparison between its performance and the performance of a system using full state feedback. Figure 5.8 shows a comparison between the non- collocated method developed in this thesis and a full state feedback method measuring robot position, robot heading, and hitch angle developed in previous work. While the steady-state behavior of both methods seems similar, the state estimation method requires signi cantly longer time to regulate to the path than the full state feedback method. However, the smoothed trailer state estimates may be more desirable to the geophysical surveying client than quick regulation to the survey path achieved by the full state feedback system. 30 0 10 20 30 40 50 60 ?0.6 ?0.5 ?0.4 ?0.3 ?0.2 ?0.1 0 0.1 0.2 0.3 0.4 Time (s) System Response (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) (a) Full state feedback 0 10 20 30 40 50 60 ?0.5 ?0.4 ?0.3 ?0.2 ?0.1 0 0.1 0.2 0.3 0.4 Time (s) System Response (SI units) trailer lateral error (m) trailer heading error (rad) robot heading error (rad) (b) State estimates Figure 5.8: A comparison between the full state feedback and state estimation meth- ods 31 Chapter 6 Conclusions The experimental results verify the conclusions reached from the simulations. The non-collocated position measurements are su cient for a linearized model to track the robot-trailer system variables to an acceptable degree of accuracy, and the LQR controller is capable of using these state variable estimates for feedback control of the system to a desired survey path. The author believes that this is the rst time that an observer using a single non-collocated sensor has been shown capable of estimating and controlling a robot-trailer system. Unlike [18], no measurements were made of robot or trailer yaw rates or lateral accelerations. 6.1 E ectiveness of the State Estimator The state estimator is able to track the trailer and robot state variables within 40 seconds of beginning operation, as seen in Figure 5.6. Though the simulations predicted accurate state tracking in less than 10 seconds, the unmodeled dynamic e ects present in the experimental system clearly have a negative impact on estimator performance. Despite these de ciencies, the estimator is able to use a model linearized around the ideal path-following trajectory to accurately track the system states in nite time. In fact, the ltering or \smoothing" e ect of the estimator results in less noisy recorded system states, a feature which may be preferable to a geophysical surveying client. 32 6.2 E ectiveness of the Control Algorithm As with the state estimator, the LQR controller was shown to be capable of accurately regulating the robot-trailer system to the desired survey path despite the de ciencies of the linearized system model. The tuning of the LQR weighting matrices to greatly penalize trailer lateral errors seems to allow the system to track the survey path on curves and to within 2 centimeters of the desired value on straight line segments. This accuracy is judged to be more than acceptable for survey grids that can often cover hundreds of square meters in area. 6.3 Future Work The linear controller and estimator have been shown to be capable of accurately following a survey path and tracking the system states, but numerous improvements might be made to the algorithm designs to account for system dynamics during turns or for the e ects caused by initially large estimate errors. 6.3.1 Inclusion of Unmodeled Dynamic E ects As discussed in Chapter 2, the derived system model is based on only kinematic relationships. While a kinematic model is relatively simple and often su cient for control purposes, the exclusion of dynamic e ects can have a negative impact on the controller and estimator performance. Future work will include the modeling of input delays and the speed at which the robot is able to achieve the desired yaw rates. Modeling these dynamics may improve the ability of the estimator to track the robot and trailer heading errors and reduce the inaccuracy of the trailer lateral error estimates when the trailer is turning. 33 6.3.2 Design of a Reduced-Order Observer Though the trailer lateral error was directly measured in this work, the full-order observer estimated this variable long with the robot and trailer heading errors. Future work could look to utilize a reduced-order observer to directly use the trailer lateral error measurements and only estimate the other two variables. This design may result in reduced computation load and a more accurate knowledge of trailer lateral error, as the estimate error produced by the dynamics of the robot-trailer system resulted in imprecise knowledge of the trailer position. 6.3.3 Further Tuning of the LQR Controller The LQR controller tunings discussed in Chapter 4, the LQR weighting matrices were heavily weighted toward eliminating trailer lateral error with relatively insignif- icant importance placed on trailer and robot heading errors. Di erent combinations of these weight values were extensively explored during the design process, but it is believed that a combination exists that can substantially reduce the oscillations seen in the system responses. Attempts at placing a penalty on system inputs were explored, and it remains possible that slightly limiting commanded yaw rates would results in a more gradual regulation with less oscillation. 6.3.4 Design of a Nonlinear Estimator and Controller Finally, the ideal controller and estimator could include the full nonlinear dy- namic equations in their models, allowing for highly-accurate tracking of the system states and calculation of system inputs. Techniques exist for designing su ciently stable nonlinear controllers, and much research has been performed on using nonlin- ear estimators to track system states. Future work will involve converting one or both designs to a nonlinear model and exploring improvements in system response. 34 Bibliography [1] B. Delaney and D. Etter, \Report of the Defense Science Board Task Force on Unexploded Ordnance," Defense Sci. Board, Washington, DC, Final Tech. Rep. A, vol. 79914, 2003. [2] H. Nelson and J. McDonald, \Multisensor towed array detection system for UXO detection," IEEE Transactions on Geoscience and Remote Sensing, vol. 39, no. 6, pp. 1139{1145, 2001. [3] H. Zafrir, Y. Bregman, D. Wolf, and S. Hershler, \Super-sensitive, real time and wide coverage, all terrain ground robotic and hand held systems for mine and UXO detection and mapping," in Second International Conference on the Detection of Abandoned Land Mines, Oct. 1998, pp. 208 {212. [4] A. Fijany, J. Collier, and A. Citak, \Recent advances in unexploded ordnance (UXO) detection using airborne ground penetrating SAR," in Proceedings of 1999 IEEE Aerospace Conference, vol. 3, 1999, pp. 429 {441 vol.3. [5] D. Hodo, \Development of an autonomous mobile robot-trailer system for UXO detection," Master?s thesis, Auburn University, 2007. [6] C. DeBolt, C. O?Donnell, C. Freed, and T. Nguyen, \The BUGS \Basic UXO Gathering System" project for UXO clearance & mine countermeasures," in Pro- ceedings of the 1997 IEEE International Conference on Robotics and Automation, vol. 1, Apr. 1997, pp. 329 {334. [7] H. Choset, \Coverage for robotics|A survey of recent results," Annals of Math- ematics and Arti cial Intelligence, vol. 31, no. 1, pp. 113{126, 2001. [8] C. Ferraresi, G. Quaglia, and G. Gherlone, \Real time trajectory generation for vehicle position control," in 2002 IEEE International Conference on Industrial Technology (IEEE ICIT ?02), vol. 1, 2002, pp. 169 { 174 vol.1. [9] T. Ng, J. Guzman, and M. Adams, \Autonomous vehicle-following systems: A virtual trailer link model," in 2005 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2005). IEEE, 2005, pp. 3057{3062. [10] F. Lamiraux, S. Sekhavat, and J. Laumond, \Motion planning and control for Hilare pulling a trailer," IEEE Transactions on Robotics and Automation, vol. 15, no. 4, pp. 640{652, 1999. 35 [11] J. Weston and D. Titterton, \Modern inertial navigation technology and its application," Electronics Communication Engineering Journal, vol. 12, no. 2, pp. 49 {64, Apr. 2000. [12] D. Bevly and B. Parkinson, \Carrier-phase di erential gps for control of a tractor towed implement," in Proceedings of the 13th International Technical Meeting of the Satellite Division of The Institute of Navigation (ION GPS 2000), 2000, pp. 2263{2268. [13] D. Bevly, J. Gerdes, C. Wilson, and G. Zhang, \The use of GPS based velocity measurements for improved vehicle state estimation," in Proceedings of the 2000 American Control Conference, vol. 4, 2000, pp. 2538 {2542 vol.4. [14] R. Daily and D. M. Bevly, \The use of GPS for vehicle stability control systems," IEEE Transactions on Industrial Electronics, vol. 51, no. 2, pp. 270 { 277, Apr. 2004. [15] S. Kennedy, J. Hamilton, and H. Martell, \Architecture and system performance of SPAN - NovAtel?s GPS/INS solution," Proceedings of IEEE/ION PLANS 2006, pp. 23{25, 2006. [16] D. W. Hodo, J. Y. Hung, D. M. Bevly, and D. S. Millhouse, \Analysis of Trailer Position Error in an Autonomous Robot-Trailer System With Sensor Noise," in IEEE International Symposium on Industrial Electronics (ISIE 2007). IEEE, 2007, pp. 2107{2112. [17] A. W. Divelbiss and J. Y. Wen, \Trajectory tracking control of a car-trailer system," IEEE Transactions on Control Systems Technology, vol. 5, no. 3, pp. 269 {278, May 1997. [18] L. Chu, Y. Fang, M. Shang, J. Guo, and F. Zhou, \Estimation of Articulation Angle for Tractor Semi-trailer Based on State Observer," in 2010 International Conference on Measuring Technology and Mechatronics Automation (ICMTMA), vol. 2, Mar. 2010, pp. 158 {163. [19] T. Kailath, Linear Systems. Prentice-Hall Englewood Cli s, NJ, 1980, vol. 1. [20] D. W. Hodo, J. Y. Hung, D. M. Bevly, and S. Millhouse, \E ects of sensor placement and errors on path following control of a mobile robot-trailer system," in 2007 American Control Conference (ACC?07). IEEE, 2007, pp. 2165{2170. [21] M. Park, W. Chung, M. Kim, and J. Song, \Control of a mobile robot with passive multiple trailers," in Proceedings of the 2004 IEEE International Con- ference on Robotics and Automation (ICRA ?04), vol. 5, Apr. 2004, pp. 4369 { 4374 Vol.5. 36 [22] M. L. Payne, J. Y. Hung, D. M. Bevly, and B. J. Selfridge, \Control of a robot- trailer system using a single noncollocated sensor," in review for 10th IEEE In- ternational Conference on Industrial Informatics (INDIN-2012), Beijing, China, July 2012, p. 6. [23] R. C. Dorf and R. H. Bishop, Modern Control Systems. Pearson Prentice Hall, 2008. [Online]. Available: http://books.google.com/books?id=V-FpzJP5bEIC [24] W. L. Brogan, Modern Control Theory. Prentice Hall, 1991. [Online]. Available: http://books.google.com/books?id=OPFQAAAAMAAJ [25] R. F. Stengel, Optimal Control and Estimation, ser. Dover Books on Advanced Mathematics. Dover Publications, 1994. [Online]. Available: http://books.google.com/books?id=jDjPxqm7Lw0C [26] H. Nguyen, \Segway robotic mobility platform," DTIC Document, Tech. Rep., 2004. 37 Appendices 38 Appendix A MATLAB code used to generate simulations %% % Mike Payne % August 2011 % Single-GPS Robot-Trailer Regulator Simulation %% clear all; close all; % System Constants Lr = 0; %Robot Tongue Length Lt = 3.495; %Trailer Tongue Length % User Settings Vr = 1.3; %Robot Speed Xo = [0.2147; -0.4249; 0.3906]; %Initial System Conditions Xe = [0;0;0]; %Equilibrium Point Xo_est = [Xo(1,1);0;0]; %Initial Estimator Conditions Uo = 0; %Initial System Input Ue = 0; %Input Equilibrium Point %Trailer speed at equlibrium point Vt = Vr*cos(Xe(2,1) - Xe(3,1)) - Lr*Ue*sin(Xe(2,1)-Xe(3,1)); % Tuning Parameters GPS_Std_Dev = 0.02; %1-sigma from RTK corrections R = GPS_Std_Dev^2; %Measurement variance Ts = 0.04; %Sample period Qc = .01; %Process disturbance variance, used as a tuning parameter % Linearized System Model A = [0,Vt,0;0,-Vr/Lt,Vr/Lt;0,0,0]; B = [0;-Lr/Lt;1]; C = [1,0,0]; D = 0; Qn = Qc; Rn = R; 39 plant = ss(A,B,C,D); %Conversion to state-space object % Continuous Estimator Design - kalman() poles [KEST,L,P] = kalman(plant,Qn,Rn); % Linear Estimator Model A_est = A; B_est = [B L]; %Trick to make Simulink block diagram simpler %Gives full access to estimates in Simulink, only x(1) is used C_est = eye(3); D_est = zeros(3,2); %Second column due to B matrix augmentation % Conversion of Estimator to Discrete Time using Zero-Order Hold [Ad_est,Bd_est,Cd_est,Dd_est] = c2dm(A_est,B_est,C_est,D_est,Ts,?zoh?); % Controller Design - lqr() poles Qx = [1000,0,0;0,1,0;0,0,1]; %State weighting matrix Ru = 1; %Input weighting matrix [K,S,E] = lqr(A,B,Rxx,Ruu); % Simulate the system - uncomment the desired simulation %sim(?LinearPlantLinearEstimator?); %sim(?NonlinearPlantLinearEstimator?); %sim(?NonlinearPlantStateFeedback?); sim(?NonlinearPlantLinearEstimatorStateFeedback?); 40 Appendix B SIMULINK model block diagrams To Workspace1 xhat To Workspace x Terminator3 Terminator2Terminator1 Terminator Scope Random Number1 Random Number Linear Plant x? = Ax+Bu y = Cx+Du Linear Estimator x? = Ax+Bu y = Cx+Du C onstant 0 Figure B.1: Simulation of the linear observer for the linear plant 41 To Workspace1 xhat To Workspace x Terminator1 Terminator Scope Random Number1 Random Numbe r Nonlinear System u x y Linear Estimator x? = Ax+Bu y = Cx+Du C onstant 0 Figure B.2: Simulation of the linear observer for the nonlinear plant To Workspac e x Terminator Scope Random Number Nonlinear System u x y Gain ?K* u C onstant 0 Figure B.3: Simulation of the LQR controller for the nonlinear plant 42 To Workspace u Terminator1 Terminator State Estimate xhat Process Noise Plant States x Nonlinear System u x y Noisy Measurement y_noise Measuremen t Noise Linear Estimator x? = Ax+Bu y = Cx+Du Feedback Gain ? K* u Estimate Error Figure B.4: Simulation of the combined observer and controller for the nonlinear plant 43