Sensorless Control of Stepper Motor Using Kalman Filter Chirayu Shah
Total Page:16
File Type:pdf, Size:1020Kb
SENSORLESS CONTROL OF STEPPER MOTOR USING KALMAN FILTER CHIRAYU SHAH Bachelor of Engineering in Instrument & Control Engineering Dharamsinh Desai Institute of Technology, India May, 2000 Submitted in partial fulfillment of requirements for the degree MASTER OF SCIENCE IN ELECTRICAL ENGINEERING at the CLEVELAND STATE UNIVERSITY December, 2004 This thesis has been approved for the Department of Electrical and Computer Engineering and the College of Graduates Studies by _________________________________________________ Thesis Committee Chairperson, Dr. Dan Simon _____________________________ Department/Date _________________________________________________ Thesis Committee Member, Dr. Zhiqiang Gao _____________________________ Department/Date _________________________________________________ Thesis Committee Member, Dr. Sridhar Ungarala _____________________________ Department/Date To Myself: Chirayu Shah My Parents: Ashwin R. Shah & Varsha A. Shah My Girlfriend: Hiral Patel My Brother: Rikin Shah ACKNOWLEDGEMENT I would like to express my sincere indebtness and gratitude to my thesis advisor Dr. Dan Simon, for the ingenious commitment, encouragement and highly valuable advice he provided me over the entire course of this thesis. His rigorous attitudes to do the research and inspire thinking to solve problems are invaluable for my professional career. I would also like to thank my committee members Dr. Zhiqiang Gao and Dr. Sridhar Ungarala for their support and advice. I wish thank my lab mates at the Embedded Control Systems Research Laboratory for their encouragement and intellectual input during the entire course of this thesis without which this work wouldn’t have been possible. My thanks also go to my mother and father, who is not even in USA but encourages me all the time on the phone. Also thanks to my brother, Rikin, and roommates who support me during my hard time. Last but not least, I would like to thank my girlfriend, Hiral, for her consistent love, support, understanding, encouragement, and for the life we experience together, both in our good times and hard times. ABSTRACT Despite model improvements and different control algorithms, much work remains to be done to attain maximum motor performance. This work attempts to achieve control and velocity tracking for a step motor using optimization techniques. The resulting system displays practical stabilization for velocity tracking of a voltage-fed permanent-magnet stepper motor. The control design is an output-feedback design that utilizes stator current and rotor position measurements. The goal of this work is to design a controller that is robust to load torques, cogging forces, and other disturbances satisfying certain bounds by estimating the speed and position of the motor using an extended Kalman filter. The controller and the estimator are implemented in a Microchip PIC16F877 microcontroller using embedded technology, and speed control is achieved using the estimated motor state. The PIC16F877 is interfaced to a PC through USART communication to send the real time data to the PC for analysis and comparison with Matlab results. v TABLE OF CONTENTS LIST OF FIGURES ............................................................................................................ ix LIST OF TABLES ............................................................................................................ xii CHAPTER I -- INTRODUCTION.................................................................................. 1 1.1 SENSORLESS CONTROL ...................................................................................... 2 1.2 LITERATURE SURVEY......................................................................................... 3 1.3 INTRODUCTION TO TECHNOLOGY ....................................................................... 5 1.4 THESIS ORGANIZATION ...................................................................................... 6 CHAPTER II – PROBLEM FORMULATION............................................................. 8 CHAPTER III -- STEPPER MOTORS ....................................................................... 11 3.1 INTRODUCTION................................................................................................. 11 3.2 THEORY OF OPERATION OF STEPPER MOTORS................................................ 13 3.3 TYPES OF STEPPER MOTORS............................................................................ 17 3.3.1 Permanent Magnet Stepper Motors..................................................... 17 3.3.2 Variable Reluctance Stepper Motors................................................... 18 3.3.3Hybrid Stepper Motors ......................................................................... 20 3.4 COMPARISON BETWEEN VR AND PM STEPPER MOTORS ................................. 21 3.5 STEPPER MOTOR SWITCHING SEQUENCE ......................................................... 22 3.6 MODELING OF PERMANENT MAGNET STEPPER MOTORS ................................. 27 3.7 SELECTION CRITERIA FOR STEPPER MOTORS ................................................... 31 3.7.1 Calculating Torque.............................................................................. 31 vi 3.7.2 Calculating Load ................................................................................. 32 3.7.3 Frictional And Rotational Acceleration Considerations..................... 32 3.8 STEPPER MOTOR APPLICATIONS ...................................................................... 32 CHAPTER IV-- KALMAN FILTER TECHNIQUE .................................................. 34 4.1 INTRODUCTION................................................................................................. 34 4.2 OBSERVERS...................................................................................................... 35 4.3 KALMAN FILTER ............................................................................................. 36 4.3.1 Introduction ............................................................................................ 36 4.3.2 Discrete time Kalman Filter................................................................... 37 4.3.3 Filter Tuning........................................................................................... 42 4.3.4 Discrete time Extended Kalman Filter ................................................... 42 4.4 MOTOR MODEL FOR DISCRETE TIME EXTENDED KALMAN FILTER ................. 47 CHAPTER V – HARDWARE AND SOFTWARE IMPLEMENTATION .............. 51 5.1 INTRODUCTION................................................................................................. 51 5.2 HARDWARE OVERVIEW................................................................................... 52 5.2.1 The Stepper Motor ........................................................................... 52 5.2.2 Motor Driver Chip (L6208) ............................................................. 54 5.2.2.1 Introduction.......................................................................... 54 5.2.2.2 Features ................................................................................ 56 5.2.2.3 Pin Description ..................................................................... 56 5.2.2.4 Motor Driving Phase Sequence ............................................. 58 5.2.2.5 Micro-Stepping Mode implementation Using L6208............. 60 5.2.3 The Microcontroller (PIC16F877) .................................................. 64 vii 5.2.3.1 Introduction ........................................................................... 64 5.2.3.2 Pin Diagram and Key Features .............................................. 66 5.2.4 Serial Communication Chip (MAX-202) ......................................... 67 5.3 HARDWARE LOOP ........................................................................................... 69 5.4 SOFTWARE OVERVIEW .................................................................................... 74 CHAPTER VI – RESULTS ........................................................................................... 77 6.1 INTRODUCTION................................................................................................. 77 6.2 SIMULATION RESULTS ..................................................................................... 77 6.3 EXPERIMENTAL RESULTS................................................................................. 97 CHAPTER VII CONCLUSION AND FUTURE WORK…………………………..101 7.1 CONCLUSION.................................................................................................. 101 7.2 FUTURE WORK .............................................................................................. 103 BIBILIOGRAPHY ....................................................................................................... 104 APPENDIX A MATLAB CODE ..................................................................................... 109 B PIC CODE (C PROGRAM).................................................................... 119 viii LIST OF FIGURES FIGURE ................................................................................................................... PAGE 3.1 Stepper Motor System............................................................................................... 11 3.2 Component of PM Stepper Motor (a) Rotor (b) Stator............................................. 13 3.3 Six Pole Rotor and Four Pole Stator in Stepper Motor............................................. 14 3.4