International Journal of Industrial Electronics and Control. ISSN 0974-2220 Volume 4, Number 2 (2012), pp. 53-60 International Research Publication House http://www.irphouse.com Design and Implementation of Arm Cortex based Speed Control of DC Motor 1 N. Madhusudhana Reddy, 2 K. Nagabhushan Raju, 2 C. Chandra Mouli and 3 D.Chandrasekhar Reddy 1 Department of Electronics, Sri Krishnadevaraya University, Anantapur, A.P., India 2 Department of Instrumentation, Sri Krishnadevaraya University, Anantapur, A.P., India. 3 Megabyte Technologies, Bangalore, Karnataka, India E-mail: madhu_sd24@yahoo.com Abstract The speed control system for DC motors used in different applications needs high performance, reliability and accuracy to achieve desired output. The paper presents the design and implementation of ARM cortex based DC motor speed control system using PID controller. ARM Cortex based controller is used because of its compatibility and portability associated with its inbuilt peripherals like timers/counters, PWM etc., to implement PID algorithm within the controller using software. This provides a single board solution for controlling the DC motor. The pulses from the DC motor module which contains optical encoder, DC motor and opto-coupler are fed as input to the controller counter. The desired speed is set in RPM from the keypad which is interfaced with the microcontroller. According to the error signal the proportional constant (kp), integral constant (ki) and derivative constant (kd) values are calculated. The microcontroller implements the PID controller and generates PWM signal which takes the motor speed to the desired RPM. The paper presents the hardware and software aspects of the above work. Index Terms: DC Motor, ARM-Cortex, PID Controller, PWM, RPM. Introduction The purpose of a motor speed controller is to take a signal representing the demand
54 N. Madhusudhana Reddy et al speed, and to drive a motor at that speed. The controller may or may not actually measure the speed of the motor. If it does, it is called a Feedback Speed Controller or Closed Loop Speed Controller, if not it is called an Open Loop Speed Controller. Feedback speed control is better, but more complicated, and may not be required for a simple robot design [1]. Many techniques have been implemented to control the DC motor speed using embedded systems [2-6]. An embedded system is a special-purpose computer system, which is completely encapsulated by the device it controls, so there are some specific requirements for each system, such as functions, reliability, cost, size and power consumption, etc. Because of the limitations from the lower performance such as low running speed, low address capability and high power consumption, the 8-bit controllers like 8051 based or 16-bit controllers like PIC cannot meet the requirements of some complex embedded applications. In the field of 32-bit embedded system application, ARM (Advanced RISC Machine) gains tremendous success [7-8]. Generally speaking, the ARM-kernel microprocessors present as smaller size, lower power consumption, and lower cost, and relatively high performance. For instance, with a plenty of resistor and high instruction executing speed, most of the data operations are completed in registers. Besides, the ARM-kernel microprocessors have advantages in addressing flexibility, facility and higher execution efficiency as well as lengths of instructions, and so on. An embedded operating system can be encapsulated in ARM, to accomplish complex algorithms and to finish a variety of tasks instead of personal computers. This paper introduces the configuration of the embedded system, and then presents a sophisticated Speed control of DC motor by using PID technique. Architecture of the Proposed System The optical encoder senses the speed of the DC motor and produces the sequence of pulses which is directly proportional to the speed of the motor. The sequence of the pulses is given as input to one of the counters of the ARM Cortex-M3 microcontroller. The counter reads the pulses and converts into digital value applied to linear equation for converting back to frequency and speed is displayed on the LCD in RPM. Dynamically the desired RPM is given as input through the 4X4 hex keypad. Then microcontroller applies PID control logic to calculate error signal and generates the PWM to get desired RPM output. Experimental Setup Hardware Design Figure 1 shows the block diagram of Design and Implementation of Arm Cortex Based Speed Control of DC Motor. Figure 2 depicts the essential functional units of the setup, namely, Input Unit, Data Processing Unit and the Output Unit.
Design and Implementation 55 Figure 1: Architecture of Design and Implementation of Arm Cortex Based Speed Control of Dc Motor Using PID Technique Figure 2: Photograph of the experimental setup with functional units Input Unit The input unit contains a 4X4 hex keypad. The keypad is organized in a matrix of rows and columns. The controller accesses both rows and columns through ports; therefore to interface a 4X4 keypad a controller needs 8 I/O lines 4 for rows and 4 for columns. Data Processing Unit The data processing unit contains ARM Microcontroller unit and DC motor module. ARM microcontroller unit It contains ARM microcontroller and DC motor driver circuit. In the present study the controller using is LM3S9B96 which is an embedded processor. An Embedded Processor is simply a micro Processor that has been Embedded into a device. It is
56 N. Madhusudhana Reddy et al software programmable but interacts with different pieces of hardware. The three most important design criteria for embedded processors are performance, compactness, high code density, low power consumption, and cost. The DC motor driver circuit is a transistor which is configured as a switch and it is driven from the microcontroller PWM 0 (Pin14). DC motor module The DC motor module consists of speed sensing unit and DC motor. Speed sensing unit consists of an optocoupler MOC7811 and an optical encoder, which will give train of pulses with some frequency depending upon the speed of the motor. The DC motor used is less weight, low power consumption and high speed etc. The lifetime of the motor may vary from a few hundred hours to more than 10, 000 hours. The specifications of DC motor used in the present study are shown in Table 1. Table 1: Specifications of DC motor. Description Rated voltage Rated current Maximum speed Torque Weight Value 12 V DC 500 ma 3000 RPM 50 gm-cm 150 g Output Unit The output unit consists of two lines liquid crystal display to display the measured DC motor speed in RPM with the help of microcontroller. The LCD commands like enable the LCD, initialization of two lines, clear the LCD, return to home (displaying the first line) and shift to right (to display the next character) etc., after the microcontroller makes RS Low, which is indicated for displaying the data on LCD. Proportional plus Integral Plus Derivative Control [PID] As the PID controller is composed of three components, it produces an output signal consisting of three terms-one is proportional to the error signal e (t), another one is proportional to integral of error signal e (t) and the third one is proportional to derivative of the error signal e (t) [6-10]. The equation of the PID controller is given as u (t) [ e(t) + e(t) dt + de(t)/dt] u (t) = Kp e(t) + Kp /Ti e(t) dt + Kp Td de(t)/dt, Where, Kp is the proportional gain. Ti is the integral time. Td is the derivative time.
Design and Implementation 57 The transfer function can be written as, U (s)/e (s) = Kp(1 + 1/Ti s + Td s) The block diagram representation of the PID controller is shown in Fig. 3. Figure 3: Block diagram of the PID controller. Software: The algorithm followed for designing the software is give in the form of Flow chart in Figure 4. Figure 4: Flow chart for an ARM Cortex based DC motor speed control system. Software is developed using embedded C programming with Keil-4 cross compiler IDE. GPIO s have been configured for initialize LCD display and measure the speed to solve PID equations and finally output control signals to the actuator. The software makes the system user friendly. It provides on-line tuning of PID parameters. The software also provides on-line variation of set point, which facilitates the system to study the step variation response. The compiled program is tested through the JTAG (Joint Test Application Group) debugger and ported the exe file into the controller ROM. Results for proposed system This paper presents implementation of ARM Cortex-M3 (LM3S9B96) microcontroller based DC motor speed and position control system using PID controller algorithm. LM3S9B96 is used because of its compatibility to implement PID algorithm with in controller itself which will make single board system to control the motor. LCD drivers have been implemented to visualize the speed of the motor. The proposed system is intended to increase the performance of the process parameters and decries the cost, complexity and the size of the system. This system is tested with load and without load conditions for various standard input test signals.
58 N. Madhusudhana Reddy et al On board PID controller system provides better system response in terms of transient as well as steady-state performances. The controller parameters are manually tuned (kp=0.232, ki=0.078 and kd=0.035) and the results of the best tuned PID controller are presented. Table 1: DC motor speed control system (In absence of load) for a step size of 1000 rpm (0-1000 rpm) Controller Sampling interval (seconds) Maximum(RPM) Overshoot Undershoot Settling time (Seconds) Steady-state error (RPM) PID 0.009 0.43 0.57 9 0.31 Figure 5 (a): DC motor speed control system using PID logic for 800, 1000 and 1200 RPM step variations. Figure 5 (b): DC motor speed control system using PID logic for 1000, 800 and 1200 RPM step variations.
Design and Implementation 59 Figure 5 (c): DC motor speed control system using PID logic for 600, 800 and 1000 RPM step variations. Figure 5 (d): Step response of DC motor speed control system for set point 1000 RPM using PID control. Conclusion An embedded based DC motor speed control system is developed using LM3S9B96 ARM microcontroller. A PID controller was successfully implemented using the above microcontroller and tested on a DC motor speed control system. For speed control, with the PID controller added, the desired output speed was obtained. The system outputs also agreed with theoretical results, indicating better accuracy of the system. The system designed in this paper, can deal with many middle and small power motor control systems. LM3S9B96 microcontroller control system has a complete set of common peripherals compared with others, thereby giving the system strong task management and real time response. When external attachments are
60 N. Madhusudhana Reddy et al added, it really minimizes overall system costs and eliminates the need to configure additional components. References [1] http://homepages.which.net/~paul.hills/speedcontrol/speedcontrollersbody.ht ml [2] Microcontroller-based dc Motor controller. KS Project Manual EFY june 2009. [3] Jose L. Tong and James P. Bobis, A model for designing digital PID controllers, IEEE Proc., 9-13 Nov 1992, pp. 1157-1162. [4] Chandrasekhar T., Nagabhushan Raju K., Embedded Based DC Motor Speed Control System; Sensors & Transducers Journal, Vol. 121, Issue 10, October 2010, pp. 94-105 [5] Walter, H. Sakman., A brushless dc motor controlled by a microcontroller with examples for a three phase motor. IEEE Trans. Indus. Elec., 1987, 34(3), 339-44. [6] S. J. Perez, M. A. Calva and R. Castaneda, A Microcontroller- Based Data Logging System, Journal of the Mexican Society of Instrumentation, Instrumentation and Development, Vol. 3, No. 9, 1997. [7] T.Z. Sun, W. J. Yuan, and H.F. Zhang, Manual for Embedded Design and Linux Driver development: Based on ARM9 Microprocessors, Beijing: Publishing house of electronics Industry, 2005 [8] Y. Chen, M. Li, Y. Yang. Analyst and Practice of Open-Code Embedded System Software: Based on SKYEYE and ARM Development platform, Beijing: Beijing University of Aeronautics and Astroni [9] Leehter Yao and Chin-Chin Lin., Design of Gain Scheduled Fuzzy PID Controller, World Academy of Science, Engineering Technology, 2005. [10] S. S. Patil, and P. Bhaskar., Design and Real-time Implementation of IFLC for a high speed PMDC motor, International Journal of Electronic Engineering Research, Vol. 1, No 1, 2009, pp. 13-25.