Application of Kalman Filtering and Pid Control For

Total Page:16

File Type:pdf, Size:1020Kb

Application of Kalman Filtering and Pid Control For APPLICATION OF KALMAN FILTERING AND PID CONTROL FOR DIRECT INVERTED PENDULUM CONTROL ____________ A Project Presented to the Faculty of California State University, Chico ____________ In Partial Fulfillment of the Requirement for the Degree Master of Science in Electrical and Computer Engineering Electronic Engineering Option ____________ by José Luis Corona Miranda Spring 2009 APPLICATION OF KALMAN FILTERING AND PID CONTROL FOR DIRECT INVERTED PENDULUM CONTROL A Project by José Luis Corona Miranda Spring 2009 APPROVED BY THE DEAN OF THE SCHOOL OF GRADUATE, INTERNATIONAL, AND INTERDISCIPLINARY STUDIES: _________________________________ Susan E. Place, Ph.D. APPROVED BY THE GRADUATE ADVISORY COMMITTEE: _________________________________ _________________________________ Adel A. Ghandakly, Ph.D. Dale Word, M.S., Chair Graduate Coordinator _________________________________ Adel A. Ghandakly, Ph.D. TABLE OF CONTENTS PAGE List of Figures............................................................................................................. v Abstract....................................................................................................................... vi CHAPTER I. Introduction.............................................................................................. 1 Purpose of the Project................................................................... 2 Limitations of the Project ............................................................. 3 II. Review of Related Literature.................................................................... 4 BallBot.......................................................................................... 5 Battlefield Extraction Assist Robot.............................................. 7 nBot and Legway.......................................................................... 9 Segway ......................................................................................... 10 Kalman Filte ................................................................................. 11 PID Control System...................................................................... 13 III. Balancing Robot System Overview.......................................................... 15 Robot Physical Structure .............................................................. 15 PIC32 Microcontroller.................................................................. 16 Sensors.......................................................................................... 17 DC Motors.................................................................................... 23 Logomatic-v2 ............................................................................... 23 DC Motor Drivers......................................................................... 25 Power Supply................................................................................ 26 IV. Methodology............................................................................................. 29 Kalman Filter................................................................................ 29 PID Controller .............................................................................. 39 iii CHAPTER PAGE V. Results and Performance Evaluation........................................................ 52 Kalman Filter Results................................................................... 53 PID Controller Results ................................................................. 61 VI. Summary, Conclusion, and Recommendations........................................ 67 Summary....................................................................................... 67 Conclusion.................................................................................... 68 Recommendations ........................................................................ 69 References .................................................................................................................. 71 Appendix A. Application Source Code.......................................................................... 73 iv LIST OF FIGURES FIGURE PAGE 1. Two Wheeled Robot Platform.................................................................. 16 2. Two Wheeled Robot General System Block Diagram ............................. 18 3. ADXL-203 Accelerometer........................................................................ 19 4. ADXL-203 Output Voltage Response vs. Orientation ............................. 20 5. IDG-300 Gyroscope.................................................................................. 22 6. Tamiya DC Motor with Foam Wheel....................................................... 24 7. Logomatic Serial Data Logger.................................................................. 25 8. VNH2SP30 DC Motor Driver .................................................................. 26 9. Nickel-Metal Hydride battery................................................................... 27 10. Nickel-Metal Hydride Cell Batteries ........................................................ 28 11. Kalman Filter Estimation Algorithm Cycle.............................................. 32 12. Kalman Filter Algorithm Equations.......................................................... 32 13. Gyroscope and Accelerometer Sensor Test Setup .................................... 34 14. Gyroscope Measurements with Drift........................................................ 35 15. Noisy Accelerometer Measurements ........................................................ 37 16. Continuous PID Controller....................................................................... 40 17. Closed Loop Control System with PID Controller ................................... 41 18. PID Algorithm in Time Domain Representation...................................... 42 v FIGURE PAGE 19. PID Controller Characteristics.................................................................. 44 20. PID Controller Discrete Representation ................................................... 45 21. Ziegler-Nichols PID Tuning Parameters................................................... 47 22. Ziegler-Nichols Close Loop Tuning Test ................................................. 48 23. Example.................................................................................................... 49 24. Typical Close Loop Output Response....................................................... 50 25. Functional Block Diagram for Balancing System..................................... 53 26. Process and Measurement Noise Covariance Matrices ............................ 54 27. Not Properly Tuned Kalman Filter ........................................................... 55 28. Kalman Filter Output Response Varying Q Matrix .................................. 57 29. Optimal Kalman Filter Q Matrix Values.................................................. 59 30. Kalman Filter Output Response Varying R Matrix .................................. 60 31. Kalman Filter Motionless Gyroscope Result............................................ 62 32. Measured System Output Response.......................................................... 63 33. PID Controller Input Error........................................................................ 64 34. PID Controller Output............................................................................... 65 vi ABSTRACT APPLICATION OF KALMAN FILTERING AND PID CONTROL FOR DIRECT INVERTED PENDULUM CONTROL by José Luis Corona Miranda Master of Science in Electrical and Computer Engineering Electronic Engineering Option California State University, Chico Spring 2009 Robotic mobility technologies over the past few years have gain popularly in both commercial and government sectors. There been a variety of techniques suggested to increase robotic mobility on dynamic environments. One such popular technique used to provide greater mobility to a robotic platform is based on the inverted pendulum model. The presented document will demonstrate the techniques involved in balancing an unstable robotic platform. The objective is to design a complete discrete digital con- trol system that will provide the needed stability. The platform will be an ideal test bed for the implementations of both PID digital control and Kalman filter algorithms. Both algorithms will provide the necessary control for the system. Therefore the presented vii project will investigate the performance of both PID digital control and Kalman filter al- gorithms. Test software was written to gather performance results for both the PID con- troller and Kalman filter. The control system performance is directly dependent on Kal- man filter and PID controller input parameters. The results clearly show how the adjust- able parameters on the control system directly affected the overall system performance. The results also demonstrate the performance and the need of the Kalman filter to remove sensor noise. The almost reliable sensor data increases PID controller performance to drive the robotic platform to vertical equilibrium. The gathered results for the Kalman filter were compared against the raw noisy sensor data. The plots for such comparison are shown on the Kalman filter results section. PID controller output response data was also collected and plotted. The PID output response results were used in the controller tuning process. viii CHAPTER I INTRODUCTION “The research on balancing robots has gained momentum over the last decade in
Recommended publications
  • Application Note TM Generic Drive Interface: Using Siemens S7 PLC Range Via Profinet
    Motion Control Products Application note TM Generic drive interface: Using Siemens S7 PLC range via Profinet AN00263 Rev D Ready to use PLC function blocks, combine with a pre-written Mint application for simple control of MicroFlex e190 and MotiFlex e180 drives via PROFINET IO Introduction This application note details how to import and configure the ABB Generic Drive Interface (GDI) and associated TIA portal library ‘ABB Motion GDI Library’ using TIA portal (version 15 or later) project and any SIMATIC S7 CPU (S7-1200, S7-1500, S7- 400) using FW 3.3.12 or later. The same principles can be applied for older Simatic Step 7 projects though firmware versions before V3.xx should be avoided. The library provides pre-written data structures and function blocks that integrate seamlessly with the Mint based GDI and allow suitable Siemens PLCs to control ABB drives running Mint programs that support PROFINET IO (MicroFlex e190 and MotiFlex e180). Note that MicroFlex e190 and MotiFlex e180 drives must be provided with the Mint memory card (option code +N8020). The instructions promote consistency in all projects and greatly simplify the development of Siemens PLC motion control applications where simple point to point motion is required. This document assumes that the reader has basic knowledge of Siemens PLCs, SIMATIC S7, PROFINET IO configuration, Mint Workbench and the Mint GDI. It is recommended that the reader refers to application note AN00204 for details on the Mint GDI operation and configuration. Pre-requisites We will need to have the
    [Show full text]
  • A Process Control Primer
    A Process Control Primer Sensing and Control Copyright, Notices, and Trademarks Printed in U.S.A. – © Copyright 2000 by Honeywell Revision 1 – July 2000 While this information is presented in good faith and believed to be accurate, Honeywell disclaims the implied warranties of merchantability and fitness for a particular purpose and makes no express warranties except as may be stated in its written agreement with and for its customer. In no event is Honeywell liable to anyone for any indirect, special or consequential damages. The information and specifications in this document are subject to change without notice. Presented by: Dan O’Connor Sensing and Control Honeywell 11 West Spring Street Freeport, Illinois 61032 UDC is a trademark of Honeywell Accutune is a trademark of Honeywell ii Process Control Primer 7/00 About This Publication The automatic control of industrial processes is a broad subject, with roots in a wide range of engineering and scientific fields. There is really no shortcut to an expert understanding of the subject, and any attempt to condense the subject into a single short set of notes, such as is presented in this primer, can at best serve only as an introduction. However, there are many people who do not need to become experts, but do need enough knowledge of the basics to be able to operate and maintain process equipment competently and efficiently. This material may hopefully serve as a stimulus for further reading and study. 7/00 Process Control Primer iii Table of Contents CHAPTER 1 – INTRODUCTION TO PROCESS
    [Show full text]
  • Design of Plc Controlled Linear Induction Motor
    www.ijcrt.org © 2018 IJCRT | Volume 6, Issue 1 January 2018 | ISSN: 2320-2882 DESIGN OF PLC CONTROLLED LINEAR INDUCTION MOTOR 1Ashish Bachute,2Akash Babar,3Balaji Bagal,4Abhay Bhagat, 5Prof. Anupma Kamboj 1Department of Electrical Engineering, 1JSPM’s Bhivarabai Sawant Institute of Technology and Research, Pune, India Abstract: This paper presents a simple and fast methodology for designing a linear induction motor (LIM). A linear induction motor is an AC asynchronous linear motor that works by the same general principles as other induction motor but is very typically designed to directly produce motion in a straight line. Characteristically, linear induction motors have a finite length primary, which generates end effects, whereas with a conventional induction motor the primary is an endless loop. Their uses include magnetic levitation, linear propulsion and linear actuators. They have also been used for pumping liquid metal. Despite their name, not all linear induction motors produce linear motion some linear induction motors are employed for generating rotations of large diameters where the use of a continuous primary would be very expensive. Linear induction motors can be designed to produce thrust up to several thousands of Newton’s. The winding design and supply frequency determine the speed of a linear induction motor. Index Terms – Linear induction motor (LIM), magnetic levitation, programmable logic controller (PLC) I. INTRODUCTION A LIM is basically a rotating squirrel cage induction motor opened out flat. Instead of producing rotary torque from a cylindrical machine it produces linear force from a flat one. Only the shape and the way it produces motion is changed.
    [Show full text]
  • Control Theory
    Control theory S. Simrock DESY, Hamburg, Germany Abstract In engineering and mathematics, control theory deals with the behaviour of dynamical systems. The desired output of a system is called the reference. When one or more output variables of a system need to follow a certain ref- erence over time, a controller manipulates the inputs to a system to obtain the desired effect on the output of the system. Rapid advances in digital system technology have radically altered the control design options. It has become routinely practicable to design very complicated digital controllers and to carry out the extensive calculations required for their design. These advances in im- plementation and design capability can be obtained at low cost because of the widespread availability of inexpensive and powerful digital processing plat- forms and high-speed analog IO devices. 1 Introduction The emphasis of this tutorial on control theory is on the design of digital controls to achieve good dy- namic response and small errors while using signals that are sampled in time and quantized in amplitude. Both transform (classical control) and state-space (modern control) methods are described and applied to illustrative examples. The transform methods emphasized are the root-locus method of Evans and fre- quency response. The state-space methods developed are the technique of pole assignment augmented by an estimator (observer) and optimal quadratic-loss control. The optimal control problems use the steady-state constant gain solution. Other topics covered are system identification and non-linear control. System identification is a general term to describe mathematical tools and algorithms that build dynamical models from measured data.
    [Show full text]
  • Motion Control and Interaction Control in Medical Robotics
    Motion Control and Interaction Control in Medical Robotics Ph. POIGNET LIRMM UMR CNRS-UMII 5506 161 rue Ada 34392 Montpellier Cédex 5 [email protected] Introduction Examples in medical fields as soon as the system is active to provide safety, tactile capabilities, contact constraints or man/machine interface (MMI) functions: Safety monitoring, tactile search and MMI in total hip replacement with ROBODOC [Taylor 92] or in total knee arthroplasty [Davies 95] [Denis 03] • Force feedback to implement « guarded move » strategies for finding the point of contact or the locator pins in a surgical setting [Taylor 92] • MMI which allows the surgeon to guide the robot by leading its tool to the desired position through zero force control [Taylor 92] e.g registration or digitizing of organ surfaces [Denis 03] Introduction Echographic monitoring (Hippocrate, [Pierrot 99]) • A robot manipulating ultrasonic probes used for cardio-vascular desease prevention to apply a given and programmable force on the patient’s skin to guarantee good conduction of the US signal and reproducible deformation of the artery Reconstructive surgery with skin harvesting (SCALPP, [Dombre 03]) Introduction Minimally invasive surgery [Krupa 02], [Ortmaïer 03] • Non damaging tissue manipulation requires accuracy, safety and force control Microsurgical manipulation [Kumar 00] • Cooperative human/robot force control with hand-held tools for compliant tasks Needle insertion [Barbé 06], [Zarrad 07a] Haptic devices [Hannaford 99], [Shimachi 03], [Duchemin 05] • Force sensing
    [Show full text]
  • Motion Control for Newbies. Featuring Maxon EPOS2 P
    Urs Kafader Motion Control for Newbies. Featuring maxon EPOS2 P. First Edition 2014 © 2014, maxon academy, Sachseln This work is protected by copyright. All rights reserved, including but not limited to the rights to translation into foreign languages, reproduction, storage on electronic media, reprinting and public presentation. The use of proprietary names, common names etc. in this work does not mean that these names are not protected within the meaning of trademark law. All the information in this work, including but not limited to numerical data, applications, quantitative data etc. as well as advice and recommendations has been carefully researched, although the accuracy of such information and the total absence of typographical errors cannot be guaranteed. The accuracy of the information provided must be verified by the user in each individual case. The author, the publisher and/or their agents may not be held liable for bodily injury or pecuniary or property damage. Version 1.2, February 2014 2 Motion Control for Newbies, featuring maxon EPOS2 P Motion Control for Newbies Featuring maxon EPOS2 P Intention and approach The basic approach of this textbook, like many, is a practical and experimental one; however, it is reversed from most. Instead of first explaining the theory of motion control and then applying it to specific examples, here we will start with hands-on exp erimenting on a real maxon EPOS2 P positioning control system by means of the EPOS Studio software and explain all the relevant motion control principles/features as they appear on the journey. Therefore, the text contains mainly the exercises and practical work to do.
    [Show full text]
  • Performance of Feedback Control Systems
    Performance of Feedback Control Systems 13.1 □ INTRODUCTION As we have learned, feedback control has some very good features and can be applied to many processes using control algorithms like the PID controller. We certainly anticipate that a process with feedback control will perform better than one without feedback control, but how well do feedback systems perform? There are both theoretical and practical reasons for investigating control performance at this point in the book. First, engineers should be able to predict the performance of control systems to ensure that all essential objectives, especially safety but also product quality and profitability, are satisfied. Second, performance estimates can be used to evaluate potential investments associated with control. Only those con trol strategies or process changes that provide sufficient benefits beyond their costs, as predicted by quantitative calculations, should be implemented. Third, an engi neer should have a clear understanding of how key aspects of process design and control algorithms contribute to good (or poor) performance. This understanding will be helpful in designing process equipment, selecting operating conditions, and choosing control algorithms. Finally, after understanding the strengths and weak nesses of feedback control, it will be possible to enhance the control approaches introduced to this point in the book to achieve even better performance. In fact, Part IV of this book presents enhancements that overcome some of the limitations covered in this chapter. Two quantitative methods for evaluating closed-loop control performance are presented in this chapter. The first is frequency response, which determines the 410 response of important variables in the control system to sine forcing of either the disturbance or the set point.
    [Show full text]
  • Advancing Motivation Feedforward Control of Permanent Magnetic Linear Oscillating Synchronous Motor for High Tracking Precision
    actuators Article Advancing Motivation Feedforward Control of Permanent Magnetic Linear Oscillating Synchronous Motor for High Tracking Precision Zongxia Jiao 1,2,3, Yuan Cao 1, Liang Yan 1,2,3,*, Xinglu Li 1,3, Lu Zhang 1,2,3 and Yang Li 1,3 1 School of Automation Science and Electrical Engineering, Beihang University, Beijing 100191, China; [email protected] (Z.J.); [email protected] (Y.C.); [email protected] (X.L.); [email protected] (L.Z.); [email protected] (Y.L.) 2 Ningbo Institute of Technology, Beihang University, Ningbo 315800, China 3 Science and Technology on Aircraft Control Laboratory, Beihang University, Beijing 100191, China * Correspondence: [email protected] Abstract: Linear motors have promising application to industrial manufacture because of their direct motion and thrust output. A permanent magnetic linear oscillating synchronous motor (PMLOSM) provides reciprocating motion which can drive a piston pump directly having advantages of high frequency, high reliability, and easy commercial manufacture. Hence, researching the tracking perfor- mance of PMLOSM is of great importance to realizing its popularization and application. Traditional PI control cannot fulfill the requirement of high tracking precision, and PMLOSM performance has high phase lag because of high control stiffness. In this paper, an advancing motivation feedforward control (AMFC), which is a combination of advancing motivation signal and PI control signal, is proposed to obtain high tracking precision of PMLOSM. The PMLOSM inserted with AMFC can provide accurate trajectory tracking at a high frequency. Compared with single PI control, AMFC can reduce the phase lag from −18 to −2.7 degrees, which shows great promotion of the tracking Citation: Jiao, Z.; Cao, Y.; Yan, L.; Li, precision of PMLOSM.
    [Show full text]
  • Machine Controller and AC Servo Drive Solutions Catalog
    Machine Controller and AC Servo Drive Solutions Catalog Certified for ISO9001 and ISO14001 JQA-0422 JQA-EM0202 Ever Forward, Ever Better 100 Years ToTogethergether withwith Our CustomersCustomers Since its founding in 1915 as a manufacturer for motors, Yaskawa Electric has capitalized on its motor drive technology to provide continuing support for the key industries of the times, first for factory automation, and today, for mechatronics and robotics. Today, Yaskawa is striving to make effective use of its technologies developed in the motion control, robotics, and system engineering sectors, and is also taking on the challenges of achieving the highly efficient utilization of natural energy and the creation of a society in which people and robots exist side-by-side. Throughout our extensive 100-year history, we have consistently sought to develop the world’s leading technologies and applications that would best delight and be most useful to our customers. Yaskawa will continue to treasure the results, technologies, and reputation we have achieved thus far, and look ahead to create“ e-motional solutions” for emerging global challenges. Motion Control Robotics System Engineering 1915 1930 1990 2015 2 Environmental Energy Robotics Human Assist Mechatronics Solutions 3 Changing Motion, Changing the World Yaskawa is committed to developing innovative mechatronics products and offering new solutions to the world. Yaskawa's technology and mechatronics products are used in a wide-variety of industrial sectors, systems, and machinery, and enable ultra-high-speed and ultra-precision control. In addition to industrial sectors, our motion technology has a nearly limitless range of applications, including familiar sectors such as lifestyles, medicine, and welfare.
    [Show full text]
  • Discrete and Continuous Model of Three-Phase Linear Induction Motors “Lims” Considering Attraction Force
    energies Article Discrete and Continuous Model of Three-Phase Linear Induction Motors “LIMs” Considering Attraction Force Nicolás Toro-García 1 , Yeison A. Garcés-Gómez 2 and Fredy E. Hoyos 3,* 1 Department of Electrical and Electronics Engineering & Computer Sciences, Universidad Nacional de Colombia—Sede Manizales, Cra 27 No. 64 – 60, Manizales, Colombia; [email protected] 2 Unidad Académica de Formación en Ciencias Naturales y Matemáticas, Universidad Católica de Manizales, Cra 23 No. 60 – 63, Manizales, Colombia; [email protected] 3 Facultad de Ciencias—Escuela de Física, Universidad Nacional de Colombia—Sede Medellín, Carrera 65 No. 59A-110, 050034, Medellín, Colombia * Correspondence: [email protected]; Tel.: +57-4-4309000 Received: 18 December 2018; Accepted: 14 February 2019; Published: 18 February 2019 Abstract: A fifth-order dynamic continuous model of a linear induction motor (LIM), without considering “end effects” and considering attraction force, was developed. The attraction force is necessary in considering the dynamic analysis of the mechanically loaded linear induction motor. To obtain the circuit parameters of the LIM, a physical system was implemented in the laboratory with a Rapid Prototype System. The model was created by modifying the traditional three-phase model of a Y-connected rotary induction motor in a d–q stationary reference frame. The discrete-time LIM model was obtained through the continuous time model solution for its application in simulations or computational solutions in order to analyze nonlinear behaviors and for use in discrete time control systems. To obtain the solution, the continuous time model was divided into a current-fed linear induction motor third-order model, where the current inputs were considered as pseudo-inputs, and a second-order subsystem that only models the currents of the primary with voltages as inputs.
    [Show full text]
  • Neural Network Control of Autoclave Curing of Composite Materials
    NEURAL NETWORK CONTROL OF AUTOCLAVE CURING OF COMPOSITE MATERIALS Thesis Submitted to The School of Engineering UNIVERSITY OF DAYTON In Partial Fulfillment of the Requirements for The Degree Master of Science in Chemical Engineering by Maria Claudia Baptista UNIVERSITY OF DAYTON Dayton, Ohio December, 1994 ABSTRACT NEURAL NETWORK CONTROL OF AUTOCLAVE CURING OF COMPOSITE MATERIALS Baptista, Maria Claudia University of Dayton, 1994 Advisor: Dr. C. William Lee A back propagation neural network has been developed to determine the temperature cure cycle of a fiber reinforced epoxy matrix composite material in an autoclave. The self-directed neural network controller performed temperature control by adjusting the set-point of the autoclave based on five sensor inputs. The curing process was simulated by a one-dimensional heat transfer model that included heat source and convective boundary conditions. These two programs, the simulator and the controller, were installed on two separate computers. The neural network controller was developed using NeuroWindows™ in the Visual Basic™ environment. The neural network controller used for testing consists of an input layer with five neurons that represent the process and material states, one hidden layer with six neurons, and an output layer with a single neuron for temperature set point adjustment. The neural network controller, when trained by a cure cycle for a given thickness panel, was able to 111 THESIS 35 08892 NEURAL NETWORK CONTROL OF AUTOCLAVE CURING OF COMPOSITE MATERIALS Approved by: C. William Lee, Ph.D. Professor Committee Chairperson Tony E. Saliba, Ph.D. Kevif{J. Myers, D.Sc., P.E. Associate Professor Associate Professor Committee Member Committee Member Donald L.
    [Show full text]
  • Automation Studio Standardization Paves the Way to the Future HMI Systems What Goes Around, Comes Around Process Control APROL – for Stepwise Migration
    05.15 The B&R Technology Magazine Process and factory automation Take control of every process mapp technology Full focus on innovation Automation Studio Standardization paves the way to the future HMI systems What goes around, comes around Process control APROL – For stepwise migration editorial As environmental regulations and demographic chang- publishing information es continue to shape the future of the process manu- facturing industry, one of the most prominent themes will be plant modularization. The challenge of the mod- ular plant will be how to quickly and effectively inte- automotion: grate intelligent units into a complex production line The B&R technology magazine, Volume 16 without excessive engineering overhead, yet retaining www.br-automation.com/automotion the ability to satisfy customers' individual requirements and requests. Media owner and publisher: Bernecker + Rainer Industrie-Elektronik Ges.m.b.H. B&R Strasse 1, 5142 Eggelsberg, Austria In spite of all this newly gained flexibility, there is no Tel.: +43 (0) 7748/6586-0 room for compromise with regard to product quality, [email protected] seamless documentation and traceability, and sustain- able production methods. Managing Director: Hans Wimmer B&R's APROL process control system satisfies the requirements of flexible and modular Editor: Alexandra Fabitsch process manufacturing plants without neglecting the high demands on availability Editorial staff: Craig Potter Authors in this edition: Eugen Albisser, and data consistency. This innovative distributed control system already facilitates Yvonne Eich, Vitor Hayakawa, Stefan Hensel, the design of machinery and plants that meet the needs of Industry 4.0 production. Peter Kemptner, Jana Otevrelova, Franz Joachim Roßmann, Jaehoon Sa, Huazhen Song APROL has taken the next step in this direction with a fully integrated business intel- ligence solution that gives users powerful and convenient reporting functions that Graphic design, layout & typesetting: allow for exploratory analysis of plant and production data.
    [Show full text]