Design and Development of Digital PID Controller for DC Motor Drive System Using Embedded Platform for Mobile Robot Chandra Shekhar Gohiya S.S.Sadistap, S.A.Akbar, B.A.Botre School of Electronics Devi Ahilya University Indore – 452017, India csgohiya@gmail.com Central Electronics Engineering Research Institute Council of Scientific and Industrial Research Pilani - 333031, India 1 ssadistap@yahoo.co.in, 2saakbar@gmail.com This paper brings out a discrete PID control mechanism for agriculture mobile robot. Here high speed ,high precision DC motor control system has been designed in MATLAB and implemented on ARM 9 based microcontroller .This paper is organized in following ways .Section II concentrate on overall system description. DC motor model derived for the system is described in section III. Section IV describes about PID controller model design while section V describe the software development and Section VI shows the test results observed and conclusion inferred from the project. Abstract— In Agriculture industry, plants are prone to diseases caused by pathogens and environment conditions and it is a prime cause to lose of revenue. It requires continuous monitoring of plants and environment parameters to overcome this problem. A mobile Robotic system for monitoring these parameters using wireless network has been envisaged here and developed based on ARM-Linux platform. Robotic platform consists of ARM9 based S3C2440 processor from SAMSUNG and Linux Kernel , Motor driver, robot mechanical assembly. The farm environment and plant condition such as temperature, humidity soil moisture content etc. are continuously monitored through suitable data acquisition system incorporated in the robotic system. A servo motor based robotic arm is designed for collecting soil sample and test various soil parameters. A closed loop feedback algorithm based on Digital PID controller has been developed for precise position and speed control of mobile robot. II. The Developed mobile robot system has embedded linux platform comprises host PC using Ubuntu 10.04 and Target device mini2440 an ARM architecture based development board. Linux kernel 2.6.32 is cross-compiled using armlinux-gcc for ARM platform. Application programs are developed for Target device and host using arm-qtopia and x86 qtopia respectively. Developed mobile robot is depicted in figure 1. All modules of robotic system is described below. The wireless control of mobile robot and monitored data acquisition is accomplished using zigbee wireless protocol. For displaying acquired data on host system a Graphical user interface is designed using qt creater framework. For independent functioning of mobile robot, application program is written in c language and cross compiled using arm-linuxgcc compiler on Ubuntu 10.04 platform and ported on the memory of ARM processor. A. ARM Based Controller Unit ARM9 based Samsung s3c2440 microcontroller is used to control the various task .This provides a small size microcontroller solution to the handheld device and ordinary application of low price, low power consumption and high performance. This 32 bit microcontroller has ARM920T processor core integrated inside s3c2440A with maximum master frequency of 400 MHz. This high end processor is used to accomplish the task of on board image processing using open-cv library in this mobile robot. Keywords- ARM-Linux platform, PID controller, Zigbee. I. INTRODUCTION Nowadays there are increasing awareness and development of agriculture mobile robots around the world. Mobile robots can be an effective tool to reduce the production cost and manpower in agriculture. It can be used for smart inspection of agriculture field. Several soil and atmospheric parameters can be monitored wirelessly with the help of mobile robots. Mobile robot driving system requires high level of quickness, precision and accurate feedback mechanism for speed and position control. c 978-1-4673-4529-3/12/$31.00 2012 IEEE SYSTEM DESCRIPTION B. Power Module and Battery 7 Ah lead acid battery from nexrobotics is used to supply the power to all module of the system . Power supply module is designed for power requirement of 12V, 5V 3.3V and 1.8 V. 52 Authorized licensed use limited to: CENTRO FED DE EDUCACAO TECNOLOGICA DE MINAS GERAIS. Downloaded on September 11,2022 at 23:14:36 UTC from IEEE Xplore. Restrictions apply. C. Driver Module For controlling the motor speed and direction a interface circuit with L293D is used .Speed is controlled using PWM signal generated by mini2440 .Driver module comprises 3 DC motor and 3 servo motor for various task of robot. D. Sensor Module Sensor module included imagining sensor (USBcamera), temperature sensor, humidity sensor, soil sensor and IR sensor for obstacle detection. Optical Interrupter switch is used as a motor speed decoder sensor. E. Communication Module Communicating wirelessly between host and target xbee-pro zigbee wireless module from maxstream is used. This is used to send commands to mobile robot and to receive data from mobile robot . Fig. 2. A schematic of DC motor From Figure: 2 we can write the following equations based on the Newton’s law combined with the Kirchoff’s law: (3) (4) Using the Laplace transform, equations (3) and (4) can be written as: (6) where s denotes the Laplace operator. From (6) we can express I(s): (7) (8) Fig. 1. Complete System III. the transfer function from the input voltage, V (s), to the output angle, θ, directly follows: DC MOTOR MODEL Direct-current (dc) motors are one of the most widely used prime movers in the industry today. Advanced manufacturing techniques have also produced dc motors with ironless rotors that have very low inertia, thus achieving a very high torque-to-inertia ratio. Low-time-constant properties have opened new applications for dc motors in computer peripheral equipment such as tape drives, printers, disk drives, and word processors, as well as in the automation and machine-tool industries [5]. The dc motor is basically a torque transducer that converts electric energy into mechanical energy. The motor torque T is related to the armature current, i by a torque constant K; T = Ki (1) The transfer function from the input voltage, V (s), to the angular velocity, ω, is: Armature voltage Vs K / Ls + R Torque T(s) 1 / Js + b Velocity S 1/S The generated voltage, Va, is relative to angular velocity by; Vs (s) (2) Back emf K Fig.3. Block diagram of DC Motor's Transfer function Mathematical Model 2013 3rd IEEE International Advance Computing Conference (IACC) 53 Authorized licensed use limited to: CENTRO FED DE EDUCACAO TECNOLOGICA DE MINAS GERAIS. Downloaded on September 11,2022 at 23:14:36 UTC from IEEE Xplore. Restrictions apply. The Figure 3 shows mathematical model representation of derived transfer function. In this project the permanentmagnet DC motor use is KM3448D. The parameters are: R = 2.7 ohm , L = 0.004 H b = 0.0000093 N-m-s-rad-1 k = 0.105 V-s-rad-1 (the back emf constant) k = 0.105 N-m-A-1 (the torque constant) J = 0.0001 kg-m2 Then transfer function for plant(dc motor) becomes And the algorithm for the previous step in time is written with the appropriate shift in subscript ,or (11) Subtraction of (11) from (10) yields D(s) = This is digitized using proper sampling time and digital plant equation can be written as D(z) = Or combining like terms yields (9) (12) IV. PID CONTROL ALGORITHM Figure 4 shows digital PID control system. System transfer function can be given as M(z) = = Which is the direct control algorithm. By taking the ztransform of the difference equation (12) we can determine the companasator transfer function which will perform the proportional plus integral plus derivative (PID) control function : Where Fig. 4. Digital PID control system The time domain relation for Continuous –time controller is Associated transfer function for the controller can be given by Laplace transform of equation Where the choice of constant will determine the system dynamics .Since this technique has proven so use full for continuous time system .It is desirable to develop a digital control algorithm for system. Digital control algorithm can be derived by approximating the integral with trapezoidal integration and derivative with backward difference equation [7]. (10) 54 Using developed DC Motor model described in equation. (9) and the closed loop system are used to determine PID constants of digital PID controller using MATLAB. Derived PID constants are Kp = 100; Ki = 200; Kd = 10. And using these values the final control algorithm can be given by equation Further this algorithm is used to calculate the error signal compared to set point value and according to the value of error, duty cycle of PWM signal is varied . V. SOFTWARE DEVELOPMENT AND IMPLEMENTATION Actual Implementation of PID controller was done using ARM based microcontroller (s3c2440) through an interfacing circuit. For software part two software routine are running in every 1/10th of a second, one is for calculating speed and second one for generating control efforts .Flow chart of control strategy is shown in figure 5. Programming was done using c language. A constant signal varying from 50 % to 90 % duty cycle is applied from the microcontroller amplified by interface circuit using L298.A wheel encoder with N=8 index holes is connected to the shaft . In this sensor a pair of IR LED and receiver is placed face to face in 2013 3rd IEEE International Advance Computing Conference (IACC) Authorized licensed use limited to: CENTRO FED DE EDUCACAO TECNOLOGICA DE MINAS GERAIS. Downloaded on September 11,2022 at 23:14:36 UTC from IEEE Xplore. Restrictions apply. a fashion such that when an index hole comes in front of the LED, output of the receiver goes low, otherwise output to receiver is high . The microcontroller counts the number of transition from high to low for a certain time interval and calculates speed (in Hz) of the motor from the relation. Speed = Time of counting * Number of Count / N. Once the speed has been calculated, control efforts are made to adjust the power delivered to motor. This design is implemented on ARM9 based s3c2440 microcontroller. Proportional, integral and derivative parameters are obtained for various load conditions to set the speed. Fig. 6. Stair step response with PID controller Fig. 5. Control Strategy Device-driver for timer :- PWM duty cycle is controlled by a device driver program this device driver program is customized as described below . 1. Setting GPB1 to TOUT1 i.e. pulse generating terminal. 2. Setting Timer Configuration Register 0 (TCFG0) 3. Setting Timer Configuration Register 1 (TCFG1). 4. Acquiring clock frequency of pclk from platform clock queue of system through the function clk_get and clk_get_rate defined in include /linux/clk.h 5. Interval is pclk/50/16/freq acquired in 4, setting the value into timer count buffer register (TCNTB1). 6.For setting duty cycle such approach is adapted that changes the value obtained in 5 into timer comparison buffer register (TCMPB1) 7. Closing dead zone, automatic reloading, closing phase inverter, renewing TCNTB1 and TCMPB 1 and starting timer1 i.e. Timer control register (TCON). 8. Resetting TCON , clearing manual renew position of timer 1. VI. RESULTS AND CONCLUSION A real time Digital PID controller has been developed and closed loop approach is adapted to control the speed of the DC motor using embedded system . Character device driver program is developed for DC motor control strategy. Fig. 6 shows the close loop response of digital system. Speed control with precision and high speed of operation is important in robotic application. High precision control implementation requirements have been met on ARM board because it is 32-bit microcontroller; additionally it has all necessary facility for concurrent programming and real-time control for fast handling of events in Robotic applications. ACKNOWLEDGMENT The authors are thank full to Dr. Chandra Shekhar Director CEERI for his encouragement and constant support. The authors are also thank full to Head school of electronics Indore for his help and support for the work. REFERENCES [1] [2] [3] [4] [5] [6] B. A. Botre, G. Manu, S. Reddy and S. S. Sadistap, “Development of Mobile embedded system for farm sensing”, Journal of Instrument Society of India, vol. 40 no. 1, pp 4-7, Jan. 2010. N. Hermarjit Singh, B A. Botre, S. S. Sadistap and K. S. N. Rao, “Smart Embedded Sensing Module for Fresh Water Aquaculture Application”, 15th National Seminar on Physics and Technology of Sensors, pp. C-39, 1-3, March 2010. B. Waphare, B. A. Botre, D. C. Gharpure and A. D. Shaligram, “3step filtering using AI for Wind Direction Sensor dedicated to be used on a Mobile Robot” Journal of Instrument Society of India, vol. 40 no. 2, pp 77-80, July 2010. “Modern Control Engineering”, by Katsuhiko Ogata, Prentice-Hall of India PVT LTD, 1991. “Control System Engineering” by I.J. Nagrath and M. Gopal, New age International, 2010. “Modern Digital Control Systems” by Raymond G. Jackquot, Marcel Dekker INC. ,1995. 2013 3rd IEEE International Advance Computing Conference (IACC) 55 Authorized licensed use limited to: CENTRO FED DE EDUCACAO TECNOLOGICA DE MINAS GERAIS. Downloaded on September 11,2022 at 23:14:36 UTC from IEEE Xplore. Restrictions apply.