SAMPLE AND HOLD INPUTS THEORY AND APPLICATIONS, AND FAULT DETECTION FOR SSCDS By Yingxu Wang A DISSERTATION Submitted to Michigan State University in partial fulfillment of the requirements for the degree of Mechanical Engineering – Doctor of Philosophy 2019 ABSTRACT SAMPLE AND HOLD INPUTS THEORY AND APPLICATIONS, AND FAULT DETECTION FOR SSCDS By Yingxu Wang The disadvantages of non-minimum-phase (NMP) systems for control applications are well known. Prior research has shown that a NMP system can be discretized to an minimum- phase (MP) system using either a zero-order hold or square-pulse sample and hold input. First the research focused on the MP characteristics of the discrete-time system that obtained from a continuous-time single-input-single-output NMP system by using different sample and hold inputs. Two new sample and hold inputs (forward and backward triangular) are studied in addition to the square pulse. Numerical simulations were adopted for studying the MP property of the resulting discrete-time system as a function of sample and hold parameters. The simulation results show that it is possible to find a smaller sampling period that results in an MP discrete-time system using the proposed sample and hold inputs compared to zero-order hold. The q-Markov Cover system identification with pseudo- random binary signal (PRBS) was then used for a hardware-in-the-loop (HIL) simulation study. A resistor-capacitor filter was used to represent the implementation error of the sample and hold input due to unmodeled actuator dynamics. HIL simulation results show that the proposed sample and hold input scheme is robust to actuator modeling error. The MP properties of the discrete-time systems with three sample and hold inputs are compared. The results show that the forward triangle sample and hold input has the best performance due to its robustness to unmodeled actuator dynamics and the capability of retaining MP property of the discretized system at small sampling periods. Based on the analytical result, the advantages of using the SHIs for the single inverted pendulum through simulations and experiments were studied. In particular, it is shown that the performance of the stabilized closed-loop system can be improved by designing an dual-loop controller based on the MP discrete system obtained using the SHIs. Simulation results in the presence of Coulomb friction show that the additional controller reduces cart oscillations significantly; for a particular SHI, the steady state amplitude of oscillation was reduced by up to 68.95%. Experiments confirmed the results obtained in simulations. The dual-loop control technique is also demonstrated for performance improvement on a mini Segway (MS), a robot developed for an undergraduate mechatronics class which equipped with an extremely low cost microcontroller (Arduino). It is important to show that the special SHIs can be implemented in a low cost micro-controller. A dual-loop control tuning method was also developed to optimize the overall closed-loop system performance. Experimental result shows that the low cost microcontroller can be used for the dual-loop SHI control scheme and the MS cart displacement oscillation is significantly reduced by more than 60% over the baseline controller. A solid-set canopy delivery system (SSCDS) is developed to deliver water and chemical solutions to high-density fruit trees with the support from USDA-SCRI (US Department of Agriculture Specialty Crop Research Initiative). For the purpose of detecting SSCDS faults, two methods were proposed and they are flow and/or pressure sensors based in-line detection method and thermal image based detection method. A FLIR thermal camera was mounted on a modified commercial Unmanned Aerial Vehicle (UAV) so that any plug, partial plug, and gusher faults can be captured by the thermal camera during the water and chemical spray process. With the help of a image processing software, the thermal video is stitched into one panorama image. By comparing it with a baseline panorama image, the SSCDS faults can be detected. The main advantage of the proposed fault detection method is the ability of distinguishing all three types of faults over a huge area within a fairly short amount of time, utilizing only a UAV equipped with both regular and thermal video cameras. The future work is to fly the UAV automatically based on a pre-planned route, collect the thermal video, process the panorama image and diagnose the SSCDS faults. Copyright by YINGXU WANG 2019 ACKNOWLEDGMENTS This thesis can not be completed without the selfless support from my advisor, Dr. Zhu. He guided me through the years of my master and Ph.D career. I would like to express my deepest sense of gratitude to him. I’m very much thankful to Dr. Mukherjee, my co-advisor, for his valuable guidance. He inspired me with his working attitude – paying attention to every detail. My sincere thanks to Dr. Grieshop. His sense of humor makes my research fun and full of joy. His expertise also guided me through a lot of hard times. Also Dr. Li, who is so thorough in his work and set an excellent example for me I’m deeply grateful to my fianc´e, Stephanie Sun. She supports me with all her heart with no reason. She gives me the strength and hope in the hard times. I also want to express my deepest gratitude to my parents. They supports me financially and mentally. I acknowledge with thanks the support from USDA-SCRI, who is the sponsor for my agriculture project. Last but not least, many thanks to my lab friends: Keith Koonter, Jie Yang, Jie Jerry Yang, Shupeng Zhang, Dafa Yan, Tao Zeng, Mengyang Gu, Xuefei Chen, Xiaojian Yang, Hailiang Zheng, Yifan Men, Ruixue Li, Tianyi He, Shen Qu, Ali Alhajjar, Anuj Pal, Wenpeng Wei, Jian Tang, Aqeel Salim, Ruitao Song, Ali Al-jiboory, Andrew White, Zhen Ren, Yu He, Dagmara Wehr, Ping Mi, Donghao Hao, Dawei Hu, Huan Li, Chengsheng Miao, Shupeng Zhao, Ju Zhang, Hai-ou Liu, Xiaohong Tai. v TABLE OF CONTENTS LIST OF TABLES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . viii LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix CHAPTER 1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 CHAPTER 2 SAMPLE AND HOLD INPUTS FOR MINIMUM-PHASE BEHAV- 2.2.1 Numerical Example 1. 2.2.2 Numerical Example 2. IOR OF NON-MINIMUM-PHASE SYSTEM . . . . . . . . . . . . . 2.1 SHIS, DE and DT systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Background DE System . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2 Two Additional Switched SHIs . . . . . . . . . . . . . . . . . . . . . 2.1.3 Discrete Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Simulation case studies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 A framework for DT system identification . . . . . . . . . . . . . . . . . . . System Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4 Experimental validation using HIL simulations . . . . . . . . . . . . . . . . . 2.4.1 HIL Simulation Experiment Setup . . . . . . . . . . . . . . . . . . . . 2.4.2 HIL Simulation Procedure . . . . . . . . . . . . . . . . . . . . . . . . 2.4.3 HIL Simulation Results . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 2.3.2 Method and Results CHAPTER 3 DEMONSTRATION OF PERFORMANCE IMPROVEMENT I . . . 3.1 Single inverted pendulum (SIP) system . . . . . . . . . . . . . . . . . . . . . 3.2 Dynamic Model with Coulomb Friction Term . . . . . . . . . . . . . . . . . 3.3 Dual-loop controller design . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inner-loop Stabilizing Controller . . . . . . . . . . . . . . . . . . . . . 3.3.1 SHI Parameter Selection For MP Characteristics . . . . . . . . . . . . 3.3.2 3.3.3 Outer-Loop Controller Design . . . . . . . . . . . . . . . . . . . . . . 3.4 Simulation and experimental validation . . . . . . . . . . . . . . . . . . . . . 3.4.1 Experimental Set Up . . . . . . . . . . . . . . . . . . . . . . . . . . . Simulation and Experiment Results . . . . . . . . . . . . . . . . . . . 3.4.2 CHAPTER 4 DEMONSTRATION OF PERFORMANCE IMPROVEMENT II . . . 4.1 Segway . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1.1 Motor Modeling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 Equations of the Wheels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.3 Equations of the Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4 Linearization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5 Dual-loop controller design . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inner-loop Stabilizing Controller . . . . . . . . . . . . . . . . . . . . . 4.5.1 vi 7 7 7 9 10 12 12 15 16 17 17 19 20 20 22 24 24 27 31 31 33 35 35 35 36 45 45 45 47 48 51 54 54 4.6 Experimental Hardware 4.5.2 SHI Parameter Selection . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.3 Outer-Loop Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.1 4.6.2 Actuators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.3 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.4 Experimental Set Up . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Experimental Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7.1 Inner-loop LQR Tuning . . . . . . . . . . . . . . . . . . . . . . . . . 4.7.2 Outer-Loop Controller Tuning . . . . . . . . . . . . . . . . . . . . . . CHAPTER 5 AGRICULTURE PROJECT: FAULT DETECTION ON SOLID- SET CANOPY DELIVERY SYSTEM FOR APPLE FARM . . . . . 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Solid-Set Canopy Delivery System . . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Emitters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Irrigation Systems 5.2.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.3 SSCDS Spray Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.4 . . . . . . . . . . . . . . . . . . . . . . . . . . . In-Line Flow Sensor 5.2.5 Thermal Fault Detection . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6 Drone Hardware Selection . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6.1 Drone: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6.2 Thermal Camera . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6.3 Gimbal: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6.4 Flight Controller: . . . . . . . . . . . . . . . . . . . . . . . . 5.2.6.5 Video Transmitter: . . . . . . . . . . . . . . . . . . . . . . . 5.3 Experiment Results and Discussion . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Experimental Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.2 Experimental Procedure and Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4.1 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.4 Discussion and Future Works 55 56 57 57 58 60 60 62 62 64 71 71 73 73 75 76 77 80 81 81 81 81 82 83 85 85 86 90 90 CHAPTER 6 CONCLUSIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 BIBLIOGRAPHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 vii LIST OF TABLES Table 2.1: Definition of the SPSHI, FTSHI and BTSHI . . . . . . . . . . . . . . . . 10 Table 2.2: Pole-Zero Location of the DT, ID, and HIL-ID Systems . . . . . . . . . . 19 Table 2.3: The Third Zero Locations of the HIL ID Systems With δ = 0.5s, P = 0.6 and 0.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Table 3.1: QUANSER inverted pendulum system parameters [1] . . . . . . . . . . . 30 Table 3.2: Experimental results for inner-loop LQR and dual-loop control with SP- SHI and FTSHI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Table 4.1: Segway system parameters (To be determined in the future work) . . . . . 53 Table 4.2: The Mean Absolute Values of Cart Displacement and Control Voltage For Inner-loop LQRc Tuning . . . . . . . . . . . . . . . . . . . . . . . . . 62 Table 4.3: The Mean Absolute Values of Outer-loop LQRd Tuning Data with dif- ferent GRc Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Table 4.4: The Mean Absolute Values of Outer-loop LQRd Tuning Data with GRc = 0.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Table 5.1: Flow sensor specification . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Table 5.2: Transmitter and receiver specifications . . . . . . . . . . . . . . . . . . . . 79 Table 5.3: FLIR VUE Pro R Specifications . . . . . . . . . . . . . . . . . . . . . . . 82 Table 5.4: Experiment #1 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 86 Table 5.5: Fault Details in the Orchard that with Hadar 7110 Emitters . . . . . . . . 87 Table 5.6: Experiment #2 Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Table 5.7: Fault Details in the Orchard that with Spinner Emitters . . . . . . . . . . 89 viii LIST OF FIGURES Figure 1.1: Flowchart of obtaining a DT system . . . . . . . . . . . . . . . . . . . . Figure 1.2: Closed-loop system architecture of a continuous-time system with a discrete-time controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4 Figure 2.1: (a) continuous input, (b) its ZOSHI, (c) SPSHI, (d) FTSHI, and (e) BTSHT 8 Figure 2.2: Shaded regions showing sample and hold parameters that result in MP characteristics of (a) SPSHI-DT, (b) FTSHI-DT, and (c) BTSHI-DT systems. The plot in (d) is an overlay of those in (a), (b), and (c) . . . . 13 Figure 2.3: Pole-zero locations of all SHIs . . . . . . . . . . . . . . . . . . . . . . . . 14 Figure 2.4: Feasible regions of all SHIs overlaid for the second example . . . . . . . . 16 Figure 2.5: Q-Markov Cover system ID process with PRBS excitation . . . . . . . . 17 Figure 2.6: PRBS sampled and held by ZOSHI, SPSHI, FTSHI, and BTSHI . . . . . 18 Figure 2.7: System responses associated with ZOSHI, SPSHI, FTSHI, and BTSHI . 18 Figure 2.8: HIL simulation setup for studying SHI robustness . . . . . . . . . . . . . 20 Figure 2.9: Filtered PRBS sampled and held by (a) SPSHI, (b) FTSHI, (c) BTSHI . 21 Figure 2.10: Zero movements of the HIL ID systems with two set of feasible sample and hold parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Figure 3.1: The Single Inverted Pendulum System . . . . . . . . . . . . . . . . . . . 24 Figure 3.2: Inverted Pendulum Free Body Diagram . . . . . . . . . . . . . . . . . . . 25 Figure 3.3: Coulomb Friction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Figure 3.4: The dual-loop controlled SIP system . . . . . . . . . . . . . . . . . . . . 32 Figure 3.5: The inverted pendulum simulation layout . . . . . . . . . . . . . . . . . . 33 Figure 3.6: The SIP p-δ feasible regions of BTSHI (Region 1), SPSHI (Region 1+2) and FTSHI (Region 1+2+3). . . . . . . . . . . . . . . . . . . . . . . . . 34 ix Figure 3.7: The inverted pendulum dual-loop simulation layout . . . . . . . . . . . . 35 Figure 3.8: The SIP experiment hardware connection . . . . . . . . . . . . . . . . . 36 Figure 3.9: The SIP experiment set up in the lab . . . . . . . . . . . . . . . . . . . . 37 Figure 3.10: The simulated and experimental results of the SPSHI-DT with δ = 0.3s for the SIP system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Figure 3.11: The simulated and experimental results of the FTSHI-DT with δ = 0.3s for the SIP system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Figure 3.12: The simulated and experimental results of the SPSHI-DT with δ = 0.4s for the SIP system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Figure 3.13: The simulated and experimental results of the FTSHI-DT with δ = 0.4s for the SIP system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Figure 3.14: The best experimental results of dual-loop with SPSHI and FTSHI com- pare with inner-loop controller . . . . . . . . . . . . . . . . . . . . . . . . 43 Figure 3.15: The trend of dual-loop control response . . . . . . . . . . . . . . . . . . . 44 Figure 4.1: Free body diagram of the mini segway robot . . . . . . . . . . . . . . . 45 Figure 4.2: Motor diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Figure 4.3: Free Body Diagram of the Wheel . . . . . . . . . . . . . . . . . . . . . . 47 Figure 4.4: Free Body Diagram of the Pendulum . . . . . . . . . . . . . . . . . . . . 49 Figure 4.5: Cart turning angle definition . . . . . . . . . . . . . . . . . . . . . . . . . 50 Figure 4.6: Dual-loop control architecture for the MS system . . . . . . . . . . . . . 54 Figure 4.7: The feasible sampling period of ZOH that result in MP DT system and the p-δ feasible regions of SPSHI. . . . . . . . . . . . . . . . . . . . . . . 55 Figure 4.8: The MPU 6050 Chip . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 Figure 4.9: The Complementary Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Figure 4.10: 12V Motor and Hall Effect Encoder . . . . . . . . . . . . . . . . . . . . . 59 Figure 4.11: Arduino MKR Motor Carrier . . . . . . . . . . . . . . . . . . . . . . . . 59 x Figure 4.12: Arduino MKR1000 WiFi . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 Figure 4.13: The MS system hardware configuration . . . . . . . . . . . . . . . . . . . 61 Figure 4.14: The MS Picture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Figure 4.15: The experimental result for inner-loop LQRc optimization . . . . . . . . Figure 4.16: LQRc tuning data plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 64 Figure 4.17: The feasible region of the closed-loop MS system with SPSHI . . . . . . 65 Figure 4.18: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 0.8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Figure 4.19: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 0.9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Figure 4.20: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 1.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . Figure 4.21: LQRd tuning data plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 70 Figure 5.1: SSCDS Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Figure 5.2: The Hadar 7110 Emitter . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Figure 5.3: The Spinner Emitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Figure 5.4: SSCDS Spray Pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 Figure 5.5: Flow sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78 Figure 5.6: Transmitter ZF-4 and Receiver ZW21-J . . . . . . . . . . . . . . . . . . 79 Figure 5.7: The transmitter is mounted inside the generator . . . . . . . . . . . . . . 79 Figure 5.8: The in-line fault sensing system prototype 1 . . . . . . . . . . . . . . . . 80 Figure 5.9: The in-line fault sensing system prototype 2 . . . . . . . . . . . . . . . . 80 Figure 5.10: Controller Tray . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Figure 5.11: Modified Drone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 xi Figure 5.12: Drone System Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Figure 5.13: Thermal and Regular Footage of the Orchard with Hadar 7110 Emitters 87 Figure 5.14: Thermal and Regular Footage of the Orchard with Spinner Emitters . . . 89 xii CHAPTER 1 INTRODUCTION A continuous-time system is non-minimum phase (unstable) if there exists at least one zero (pole) in the right-half plane. Similarly, a discrete-time system is non-minimum phase (un- stable) if there is at least one zero (pole) outside the unit circle. If a stable continuous-time system is discretized using a zero-order hold (ZOH), each pole p of the continuous-time system is mapped into the pole epT for the discrete-time system, where T is the sampling interval. Therefore, discretization preserves the stability characteristics of poles. The same is not true for zeros. The control design for non-minimum-phase (NMP) systems is challenging. For instance, from root locus analysis that the closed-loop poles move towards the open-loop zeros when the system proportional gain increases. This results in unstable closed-loop dynamics and prevents the use of high-gain control to achieve the desired closed-loop performance. It is also well known that asymptotic tracking is difficult to achieve when the system is NMP. Control methods can only achieve approximate output tracking for NMP systems [2–8]. NMP systems are difficult to control, but discretization with ZOH may alleviate the problem; it is shown in [8–21] that a NMP continuous-time system may map into an MP discrete-time system. This happens, for example, when a ZOH input is used with a suffi- ciently large sampling period [9]. Unfortunately, a precise mathematical formula for calcu- lating the smallest feasible sampling period was not found. For an NMP continuous-time system, a feasible sampling period is the one that results in an MP discrete-time system. Based on [9], the range of feasible sampling periods was determined by using a symbolic approach in [10] and genetic algorithms in [11]. The methods for finding feasible sampling periods with a ZOH input when the continuous-time system is minimum-phase (MP) can be found in [12–14]. For stable MP systems, the Nyquist algorithm was used in [12]; the results were extended in [13] to unstable systems with no poles or zeros on the imaginary axis. 1 A first-order approximation, based on Taylor series, was used in [14] to find the smallest feasible sampling period for single-input-single-output (SISO) systems. The results cited above find feasible sampling periods with ZOH input, but it all have restrictions on the system and the feasible sample period may not be small enough for closed- loop control design purpose. To find a feasible sampling period smaller than that obtained with the ZOH, other sample and hold inputs (SHI) were explored in [15–21]. The impulse generator function (IG) was used in [15], but the reduction of the smallest feasible sampling period was minor. The first-order hold was studied in [16] and [17], but it provided no improvement over ZOH. In [18–21], fractional-order hold (FROH) schemes were studied. They were found to reduce the lower bound of feasible sampling periods obtained with ZOH. However, the FROH schemes have restrictions, such as the continuous-time system has to be low-pass [18], [19]; they are only applicable to second-order or first-order plants with time delay [20], and the resulting discrete-time system is MP only if the continuous-time system is MP and when the transfer function relative degree is 1 or 2 [21]. An alternative approach that reduces the lower boundary of feasible sampling periods was developed in [8]; it is based on the characteristics of discrete equivalent (DE) system obtained with pulse SHI. It was shown that a continuous-time NMP system and its corresponding DE system can have the same state and output variables at regular sampling intervals for pulse SHI and ZOH input, respectively. A proper choice of the sampling period and the pulse duty cycle can result in MP characteristics of the DE system; this implies that the NMP system can exhibit MP behavior at sampled data points. In this paper, two additional SHIs are investigated: forward and backward triangle SHIs. The feasible sampling periods for these two triangular SHIs and the pulse SHI are compared with that of the conventional ZOH input. Since any microprocessor-based controller and its associated control design are in discrete- time (DT) domain, it is important to study the MP property in discrete-time domain. This is the main focus of this thesis. The flowchart in Fig. 1 shows the process of obtaining a 2 DT system from a continuous-time system using a specific SHI. The top figure shows the response of a continuous-time system with an SHI. The middle figure shows the response of the corresponding DE system with only the ZOH input. The output of the DE system, as expected, matches the output of the continuous-time system with SHI shown in the top figure. The bottom figure shows the discrete-time representation of the DE system, its input and output. It will be discussed later how the resulting DT system can be MP even when the continuous-time system is NMP through a proper choice of the sampling period and the duty cycle of the SHIs. Figure 1.1: Flowchart of obtaining a DT system In Fig. 1. the systems shown in the middle and bottom figures are virtual systems. However, the DT system model can be used to design a discrete-time controller for the original continuous-time system with SHI shown in Fig. 2. This is true because the output of the DT system and the original continuous-time system are identical at each sampling instant. The main contribution of the first part of this thesis is to find the smallest feasible 3 Continuous-time DomainZOHDiscreteInput00.511.522.533.544.55-0.8-0.6-0.4-0.2000.511.522.533.544.55Discrete-time DomainContinuous-Time SystemDE SystemDT SystemContinuousInputContinuousInput00.511.522.533.544.55SHIsContinuous-time Domain00.511.522.533.544.55-1-0.8-0.6-0.4-0.2000.511.522.533.544.55-1-0.8-0.6-0.4-0.2000.511.522.533.544.55-1-0.8-0.6-0.4-0.20 sampling period for a continuous-time NMP system using an SHI through case studies and to show the potential of using the SHIs to improve the feasible sampling periods. This is important since the smallest feasible sampling period using the conventional ZOH is often too large to be used for practical applications. Through proper choice of duty cycle and sampling period of the SHI, the DT system can be MP even though the original continuous-time system is NMP. This allows us to design a discrete-time controller base on the MP DT model for the continuous-time NMP system with the selected SHI. In this paper, it is demonstrated through two examples that the smallest feasible sampling period of an NMP system can be reduced significantly. Also, SHI implementation error was introduced in hardware-in-the- loop (HIL) simulations to demonstrate the feasibility for practical applications. Figure 1.2: Closed-loop system architecture of a continuous-time system with a discrete-time controller Based on the developed theory, an experimental validation was performed on a single inverted pendulum (SIP). since it has been used as a benchmark station for validating and demonstrating advanced control algorithms [22, 23]. This is because it is an under actuated NMP system with a high degree of nonlinearity. Different control approaches have been implemented over the past few decades for the SIP system such as PID control [24–26], LQR [25–28], and LQG control [29]; the performance of the closed-loop systems is highly dependent on the selection of the PID gains or LQR and LQG weighting matrices. Without advanced tuning methods [24, 27, 28, 30], the implementation of the above-mentioned controllers is challenging and time consuming. Fuzzy logic control algorithms [31, 32] have been used but 4 Continuous-Time SystemDiscrete-TimeControllerZOHSHIsZOH00.511.522.533.544.55-1-0.8-0.6-0.4-0.20 the performance is not ideal. Fractional order PIDs [33,34] are also used but the performance improvements over LQR are minor. The first experimental validation focus on converting the stabilized continuous-time SIP system into an MP discrete-time system for the purpose of improving the closed-loop system performance. Two linear quadratic regulation (LQRs) loops were used: the inner loop (designed by the manufacturer) optimizes the continuous-time NMP system for guaranteed stability; the outer loop, sampled at 3.3 Hz and 2.5 Hz for two different SHIs, is used to further improve the closed-loop system performance exploiting MP characteristics of the DE system. Due to the presence of Coulomb friction, the positions of the cart and the pendulum oscillate around the equilibrium configuration; the cart displacement oscillation is significantly reduced by the outer-loop discrete-time controller. The first experimental validation lies in experimental demonstration of performance im- provement of an NMP SIP system using SHIs. For the studied SIP, the feasible sampling rate is increased from 1.12Hz (ZOH) to 5.78Hz by using the SHIs proposed in [35]. As a result, the steady-state amplitude of oscillation was reduced by 78.87% in simulations and 68.95% in experiments. The outer-loop controller was implemented using the same control system hardware provided by the SIP manufacturer. Since the controller was implemented into to a very sophistic microcontroller in the SIP validation, the feasibility of implementing the proposed SHIs into an extremely low cost microprocessor remains an open question, which is the top of this paper. To be specific, this paper studies the performance improvement of a mini Segway (MS) with a low cost microprocessor (Arduino) with a dual-loop control scheme. The MS is a two-wheel self- balanced robot and is a multi-input-multi-output (MIMO) nonlinear system. It is NMP after linearization about the upright equilibrium point. Due to its under-actuated nature, this platform is widely used for controller design and implementation studies, including PID controllers [36] [37] [38] [39] [40] [41], Fuzzy logic controllers [42] [43] [44], Fuzzy combined with PID [45], Adaptive control [46] and LQR control [47] [48] [41] [49]. 5 In this study, the dual-loop control architecture that proposed in [50] was adopted. The continuous-time inner-loop LQR was implemented at 100 Hz and a discrete-time outer-loop LQR with the selected SHI was implemented at 5 Hz. The idea is to utilize the inner-loop controller to stabilize the MS system and to convert the resulting NMP MS system into a discrete-time MP system with the help of proposed SHIs. Consequently a high gain outer- loop can be used to further improve dual-loop closed-loop system performance. It is obvious that the overall system performance is affected by both inner- and outer-loop controllers. To study the interaction between two controllers, multiple inner-loop LQR controllers were designed with gains from low to high and the outer-loop controller was optimized for each designed inner-loop controller. It was found that the inner-loop control gain shall be properly chosen to have a decent closed-loop system performance without the outer-loop controller. When the inner-loop control gain is relatively low, the nonlinear Coulomb friction dominates the closed-loop system dynamics, leading to unstable system responses; and while the inner- loop control gain is relatively high, the system nonlinarity could result in unwanted high frequency oscillations. The rest of the paper is organized as follows. In Chapter II, the SHIs and DE system are introduced and implemented in dSPACE for HIL analysis. Analytical results are pre- sented. The SIP implementation for performance improvement is showed in Chapter III. The dual-loop implementation onto a MS system along with controller tuning within a low cost microcontroller is presented in Chapter IV; Chapter V is another area that relates to my study – fault detection of an apple orchard with IR camera that carried by a drone. Concluding remarks are provided in Section VI. 6 CHAPTER 2 SAMPLE AND HOLD INPUTS FOR MINIMUM-PHASE BEHAVIOR OF NON-MINIMUM-PHASE SYSTEM 2.1 SHIS, DE and DT systems 2.1.1 Background DE System Consider the continuous-time input u(t) shown in Fig. 2.1 (a) with solid line. This input can be discretized using a zero-order sample and hold function (ZOSHF), shown in Fig. 2.1 (a) with dotted lines. Mathematically, the zero-order sample and hold input (ZOSHI) can be defined as follows. uz(t) = u(tk), if tk < t ≤ tk + δ, k = 0, 1, 2, ... (2.1) where tk, k = 0, 1, 2, ..., are the sampling time instants; δ is the sampling period; and u(tk) is the zero-order hold (ZOH) value of u(t) over the interval (tk, tk + δ]. uz(t) is shown in Fig. 2.1 (b). For the linear system ˙x(t) = Ax(t) + B ¯u(t), x(t0) = x0 y(t) = Cx(t) with the switched input ¯u(t) shown in Fig. 2.1 (c), and defined as uz(t), 0, ¯u(t) = if tk < t ≤ tk + pδ if tk + pδ < t ≤ tk + δ (2.2) (2.3) where k = 0, 1, 2, ... and p ∈ (0, 1] is the duty cycle of the switched input, the concept of DE system was introduced as follows [21]: Definition 1 (DE system): The time-invariant linear system with the ZOSHI 7 Figure 2.1: (a) continuous input, (b) its ZOSHI, (c) SPSHI, (d) FTSHI, and (e) BTSHT ˙¯x(t) = ¯A¯x(t) + ¯Buz(t), ¯x(t0) = x0 ¯y(t) = C ¯x(t) (2.4) is a DE system of (2.2) if the state variables of (2.2) and (2.4) match at sampling times tk, k = 0, 1, 2, .... The state variables of (2.2) and (2.4) at time tk+1 = tk + δ are given below by the 8 ()utktkt0t1t2tktkt0t1t2tkt0t1t2tkt0t1t2tktkt0t1t2t()Zutktp()ut()ut()ut(a)(b)(c)(d)(e) following equations. x(tk + pδ) = eApδx(tk) + eA(pδ−τ )B ¯u(tk + τ )dτ (cid:90) pδ 0 = eApδx(tk) + A−1(eApδ − I)Bu(tk) x(tk+1) = eA(δ−pδ)x(tk + pδ) = eAδx(tk) + A−1(eAδ − eA(1−p)δ)Bu(tk) (cid:90) δ ¯Aδ ¯x(tk) + ¯Aδ ¯x(tk) + ¯A−1(e e 0 ¯x(tk+1) = e = e ¯A(δ−τ ) ¯BuZ (tk + τ )dτ ¯Aδ − I) ¯Bu(tk) (2.5) (2.6) Comparing (2.5) and (2.6), it is clear that (2.2) and (2.4) will be DE if the following conditions are met: ¯A = A, ¯B = [I − e−Aδ]−1[I − e−Apδ]B (2.7) When p = 1, the switched input in (2.3) is identical to the ZOSHI. In this case, the DE conditions in (2.7) simply reduce to ¯A = A, ¯B = B (2.8) 2.1.2 Two Additional Switched SHIs The switched input ¯u(t) in (2.3), which is shown in Fig. 2.1 (c), will henceforth be referred to the square pulse sample and hold input (SPSHI). Two new SHIs are introduced in this paper: the forward triangle sample and hold input (FTSHI) and the backward triangle sample and hold input (BTSHI). These are shown in Fig. 2.1 (d) and Fig. 2.1 (e), respectively. The SPSHI, FTSHI, and BTSHI are defined in the following table: 9 Table 2.1: Definition of the SPSHI, FTSHI and BTSHI tk < t ≤ tk + pδ tk + pδ < t ≤ tk + δ Input SPSHI BTSHI FTSHI ¯u(t) = 2 p pδ + uz(t) ¯u(t) = 1 p[uz(t)] (cid:104) uz(t)(tk−t) (cid:104) uz(t)(t−tk) (cid:105) ¯u(t) = 2 p pδ (cid:105) 0 0 0 Similar to the SPSHI, the conditions for DE system with the FTSHI can be obtained below. ¯A = A ¯B = (I − e−Aδ)−1[ A−1(e−Apδ − I) + I]B 1 pδ And the BTSHI conditions are ¯A = A ¯B = (I − e−Aδ)−1[ 1 pδ A−1(I − e−Apδ) − e−Apδ]B (2.9) (2.10) Note that when system matrices A, B, and C, and SHI parameters p and δ are given, (2.7), (2.9), and (2.10) can be used to construct DE systems with SPSHI, FTSHI, and BTSHI. Since is different from B, the zero locations of the DE system could be different from those of the original system. 2.1.3 Discrete Time Systems Consider the standard discrete-time (DT) system with the same initial conditions as the DE system in (2.4) x(tk+1) = Adx(tk) + Bdu(tk), x(t0) = x0 y(tk) = Cdx(tk) (2.11) 10 The DT system will have the same state and output variables as the DE system with SPSHI, described by (2.4) and (2.7), at sampling time tk(k = 0, 1, 2, ...) if Ad = eAδ, Cd = C and following condition is met Bd = A−1(eAδ − I)(I − e−Aδ)−1(I − e−Apδ)B (2.12) Similarly, the conditions for FTSHI are and Bd = A−1(eAδ − I)(I − e−Aδ)−1[A−1 e−Apδ − I pδ + I]B (2.13) The conditions for the BTSHI are and Bd = A−1(eAδ − I)(I − e−Aδ)−1[A−1 I − e−Apδ pδ − e−Apδ]B (2.14) It should be noted that the continuous-time system in (2.2) with the SPSHI, its DE system (2.7), and the corresponding DT system (2.12) have the same state and output variables at the sampling time tk (k = 0, 1, 2, ...). The same is true for system (2.2) with the FTSHI, its DE system (2.9), and its DT system (2.13); and for system (2.2) with the BTSHI, its DE system (2.10), and its DT system (2.14). The DT system corresponding to system (2.2) with p = 1 has the following system matrices Ad = eAδ, Bd = A−1(eAδ − I)B, Cd = C (2.15) A comparison of the system matrices in (2.12), (2.13), and (2.14) with those in (2.15) indi- cates that although all four systems have identical ZOSHI, the Bd matrices are all different. This suggests that the location of the zeros of the DT systems in (2.12), (2.13), and (2.14) could be different from those in (2.15). In the sequel, the system of (2.15) will be referred as the ZOSHI-DT system. Similarly, the systems of (2.12), (2.13), and (2.14) will be referred as SPSHI-DT, FTSHI-DT, and BTSHI-DT systems, respectively. 11 2.2 Simulation case studies In this chapter, numerical simulation studies were conducted to illustrate the possibility of shifting zeros of a DT system for a given continuous-time system by using different SHI functions. 2.2.1 Numerical Example 1. Consider the transfer function below G(s) = (s − 5)(s2 + 1) (s + 2)(s + 1)(s2 + 2s + 5) (2.16) This represents a stable NMP system with zeros locate at 5, i and −i. Using (2.12), (2.13), and (2.14), the zero locations of the SPSHI-DT, FTSHI-DT, and BTSHI-DT systems were calculated for a range of p and δ values. The regions where all the zeros lie inside the unit circle are defined as feasible regions and shown in Fig. 2.2(a), (b), and (c) for the SPSHI-DT, FTSHI-DT, and BTSHI-DT systems, respectively. For the purpose of comparison, Figs. 2.2 (a), (b), and (c) are overlaid in Fig. 2.2 (d). The zero locations of the ZOSHI-DT system can be observed from the top boundary of Fig. 2.2 (a) since it is a special case of the SPSHI-DT with p = 1. For very small values of p, the minimum δ value that results in MP characteristic is the same for all three DT systems shown in Fig.2.2. This is because when the duty cycle is extremely small, all three SHIs converge to a narrow pulse. As mentioned earlier, the ZOSHI-DT system is a special case of the SPSHI-DT system for p = 1. Therefore, the feasible sampling period for the ZOSHI-DT system is between 0.69s and 1.76s; see Fig. 2.2 (a). The same result can be obtained using the procedure outlined in [8]. Compare to the ZOSHI-DT system, the smallest feasible sampling period of FTSHI-DT system is as low as 0.38s. This indicates that the system in (2.16) with FTSHI can have a much smaller feasible sampling period than that with the conventional ZOH method. 12 Figure 2.2: Shaded regions showing sample and hold parameters that result in MP characteristics of (a) SPSHI-DT, (b) FTSHI-DT, and (c) BTSHI-DT systems. The plot in (d) is an overlay of those in (a), (b), and (c) For feedback control, it is beneficial to have a small sampling period, i.e., a small δ. Furthermore, it is desirable to have a large value of p, since a small value of p will increase the maximum norm of the input over each sampling period and reduce the effectiveness of the control. This implies that the region in the top left hand corner of the shaded region in Fig. 2.2 (d) is of maximum relevance. An investigation of this corner region indicates that for p = 0.8 (duty cycle of 80%), for example, the feasible sampling period can be as small as 0.32s with FTSHI. For the SPSHI the smallest feasible sampling period is slightly higher, and is equal to 0.42s; for BTSHI it is even higher, equal to 0.55s. When a sampling period of δ = 0.3s is given, the FTSHI-DT system provides MP characteristics with the largest duty cycle of 67.9%, the SPSHI-DT system has a smaller duty cycle of 48.5%, and for the BTSHI-DT system, it reduces further down to 35.4%. In summary, for system (2.16), the 13 FTSHI-DT system provides MP characteristics with the largest duty cycle and the smallest sampling period among all four DT systems. For the purpose of studying the MP property of the associated DT systems, the zeros of the SPSHI-DT, the FTSHI-DT, and the BTSHI-DT systems are calculated for system (2.16) with sample and hold parameters of δ = 0.5s and p = 0.8 and the ZOSHI-DT system is calculated with δ = 0.5s. For comparison purposes, the pole-zero plot is shown in Fig. 5: Figure 2.3: Pole-zero locations of all SHIs From Fig. 2.3, the poles of the DT systems, represented by cross marks, are identical. Circles, triangles, squares, and pentagrams are used to represent the zero locations of the SPSHI-DT, the FTSHI-DT, the BTSHI-DT, and the ZOSHI-DT systems, respectively. For system (2.16), when the SHIs are used, the zeros of the corresponding DT systems are moved from the locations associated with the conventional ZOH DT system toward the unite circle. Note that sampling period of 0.5s is smaller than the smallest feasible sampling period of ZOH method. According to Fig. 2.2, the choice of δ = 0.5, p = 0.8 is within the feasible region of SPSHI-DT and FTSHI-DT but not of BTSHI-DT. As a result, the zeros of the 14 SPSHI-DT and FTSHI-DT systems are shifted inside the unit circle, while the zeros of the BTSHI-DT system were also moved toward the unit circle but still is outside. It is interesting to observe that for all three DT systems with different SHIs, the movement of the real zero is much larger than the complex zeros. 2.2.2 Numerical Example 2. Consider the transfer function from [9] as the second example G(s) = 6(1 − s) (s + 2)(s + 3) (2.17) This stable NMP system has an unstable zero located at 1. The feasible regions of the SPSFI-DT, the FTSHI-DT, and the BTSHI-DT systems are overlaid in Fig. 2.4. For system (2.17) the shapes of the feasible regions are quite different from those in Fig. 2.2, where Fig. 2.2 shows discontinuous feasible regions and the regions in Fig. 2.4 are continuous. This implies that for different systems, their feasible regions could be quite different. According to [9], the ZOSHI-DT system is MP with a sampling period not smaller than 1.2485s and Fig. 2.4 confirms it; see the top boundary of the SPSHI-DT feasible region. Note that when p = 1, the SPSHI-DT system is equivalent to the ZOSHI-DT system. With the FTSHI, the feasible sampling period can be as small as 0.69s when the duty cycle is 1. If a smaller duty cycle is allowed, the feasible sampling period can be reduced further for all three SHIs. For system (2.17) the lower feasible sampling period boundary is 0.4s (a three-time reduction). Note that the bandwidth of system (2.17) is 1.227 Hz and the lower bound of the SHI feasible sampling frequency is 2.5Hz, which is about twice of the system bandwidth. Although the SHI feasible sampling frequency boundary is relatively low, compared to the system bandwidth, it is still more than two times of the system frequency; and in addition, it is more than three times higher than the feasible sampling frequency of conventional ZOH (0.8Hz). Further study will be conducted to observe the closed-loop system performance using SHI. 15 Figure 2.4: Feasible regions of all SHIs overlaid for the second example From the aspect of selecting the feasible sample and hold parameters, the FTSHI has the outstanding advantage compared with the SPSHI and the BTSHI. 2.3 A framework for DT system identification The results from the previous section show that it is possible to use a special SHI to obtain a discrete-time MP system even though the original continuous-time system is NMP. The SHIs are designed to be implemented into the physical control system. Note that a wave-generating circuit can be used to generate pulse, forward or backward triangular signals and a variable-gain amplifier, utilizing the generated signal as input, can be used to generate the sample and held signals. The amplifier gain is the control input. Finally, an ASIC (application specific integrated circuit) can be designed and used as the SHIs. The next two sections investigate the SHI robustness when the SHI is not implemented precisely. In practice it is impossible to implement the required SHI precisely, which could make the resulting DT system not always be MP even though in theory it should be. To study the SHI robustness, HIL simulation approach was used to simulate the system responses with an inexactly implemented SHI input; based on the simulation results, system identification was used to obtain the correspondent DT system model, and its MP property is correlated to the implementation error. This section presents the system identification (ID) approach and the next section discusses the SHI robustness using a system ID base on the HIL simulation results. 16 2.3.1 System Identification The system ID based upon the q-Markov COVariance Equivalent Realization (q-Markov Cover) [51], [52] with pseudo-random binary signal (PRBS) as system excitation was used to obtain the DT system model. The q-Markov Cover system ID is capable of identifying discrete-time system model with multiple sampling rates. However, a single sampling rate q-Markov Cover was used in this study and the PRBS excitation was sampled and held by SPSHI, FTSHI, or BTSHI. The associated system output, along with the PRBS input, were used for system ID to obtain the corresponding DT system model. The system ID process is depicted in Fig. 2.5. Figure 2.5: Q-Markov Cover system ID process with PRBS excitation 2.3.2 Method and Results The PRBS sampling period is defined as δ to be consistent with the notation for SHI. In principal, the order of PRBS shall be small to have a short period. However PRBS order is inversely proportional to its lowest frequency component contained in the signal. Therefore the order selection is to cover the lowest frequency of the dynamic system to be identified with the lowest order possible. For this study the PRBS order was selected to be 11. To generate the input to the continuous-time NMP system defined in (2.16), PRBS was sampled and held by the SHI functions defined in Table 1 and the resulting PRBS are shown in Fig. 2.6 for δ = 0.5s and p = 0.3. 17 NMP SystemSystem ResponseQ-Markov Cover System ID DT System PRBSSHI Figure 2.6: PRBS sampled and held by ZOSHI, SPSHI, FTSHI, and BTSHI The system responses of the continuous-time NMP system in (2.16) using the signals shown in Fig. 2.6 are shown in Fig. 2.7. Figure 2.7: System responses associated with ZOSHI, SPSHI, FTSHI, and BTSHI Note that system (2.16) has a bandwidth of 0.1125Hz. The DT system sample rate is 2.0Hz, which is more than 10 times faster than the system bandwidth. According to [53], the DT system should represent the continuous-time dynamics well. To accurately simulate the SHI shape, the simulation step size of 0.001s was selected in Simulink. Based upon the discrete-time PRBS and the associated sampled system response, the system ID was conducted to obtain the associated DT model denoted as ID DT model. From Fig. 2.2 (d), to ensure the ID DT models to be MP with exact SHIs, the sampling period and duty cycle for all SHIs were chosen to be 0.5s and 30%, respectively. The system poles and zeros are calculated using the DT system analytical equations (2.12), (2.13), and (2.14) directly based on the ID DT models. The absolute values of poles and zeros are shown in Table 2.2, where rows denoted by “AN” are the absolute values of poles and zeros from the analytical equations, the rows of “ID” are associated with the poles and zeros of ID DT 18 SPSHIZOSHIFTSHIBTSHISPSHIZOSHIFTSHIBTSHI Table 2.2: Pole-Zero Location of the DT, ID, and HIL-ID Systems p Z ZOSHI AN ID 0.61 0.61 0.61 0.67 0.61 0.61 0.37 0.36 1.00 1.00 1.00 1.00 1.51 1.52 SPSHI AN ID 0.61 0.61 HIL-ID 0.61 0.61 0.61 0.61 0.61 0.62 0.62 0.37 0.32 0.34 0.95 0.95 0.95 0.95 0.95 0.95 0.23 0.25 0.25 FTSHI AN ID 0.61 0.61 HIL-ID 0.61 0.61 0.61 0.61 0.61 0.62 0.62 0.37 0.33 0.33 0.95 0.95 0.95 0.95 0.95 0.95 0.19 0.19 0.21 BTSHI AN ID 0.61 0.61 HIL-ID 0.61 0.61 0.61 0.61 0.61 0.62 0.62 0.37 0.34 0.34 0.94 0.94 0.94 0.94 0.94 0.94 0.28 0.31 0.29 models, and rows of “HIL-ID” will be discussed in the next section. From Table 2.2 since the SHIs were implemented precisely, the pole and zero locations of the ID DT models and the corresponding DT systems are very close in the sense of their absolute values. This implies that the q-Markov Cover system identification using PRBS is able to identify the DT system model accurately. It is concluded that it can be used for studying the MP characteristics with SHI implementation error through HIL simulations. 2.4 Experimental validation using HIL simulations In this section, HIL simulations were used to study the robustness of the SHIs under different levels of unmodeled actuator dynamics to emulate the practical implementation of SHIs. Q-Markov Cover system ID was conducted based on the PRBS input and the response of dSPACE-simulated system (2.16). The robustness property of all the SHIs is observed by 19 comparing the zero locations of the DT systems with and without actuator dynamics. 2.4.1 HIL Simulation Experiment Setup Figure 2.8: HIL simulation setup for studying SHI robustness A dSPACE auto-box and a resistance-capacitor (RC) filter circuit were used for the HIL simulations; see Fig. 2.8. The dSPACE auto-box was used to simulate system (2.16); it also converts the discrete-time control signal (PRBS input) into sample and hold signal based on the SHI and sends the signal to its D/A output channel. The analog signal is an RC filter and sampled by the dSPACE A/D converter, where the sampling frequency is 1000Hz, which is significantly higher than the SHI sampling rate (1/δ). The RC filter circuit was used to simulate the implementation error of the sample and held input with a 1kΩ resistor and a selection of capacitor of 1µF, 3.3µF, 10µF, 47µF, or 100µF. Note that the 1µF capacitor provides the smallest unmodeled actuator dynamics and the 100µF capacitor provides the largest one. 2.4.2 HIL Simulation Procedure The PRBS was sampled and held by SPSHI, FTSHI, and BTSHI through real-time simula- tions in dSPACE with the feasible sample and hold parameters of δ = 0.5s and p = 0.3. Note that the time constant of the RC filter is much smaller than that of the simulated system. 20 NMP SystemQ-Markov Cover System ID DT System PRBSdSPACEAUTOBOXRC FilterSHIZOH Therefore, the RC filter dynamics was not significant enough to be included in the ID DT model. Figure 2.9: Filtered PRBS sampled and held by (a) SPSHI, (b) FTSHI, (c) BTSHI Before simulating using different RC filters, the HIL simulation was proceeded with no actuator dynamics, that is, R=C=0. In this case, the poles and zeros of the ID DT system based on the HIL simulation results matched with those of the theoretical DT system, as expected. The magnitudes of the poles and zeros of the analytical (AN) and HIL-ID DT systems are shown in Table 2.2. When the RC circuit is used in the HIL simulations, the input to the system generated by the SHIs is distorted. The level of distortion increases as the RC circuit time constant gets large. The input signals filtered by the RC circuit (with different C values) are shown in Fig. 2.9. Note that for the 1µF and 3.3µF cases, the actuator dynamics effects are not significant enough to alter the input signal. For the 10µF, 47µF, and 100µF cases, as the capacitance increases, the input signals become fairly smooth and their magnitudes decrease dramatically. 21 0 µF1 µF3.3 µF10 µF47 µF100 µF00.10.20.30.40.50.60.70.80.9100.5100.10.20.30.40.50.60.70.80.9101200.10.20.30.40.50.60.70.80.91012(a)SPSHI(b)FTSHI(c)BTSHI 2.4.3 HIL Simulation Results The ID DT system of (2.16) has three zeros. The HIL simulation indicates that for the selected values of p = 0.3, δ = 0.5, C = 1, 3.3, 10, 47, 100µF (2.18) two of the zeros are MP complex conjugate pairs; they are marginally affected by the unmodeled actuator dynamics. The third zero is inside the unit circle for small unmodeled actuator dynamics; and it moves outside the unit circle when the unmodeled actuator dy- namics is increased to a certain level. Another HIL simulation was conducted with δ = 0.5s and p = 0.6. The HIL simulation results of SPSHI, FTSHI, and BTSHI with two p values are shown in Table 2.3. It is clear from Table 2.3 that the real zero is less sensitive to the unmodeled actuator dynamics when the duty cycle is smaller. The locations of the real zeros of the ID systems with 30% and 60% duty cycles are plotted in Fig. 2.10 as functions of the capacitance (unmodeled actuator dynamics). It confirms that the FTSHI and BTSHI has the best and worst robustness, respectively. Table 2.3: The Third Zero Locations of the HIL ID Systems With δ = 0.5s, P = 0.6 and 0.3 Capacitance (µ F) SPSHI FTSHI BTSHI 1 3.3 10 47 100 p = 0.6 p = 0.3 p = 0.6 p = 0.3 p = 0.6 p = 0.3 -0.45 -0.46 -0.49 -0.95 -1.05 -0.25 -0.25 -0.27 -0.35 -0.55 -0.32 -0.32 -0.34 -0.58 -0.74 -0.21 -0.21 -0.22 -0.30 -0.46 -0.62 -0.64 -0.67 -0.99 -1.70 -0.29 -0.30 -0.32 -0.42 -0.65 As a summary, based on the HIL simulation study, the MP characteristics of SHIs are affected by both the level of unmodeled actuator dynamics (SHI implementation error) and the selection of feasible SHI parameters. For a given sampling period, small duty cycle improves the SHI robustness to unmodeled actuator dynamics; see Fig. 2.10. Among the 22 Figure 2.10: Zero movements of the HIL ID systems with two set of feasible sample and hold parameters three SHIs, the BTSHI has the worst robustness property, while the FTSHI provides the best robustness and smallest feasible sampling period with a given duty cycle. 23 0102030405060708090100-1.8-1.6-1.4-1.2-1-0.8-0.6-0.4-0.20 SPSHI with p = 0.3SPSHI with p = 0.6FTSHI with p = 0.3FTSHI with p = 0.6BTSHI with p = 0.3BTSHI with p = 0.6Zero ValueCapacitance CHAPTER 3 DEMONSTRATION OF PERFORMANCE IMPROVEMENT I 3.1 Single inverted pendulum (SIP) system A Quanser SIP system is used for the purpose of demonstration - see Fig.3.1. The system is comprised of a pendulum hinged on a cart that moves freely on a horizontal track, where xc is the cart displacement, α is the pendulum angle, u is the control input, and f is the overall friction. Figure 3.1: The Single Inverted Pendulum System The SIP system parameters are defined in Table II. The free body diagram of the SIP is shown in the following figure. The EOMs of the SIP system is derived as follows: Summing the horizontal force of the 24 Figure 3.2: Inverted Pendulum Free Body Diagram cart F = Mc ¨x + Beq ˙x + N + Fa (3.1) where N is the reaction force between cart and pendulum. Fa is the inertia force due to the armature motor rotation. For the reaction force N , it is represented as N = Mp ¨xp where xp is the pendulum horizontal displacement. It can be specified as xp = x − lp sin α ˙xp = ˙x − lp ˙α cos α ¨xp = ¨x − lp ¨α cos α + lp ˙α2 sin α (3.2) (3.3) where x is the cart position. Substitute the ¨xp into (3.2), the reaction force N becomes N = Mp ¨x = Mp(¨x − lp ¨α cos α + lp ˙α2 sin α) the motor running armature inertia force Fa is specified as Fa = ηgKgTa rm (3.4) (3.5) where ηg is the gearbox efficiency Kg is the gearbox ratio. Ta is the motor torque, which can be written as Ta = Jm ¨α = JmKg ¨x rm 25 (3.6) Jm is the motor moment of inertia, and rmp is the motor pinion radius. The resultant inertia force becomes Fa = ηgK2 g Jm ¨x r2 m (3.7) So, the first equation of motion becomes F = (Mc + Mp + g Jm ηgK2 r2 mp )¨x + Beq ˙x − Mplp ¨α cos α + Mplp ˙α2 sin α (3.8) In this EOM, F is the driving force from the motor. F = ηgKgTm rmp in where Tm is the motor torque specified as Tm = ηmKt (3.9) (3.10) ηm is the motor efficiency and Kt is the motor torque constant. As a result, the driving force is as F = ηgηmKgKt(rmV − KgKm ˙x) Rmr2 m (3.11) Rm is the motor armature resistance. For the second EOM, sum the moments about the centre of the pendulum, P lp sin α + N lp cos α − Bp ˙α = Jp ¨α (3.12) where Bp is the viscous damping coefficient at the pendulum pivot. Jp is the pendulum moment of inertia. Since the EOM is about the center, Jp is calculated as Jp = 1 12 MpL2 p = 1 3 Mpl2 p To solve this EOM, the vertical displacement need to be considered yp = lp cos α ˙yp = −lp ˙α sin α ¨yp = −lp ¨α sin α − lp ˙α2 cos α 26 (3.13) (3.14) As a result, the vertical force applied on the pendulum is as P = Mp(¨yp + g) = −Mplp ˙α2 cos α − Mplp ¨α sin α + Mpg (3.15) substitute (3.14) & (3.15) into (3.12), which leads to the second EOM: Jp ¨α = −Mpl2 p ¨α + Mpglp sin α + Mplp ¨x cos α − Bp ˙α (3.16) 3.2 Dynamic Model with Coulomb Friction Term Figure 3.3: Coulomb Friction The coulomb friction can be written as v(t) (cid:54)= 0 : Ff (t) = µFN sgn(v(t)) (3.17) v(t) is the cart velocity ( ˙x) and FN is the gravity force, which is the cart and pendulum weight in force: FN = (Mc + Mp)g (3.18) Summing the horizontal force of the cart F = Mc ¨x + Beq ˙x + µ(Mc + Mp)g ˙x + N + Fa (3.19) 27 where N is the reaction force between cart and pendulum. Fa is the inertia force due to the armature motor rotation. For the reaction force N , it is represented as N = Mp ¨xp (3.20) where xp is the pendulum horizontal displacement. It can be specified as xp = x − lp sin α ˙xp = ˙x − lp ˙α cos α ¨xp = ¨x − lp ¨α cos α + lp ˙α2 sin α (3.21) where x is the cart position. Substitute the ¨xp into (3.20), the reaction force N becomes N = Mp ¨x = Mp(¨x − lp ¨α cos α + lp ˙α2 sin α) the motor running armature inertia force Fa is specified as Fa = ηgKgTa rm (3.22) (3.23) where ηg is the gearbox efficiency Kg is the gearbox ratio. Ta is the motor torque, which can be written as Ta = Jm ¨α = JmKg ¨x rm (3.24) Jm is the motor moment of inertia, and rmp is the motor pinion radius. The resultant inertia force becomes Fa = ηgK2 g Jm ¨x r2 m (3.25) So, the first equation of motion becomes F = (Mc + Mp + g Jm ηgK2 r2 mp )¨x + Beq ˙x + µ(Mc + Mp)g ˙x − Mplp ¨α cos α + Mplp ˙α2 sin α (3.26) where µ is the Coulomb friction coefficient and F is the motor driving force that given by the expression of F = ηgKgTm rmp 28 (3.27) in where Tm is the motor torque specified as Tm = ηmKt (3.28) ηm is the motor efficiency and Kt is the motor torque constant. As a result, the driving force is as F = ηgηmKgKt(rmu − KgKm ˙x) Rmr2 m (3.29) Rm is the motor armature resistance. For the second EOM, sum the moments about the center of the pendulum, P lp sin α + N lp cos α − Bp ˙α = Jp ¨α (3.30) where Bp is the viscous damping coefficient at the pendulum pivot. Jp is the pendulum moment of inertia. Since the EOM is about the center, Jp is calculated as Jp = 1 12 MpL2 p = 1 3 Mpl2 p (3.31) To solve this EOM, the vertical displacement need to be considered. As a result, the vertical force applied on the pendulum is as P = Mp(¨yp + g) = −Mplp ˙α2 cos α − Mplp ¨α sin α + Mpg (3.32) substitute (3.14) & (3.32) into (3.30) Jp ¨α = −Mpl2 p ¨α + Mpglp sin α + Mplp ¨x cos α − Bp ˙α which leads to the second EOM of 0 = (Jp + Mpl2 p)¨α − Mpglp sin α − Mplp ¨x cos α + Bpα (3.33) (3.34) where the motor inductance is ignored. The values of the parameters that used in the derivation process are provided in TABLE 3.1. The equilibrium point considered for the SIP system is the pendulum upright position with the cart at the origin: α = 0 and xc = 0. For 29 Table 3.1: QUANSER inverted pendulum system parameters [1] Symbol Description Value/Unit R Kt ηm Km Jm Kg ηg rm rp Beq Bp lp Jp Mp Mc Vm µ Motor Armature Resistance 2.6 Ω Motor Torque Constant 0.00767 Nm/A Motor Efficiency 100% Motor EMF Constant Rotor Moment of Inertia 0.00767 Ns/rad 3.9 × 10−7 kgm2 Gearbox Ratio Gearbox Efficiency Motor Pinion Radius Position Pinion Radius Equivalent Viscous Damping Coefficient at Motor Viscous Damping Coefficient at Pendulum Pivot Pendulum Length from Pivot to Center of Mass 3.71 100% 6.35 × 10−3 m 1.48 × 10−2 m 5.4 Nms/rad 5.4 Nms/rad 0.3302 m Pendulum Moment of Inertia 0.00788 kgm2 Pendulum Mass Cart Mass Motor Nominal Input Voltage Coulomb friction coefficient 0.23 kg 0.94 kg 5 V 1.45 control design, the friction is assumed to zero. The linearized state space model with motor driving force as input is given by (2.2), where x = [ xc α ˙xc  ˙α ]T and 0 1 MplpBp q (Mc+Mp)Bp q (3.35) 0 0 0 0   A = B = 0 0 q q  , 0 0 Mpl2 p+Jp q Mplp q (Mplp)2 (Mc+Mp)Mpglp 1 0 q −Beq(Mpl2 p+Jp) MplpBeq q 1 0 0 0  0 1 0 0 C = 30 In (3.35), q is defined as q (cid:44) (Mc + ηgK2 g Jm r2 m + Mp)Jp + (Mc + ηgK2 g Jm r2 m )Mpl2 p For the purpose of state feedback, ˙xc and ˙α are obtained by low-pass filtering the derivatives of xc and α. For the given system parameters listed in TABLE 3.1, the system model matrices in (3.35) are A =  0 0 1 0 0 0 1 0 0 1.522 −4.787 −0.005 0 26.110 −11.029 −0.084  , B =   0 0 0.886 2.043 (3.36) The linearized model in (3.36) has an unstable pole at s = 4.90. Since the SHIs can only be implemented for stable systems [35], a stabilizing controller will be designed first. 3.3 Dual-loop controller design 3.3.1 Inner-loop Stabilizing Controller To stabilize the SIP and improve its performance using SHIs, a dual-loop control system configuration is proposed - see Fig. 3.4. The inner loop (shown in the dashed region) uses a continuous-time LQR implemented at 500 Hz sampling rate; it provides the control input v to stabilize the SIP about its equilibrium configuration. The cost function of the LQR is (cid:90) ∞ 0 J = 1 2 (cid:104) x(t)T Qx(t) + v(t)T Rv(t) (cid:105) dt (3.37) where Q ≥ 0 and R > 0 are the weighting matrices. The state feedback controller is given by u = −Kx, where the control gain K = R−1BT P and P is positive semidefinite solution of the Ricatti equation P A + AT P + Q − P BR−1BT P = 0 (3.38) 31  =   ˙xc ˙α ¨xc ¨α 0 0 0 0 1 0 0 1 64.019 −289.00 61.574 −42.999 147.507 −643.282 141.874 −99.147 (cid:21)  and the stabilized state  xc α ˙xc ˙α  (3.39) Figure 3.4: The dual-loop controlled SIP system We used the LQR designed by Quanser with Q = diag[35, 350, 0.1, 0.1] and R = 0.02. The resultant control gain was K = 41.83 −189.84 47.85 −28.09 equation of the inner-loop is: (cid:20)  0 0 1.530 3.526  w + Note that the inner-loop controller is discretized and implemented in the Quanser control hardware. The inner-loop simulation layout is shown in Fig. 3.5 32 ++ Figure 3.5: The inverted pendulum simulation layout 3.3.2 SHI Parameter Selection For MP Characteristics We begin by converting the system in (3.39) first into the DE system in (2.4) and then into the DT system in (2.11). The Bd matrix in (2.11) will be chosen from (2.12), (2.13) and (2.14) depending on the choice of SHI: SPSHI-DT, FTSHI-DT, and BTSHI-DT. The SHI parameters p ∈ (0, 1] and δ ∈ (0, 1] will be chosen such that the DT system is MP. Parameters p and δ that result in MP characteristics are defined as feasible duty cycle (FDC) and feasible sampling period (FSP), respectively; the set of FSP and FDC is defined as the p-δ feasible region. Since SIP is a two-output system, the SHI parameter selection should be based on both transfer functions. The p-δ feasible regions of SPSHI-DT, FTSHI-DT and BTSHI-DT systems for both transfer functions are shown in Fig. 3.6. The ZOH is a special case of the SPSHI (p = 1). The p-δ feasible region for the ZOH, shown by the thick horizontal line on the top of Fig. 3.6, indicates that the smallest FSP is 0.89s (1.12 Hz). Fig. 3.6 also shows that the FSP can be reduced to 0.173s (5.78 Hz) by using the SHIs with extremely small duty cycles; this will, however, result in large peak magnitudes - see TABLE 2.1. The Bode plots of the system in (3.39) indicate that the bandwidths of the stabilized system are 0.29Hz (cart displacement) and 2.53Hz (pendulum angle). For implementation, the outer-loop sampling rate should be at least twice the bandwidth [53] of the stabilized 33 Figure 3.6: The SIP p-δ feasible regions of BTSHI (Region 1), SPSHI (Region 1+2) and FTSHI (Region 1+2+3). SIP, implying that the sampling rate should be at least 5Hz. From practical considerations, the sampling rate should be at least five times the bandwidth; this corresponds to a sampling rate of 12.5Hz (0.08s sampling period). According to Fig. 3.6, the minimum FSP is 0.173s (5.78 Hz) - this implies that it will not be possible to adequately control the pendulum. Since the cart dynamics is considerably slower (0.29Hz), FSPs of 0.3s (3.3Hz) and 0.4s (2.5 Hz) can improve the performance of the cart displacement. Although the minimum FSP is 0.173s, higher values were chosen to avoid large peak input that may exceed the actuator limit. From Fig. 3.6, it can be seen that for the SPSHI, the maximum duty cycles for sample periods of 0.3s or 0.4s are 0.656 or 0.798, respectively. The FTSHI system has a larger p-δ feasible region and the corresponding feasible duty cycles are 0.886 and 1.0 for 0.3s and 0.4s sampling periods, respectively. The selected SHI parameters are marked with dotted lines in Fig. 3.6. Based on the results in [35] and the p-δ feasible regions in Fig. 3.6, the BTSHI-DT is not considered. The circle and square marks along the δ = 0.3s dashed-line will be discussed later. 34 3.3.3 Outer-Loop Controller Design A discrete-time LQR is designed for the outer-loop to provide additional control effort to improve the performance of the stabilized DT system. Consider the cost function: xT (k)Qdx(k) + wT SHI (k)RdwSHI (k) (3.40) (cid:105) ∞(cid:88) (cid:104) k=0 J = 1 2 (cid:21) where Qd = diag[10, 1000, 1, 1] and Rd = 0.02. These values were chosen through trial and error to provide adequate control authority and avoid actuator saturation. For the choice of SPSHI with p = 0.2 and δ = 0.3s, the LQR gains were obtained as Kd = −8.63 12.80 −7.99 5.45 . The dual-loop simulation layout is shown in Fig. 3.7 (cid:20) Figure 3.7: The inverted pendulum dual-loop simulation layout 3.4 Simulation and experimental validation 3.4.1 Experimental Set Up To evaluate the effectiveness of the dual-loop control design, simulations were first conducted and then validated through experiments using a Quanser SIP system [54]. The experimental 35 Figure 3.8: The SIP experiment hardware connection hardware configuration is shown in Fig. 3.8. In this system, the cart is driven by a motor with a planetary gear head. The cart displace- ment is measured by a US Digital E2 encoder with a resolution of 0.023 mm. The pendulum angle is measured by another similar encoder with a resolution of 0.018 deg (an upgrade from the Quanser provided encoder with 0.086 deg resolution). The Quanser Q8-USB DAQ system is used for data acquisition and control; the control signal to the motor is amplified by the Quanser VoltPAQ. It should be mentioned that both control loops are implemented in the same host computer and no additional hardware is therefore required. 3.4.2 Simulation and Experiment Results The simulation and experimental results of cart displacement and pendulum angle for SPSHI- DT systems are shown in Figs. 3.10 (a) and (c) for δ = 0.3s and in Figs. 3.10 (b) and (d) for δ = 0.4s. The results for FTSHI-DT systems are similarly shown in Fig. 3.12. In all the figures, dotted lines are used to show simulation results and solid lines are used for experimental results. The results are shown for three time segments: the first segment 36 Figure 3.9: The SIP experiment set up in the lab (0−20s) corresponds to the response of the system in the absence of the outer-loop controller, the second segment (20 − 40s) corresponds to dual-loop controller with p = 0.2 for SPSHI and p = 0.4 for FTSHI, the third segment (40 − 60s) corresponds to p = 1.0 for both SHIs. The choice of p = 1.0 is used to compare with ZOH. The oscillations in the responses are mainly due to the Coulomb friction between the cart and track; it was artificially introduced in the simulation model (see (3.26)), where the value of µ = 1.45 was used to achieve a close match with experimental results. The SIP system was studied in both simulations and experiments. For each SHI (SPSHI or FTSHI) and sampling period (δ = 0.3s or δ = 0.4s), the total run time was 300s: started with 50s of inner-loop only and followed by 50s of dual-loop control with p = 0.2. For each additional 50s, the duty cycle is increased by another 0.2 until it reached 1.0. The corresponding cart displacement, pendulum angle, and control voltage signals for δ = 0.3s are shown in Figs. 3.10 (a), (b), and (c) for SPSHI-ST system and in Figs. 3.11 (a), (b), and (c) for FTSHI-DT system, respectively. 37 Similarly, the simulation and experiment results for δ = 0.4s are shown in Figs. 3.12 (a), (b), and (c) for the SPSHI-DT system and in Figs. 3.13 (a), (b), and (c) for the FTSHI-DT system, respectively. The simulation and experimental results are overlaid for each case using dotted and solid lines, respectively. The vertical straight black-dashed lines are used to mark these 50s time intervals. The oscillation responses in the experiments are mainly due to the coulomb friction between the cart and track. The encoder noises are also contributing to the oscillation, however, the contribution is minor due to its high resolution. These factors were simulated by tuning the friction coefficient to match the simulated and experimental results. Table 3.2: Experimental results for inner-loop LQR and dual-loop control with SPSHI and FTSHI p |x|avg(mm) |x|avg(mm) |u|avg(V ) |u|avg(V ) δ = 0.4s δ = 0.3s δ = 0.3s δ = 0.4s Inner-loop N/A 16.440 SPSHI FTSHI 0.2 0.4 0.6 0.8 1.0 0.2 0.4 0.6 0.8 1.0 5.105 5.371 8.125 14.477 22.233 8.481 7.348 7.792 9.286 12.427 9.307 9.322 10.384 13.559 21.533 12.115 10.970 10.615 11.237 12.711 0.806 0.531 0.578 0.712 0.771 0.859 0.677 0.644 0.698 0.758 0.826 0.717 0.771 0.840 0.866 1.018 0.812 0.777 0.843 0.890 0.889 The mean absolute values of cart displacement (|x|avg) and overall control voltage (|u|avg) of experimental results are shown in TABLE 3.2 with δ = 0.3s and δ = 0.4s. The mean 38 Figure 3.10: The simulated and experimental results of the SPSHI-DT with δ = 0.3s for the SIP system absolute value for a variable is defined as the ratio of the L1-norm of the sampled data vector and vector size. The best performances in terms of duty cycle p are highlighted with boxes and marked with circle and square in Fig. 3.6 for SPSHI and FTSHI, respectively. The experimental results in TABLE 3.2 show that with δ = 0.3s and p = 0.2, the mean absolute value of cart displacement amplitude reduces significantly from 16.440 mm (inner-loop only) 39 Figure 3.11: The simulated and experimental results of the FTSHI-DT with δ = 0.3s for the SIP system down to 5.105 mm (68.95% reduction) for SPSHI and to 7.348 mm (55.33% reduction) for FTSHI with δ = 0.3s and p = 0.4. The corresponding mean absolute values of the control signals are also reduced from 0.806V (inner-loop only) to 0.531V (34.1% reduction) for the SPSHI and to 0.644V for the FTSHI. The experimental control voltage signals show that use of SHIs does increase control effort in terms of mean absolute value. 40 Figure 3.12: The simulated and experimental results of the SPSHI-DT with δ = 0.4s for the SIP system For the purpose of comparison, the best experimental results for SPSHI and FTSHI are compared with the result obtained with the inner-loop controller only - see Fig. 3.14 for cart displacement amplitudes and overall control signals, respectively. The SPSHI is seen to outperform the FTSHI. In order to understand the trend of system response under different SHIs, all the data 41 Figure 3.13: The simulated and experimental results of the FTSHI-DT with δ = 0.4s for the SIP system in TABLE 3.2 is plotted in Fig. 3.15. The |xc|avg for SPSHI and FTSHI are shown in Figs. 3.15 (a) and (b) for δ = 0.3s and 0.4s. Similarly, the |u|avg for SPSHI and FTSHI are shown in Figs. 3.15 (c) and (d). Both the SPSHI and FTSHI outperform the baseline controller in terms of |xc|avg. Also, the higher sampling rate δ = 0.3 requires less control effort |u|avg while providing better performance in general. 42 Figure 3.14: The best experimental results of dual-loop with SPSHI and FTSHI compare with inner-loop controller 43 Figure 3.15: The trend of dual-loop control response 44 CHAPTER 4 DEMONSTRATION OF PERFORMANCE IMPROVEMENT II 4.1 Segway Mini segway (MS) is a two-wheel self-balanced robot. It utilizes a microcontroller (Ar- duino), two motor-wheel sets and a cart body. The free body diagram of the MS system is shown in Fig. 4.1, where two motors provide the torques (τL and τR) to prevent the cart body from falling and also to move the cart forward, backward and make it turn; xcart is the cart displacement in x direction; and θp and φ are the cart body roll angle and cart yaw angle, respectively. Figure 4.1: Free body diagram of the mini segway robot 4.1.1 Motor Modeling Sine the left and right motor/wheel are identical, only the derivation for the left motor/wheel is showed here. When the control current iL is applied, the motor torque is as τmL = KmiL (4.1) 45 Figure 4.2: Motor diagram and there is back electro magnetic voltage VeL, defined as follows VeL = KeωL From Kirchhoff’s voltage law of the DC motor, we have uL − RmiL − Lm diL dt − VeL = 0 which results in the DC motor linear equation: diL dt = uL Lm − Rm Lm iL − VeL Lm The DC motor has the torque equation of ΣM = τmL − Kf ωL − τaL = Iw dωL dt as a result, the second DC motor linear equation is as dωL dt = Km Iw iL − Kf Iw ωL − τaL Iw So, the DC motor EOM for the left wheel is as  diL uL dt = Lm dωL dt = Km Iw − Rm Lm iL − Kf iL − Ke ωL ωL − τaL Lm Iw Iw 46 (4.2) (4.3) (4.4) (4.5) (4.6) (4.7) TmL + U£ TL Simplifying the motor dynamics by setting the inductance to zero  iL = ωL − Ke uL Rm Rm iL − Kf Iw Iw dωL dt = Km Iw ωL − τaL So the approximation of the motor angular accelerations are ωL − Kf Iw uL − KmKe IwRm Km IwRm dωL dt = ωL − τaL Iw combining equation (4.5) and (4.9), the motor generated torque is as τmL = −KmKe Rm ωL + Km Rm uL 4.2 Equations of the Wheels (4.8) (4.9) (4.10) Figure 4.3: Free Body Diagram of the Wheel In the cart model, the left motor angular speed is replaced by ˙θL and the right motor angular speed is ˙θR. From the motor equation, the driving torques on the left and right 47 wheels are what’s left from the motor generated torque fights against motor internal friction.  τL = −KmKe τR = −KmKe Rm Rm ˙θL + Km Rm ˙θR + Km Rm uL − Kf uR − Kf ˙θL ˙θR (4.11) Summing the moments around the contacting point of the left wheel and ground: ΣML = τL − FLr = τmL − Kf ˙θL − FLr = (Iw + r2mw)¨θL (4.12) where FL is the cart to left wheel force. Assuming no slip, the driving force on both left and right wheels are as FL = −KmKe Rmr −KmKe Rmr After linear transformation of: FR = ˙θL + ˙θL + − Iw ¨θL − mw ¨θLr r − Iw ¨θR − mw ¨θRr r Km Rmr Km Rmr ˙θL uL − Kf r ˙θR uR − Kf r ˙φh r + r r − ˙φh  ˙θL = ˙x  xL = x + φh xR = x − φh ˙θR = ˙x r (4.13) (4.14) (4.15) (4.16) and The driving forces become FL = FR = −KmKe Rmr2 −KmKe Rmr2 ˙xL + ˙xR + Km Rmr Km Rmr uL − Kf ˙xL uR − Kf ˙xR r2 − Iw r2 − Iw r2 ¨xL − mw ¨xL r2 ¨xR − mw ¨xR 4.3 Equations of the Pendulum Summing the force in x-axis of the pendulum: ΣFx = FL + FR = mp ¨xp (4.17) Since the pendulum acceleration in x-axis is as in (3.21), so equation (4.17) becomes ΣFx = FL + FR = mp ¨xp = mp ¨x − mpl ˙θ2 psinθp + mpl ¨θpcosθp (4.18) 48 Figure 4.4: Free Body Diagram of the Pendulum Substitute equation (4.16) into equation (4.18) and we get the first segway EOM: −2KmKe Rmr2 ˙x + Km Rmr (uL + uR) − ( 2Iw r2 + 2mw)¨x − 2Kf ˙x r2 = mp ¨x − mpl ˙θ2 psinθp + mpl ¨θpcosθp Summing the moments around the pendulum joint and we have the second EOM: (Ip + mpl2)¨θp = −mpl¨xcosθp + mplgsinθp − (τL + τR) (4.19) (4.20) When the cart is making a turn, the difference between the generated forces of the two wheels result in the pendulum spinning about the Z-axis, which is defined in the following figure. The associated governing equation is as: ¨φIpz = (FL − FR)h (4.21) 49 Figure 4.5: Cart turning angle definition where Ipz is the pendulum moment of inertia about z-axis and it is calculated as: (cid:90) ltot mp ltot 3 Ipz = = (ysinθp)2dy + 2Iw + 2mwl2 0 4mpl2sin2θp + 2Iw + 2mwl2 (4.22) Substitute equation (4.16) into this we can get: ¨φIpz = −KmKeh Rmr2 ( ˙xL− ˙xR)+ Kmh Rmr (uL−uR)− Iwh r2 (¨xL− ¨xR)−mwh(¨xL− ¨xR)− Kf r2 ( ˙xL− ˙xR) According to equation (4.15), equation (4.23) becomes ¨φIpz = −2KmKeh2 Rmr2 ˙φ + Kmh Rmr (uL − uR) − 2Iwh2 r2 ¨φ − 2mwh2 ¨φ − 2Kf h r2 ˙φ (4.23) (4.24) where r is the wheel radius, h is the half cart width, φ is the cart turning angle and x is the cart position. Replace the θL, θR, xL and xR therms in equation (4.19), (4.20) and (4.24) to get the EOM: 50 2Iw r2 + 2mw)¨x = −2KmKe Km (mp + Rmr (Ip + mpl2)¨θp = −mpl¨xcosθp + mplgsinθp + Rmr2 ˙x + (uL + uR) − 2Kf ˙x ˙x − Km 2KmKe Rm r2 + mpl ˙θ2 psinθp − mpl ¨θpcosθp (uL + uR) + 2Kf r ˙x Rmr Kmh Rmr ˙φ + (uL − uR) − 2Kf h r2 ˙φ (4.25) (Ipz + 2Iwh2 r2 + 2mwh2) ¨φ = −2KmKeh2 Rmr2 4.4 Linearization The linearization is done with the following transformation cosθp = 1, sinθp = θp, and Then the EOM becomes: = 0 (4.26) (cid:18) dθp (cid:19)2 dt 2Iw r2 + 2mw)¨x = −2KmKe Rmr2 ˙x + (mp + (Ip + mpl2)¨θp = −mpl¨x + mplgθp + Km Rmr 2KmKe r2 − mpl ¨θp (uL + uR) − 2Kf ˙x 2Kf ˙x − Km (uL + uR) + Rm r (uL − uR) − 2Kf h r2 Kmh Rmr ˙φ Rmr −2KmKeh2 ˙φ + Rmr2 (Ipz + 2Iwh2 r2 + 2mwh2) ¨φ = For state space form purpose let ˙x (4.27) a = mp + 2mw + 2Iw r2 , b = Ip + mpl2 and c = Ipz + 2Iw r2 h2 + 2mwh2 (4.28) we have ˙x + Km Rmra ¨x = −2KmKe Rmr2a ¨θp = −mpl b ¨x + −2KmKeh2 ¨φ = Rmr2c mpgl b ˙φ + (uL + uR) − 2Kf ˙x r2a ˙x − Km 2KmKe Rmrb Rmb (uL − uR) − 2Kf h ˙x r2c θp + Kmh Rmrc − mpl a ¨θp (uL + uR) + 2Kf ˙x rb (4.29) 51 In the state space form, the firction term Kf is assumed to be 0. To eliminate the double dot terms on the right hand side of these equations, the final EOM is: ¨x = ¨θp = ¨φ = −2KmKe(mplr + b) Rmr2(ab − m2 pl2) 2KmKe(ra + mpl) Rmr2(ab − m2 pl2) −2KmKeh2 ˙x − m2 pl2g ab − m2 mpgla ab − m2 (uL − uR) ˙x + Rmr2c ˙φ + Kmh Rmrc Km(b + mplr) Rmr(ab − m2 pl2 θp + pl2) pl2 θp − Km(mpl + ar) Rmr(ab − m2 pl2)) (uL + uR) (uL + uR) (4.30) The state vector is chosen as [x ˙x θp ˙θp φ ˙φ]T , and the inputs are the applied terminal voltages uL and uR. As a result, the state space form of the segway model is shown below:  (4.31) 0 0 0 0 0 0   A = B = 1 −2KmKe(mplr+b) Rmr2(ab−m2 pl2) 0 2KmKe(ra+mpl) Rmr2(ab−m2 pl2) 0 0 0 −m2 pl2g pl2 0 0 ab−m2 1 0 0 0 0 0 mpgla ab−m2 0 pl2 0 0 0 0 0 0 −2KmKeh2 1 Rmr2c 0 0 0 0 0 0 Km(b+mplr) Rmr(ab−m2 pl2) Km(b+mplr) Rmr(ab−m2 pl2) 0 −Km(mpl+ar) Rmr(ab−m2 pl2)) 0 −Km(mpl+ar) Rmr(ab−m2 pl2)) 0 Kmh Rmrc 0 −Kmh Rmrc  The linearized model in (4.31) is an unstable NMP system. Since the SHIs can only be implemented for stable systems [35], a stabilizing controller will be designed first. The MS system parameters used in this study are shown in Table 4.1. With these parameter values, the MS state-space model becomes (4.32) 52 Description Table 4.1: Segway system parameters (To be determined in the future work) Value/Unit 0.027 V · s/rad 0.23 N · m/A 0.001 N · s/rad 0.0000409 kgm2 0.0012 kgm2 Ω Motor EMF constant Motor torque constant Motor shaft friction coefficient Cart body moment of inertia Motor internal resistance Wheel moment of inertia 4.8 Ω Distance between cart body center of mass and y-axis Wheel mass Cart body mass Wheel radius Half cart width 0.02 m 0.0492 kg 0.7197 kg 0.034 m 0.086 m Symbol Kemf Kτ Rm Kf Iw Ip l mw mp r h  1 0 0 0 0 −26.4502 (4.32) 0 0 0   A = [h!] B = 1 0 0 0 0 −6.8776 −1.6517 0 0 0 0 0 1 0 0 156.8512 107.3635 0 0 0 0 0 0 0 0 0 0 0 0 2.4425 2.4425 0 0 −55.7028 −55.7028 0 0 19.3887 −19.3887  The MS system is open-loop unstable due to a positive pole located at s = 9.5715. A stabilizing controller is mandatory prior to use SHI technique for performance improvement since using SHI requires a stable plant. 53 4.5 Dual-loop controller design 4.5.1 Inner-loop Stabilizing Controller A dual-loop control architecture proposed in [50] is used for the MS system, where the inner- loop controller stabilizes the MS system and outer-loop controller with SHI further improves MS system performance. For this study, as shown in the dashed region of Fig. 4.6, the inner-loop utilizes a continuous-time LQR (referred as LQRc) implemented at 100Hz. The Figure 4.6: Dual-loop control architecture for the MS system cost function for LQRc is Jc = (cid:90) ∞ 0 1 2 (x(t)T Qcx(t) + v(t)T Rcv(t))dt (4.33) where Qc ≥ 0 and Rc > 0 are the weighting matrices. The controller is in the form of v = −Kcx, where Kc = R−1 c BT Pc and Pc is the stabilizing solution of the folowing Ricatti equation PcA + AT Pc + Qc − PcBR−1 c BT Pc = 0 (4.34) For demonstration purpose, an initial set of LQRc weighting matrices were chosen as Qci = diag[100 0.1 300 0.1 10 0.01] and Rci = diag[1 1] and the corresponding control gain is: Kci = (4.35) −7.07 −9.49 −14.64 −0.91 2.24 0.08 −7.07 −9.49 −14.64 −0.91 2.24 −0.08  54 With the initial LQRc, the MS system is stabilized and the resulting closed-loop system remains NMP. 4.5.2 SHI Parameter Selection For δ ∈ (0, 1] and p ∈ (0, 1], the zero locations of the Kci stabilizing MS system can be calculated and the SHI feasible region is shown in Fig. 4.7, where the shaded area is the feasible region that is the common area formed by the sampling period and duty cycle resulting in a MP DT system for the closed-loop system with the inner-loop controller. Figure 4.7: The feasible sampling period of ZOH that result in MP DT system and the p-δ feasible regions of SPSHI. The black horizontal line on the top of Fig. 4.7 represents the feasible region of ZOH, a special case of SPSHI with p = 100%. The smallest sampling period for ZOH to achieve MP DT system is as large as 0.75s. This sampling period can be significantly reduced down to 0.1184s by using the SPSHI with extremely small duty cycle. However for an implementable sampling period (e.g. less than 0.2s), the associated duty cycle is reasonable. Note that achieving samll feasible sample period is very important for improving closed-loop system 55 performance using the outer-loop controller. In order to have the outer-loop controller sample frequency to be adequate to cover system dynamics for both outputs, the normalizes system bandwidths are calculated and they are 1.3Hz and 33.9Hz for cart displacement and cart pitch angle, respectively. For the outer-loop controller, at least 67.8Hz sampling frequency is required [53]. In this case, it is impossible to have the outer-loop controller to cover system dynamics for both outputs. Consequently, only the cart displacement output is considered since it requires a controller with the lowest sample frequency of 2.6Hz [53]. Therefore, small sampling period within the feasible region shown in Fig. 4.7 is preferred. Due to the experimental validation result in [50], small duty cycle leads to better performance. As a result, for the SPSHI, the outer-loop sampling period is chosen as 0.2s, marked using the dashed-line in Fig. 4.7, and the implementation duty cycle is chosen to be 20%. 4.5.3 Outer-Loop Design Since the open-loop MS system is NMP, high gain control could be destabilizing. With the SHI parameters selected in the previous section, it is able to convert the NMP MS system from the continuous-time domain into discrete-time MP system. In order to improve the stabilized MS system performance, the outer-loop controller, a discrete-time LQR (referred as LQRd) with the SPSHI, was used (see Fig. 4.6), and LQRd provides additional control effort for further performance improvement. The LQRd cost function is defined below. ∞(cid:88) k=0 Jd = 1 2 (xT (k)Qdx(k) + ωT SHI (k)RdωSHI (k)) (4.36) Note that selection of LQRd weighting matrices (Qd and Rd) is critical for this study, where an adequate control effort should be guaranteed while maintaning both actuators with their saturation limit of ±12V . 56 4.6 Experimental Hardware The target MS system is built with three main component groups: sensors, actuators and microcontroller. 4.6.1 Sensors In order to balance the MS system about its upright equilibrium point, the measurement signals of cart body pitch angle, pitch angular velocity, each wheel displacement and velocity are required. 1) Body pitch angle and velocity: MPU-6050 sensor that shown in Fig. 4.8 from IvenSense Inc. is used for reading body angular information. It contains a MEMS (microelectrome- chanical system) gyroscope and a MEMS accelerometer in a single chip. The gyroscope is a sensor that measures the angular velocity in roll, pitch, and yaw directions and the accelerometer measures gravitational and motion accelerations in X,Y and Z directions. After disabling the sleep mode of the chip in Simulink, the gyroscope and accelerometer readings are sent to the microcontroller via the Arduino I2C bus. The cart body pitch angular velocity is obtained directly from the gyroscope raw data. Figure 4.8: The MPU 6050 Chip 57 Theoretically, integrating the angular velocity yields the pitch angle, but the sensor noise and bias cause the integrated angle signal drift. Note that the pitch angle can also be obtained from the arc-tangent value of the X and Z direction gravitational accelerations from the accelerometer signals, however the sensor noise and external forces could also affects its accuracy easily. Hence, a complementary filter, developed in [55], is used to have an accurate pitch angle signal; see the complementary filter in Fig. 4.9. Figure 4.9: The Complementary Filter To compensate the gyroscope drift with the accelerator reading, it applies a low-pass filter and a high-pass filter to accelerometer and gyroscope readings, respectively. In the MS that used in this paper, T s = 0.02 s was used for the filter. 2) Wheel displacement and velocity: The MS displacement is measured with two hall-effect rotary encoders mounted on the two motors (As shown in Fig. 4.10). The motor encoders output digital signals of both motor shaft positions with a resolution of 1320 samples per revolution. The encoder readings can be converted into cart displacement and velocity based on gear ratio and wheel radius. 4.6.2 Actuators As shown in Fig. 4.10, two of these 12V DC motors with a 1 : 4 gear ratio are used, where the motor peak speed is 333 RPM and peak output power is 4.8W. The motor torque parameter 58 Figure 4.10: 12V Motor and Hall Effect Encoder Kτ is 0.23 N m/A. The MKR motor carrier that shown in Fig. 4.11 is used to drive both two motors and read out both encode signals. It has an operating voltage of 5 to 12V and uses a L298P motor driver. The maximum output current is 2A/channel, which is lower than the motor maximum current of 6.5 A so that the motors are protected from excess current. Figure 4.11: Arduino MKR Motor Carrier 59 4.6.3 Microcontroller For the purpose of balancing the MS system, the microcontroller speed has to be adequate for sampling sensor signals, communicating with the host computer via Wi-Fi, and generat- ing control commands for both motors. The sample periond is limited by the feasible region to 0.1s and any Arduino board is suitable for this task if the control algorithm is written in Arduino language. However, for this study, the control algorithm was developed in Mat- lab/Simulink, which requires additional throughput from the microcontroller to handle the communication between the Arduino microcontroller and real-time Simullink via Wi-Fi; see Fig. 4.13 below. Therefore, a more advanced Arduino board, Arduino MKR 1000 Wi-Fi is selected for this study. It uses the microcontroller with a clock speed of 48 HMz that is capable of handling the sampling frequency of 100Hz. Figure 4.12: Arduino MKR1000 WiFi 4.6.4 Experimental Set Up The MS experimental hardware configuration is shown in Fig. 4.13. The rectangular box represents the MS cart. All the sensor signals are fed into the Arduino MKR 1000 and send to the host computer via Wi-Fi. The host computer then generates control signals in the 60 Matlab/Simulink and sends back to the microcontroller to drive the motors using the MKR motor shield. Figure 4.13: The MS system hardware configuration The MS built in the lab is shown in Fig. 4.14. Figure 4.14: The MS Picture 61 4.7 Experimental Implementation 4.7.1 Inner-loop LQR Tuning After the MS system platform was developed, the inner-loop LQRc is implemented to stabi- lize the MS system. A ”baseline” system performance was established based on Qci and Rci. Started from this ”baseline” and with Qci matrix fixed, the weighting matrix Rc was tuned by introducing a gain GRc such that Rc = GRcRci. Experiments were conducted with GRc from 0.6 to 1.2 with an increment of 0.1. The cart displacement and pitch angle are shown in Fig. 4.15 (a) and (b). The corresponding control voltages are shown in Fig. 4.15 (c). The mean absolute values of the cart oscillation magnitude (|xcart|avg), pitch angle (|θp|avg) and the corresponding control voltage (|v|avg) for each GRc are shown in Table 4.2. Table 4.2: The Mean Absolute Values of Cart Displacement and Control Voltage For Inner-loop LQRc Tuning N/A 0.3 GRc Value 0.7 0.5 19.35 15.32 18.63 12.17 4.31 2.56 1.08 0.85 3.96 2.44 1.16 1.00 0.9 1.1 16.58 ∞ 0.89 ∞ 1.10 ∞ |xcart|avg (mm) |θp|avg (mm) |v|avg (V) and the data is plotted in Fig. 4.16. From Fig. 4.15, when GRc is 0.6, the resulting LQR control gain is high, the MS system outputs including pitch angle and dispalcement oscillate with very high frequencies. When GRc = 0.7 with a reduced control gain, the cart oscillation magnitude is reduced but is still unstable. As a result, these two GRc values are not feasible since they do not result in feasible LQRc controllers for stabilization purpose. For GRc = 0.8, the closed-loop system 62 Figure 4.15: The experimental result for inner-loop LQRc optimization takes about 5s to stabilize, therefore, the GRc region between 0.7 and 0.8 is the transition one from unstable to stable for the MS system (as shown in Fig. 4.16). The closed-loop system performance is further improved with GRc = 0.9 and the cart is also stabilized with GRc = 1.0 with an increased oscillation magnitude. When GRc reaches 1.1, the closed-loop system has an unbounded oscillation magnitude for cart displacement, indicating an unstable system. The data in Table 4.2 is plotted in Fig. 4.16. In spite of the undesired range and unstable range, the feasible (stabilizing) GRc is between 0.8 and 1.0. 63 Figure 4.16: LQRc tuning data plot 4.7.2 Outer-Loop Controller Tuning For each stabilizing GRc using for the inner-loop LQRc, the outer-loop LQRd controller was tuned accordingly to achieve optimal performance. A ”baseline” LQRd was designed first using weighting matrices Qdi = diag[100 0.1 80 0.1 10 0.01] and Rdi = diag[1 1]. With the feasible LQRc controllers, the dual-loop feasible regions are shown in Fig. 4.17 . The smallest feasible sampling periods are 0.1136s, 0.1162s and 0.1184s for GRc values of 0.8, 0.9, and 1.0, respectively. Since the feasible regions of the closed-loop systems with SPSHI in Figs. 4.7 and 4.17 changes a little, the SHI parameters remain unchanged at p = 20% and δ = 0.2s. 64 Figure 4.17: The feasible region of the closed-loop MS system with SPSHI For the purpose of tuning, GRd was introduced so that Rd = GRdRdi, where GRd ranges from 0.3 to 1.1 with a 0.2 increment while Qdi matrix is fixed. Smaller GRd values such as 0.1 and 0.2 were tested but the corresponding LQRd gain was too large for the MS system so that the nonlinearity characteristics were excited and resulted in unstable system responses. The control gain tuning is to achieve the best performance improvement of cart oscillation magnitude. For GRc = 0.8, 0.9and1.0, the outer-loop tuning result is shown in Fig. 4.18, Fig. 4.19 and Fig. 4.20,respectively. The data in Fig. 4.18, Fig. 4.19 and Fig. 4.20 are shown in the table below. The reason why the data in Table 4.3 is different with that in Table 4.2 for the inner-loop controller case is due to the variation of the battery position and unmodeled actuator dynam- ics of the MS system. However the data is adequate for observing the outer-loop controller effectiveness. For a maximized performance improvement, GRc = 0.9 is apparently the best: The inner-loop controller results in the smallest cart oscillation magnitude meanwhile the outer-loop has the best performance improvement of 64.8% (It is 51.6% and 60.0% for GRc values of 0.8 and 1.0, respectively). Therefor the criteria for tuning the inner-loop LQR is 65 Figure 4.18: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 0.8 for the best local performance and only GRc = 0.9 is considered. The experimental result in Fig. 4.19 is divided into six segments. Segment I corresponds to the response of the inner-loop MS system with LQRc only, which is tuned in the previous section and it is used as the baseline controller. Start from segment II to segment VI, the GRd values increases from 0.3 to 1.1 with 0.2 increment. The experimental results with SPSHI in Fig. 4.19 (a) show that the outer-loop LQRd with GRd = 0.3 reduces the amplitude of the cart displacement significantly. However the 66 Figure 4.19: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 0.9 cart body pitch angle that shown in Fig. 4.19 (b) is barely affected due to aforementioned inadequate control frequency. From segment II to segment VI, with the increasing GRd value, the cart displacement increases while the SHI control effort is decreasing. The overall (u) and SPSHI (ω) control efforts and are shown in Fig. 4.19 (c) and Fig. 4.19(d), respectively. The SPSHI signal is 0 in segment I since only LQRRc is used. The outer-loop is activated from segment II and it starts to generate additional control effort, which reduced the cart displacement. As GRd increases, the SPSHI signal decreases and 67 Figure 4.20: The Experimental result for Outer-loop Controller Optimization with SPSHI and GRc = 1.0 result the increase of cart displacement. The mean absolute values of the cart displacement, overall control input voltage and SHI voltage in Fig. 4.19 for each GRd value are shown in Table 4.4. The data in Table 4.4 is plotted in the figure shown below. The best cart displacement is boxed in the table. From the trend shown in Fig. 4.21 (a), when GRd = 0.3, the cart oscillation magnitude reaches the local minimum, meanwhile the cart pitch angle is slightly higher than the single loop case. The numerical results show that 68 Table 4.3: The Mean Absolute Values of Outer-loop LQRd Tuning Data with different GRc Values N/A 0.3 GRd Value 0.7 0.5 0.9 1.1 27.87 13.50 15.46 15.64 16.89 15.51 10.94 3.85 5.39 6.29 6.84 7.36 16.59 6.63 8.00 10.55 12.07 13.29 GRc = 0.8 |xcart|avg(mm) |xcart|avg(mm) |xcart|avg(mm) GRc = 0.9 GRc = 1.0 Table 4.4: The Mean Absolute Values of Outer-loop LQRd Tuning Data with GRc = 0.9 N/A 0.3 GRd Value 0.5 0.7 0.9 1.1 10.94 3.85 5.39 6.29 6.84 7.36 0.95 0.98 1.00 0.99 1.08 1.11 0.69 0.47 0.52 0.55 0.56 0.57 0 0.047 0.04 0.03 0.027 0.023 |xcart|avg (mm) |θp|avg (mm) |u|avg (V) |ω|avg (V) the inner-loop mean absolute cart displacement amplitude is reduced from 10.94 mm to 3.85 mm at GRd = 0.3, which is 64.8% reduction. Note that even though the SPSHI signal in Fig. 4.19 (d) ranges from −1 to 1V, it does not increase the overall control voltage in Fig. 4.19 (c). Also the trend in Fig. 4.21 (d) shows that higher SHI control signal can result in low overall control voltage. 69 Figure 4.21: LQRd tuning data plot 70 CHAPTER 5 AGRICULTURE PROJECT: FAULT DETECTION ON SOLID-SET CANOPY DELIVERY SYSTEM FOR APPLE FARM A solid-set canopy delivery system (SSCDS) is developed to deliver water and chemical solusions to high-density fruit trees with the support from USDA-SCRI (US Department of Agriculture Specialty Crop Research Initiative). For the purpose of detecting SSCDS faults, two methods were proposed and they are flow and/or pressure sensors based in-line detection method and thermal image based detection method (main focus of this paper). A FLIR thermal camera was mounted on a modified commercial Unmanned Aerial Vehicle (UAV) so that any plug, partial plug, and gusher faults can be captured by the thermal camera during the water and chemical spray process. With the help of a image processing software, the thermal video is stitched into one panorama image. By comparing it with a baseline panorama image, the SSCDS faults can be detected. The main advantage of the proposed fault detection method is the ability of distinguishing all three types of faults over a huge area within a fairly short amount of time, utilizing only a UAV equipped with both regular and thermal video cameras. The future work is to fly the UAV automatically based on a pre-planned route, collect the thermal video, process the panorama image and diagnose the SSCDS faults. 5.1 Introduction This project is funded by the USDA-SCRI to the research and extension team of Michi- gan, Washington, and New York. A solid-set canopy delivery system (SSCDS) was built on the apple orchard located at the Clarksville Research Center of the Michigan State University in Clarksville, MI, USA. This project is to demonstrate high-density tree fruit production and evaluate SSCDS spray coverage for additional perennial fruit crops. SSCDS consists of a network of micro-sprayers positioned in the tree canopy/trellis and connected to a pump- 71 ing/mixing station. SSCDS application virtually eliminates applicator exposure common to tractor-based sprayers, while increasing farmers’ ability to apply sprays during critical weather periods, which will help to ensure that US growers remain competitive in an in- creasingly globalized marketplace. To ensure reliability and longevity, fault detection of the SSCDS is necessary. Due to the nature of SSCDS, the fault detection should be low cost, precise and fast. The cost is the most important concern for growers since the investment return period is too long to afford a high cost system; also the diagnostic system needs to be precise and fast to locate the faults in the irrigation system to minimize the fault impact. As a result, two fault detection schemes were proposed and they are in-line and thermal fault detection. Previously, in-line fault detection was conducted using flow meters, pressure sensors and/or valves ( [56], [57] and [58]), however these schemes require to install sensors on each emitter, which could result in unaffordable cost for larger orchards. A low cost scheme was developed in [59], but it was unable to locate the fault precisely. For the SSCDS a low cost and precise in-line fault detection scheme was developed, which consists of an in-line flow sensor, a transmitter and a receiver. It was designed to detect faults in each section consisting of three manifolds, where each manifold is formed by three emitters. The low-cost flow sensor was used to report any abnormal flow within the corresponding section via a low-cost micro- transmitter. The SSCDS faults can be identified as soon as spray starts. However, due to device degradation, installation and device variations the in-line fault detection method could lose its detection accuracy as the system ages. The second fault detection scheme is based on thermal (IR) imaging technology. It is widely used nowadays for fault detection of electrical assets ( [60]), ground water monitoring ( [61], [62]) and defense system applications ( [63]). This technology was also used in agricul- ture area including food or crop health inspection ( [64], [65] ), plant stress monitoring ( [66]), irrigation system fault detection ( [67] and [68]), etc. Based on these successful applications, thermal imaging fault detection using UAVs were studied by [69], [70] and [71]. As a re- 72 sult, the aerial thermal technology was proposed for the SSCDS as the second fault detection scheme. It utilizes a modified drone with an additional thermal (IR) camera mounted. Along with the attached RGB camera, the drone takes both thermal and RGB videos at the same time during the spray process. Since a commercial drone is used instead of a professional drone, the fly time is limited by its battery size. With a video transmitter, an extra thermal camera and a gimbal mounted, the fly time is reduced from 25 minutes (without payload) to about 20 minutes. A fly pattern was designed to maximize thermal and RGB videos taken using the modified drone so that it is able to monitor up to 5 rows (300 feet each) within one run. With the help of image processing software, images from both thermal and RGB videos can be stitched into panorama pictures, making it convenient to identify the faults via image processing algorithms. The thermal and RGB panorama pictures provide detailed information regarding system faults, comparing with the in-line fault detection method. It is able to identify any single spray fault based on the stitched panorama pictures. Since the thermal camera captures relative temperature, fault detection under multiple operational temperature conditions were studied and the thermal image-based method is able to identify all these faults. However, this method is limited by certain weather condition. For instance, the drone is not operable under heavy wind (e.g., wind speed over 10m/s) or rain. Also the thermal fault detection method requires relatively expensive devices such as the drone and thermal camera (both over $2000), and it also requires a professional pilot license to operate the drone. But it is possible, in the future, that thermal fault detection service can be done by an independent professional company, which will significantly reduce the cost. 5.2 Solid-Set Canopy Delivery System 5.2.1 Emitters A Solid-Set Canopy Delivery System (SSCDS) consists of two main parts: irrigation system and sprayer. The irrigation system is designed based on the sprayer selection and orchard layout. The apple trees are planted 3 feet apart in rows and separated in sections by wooden 73 poles every 7 to 10 trees; see Fig. 5.1. Two types of emitters were selected for SSCDS: Figure 5.1: SSCDS Layouts The first type of emitter is the Hadar 7110 shown in Fig. 5.2. It produces 8.7 gallon/hour flow in the form of mist. Three emitters form a triangle manifold and manifolds were mounted 6 feet apart. Figure 5.2: The Hadar 7110 Emitter 74 The second type of emitter, called Spinner shown in Fig. 5.3, has higher flow rate and produces 26.4 gallon/hour flow in the form of droplets. There is one Spinner hanging over each tree. Figure 5.3: The Spinner Emitter For both types of emitters, all manifolds were fed through a 32 psi stop drip device for building up the pressure inside irrigation line and the system was pressurized to 60 psi at run time. 5.2.2 Irrigation Systems The irrigation layouts for Hadar 7110 and Spinner emitters are shown in Fig. 5.1 (a) and (b), respectively. Both irrigation layouts utilize a water pump and an air compressor. Chemical solution will be pumped into the waterline and held within sections by the special designed valve between every two sections. After the waterline is filled up, the airline is pressured by the air compressor so that the solution trapped in the waterline is pushed out through the emitter manifold section-by-section to complete the spray process. 75 5.2.3 SSCDS Spray Pattern In order to deliver roughly the same amount of solution to the canopy in each section, a special design of the spray system was developed. There are two pipe along the row as a set: upper air line and lower water line. The spray manifold locates at a optimized location in the lower water line. Between each segment, a valve box is used to connect the upper air line and the lower water line. The spray pattern and the use of the valve box is shown in Fig. 5.4 Figure 5.4: SSCDS Spray Pattern The pattern can be summarized as: 76 1. Initial condition: no air or water pumped into the air and water lines. 2. The water line is filled with solutions. As the in-line pressure is building up, the valve boxes are activated to segment the water line and keep the solutions within each segmentation. 3. The air line is filled with 60 psi air flow that provided by a portable air compressor. 4. When the static air pressure in the air line reaches 35 psi, the valve between air and water lines will be open to push the solution through the emitter manifold segment by segment. 5. The valve box operates with pressure signal. when one segment finishes the spray with the solution in the segmented lower water line, the valve box will close the air-water valve so that the spray will perform in the next segment. 6. When all the solution are sprayed in all of the segments, the user stops the air pump to finish the spray in this row and move onto the next row. 7. On each of the emitter manifold, there is a 25 psi stop drip mechanism that opens up when there is no pressure to eliminate any residual solution in the waterline. This is the SSCDC spray process. It requires a reliable design of the valve box and flow sensor. 5.2.4 In-Line Flow Sensor Due to the size of a farm, the in-line sensor has to be wireless so that the user will identify which row is having an abnormal emitter. In this case, the in-line sensor design is divided into two portion: Sensor and transmitter/receiver. For the flow sensor, we decided to go with the DC Water Turbine Generator Water (shown in Fig. 5.5), which is designed to be in the middle of the water pipe. When there is water flowing through the pipe to push through the generator turbine, the generator is activated. With a modification on the generator, the geneated voltage is not going to be regulated so the flow intensity can be monitored. The generator we chose is called Yosoo 77 DC Water Turbine Generator Water 12V DC 10W Micro-hydro Water Charging Tool. It has the specifications listed below: Figure 5.5: Flow sensor Table 5.1: Flow sensor specification Condition Value/Unit 12V 10M Ω ≥ 220mA(@12V ) Output voltage Output current Insulation resistance Maximum static pressure 0.6MPa (87.02 Psi) Maximum kinetic pressure 1.2MPa (174.05 Psi) Stat pressure 0.05Mpa (7.25 Psi) Mechanical noise Generator life 55dB (Max) ≥ 3000h For the wireless transmitter, it has to be small, low power consumption ut wide range of working voltage, high tolerance of working temperature, long range and long life. With these restrictions, we decided to go with the Transmitter ZF-4 and Receiver ZW21-J (shown in the Fig. )that manufacture by a Chinese company. The specifications are listed below: The selection of the transmitter and receiver fulled the task perfectly. The transmitter will be mounted inside the generator (shown in Fig. 5.7), which solves the reliability issue. Based on the concept, two in-line sensing systems were made for testing purpose and the layout are shown in the Figs.5.8 and 5.9 78 Figure 5.6: Transmitter ZF-4 and Receiver ZW21-J Table 5.2: Transmitter and receiver specifications Receiving Frequency Working Voltage Working Current Working Distance Size Working Temperature Transmitter 315/433 MHZ DC 5V - 12V 35 mA 2 miles Receiver 300/440 MHZ DC 3.6V – 5.5V 3.7 mA 4.7 mA 2 miles 0.77” x 0.73” x 0.26” 1.02”x 0.47”x 0.26” -4 F to +140 F -4 F to +140 F Figure 5.7: The transmitter is mounted inside the generator In Figs. 5.8 and 5.9, the flow generators are marked with red circles and the emitter manifolds are marked with green circles. In Fig. 5.8, the solution deliver system was tested, and in Fig. 5.9, different types of flow generators are tested. 79 Transmitter ZF-4 Receiver ZW21-JAir pipeWater pipeValve box Figure 5.8: The in-line fault sensing system prototype 1 Figure 5.9: The in-line fault sensing system prototype 2 5.2.5 Thermal Fault Detection Due to the nature of the SSCDS, the fault detection mechanism is necessary since the emitters are easy to clog (plug) or fall off (gusher) over time. In order to help growers locate faults in the field without checking emitters one-by-one in person, the Michigan State University (MSU) engineering team developed a fast and precise fault detection scheme – the thermal fault detection mechanism, which uses a commercial drone with a thermal (IR) camera mounted. The live thermal videos of the faulted sections were sent back to the user with a video transmitter mounted on the drone. In this paper, the thermal fault detection is introduced in details. 80 5.2.6 Drone Hardware Selection 5.2.6.1 Drone The selection of commercial drone is critical due to multiple factors. The drone battery is not only used for the drone, it also provides power to the thermal camera, the mounting gimbal and the video transmitter. The battery capacity has to be sufficient for a long flight time with payload. Extra space on the drone is required for mounting the thermal camera without affecting the drone functions including steady hovering and route planing based on GPS and distance sensors. Payload is the third factor since the drone can not take off or perform the onboard functions with excessing payload. These factors require a large drone but the size is also limited by its mobility and cost. After a long process of market research, DJI inspire 1 V2 was selected. The battery supports up to 20 and 25 minutes of flying time with and without payload (up to 550 g), respectively. 5.2.6.2 Thermal Camera This project also requires a thermal camera that is light in weight, small in size, and low operational power. As a result, the FLIR VUE Pro R, a thermal (IR) camera for professional drone, was selected. The specifications of the camera are listed in Table 5.3. This thermal camera meets the requirements for fault detection. It was used for record- ing spray process. The thermal videos are broken into frames and stitched into panorama pictures for post analysis, and the results are shown in the next section. 5.2.6.3 Gimbal A GoPro direct mount for the camera was used at first, however the camera pointing direc- tion changes as the drone moves, and high frequency vibrations with fairly large magnitude, generated by the drone propellers, pass to the camera. All these factors result in unus- able thermal footage. Therefore, the GoPro mount was replaced by a 3-axis gimbal. PID 81 Table 5.3: FLIR VUE Pro R Specifications Size Spectral Band Thermal Imager Weight Zoom Operating Temperature Range Full Frame Rate Lens Options Sensor Resolution Measurement Accuracy Input Voltage Power Dissipation (peak) 2.26” × 1.75” (including lens) 7.5 − 13.5 µm Uncooled VOx Microbolometer 310g Yes – Adjustable via PWM −20◦C to +50◦C 30 Hz (NTSC); 25 Hz (PAL) 6.8mm; 45◦ × 35◦ 336 × 256 ±5◦C or 5% of reading 4.8 − 6.0 VDC 2.1 W (3.9 W) (proportional-integral-derivative) controllers are used to control the three gimbal motors and the PID gains are precisely tuned to minimize any unexpected motion or vibration so that the thermal footage can be stabilized. Even though the camera movement range is lim- ited by the gimbal frame, it still has ± 65 degree freedom in yaw, pitch and roll axises. A small modification was made to the drone logic board so that the gimbal can be powered by the drone battery. Even though the flight time is reduced due to the gimbal power usage, reducing payload is more important for this project. 5.2.6.4 Flight Controller Since the camera has a function of zoom in/out and the pilot needs to adjust the camera to capture perfect videos at different altitudes due to plant height variations, an online flight controller was used so that the pilot can adjust the camera settings and gimbal angle at the same time during the flight. A RadioLink AT9S transmitter/controller and a R9DS receiver 82 are used. The receiver is placed on the drone and it supports both SBUS and PWM signals with up to 10 output channels. It was connected to the gimbal and thermal camera so that all gimbal and camera functions are accessible during the flight. A remote controller tray was made to hold both of the flight controllers (DJI drone and R9DS flight controllers) so that the pilot can operate the drone and control the camera at the same time using both hands. The two controller assembly is shown in Fig. 5.10, where the lower white and upper dolden controllers are for controlling the drone and adjusting the thermal camera, respectively. the iPad mini between two controllers is connected to the drone controller for adjusting parameters and displaying live RGB video. The black screen on the top is connected to a video receiver to observe the live thermal video. Figure 5.10: Controller Tray 5.2.6.5 Video Transmitter For thermal video transmission, a set of DJI Downlink video transmitter and receiver is used. The transmitter is mounted on the drone and powered by the drone battery as well. The 83 receiver was mounted on the back of the controller tray. The channel selection for the video transmission was critical since it may interfere with the RGB video or drone control signal transmissions, which could affect controlling the drone. The modified drone is shown in Fig. 5.11. Figure 5.11: Modified Drone A system diagram is shown in Fig. 5.12 to summarize the modified drone system archi- tecture. Figure 5.12: Drone System Layout 84 5.3 Experiment Results and Discussion 5.3.1 Experimental Setup On a summer morning, the water temperature is lower than atmosphere. Due to transpi- ration effect, the trees were slightly cooler than the atmosphere prior to spray. During the spray, the sprayed area temperature could be even lower than the area that are not being sprayed. When the outside temperature is low (e.g., below 50◦ F), the water is ”hotter” than the atmosphere and the tree temperature situation is reversed prior to and during spray. The thermal camera has a resolution of ± 0.2◦C in distinguishing the temperature differences between objects. Based on theses concepts, the thermal camera is used to pick up the ”hot” or ”cold” spots on trees and those spots will be identified as fault regions. The corresponding thermal footage is referred as feasible thermal footage. The flight and spray patterns are the key for a successful fault detection. When flying the drone along orchard with 30 feet in height and 1.5 feet/second in speed, the modified drone is able to cover up to four of 300 feet long rows in one run, including the battery consumption during taking off and landing. Due to the fact that the drone position can easily be disturbed by the gust wind, stable thermal video was not obtainable via manual control when the wind speed exceeds 3 feet/second. Therefore the route following feature, a drone built-in function, was used for obtaining thermal videos. Prior to the experiment, all SSCDC emitters were in perfect working condition. For fault detection experiments, faults were created before the spray, otherwise the thermal camera would not be able to capture any faults since the canopy were all cooled down or heated up by a perfect spray. The created faults includes plug, partial plug and gusher for both emitters and these faults were placed randomly along the orchards. 85 5.3.2 Experimental Procedure and Results The experiment was divided into two parts on two orchards for two types of emitters. Ex- periment #1 was performed on the orchard that used the Hadar 7110 emitters. The weather condition and the water temperature for this experiment are shown in Table 5.4 Table 5.4: Experiment #1 Parameters Experiment Parameters Outside temperature Water temperature Humidity Wind Direction Wind Speed Value 76 F − 80 F 65 F − 67 F 77% − 85% South to Southwest 10.2f t/s − 16.9f t/s It was a hot windy day and the water was slightly colder than atmosphere. As shown in Fig. 5.13 (a), no spray for the first run so that a clear thermal video (baseline) was obtained. The faults shown in Table 5.5 were placed for the regular fault simulation footage in the second run; see Fig. 5.13 (b). For the baseline of thermal fault detection, all the faults were corrected and the thermal footage is shown in Fig. 5.13 (c). And Fig. 5.13 (d) is the stitched panorama picture from the RGB camera. All of the panorama pictures are aligned horizontally so that pictures (a), (b), (c) and (d) are showing the same orchard section. In Fig. 5.13 (d), the white stripes are used for marking all the Hadar 7110 emitter positions, which are also marked with A1 − A13 in Fig. 5.13 (c). For the thermal footage in black and white pattern, temperature difference is indicated by color: darker color means lower temperature and lighter color higher temperature. Com- paring Fig. 5.13 (b) with Fig 5.13 (c), at A2 and A6 locations, the color of upper portion of the trees in Fig. 5.13 (b) is obviously lighter than that in Fig. 5.13 (c). This means that at these two locations, the solution was not sufficiently dense to cool down the trees; see Fig. 86 Figure 5.13: Thermal and Regular Footage of the Orchard with Hadar 7110 Emitters Table 5.5: Fault Details in the Orchard that with Hadar 7110 Emitters Fault Location Fault Type A2 A6 A7 A9 Upper plug Partial plug Manifold plug Lower gusher A13 Upper gusher 5.13 (c). The situation got worse at location A7 in Fig. 5.13 (b): it has a fairly large ”hot” spot, comparing to Fig. 5.13 (c), which means it is another fault. From these observations, the thermal camera is capable of detecting plug faults. However, at A9 and A13 locations, the gusher faults are not as obvious as plug faults. At location A9, there is a black line marked with the red circle and the upper portion of the tree is ”hot”. Crossing reference with Fig. 5.13 (d), it can be observed that the black line was not a white stripe for marking emitter locations, which means that it could be a spout. So the gusher fault can be detected by the thermal camera for this location. But the same fault happens at location A13. The 87 spout is not visible but the upper portion of the trees is darker, which means that the spout was shooting at the leaves and spread out. The second experiment was performed on the orchard with Spinner emitters on the other day. The experimental parameters are shown in table 5.6. Table 5.6: Experiment #2 Parameters Experiment Parameters Value Outside temperature Water temperature Humidity 49 F 55 F 59% − 61% Wind Direction North - Northeast Wind Speed 4.4f t/s It was a cold day with almost no wind so water was hotter than atmosphere. In this orchard, faults were also created on purpose and the locations are listed in Table 5.7. Due to the fact that the emitters were too close to each other, only the faulted emitters were marked with small pieces of white stripes on top of the irrigation line (see Fig. 5.14 (e)). The faulted emitters are also marked with B1 − B4 at the corresponding locations in Fig. 5.14 (d). In this experiment, thermal plate ”fusion” was tested and are shown in Figs. 5.14 (a) and (b), which are spray with and without created faults, respectively. Black-white thermal plate was also used for fault and no fault sprays and they are shown in Fig. 5.14 (c) and (d), respectively. The fusion video was taken first and the black-white video was taken 2 hours later after all the solution was evaporated and the canopy temperature recovered back to normal. The experiment parameters were exactly the same for these two thermal plate runs. By comparing Fig. 5.14 (a) with Fig. 5.14 (c), a huge difference in these two thermal plates are observed. The black-white footage shows a better result with larger faulted area than the thermal ”fusion” one, indicating that for this thermal camera, black-white plate has a better sensitivity than the fusion plate. 88 Table 5.7: Fault Details in the Orchard that with Spinner Emitters Fault Location Fault Type B1 B2 B3 B4 plug gusher plug gusher Figure 5.14: Thermal and Regular Footage of the Orchard with Spinner Emitters From Fig. 5.14, the gusher effects are easily detected using the thermal camera by observing the ”hot” areas due to higher flow rate of ”hot” solution (water), however the plug effects are not even visible in the thermal footage. Note that the Spinner emitter has a much bigger droplets so it is fairly robust with high viscosity solutions. Even though the thermal scheme was not able to detect the plug faults on a cold day, it is still feasible for fault detection of Spinner emitters. 89 5.4 Discussion and Future Works Due to the battery size limitation, the thermal fault detection is not able to cover an orchard requiring more than 20 minutes of flight. For an applicable thermal fault detection, a hybrid drone shall be a better choice. The hybrid drone utilizes a small internal combustion engine to generate electric power for propellers and it has much longer flight duration. Due to the limitations of season and weather, limited experiments were conducted in 2018. In 2019, similar experiments will be conducted to confirm the thermal fault detection capability including the variations of thermal plates, orchards, weather conditions, video taking angle, and emitters. For the future work, an adaptive parameter estimation algorithm and a PID controller can be combined with online image processing algorithm to have the thermal camera to track the trees so that the thermal camera angle control can be automated. Also, a second online image processing algorithm can be developed so that the faults can be automatically marked on the image in real-time. 5.4.1 Future Work For the future work of the SSCDS project, more of the flow fault detection system need to be made and calibrated for the in-line fault detection sensor, and more flights need to be made in order to collect enough thermal image data including ”plug” and ”gusher” faults. Also, an optimal fly hight and speed need to be determined for best fault detection. In addition, a Matlab based software need to be developed or other image processing software need to be found to process these thermal image data to achieve automatic fault detection. 90 CHAPTER 6 CONCLUSIONS Two new sample and hold input (SHI) functions are proposed based on the square pulse SHI that proposed previously in an other research. Numerical and simulation study show that by selecting the proper sampling period and duty cycle the resulting discrete-time system can be minimum phase (MP). Additionally, the forward triangle SHI provides a discrete- time MP system with the smallest feasible sampling period for a given duty cycle. Also, comparing with the conventional zero-order holder, the SHIs provides additional choice of sampling periods to achieve MP system in discrete-time domain. An experimental demonstration of performance improvement of a non-minimum phase (NMP) system using special sample and hold inputs (SHIs) was performed. The SHIs are used to convert the continuous-time NMP system into a discrete-time minimum-phase (MP) system, thus allowing a discrete-time controller to be designed for improving the performance. This concept is demonstrated with a single inverted pendulum (SIP) system through sim- ulations and experiments using the square pulse sample and hold input (SPSHI) and the forward triangle sample and hold input (FTSHI). The overall controller is comprised of an inner-loop continuous-time stabilizing controller (provided by the SIP manufacturer) and an outer-loop discrete-time performance enhancement controller. While the inner-loop stabiliz- ing controller is required to convert the continuous-time NMP system into a discrete-time MP system, the outer-loop discrete-time controller allows additional control effort to be used for better performance. The inner-loop continuous-time controller was implemented at 500Hz whereas the outer-loop controller was implemented at less than 5Hz to ensure MP characteristics of the discrete-time system. To achieve good match between simulation and experiment results, Coulomb friction was added to the Simulink model. Both simulation and experiment results show that the mean absolute value of the cart displacement can be significantly reduced when the outer-loop controller is used. The effectiveness of both SHIs 91 is compared with the inner-loop controller experimentally; the improvement is 69% for the SPSHI and 55% for the FTSHI. Two sampling rates were used for the discrete-time controller and it was found that the controller with higher sampling rate provided better performance. A MS platform was built for this paper to present the implementation of the previously proposed dual-loop control architecture onto a non-minimum phase (NMP) mini segway (MS) system with a low cost microcontroller. It is shown that the both inner- and outer- loop controllers affect the overall MS system performance. In order to study this interaction, a fine tuning was performed on the inner-loop continuous-time LQR while preserving the MS stability. A GRc gain that ranges from 0.6 to 1.1 is introduced to the R matrix of the inner-loop controller. The outer-loop LQR controller is optimized for the inner-loop LQR with each GRc value. It was found that GRc selection is the key factor to have a good inner-loop closed-loop MS system performance. When GRc is too low, nonlinear Coulomb friction affects the MS system and result in an undesired high frequency oscillation. When GRc is too high, the system nonlinarity results in unstable performance. In the outer-loop, a SPSHI was combined with a discrete-time LQR and implemented at 5Hz sampling rate. The SPSHI was used to obtain a MP MS system from the NMP closed-loop system so that the extra control effort that provided by the discrete-time LQR can be utilized to further improve the MS performance. For the outer-loop LQR, a fine tuning was also performed to obtain the optimized controller by introducing the GRd gain of the R matrix. Experiments were also conducted with the varying GRd. For both tuning processes, the experimental results are presented graphically and numerically. For the solid-set canopy delivery system (SSCDS) project, based on the current design, two fault detection schemes are developed by the engineering team of Michigan State Uni- versity. The first one is the in-line fault detection with special valve and flow sensors; and the second is thermal fault detection that utilized a DJI Inspire 1 V2 commercial drone and FLIR VUE Pro R thermal (IR) camera. These two schemes will be used together, where the in-line scheme detects the faulted sections first, followed by sending the drone to locate 92 the faulted emitter. Multiple experiments were conducted for different types of faults with two types of emitters (mist Hadar 7110 and large-droplet Spinner emitters). Specific spray and fly patterns are designed for thermal fault detection. From the results obtained so far, the thermal (IR) camera is feasible for detecting these faults. To be more specific, it is able to precisely detect the plug and gusher faults for Hadar 7110 emitter and gusher faults for the Spinner emitters. As a result, fault detection feasibility of SSCDS is validated using the thermal (IR) images captured by a drone. 93 BIBLIOGRAPHY 94 BIBLIOGRAPHY [1] Quanser, “Ip02 base unit experiment set up and experiment,” Quanser User Manual, 2012. [2] M. Tomizuka, “Zero phase error tracking algorithm for digital control,” Journal of Dynamic Systems, Measurement, and Control, vol. 109, no. 1, pp. 65–68, 1987. [3] E. Gross, M. Tomizuka, and W. Messner, “Cancellation of discrete time unstable ze- ros by feedforward control,” Journal of dynamic systems, measurement, and control, vol. 116, no. 1, pp. 33–38, 1994. [4] B. Haack and M. Tomizuka, “The effect of adding zeroes to feedforward controllers,” Journal of dynamic systems, measurement, and control, vol. 113, no. 1, pp. 6–10, 1991. [5] D. Torfs, J. De Schutter, and J. Swevers, “Extended bandwidth zero phase error tracking control of nonminimal phase systems,” Journal of dynamic systems, measurement, and control, vol. 114, no. 3, pp. 347–351, 1992. [6] H.-S. Park, P. H. Chang, and D. Y. Lee, “Continuous zero phase error tracking controller with gain error compensation,” in American Control Conference, 1999. Proceedings of the 1999, vol. 5, pp. 3554–3558, IEEE, 1999. [7] J. A. Butterworth, L. Y. Pao, and D. Y. Abramovitch, “The effect of nonminimum- phase zero locations on the performance of feedforward model-inverse control techniques in discrete-time systems,” in American Control Conference, 2008, pp. 2696–2702, IEEE, 2008. [8] R. Jafari and R. Mukherjee, “Intermittent output tracking for linear single-input single- output non-minimum-phase systems,” in American Control Conference (ACC), 2012, pp. 5942–5947, IEEE, 2012. [9] K. J. ˚Astr¨om, P. Hagander, and J. Sternby, “Zeros of sampled systems,” Automatica, vol. 20, no. 1, pp. 31–38, 1984. [10] C.-H. Wang, W.-Y. Wang, and C.-C. Hsu, “Minimum-phase criteria for sampled systems via symbolic approach,” International journal of systems science, vol. 28, no. 8, pp. 767– 775, 1997. [11] C.-C. Hsu and T.-C. Lu, “Minimum-phase criterion on sampling time for sampled- data interval systems using genetic algorithms,” Applied Soft Computing, vol. 8, no. 4, pp. 1670–1679, 2008. [12] Y. Fu and G. A. Dumont, “Choice of sampling to ensure minimum-phase behaviour,” IEEE Transactions on automatic control, vol. 34, no. 5, pp. 560–563, 1989. 95 [13] M. Ishitobi, “Criteria for stability of zeros of sampled systems,” IEE Proceedings-Control Theory and Applications, vol. 141, no. 6, pp. 396–402, 1994. [14] T. Hagiwara, “Analytic study on the intrinsic zeros of sampled-data systems,” IEEE Transactions on Automatic Control, vol. 41, no. 2, pp. 261–263, 1996. [15] E.-W. Bai and Y.-Q. Wu, “Limiting zero distribution of sampled systems,” Automatica, vol. 38, no. 5, pp. 843–851, 2002. [16] T. Hagiwara, T. Yuasa, and M. Araki, “Limiting properties of the zeros of sampled- data systems with zero-and first-order holds,” in IEEE CONFERENCE ON DECISION AND CONTROL, vol. 2, pp. 1949–1949, INSTITUTE OF ELECTRICAL ENGINEERS INC (IEE), 1992. [17] T. Hagiwara, T. Yuasa, and M. Araki, “Stability of the limiting zeros of sampled-data systems with zero-and first-order holds,” International Journal of Control, vol. 58, no. 6, pp. 1325–1346, 1993. [18] K. M. Passino and P. J. Antsaklis, “Inverse stable sampled low-pass systems,” Interna- tional Journal of Control, vol. 47, no. 6, pp. 1905–1913, 1988. [19] M. Ishitobi, “Stability of zeros of sampled system with fractional order hold,” IEE Proceedings-Control Theory and Applications, vol. 143, no. 3, pp. 296–300, 1996. [20] R. B´arcena and A. Etxebarria, “Sufficient conditions for the attainment of sampled sys- tems without nonminimum-phase zeros,” International Journal of Control, Automation and Systems, vol. 8, no. 2, pp. 244–249, 2010. [21] M. Ishitobi and Q. Zhu, “Zeros of sampled systems with fractional order hold imple- mented by zero order hold,” in Intelligent Processing Systems, 1997. ICIPS’97. 1997 IEEE International Conference on, vol. 1, pp. 698–702, IEEE, 1997. [22] O. Boubaker, “The inverted pendulum: A fundamental benchmark in control theory and robotics,” in Education and e-Learning Innovations (ICEELI), 2012 international conference on, pp. 1–6, IEEE, 2012. [23] O. Boubaker, “The inverted pendulum benchmark in nonlinear control theory: a sur- vey,” International Journal of Advanced Robotic Systems, vol. 10, no. 5, p. 233, 2013. [24] M. F. M. Salleh and M. A. Shamsudin, “Mathematical modelling and quadratic optimal tuning based pid scheme for an inverted pendulum-cart system,” in Asian Simulation Conference, pp. 191–202, Springer, 2017. [25] A. Jose, C. Augustine, S. M. Malola, and K. Chacko, “Performance study of pid con- troller and lqr technique for inverted pendulum,” World Journal of Engineering and Technology, vol. 3, no. 02, p. 76, 2015. 96 [26] L. B. Prasad, B. Tyagi, and H. O. Gupta, “Optimal control of nonlinear inverted pen- dulum system using pid controller and lqr: performance analysis without and with dis- turbance input,” International Journal of Automation and Computing, vol. 11, no. 6, pp. 661–670, 2014. [27] C. Wongsathan and C. Sirima, “Application of ga to design lqr controller for an in- verted pendulum system,” in Robotics and Biomimetics, 2008. ROBIO 2008. IEEE International Conference on, pp. 951–954, IEEE, 2009. [28] S. Trimpe, A. Millane, S. Doessegger, and R. D’Andrea, “A self-tuning lqr approach demonstrated on an inverted pendulum,” IFAC Proceedings Volumes, vol. 47, no. 3, pp. 11281–11287, 2014. [29] R. Eide, P. M. Egelid, A. Stamsø, and H. R. Karimi, “Lqg control design for balancing an inverted pendulum mobile robot,” 2011. [30] M. J. Grimble, “Implicit and explicit lqg self-tuning controllers,” IFAC Proceedings Volumes, vol. 17, no. 2, pp. 941–947, 1984. [31] M. E. Magana and F. Holzapfel, “Fuzzy-logic control of an inverted pendulum with vision feedback,” IEEE transactions on education, vol. 41, no. 2, pp. 165–170, 1998. [32] L. B. Prasad, H. O. Gupta, and B. Tyagi, “Intelligent control of nonlinear inverted pendulum dynamical system with disturbance input using fuzzy logic systems,” in Re- cent Advancements in Electrical, Electronics and Control Engineering (ICONRAEeCE), 2011 International Conference on, pp. 136–141, IEEE, 2011. [33] R. Or´ostica, M. A. Duarte-Mermoud, C. J¨auregui, and G. Lefranc, “Inverted pendulum stabilization by means of fractional order pid controllers,” in Electrical, Electronics Engi- neering, Information and Communication Technologies (CHILECON), 2017 CHILEAN Conference on, pp. 1–7, IEEE, 2017. [34] R. Or´ostica, M. A. Duarte-Mermoud, and C. J´auregui, “Stabilization of inverted pen- dulum using lqr, pid and fractional order pid controllers: A simulated study,” in Auto- matica (ICA-ACCA), IEEE International Conference on, pp. 1–7, IEEE, 2016. [35] Y. Wang, R. Jafari, G. G. Zhu, and R. Mukherjee, “Sample-and-Hold Inputs for Minimum-Phase Behavior of Nonminimum-Phase Systems,” IEEE Transactions on Control Systems Technology, vol. 24, no. 6, pp. 2103–2111, 2016. [36] H.-S. Juang and K.-Y. Lurrr, “Design and control of a two-wheel self-balancing robot using the arduino microcontroller board,” in 2013 10th IEEE International Conference on Control and Automation (ICCA), pp. 634–639, IEEE, 2013. [37] N. G. M. Thao, D. H. Nghia, and N. H. Phuc, “A pid backstepping controller for two- wheeled self-balancing robot,” in International Forum on Strategic Technology 2010, pp. 76–81, IEEE, 2010. 97 [38] A. Unluturk, O. Aydogdu, and U. Guner, “Design and pid control of two wheeled autonomous balance robot,” in 2013 International Conference on Electronics, Computer and Computation (ICECCO), pp. 260–264, IEEE, 2013. [39] T.-J. Ren, T.-C. Chen, and C.-J. Chen, “Motion control for a two-wheeled vehicle using a self-tuning pid controller,” Control Engineering Practice, vol. 16, no. 3, pp. 365–375, 2008. [40] K. Liu, M. Bai, and Y. Ni, “Two-wheel self-balanced car based on kalman filtering and pid algorithm,” in 2011 IEEE 18th International Conference on Industrial Engineering and Engineering Management, pp. 281–285, IEEE, 2011. [41] W. An and Y. Li, “Simulation and control of a two-wheeled self-balancing robot,” in 2013 IEEE International Conference on Robotics and Biomimetics (ROBIO), pp. 456– 461, IEEE, 2013. [42] Q. Yong, L. Yanlong, Z. Xizhe, and L. Ji, “Balance control of two-wheeled self-balancing mobile robot based on ts fuzzy model,” in Proceedings of 2011 6th International Forum on Strategic Technology, vol. 1, pp. 406–409, IEEE, 2011. [43] X. Ruan and J. Cai, “Fuzzy backstepping controllers for two-wheeled self-balancing robot,” in 2009 International Asia Conference on Informatics in Control, Automation and Robotics, pp. 166–169, IEEE, 2009. [44] X. Ruan, J. Cai, and J. Chen, “Learning to control two-wheeled self-balancing robot using reinforcement learning rules and fuzzy neural networks,” in 2008 Fourth Interna- tional Conference on Natural Computation, vol. 4, pp. 395–398, IEEE, 2008. [45] W. Wei, M. Xiaoning, and W. Jijun, “Intelligent control in two-wheel self-balanced robot,” in 2010 International Conference on Computer, Mechatronics, Control and Elec- tronic Engineering, vol. 3, pp. 470–473, IEEE, 2010. [46] A. Wasif, D. Raza, W. Rasheed, Z. Farooq, and S. Q. Ali, “Design and implementation of a two wheel self balancing robot with a two level adaptive control,” in Eighth Inter- national Conference on Digital Information Management (ICDIM 2013), pp. 187–193, IEEE, 2013. [47] C. Sun, T. Lu, and K. Yuan, “Balance control of two-wheeled self-balancing robot based on linear quadratic regulator and neural network,” in 2013 Fourth International Conference on Intelligent Control and Information Processing (ICICIP), pp. 862–867, IEEE, 2013. [48] W. Junfeng and Z. Wanying, “Research on control method of two-wheeled self-balancing robot,” in 2011 Fourth International Conference on Intelligent Computation Technology and Automation, vol. 1, pp. 476–479, IEEE, 2011. [49] C. Xu, M. Li, and F. Pan, “The system design and lqr control of a two-wheels self- balancing mobile robot,” in 2011 International Conference on Electrical and Control Engineering, pp. 2786–2789, IEEE, 2011. 98 [50] Y. Wang, G. G. Zhu, and R. Mukherjee, “Experimental study of nmp sample and hold input using an inverted pendulum,” in ASME 2018 Dynamic Systems and Control Con- ference, pp. V001T01A004–V001T01A004, American Society of Mechanical Engineers, 2018. [51] G. G. Zhu, R. E. Skelton, and P. Li, “Q-markov cover identification using pseudo- random binary signals,” International Journal of Control, vol. 62, no. 6, pp. 1273–1290, 1995. [52] G. G. Zhu, “Weighted multirate q-markov cover identification using prbs–an application to engine systems,” Mathematical Problems in Engineering, vol. 6, no. 2-3, pp. 201–224, 2000. [53] C. E. Shannon, “Communication in the presence of noise,” Proceedings of the IRE, vol. 37, pp. 10–21, Jan 1949. [54] Quanser, “Linear servo base unit with inverted pendulum,” May 2018. [55] A.-J. Baerveldt and R. Klang, “A low-cost and low-weight attitude estimation system for an autonomous helicopter,” in Proceedings of IEEE International Conference on Intelligent Engineering Systems, pp. 391–395, IEEE, 1997. [56] S. Barash, Y. Brandman, Y. Cohen, S. Shporn, J. Vishnipolsky, and E. Yanai, “Computer-controlled irrigation system,” June 24 1980. US Patent 4,209,131. [57] A. Povoa and D. Hills, “Sensitivity of microirrigation system pressure to emitter plug- ging and lateral line perforations,” Transactions of the ASAE, vol. 37, no. 3, pp. 739–799, 1994. [58] R. W. Coates, M. J. Delwiche, and P. H. Brown, “Control of individual microsprinklers and fault detection strategies,” Precision Agriculture, vol. 7, no. 2, pp. 85–99, 2006. [59] J. E. Barlow and E. S. Pattiani, “Remotely controlled irrigation timer with fault detec- tion,” Aug. 24 2004. US Patent 6,782,311. [60] Z. A. Jaffery and A. K. Dubey, “Design of early fault detection technique for electrical assets using infrared thermograms,” International journal of electrical power & energy systems, vol. 63, pp. 753–759, 2014. [61] R. S. Deitchman and S. P. Loheide, “Ground-based thermal imaging of groundwater flow processes at the seepage face,” Geophysical Research Letters, vol. 36, no. 14, 2009. [62] R. R. Gillies and T. N. Carlson, “Thermal remote sensing of surface soil water content with partial vegetation cover for incorporation into climate models,” Journal of Applied Meteorology, vol. 34, no. 4, pp. 745–756, 1995. [63] A. Akula, R. Ghosh, and H. Sardana, “Thermal imaging and its application in defence systems,” in AIP conference proceedings, vol. 1391, pp. 333–335, AIP, 2011. 99 [64] G. Ginesu, D. D. Giusto, V. Margner, and P. Meinlschmidt, “Detection of foreign bodies in food by thermal image processing,” IEEE Transactions on Industrial Electronics, vol. 51, no. 2, pp. 480–490, 2004. [65] V. Chelladurai, D. Jayas, and N. White, “Thermal imaging for detecting fungal infection in stored wheat,” Journal of Stored Products Research, vol. 46, no. 3, pp. 174–179, 2010. [66] M. Stoll and H. G. Jones, “Thermal imaging as a viable tool for monitoring plant stress,” OENO One, vol. 41, no. 2, pp. 77–84, 2007. [67] S. Thomson, T. Brooks, Y. Huang, J. Weick, D. K. Fisher, S. DeFauw, C. Ouellet- Plamondon, and P. English, “Thermal imaging: from irrigation management to finding leaks at the levee,” Resource Magazine, vol. 22, no. 3, pp. 10–13, 2015. [68] M. M¨oller, V. Alchanatis, Y. Cohen, M. Meron, J. Tsipris, A. Naor, V. Ostrovsky, M. Sprintsin, and S. Cohen, “Use of thermal and visible imagery for estimating crop water status of irrigated grapevine,” Journal of experimental botany, vol. 58, no. 4, pp. 827–838, 2006. [69] V. Gonzalez-Dugo, P. Zarco-Tejada, E. Nicol´as, P. A. Nortes, J. Alarc´on, D. S. Intrigli- olo, and E. Fereres, “Using high resolution uav thermal imagery to assess the variability in the water status of five fruit tree species within a commercial orchard,” Precision Agriculture, vol. 14, no. 6, pp. 660–678, 2013. [70] Y. Pederi and H. Cheporniuk, “Unmanned aerial vehicles and new technological meth- ods of monitoring and crop protection in precision agriculture,” in 2015 IEEE In- ternational Conference Actual Problems of Unmanned Aerial Vehicles Developments (APUAVD), pp. 298–301, IEEE, 2015. [71] K. Ribeiro-Gomes, D. Hern´andez-L´opez, J. Ortega, R. Ballesteros, T. Poblete, and M. Moreno, “Uncooled thermal camera calibration and optimization of the photogram- metry process for uav applications in agriculture,” Sensors, vol. 17, no. 10, p. 2173, 2017. 100