Software interfacing of servo motor with microcontroller

Similar documents
EET 438a Automatic Control Systems Technology Laboratory 5 Control of a Separately Excited DC Machine

Fuzzy Logic Controller for Three Phase PWM AC-DC Converter

Synchronous Machine Parameter Measurement

Synchronous Machine Parameter Measurement

A Novel Back EMF Zero Crossing Detection of Brushless DC Motor Based on PWM

Lab 8. Speed Control of a D.C. motor. The Motor Drive

Synchronous Generator Line Synchronization

Exercise 1-1. The Sine Wave EXERCISE OBJECTIVE DISCUSSION OUTLINE. Relationship between a rotating phasor and a sine wave DISCUSSION

Performance Comparison of Sliding Mode Control and Conventional PI Controller for Speed Control of Separately Excited Direct Current Motors

Compared to generators DC MOTORS. Back e.m.f. Back e.m.f. Example. Example. The construction of a d.c. motor is the same as a d.c. generator.

Nevery electronic device, since all the semiconductor

Experiment 3: Non-Ideal Operational Amplifiers

Three-Phase Synchronous Machines The synchronous machine can be used to operate as: 1. Synchronous motors 2. Synchronous generators (Alternator)

Robustness Analysis of Pulse Width Modulation Control of Motor Speed

ABB STOTZ-KONTAKT. ABB i-bus EIB Current Module SM/S Intelligent Installation Systems. User Manual SM/S In = 16 A AC Un = 230 V AC

Experiment 3: Non-Ideal Operational Amplifiers

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 4143/5195 Electrical Machinery Fall 2009

Sri Ramakrishna Institute of Technology, Coimbatore, India 6. College of Engineering, Guindy, Chennai, India

Module 9. DC Machines. Version 2 EE IIT, Kharagpur

Simulation of Transformer Based Z-Source Inverter to Obtain High Voltage Boost Ability

(CATALYST GROUP) B"sic Electric"l Engineering

CHAPTER 2 LITERATURE STUDY

The Discussion of this exercise covers the following points:

DESIGN OF CONTINUOUS LAG COMPENSATORS

Application Note. Differential Amplifier

Modeling of Inverter Fed Five Phase Induction Motor using V/f Control Technique

Postprint. This is the accepted version of a paper presented at IEEE PES General Meeting.

Design And Implementation Of Luo Converter For Electric Vehicle Applications

Study on SLT calibration method of 2-port waveguide DUT

Tuning and Analysis of Fractional Order Controllers for Hard Disk Drive Servo System

MAXIMUM FLOWS IN FUZZY NETWORKS WITH FUNNEL-SHAPED NODES

Understanding Basic Analog Ideal Op Amps

A Cost Effective Speed Control Method for BLDC Motor Drive

Exponential-Hyperbolic Model for Actual Operating Conditions of Three Phase Arc Furnaces

CHAPTER 3 AMPLIFIER DESIGN TECHNIQUES

Lecture 16: Four Quadrant operation of DC Drive (or) TYPE E Four Quadrant chopper Fed Drive: Operation

Y9.ET1.3 Implementation of Secure Energy Management against Cyber/physical Attacks for FREEDM System

(1) Non-linear system

Section 2.2 PWM converter driven DC motor drives

ScienceDirect. Adaptive LMS Filter using in Flexible Mechatronics System with Variable Parameter Control

Engineer-to-Engineer Note

METHOD OF LOCATION USING SIGNALS OF UNKNOWN ORIGIN. Inventor: Brian L. Baskin

This is a repository copy of Effect of power state on absorption cross section of personal computer components.

Application of Wavelet De-noising in Vibration Torque Measurement

IMPLEMENTATION OF FUZZY-NEURO CONTROLLER FOR DC-DC CONVERTER FED DC SERIES MOTOR USING EMBEDDED MICROCONTROLLER

To provide data transmission in indoor

PB-735 HD DP. Industrial Line. Automatic punch and bind machine for books and calendars

Products no longer available

Mechanics & Industry. Experimental investigations on the effectiveness of electromagnetic actuator as sensor

Foot-Pedal: Haptic Feedback Human Interface Bridging Sensational Gap between Remote Places

Development and application of a patent-based design around. process

MULTILEVEL INVERTER TOPOLOGIES USING FLIPFLOPS

Low Cost Microcontroller Based Implementation of Modulation Techniques for Three-Phase Inverter Applications

Safety Relay Unit. Main contacts Auxiliary contact Number of input channels Rated voltage Model Category. possible 24 VAC/VDC G9SA-501.

& Y Connected resistors, Light emitting diode.

A Development of Earthing-Resistance-Estimation Instrument

JUMO Wtrans B Programmable Head Transmitter with Radio Transmission

Dynamic Power Quality Compensator with an Adaptive Shunt Hybrid Filter

Direct AC Generation from Solar Cell Arrays

ISSCC 2006 / SESSION 21 / ADVANCED CLOCKING, LOGIC AND SIGNALING TECHNIQUES / 21.5

CS 135: Computer Architecture I. Boolean Algebra. Basic Logic Gates

FPGA Based Five-Phase Sinusoidal PWM Generator

Experimental Application of H Output-Feedback Controller on Two Links of SCARA Robot

Interference Cancellation Method without Feedback Amount for Three Users Interference Channel

Effect of High-speed Milling tool path strategies on the surface roughness of Stavax ESR mold insert machining

NP10 DIGITAL MULTIMETER Functions and features of the multimeter:

Optimal Speed Control for Direct Current Motors Using Linear Quadratic Regulator

Application of Feed Forward Neural Network to Differential Protection of Turbogenerator

Real Time Determination of Rechargeable Batteries Type and the State of Charge via Cascade Correlation Neural Network

DP400 / DM350. Inverter. Total Solutions from the Single Source Provider DP400 PULSED MAG - PULSED MIG CO2 - MAG - MIG - FCAW

Soft switched DC-DC PWM Converters

5 I. T cu2. T use in modem computing systems, it is desirable to. A Comparison of Half-Bridge Resonant Converter Topologies

Experiment 8 Series DC Motor (II)

Investigation of Ground Frequency Characteristics

Array chip resistors size ARC241/ARC242 ARV241/ARV242

A New Stochastic Inner Product Core Design for Digital FIR Filters

Mixed CMOS PTL Adders

A Simple Approach to Control the Time-constant of Microwave Integrators

Electrical data Nominal voltage AC/DC 24 V Nominal voltage frequency

Multi-beam antennas in a broadband wireless access system

Design and Modeling of Substrate Integrated Waveguide based Antenna to Study the Effect of Different Dielectric Materials

Pulse Radar with Field-Programmable Gate Array Range Compression for Real Time Displacement and Vibration Monitoring

Connection Technology

Three-Phase NPC Inverter Using Three-Phase Coupled Inductor

Research on Local Mean Decomposition Algorithms in Harmonic and Voltage Flicker Detection of Microgrid

Controls. Solid-State Switching Devices. Reference Manual April Low-Voltage Controls and Distribution

Estimation of Disk Slip Position Error for Mobile Hard Disk Drives

Modeling of Conduction and Switching Losses in Three-Phase Asymmetric Multi-Level Cascaded Inverter

Resolver Interface Card "OPC-G1. RES" Product Specifications

Ultra Low Cost ACCELEROMETER

MEASURE THE CHARACTERISTIC CURVES RELEVANT TO AN NPN TRANSISTOR

THE present trends in the development of integrated circuits

Electrical data Nominal voltage AC/DC 24 V Nominal voltage frequency

SLOVAK UNIVERSITY OF TECHNOLOGY Faculty of Material Science and Technology in Trnava. ELECTRICAL ENGINEERING AND ELECTRONICS Laboratory exercises

Analog computation of wavelet transform coefficients in real-time Moreira-Tamayo, O.; Pineda de Gyvez, J.

Dual-Fuzzy MPPT in Photovoltaic-DC Analysis for Dual-load Operation with SEPIC Converter

EY-AM 300: novanet BACnet application master, modunet300

Electrical data Nominal voltage AC/DC 24 V Nominal voltage frequency

Low noise SQUID simulator with large dynamic range of up to eight flux quanta

Passive and Active Hybrid Integrated EMI Filters

Transcription:

University of Wollongong Reserch Online Fculty of Engineering nd Informtion Sciences - Ppers: Prt A Fculty of Engineering nd Informtion Sciences 2013 Softwre interfcing of servo motor with microcontroller Ahmed M. Hidr University of Wollongong, hidr@uow.edu.u Chellli Benchib University of Bechr Mohmd Zhir University Mlysi Phng Publiction Detils A. M. Hidr, C. Benchib & M. Zhir, "Softwre interfcing of servo motor with microcontroller," Journl of Electricl Systems, vol. 9, (1) pp. 84-99, 2013. Reserch Online is the open ccess institutionl repository for the University of Wollongong. For further informtion contct the UOW Librry: reserch-pubs@uow.edu.u

Softwre interfcing of servo motor with microcontroller Abstrct Automtic control of DC servo motor in terms of rottion ngle hs plyed vitl role in the dvnce Electromechnicl Engineering. Nowdys, the utomtic process of motor control using Personl Computer (PC) is commonly used. The controllers re designed to interfce between Computer nd Motor. This pper presents the implementtion of PIC Microcontroller with Grphicl User Interfce (GUI) in Mtlb to trck the rottionl ngle of DC servo motor. The movement of slider on GUI will ct s n input signl into the Microcontroller to chnge the rottion ngle. A simultion on the performnce of the system hs been crried out using Proteus softwre interfced with Mtlb nd the controller ws tested on rel-time ppliction. Results show tht the use of PIC Microcontroller nd GUI in Mtlb is n dvntge solution to control the rottionl ngle. Keywords interfcing, microcontroller, softwre, motor, servo Disciplines Engineering Science nd Technology Studies Publiction Detils A. M. Hidr, C. Benchib & M. Zhir, "Softwre interfcing of servo motor with microcontroller," Journl of Electricl Systems, vol. 9, (1) pp. 84-99, 2013. This journl rticle is vilble t Reserch Online: http://ro.uow.edu.u/eisppers/468

Ahmed M. A. Hidr 1, Chellli Benchib 2, Mohmd Zhir 3 J. Electricl Systems 9-1 (2013): 84-99 Regulr pper Softwre Interfcing of Servo Motor with Microcontroller JES Journl of Electricl Systems Automtic control of DC servo motor in terms of rottion ngle hs plyed vitl role in the dvnce Electromechnicl Engineering. Nowdys, the utomtic process of motor control using Personl Computer (PC) is commonly used. The controllers re designed to interfce between Computer nd Motor. This pper presents the implementtion of PIC Microcontroller with Grphicl User Interfce (GUI) in Mtlb to trck the rottionl ngle of DC servo motor. The movement of slider on GUI will ct s n input signl into the Microcontroller to chnge the rottion ngle. A simultion on the performnce of the system hs been crried out using Proteus softwre interfced with Mtlb nd the controller ws tested on rel-time ppliction. Results show tht the use of PIC Microcontroller nd GUI in Mtlb is n dvntge solution to control the rottionl ngle. Keywords: Automtic control; Mtlb GUI; DC servo motor; PIC Microcontroller; Proteus softwre 1. Introduction DC Servo Motors become n importnt device in wide rnge of industril pplictions tht require high dynmics on position control such s numericlly controlled mchinery, robotics, utomtion nd other mechnism where the strting nd stopping functions re quickly nd ccurtely [1,2]. These pplictions require high-speed control ccurcy nd good dynmic respond. In robotic pplictions, servo motors re used to move the robotic rm to relevnt position by mens of controllers in the utomted mnufcturing lines of industries [3, 4]. The rotor construction of servo motors mde of specil mteril with less weight to decrese the inerti of rmture but cpble to produce the necessry mgnetic flux. Low rotor inerti increses the cpbility of immeditely strting nd stopping during the on-off conditions. The high cost of servo motor becomes mjor issue. Therefore, the smll-scle mnufcturers or users cnnot fford to use this type of DC Motor. DC Servo Motors hve lrge mrket shre in the Industry Automtion & Drive Technologies. The common problems in controlling the servo motor with specific speed nd position is the tuning of the prmeters. Mny different techniques hve been proposed in order to cope with the tuning problems. Fuzzy Logic is one of the implemented techniques tht hve been used to sort out with these problems [4, 5]. The nonlinerity of the servo motor is one of the difficulties in controlling the servo motor. Since the lod pressure vries over wide rnge under internl prmeter vritions nd externl disturbnces (lod torque vritions), these two fctors tend to induce higher degree of nonlinerity [6, 7]. Along with the rpid development of digitl nd computer control technology, embedded hrdwre interfcing with the technology of simulink softwre is undergoing tremendous chnge. Currently, there re severl commercilly vilble embedded hrdwre interfcing, including dvnced RISC mchine (ARM), digitl signl processing 1 Ahmed M. A. Hidr, University of Wollongong, NSW, Austrli, E-mil: hidr@uow.edu.u 2 Chellli Benchib, University of Bechr, Algeri 3 Mohmd Zhir, University Mlysi Phng, Mlysi Copyright JES 2013 on-line : journl/esrgroups.org/jes

J. Electricl Systems 9-1 (2013): 84-99 (DSP), ppliction-specific integrted circuit (ASIC), nd field progrmm ble gte rry (FPGA). Among them, FPGA hve number of progrmmble logic resources tht mke it possible to integrte with microprocessors to form complete embedded system nd perform complex computtions in hrdwre [8]. Mny reserchers hve investigted servo system simultion focusing on principle teching nd mintin trining [5, 9, 10, 11, 12]. In [10], n integrted Mtlb/Simulink with neurl network nd LbVIEW ws designed to develop SCADA rel-time AC servo motor monitoring control system. Another simulink testing system is introduced in [5] for intelligent robot control using Mtlb environment nd Turbo C softwre. Both systems re n effective solution to simplify the dt processing with high performnce servo motor trcking scheme. The trditionl test system cn no longer meet the rpid development of modern servo system. Therefore, new kind of utomtic testing systems incorporting monitoring softwre re needed. Ref. [13] discusses the development of simultion softwre models for two xis servo pltform bsed on the Ntionl Instruments LbVIEW. The system is used to evlute nd test n dvnced servo control lgorithms before being implemented into the ctul system. An overll network structure of developed system in lyers ws designed in [14]. The system consists of dvnced test instruments, user-friendly virtul interfce, dtbse server, LAN clients nd web server. The connection between LbVIEW nd dtbse is relized by using the Dtbse Connectivity Toolkit. To simplify the progrm, Virtul Instruments Softwre Architecture ws pplied with written commnds to the buffer, insted of considering ny specific communiction protocols. This pper presents the implementtion of computer interfcing control for servo motor bsed on Mtlb coding imbedded in microcontroller. Proteus softwre ws used to simulte the hrdwre nd verify the Mtlb coding for rel time ppliction. In this work, some of the components cn be chnged esily to upgrde the performnce of the system. The work is orgnized s such tht, section 1 gives brief introduction of DC servo motor with the existing softwre. A literture review on DC motors nd control methods re presented in Section 2. Section 3 presents the principle opertion of DC servo motor control. The methodology, softwre simultion nd hrdwre implementtion re outlined in Sections 4 nd 5 respectively. The results re discussed in Section 6, while Section 7 drfts the conclusion. 2. A review on dc servo motor control According to the vriety of DC motor, different techniques re designed to control the DC motor nd overcome the voltility chrcteristics of the physicl DC motor system itself. The types of DC motor re permnent mgnet, winding, stepper nd servo, etc. Permnent mgnet DC motor hs smll size nd compct compre to other types of DC motor but the mgnetic field strength cnnot be vried. Winding DC motors which re shunt-wound, series-wound nd compound provide very high rnge speed nd torque. However, the stepper motor hs higher precise speed control nd lrge torque t low speed but in terms of cost, this type is expensive. Alterntively, servo motor is n importnt for the ppliction t the industries due to its bility of quick response nd precise positioning but motor is expensive [1]. A servo motor is n electromechnicl device in which the electricl input determines the position of motor rmture. It is ctully n ssembly of four things: norml DC 85

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller motor, ger reduction unit, position-sensing device nd control circuit. Servo motors re used extensively in robotics industry nd rdio-controlled crs. The implemented types in modern servo systems re AC servo motors bsed on induction motor designs, DC servo motors bsed on DC motor designs, DC brushless motors nd AC brushless servo motors bsed on synchronous motor designs. These motors re working in closed loop control systems where the progrmmed position of motion nd velocity feedbck controllers re required [4]. Different studies nd reserches hve been conducted on the servo motor control. Currently, the conventionl method of servo motor control is bsed on proportionl integrl derivtive. Other suggested methods such s rtificil intelligence nd fuzzy logic were mentioned in Ref [15]. Usully the control method of fuzzy with fixed set of quntizing fctor nd scling fctor is often used in the fuzzy control [16]. However, the vritions of quntizing fctor, scling fctor nd control rule in the fuzzy look up tble my significntly ffect the speed of DC Motor. In ddition, with the sme set of fuzzy control rule, quntizing fctor nd scling fctor, the vrition of membership function will lso ffect the control performnce of fuzzy control [17, 18]. So fr, severl pproches for robust control hve been proposed nd considerble progress ws mde in this re. The populr techniques primrily intended for liner systems such s liner Qudrtic Gussin control design with loop trnsfer recovery (LQG/LTR) technique nd dptive or self-tuning control. Among the techniques used minly for nonliner systems, the sliding-mode control. Recently, Time Dely Control (TDC) hs lso ttrcted ttention s n excellent robust nonliner control lgorithm. The min purpose of using TDC methods is to ssure control performnces (such s ccurcy, stbility, speed, etc) Generlly, TDC uses the time-delyed vlues of control inputs nd derivtives of stte vribles t the previous time step to cncel the nominl nonliner dynmics nd the forementioned uncertinties. Thus, TDC does not require ny rel-time computtion of nonliner dynmics, nor does it use the prmeter estimtions s in dptive control [19]. Proportionl integrtion (PI) controller is unquestionble s the most common controller in the process control industry. The min reson for using this controller is its reltively simple structure, which cn be esily understood nd implemented in prctice. It lso implemented in the sophisticted control strtegies, such s model predictive control [20]. PI control is mth totl of integrtion error nd multiplying of error with constnt [21]. A simplest method to control the rottion speed of DC motor is to control its driving voltge. The higher the voltge is the higher speed the motor tries to rech. In mny pplictions, simple voltge regultion would cuse lots of power loss on control circuit, thus, pulse width modultion method (PWM) is used in mny DC motor controlling pplictions [4, 22]. In the bsic PWM method, the operting power to the motors is turned ON nd OFF to modulte the current to the motor. The PWM control method uses the widths of pulses in pulse trin to control the speed of the motor [23]. The pulses re rrnged such tht, only one pulse occurs for every period of the system clock. The duty cycle of the pulses determines the speed of the motor. Therefore, the higher the duty cycles the higher the speed [4]. This would give the motor the bility to sfely vry the speed from stnd still to its mximum speed. For this reson, the PWM method ws chosen to be implemented in the motor control design. Sometimes, the rottion direction needs to be chnged. In the norml permnent mgnet motors, this rottion is chnged by chnging the 86

J. Electricl Systems 9-1 (2013): 84-99 polrity of operting power (for exmple by switching from negtive power supply to positive or by interchnging the power terminls going to power supply). This direction chnging is typiclly implemented using rely or circuit clled n H bridge [3]. The min purpose of interfcing motor control is to implement closed-loop control of servo motor position utilizing locl interconnect network (LIN) to llow series of similr motors connected together nd controlled by mster controller. Since the motor is used for steering nd driving systems, single controller cn be used for both functions. A microcontroller is pplied to produce the PWM signl. The control progrmming bsed on computer interfcing to produce the PWM output would eliminte the need for dditionl hrdwre, sving on the overll cost of such motor drive circuit [24, 25]. The Complex high-performnce controllers such s PID hve to be progrmmed nd loded into the microcontroller by converting it into hex file. Interfcing the motor with computer progrmming is chieved by the generted PWM signl from microcontroller. The control system on the hrdwre uses ll the necessry fetures to meet the requirements of LIN pplictions [26, 27, 28]. 3. Principle opertion of dc servo motor control Servos re controlled by pulse of vrible width. The sent signl of this input pulse is chrcterized by minimum pulse, mximum, nd repetition rte s seen in Figure 1. Given the rottion constrints of the servo, neutrl is defined to be the position where the servo hs exctly the sme mount of potentil rottion in clockwise direction s it is in counter clockwise direction [29]. The ngle is determined by the durtion of pplied pulse to the signl wire which is clled PWM or Pulse Coded Modultion. The servo should detect pulse every 20 ms. The length of the pulse will determine how fr the motor turns. For exmple, 1.5 ms pulse will mke the motor turn to 90 degree position (neutrl position). The position pulse must be repeted to instruct the servo to sty in position [28]. 20ms Pulse Width 0.5ms 2.5ms Fig. 1: Input pulse of servo motor When pulse is sent to servo tht is less thn 1.5 ms, the servo rottes to position nd holds its output shft some number of degrees counter-clockwise from the neutrl point. When the pulse is wider thn 1.5 ms, the opposite opertion is occurred. The miniml width nd the mximum width of pulse tht will commnd the servo to turn to vlid position re functions of ech servo. Generlly the minimum pulse will be bout 1 ms wide (some servo is 0.5 ms) nd the mximum pulse will be 2 ms wide (some servo is 2.5 ms). The servo motor opertes in the rnge of 5 % to 10 % of duty cycles. Figure 2 shows reltionship between pulse nd direction of servo motor. 87

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller 1 ms 1.5 ms 2 ms Fig. 2: Reltionship between pulse nd direction of servo motor The PWM is commonly used technique for controlling power into electricl device. The verge vlue of voltge (nd current) fed to the lod is controlled by turning the switch between supply nd lod, ON nd OFF t fst pce. The longer the switch is ON compred to the OFF periods, the higher the power supplied to the lod is. AC drives required the sinusoidl signl nd modultion genertor. The tringulr signl is the crrier or switching frequency of the inverter. The modultion genertor produces sine wve signl tht determines the width of the pulses, nd therefore the RMS voltge output of the inverter. For DC drives, the PWM signl is generted by compring tringulr wve signl with DC signl s shown in Figure 3. The DC signl cn be rnged between the minimum nd mximum voltges of the tringle wve. The PWM signl is mesured using the percentge of duty cycle where the pulse durtion over the pulse period [26]. Tringulr Wve Genertor + PWM out DC Level PWM Fig. 3: The genertion of PWM for DC drives The mthemticl model of DC servo motor cn be simplified by men of the circuit s shown in Figure 4. The electricl prt represented by rmture nd the mechnicl prt by T nd J. As the field excittion is constnt, the rmture controller only depends on rmture voltge [30, 31]. The mechnicl equtions describing this system cn be written with the 88

J. Electricl Systems 9-1 (2013): 84-99 ssumptions tht the loss is included in lod torque nd neglecting viscous friction constnt [30] s given below, J + R i L + Te T V Eb ω V R i L d J T dt With, E b K T e K i e T di dt E where, i : rmture current; b Fig. 4: DC servo motor equivlent circuit V : rmture voltge; R :rmture resistnce; (1) (2) (3) (4) L : rmture inductnce; K : torque nd bck electromgnetic constnt ( Nm.A -1 ); ; rotor ngulr speed; T : electromgnetic torque; T : totl lod torque; J : rotor inerti. e The control input is the rmture voltge V nd the totl lod torque T is the disturbing input. The two stte vribles re rmture current i nd ngulr speed. Then the previous equtions led to the stte spce model of DC motor: di R L d dt K dt J K L 0 1 i L 0 0 V 1 T J The two stte vribles excited the ngulr speed in order to perform speed regultor relted with the ngulr speed. Therefore, is considered s the output of the system nd V is the input. Tking into ccount only these two system vribles, the trnsfer function of the DC motor is: ( s) H ( s) V ( s) 1 K 1 1 R J L J s 2 2 K K s 2 (5) (6) 89

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller The two time constnts re defined s: Electricl time constnt, e L R And electro mechnicl time constnt, R J em 2 K Therefore, ( s) H ( s) U ( s) 1 K 1 1 s em em e s 2 (7) (8) (9) 4. Softwre implementtion of servo motor control This section presents the simultion procedures of servo motor control using the Proteus nd Mtlb softwre interfced with Virtul Seril Port. The Proteus design suite is wholly unique in offering the bility to co-simulte both high nd low-level microcontroller code in the context of mixed-mode SPICE circuit simultion. There re over 8000 digitl nd nlog devices model tht cn be simulted by plcing nd wired it up. The most exciting nd importnt feture of Proteus is its bility to simulte the interction between softwre running on microcontroller nd ny nlog or digitl electronics connected to it. Proteus cn work with populr compiler nd ssembler to simulte the execution of the object code (mchine code), just like rel chip. If the progrm code is written to port, the logic levels in the circuit will be chnged ccordingly, nd if the circuit chnges the stte of the processor's pins, this cn be seen by the progrm code, just s in rel life [32, 33]. The ppliction of GUI for system control is widely used in the industries nd robotic. In this work, the slider in Mtlb GUI contributes to control the servo motor rottion ngle s seen in Figure 5. The signl dt obtined from the djusted slider will be sent to the microcontroller nd this signl will rotte the servo motor bsed on the desired ngle djusted by slider. The schemtic digrm of servo motor control is shown in Figure 6. The system ws built nd developed using Proteus softwre incorporting with Mtlb coding. The microcontroller coding re compiled using the Micro Code Studio. Hex file of coding progrm cn be uploded into the microcontroller to mke it redy for rel ppliction during hrdwre implementtion. As seen from Figure 7, the output from microcontroller is mesured using the digitl oscilloscope provided within Proteus. This mesurement is n importnt to determine the correct output from the microcontroller into servo motor. The Virtul Seril Port Kit cretes virtul seril ports nd connects ech pir of them vi virtul null-modem cble. Consequently, ll the dt written to one virtul seril port cn be immeditely red by the other one, nd vice vers. Moreover, this functionlity is esily integrted into the softwre. Figure 8 shows how virtul null-modem cbles re connected between two seril ports [32, 33]. The ports hve to be defined correctly in virtul seril port to mke sure tht the signl hs been sent into the right pth. 90

J. Electricl Systems 9-1 (2013): 84-99 Fig. 5: Servo motor control grphicl user interfce Fig. 6: The schemtic digrm of servo motor control Fig. 7: Digitl oscilloscope within Proteus 91

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller Fig. 8: Virtul Null-modem cbles connection In order to control the servo motor, the Mtlb interfcing with Proteus softwre is chieved by the combintion of GUI, microcontroller nd virtul port communiction between Mtlb nd Proteus s shown in Figure 9. The pir of seril ports is fixed t COM2 for GUI nd COM4 for microcontroller s seen in Figure 10. The procedures of interfcing simultion re summrized below: Construct the schemtic digrm using Proteus softwre. Write the PIC coding in Micro Code Studio compiler nd compile them. This cn be done using compiler such s MPLAB. The outcome of compiling is the genertion the HEX file. Uplod the HEX file to the microcontroller in the Proteus softwre. Run the Virtul Seril Port nd define both ports; COM2 for Mtlb nd COM4 for seril port (COM-PIN) t the Proteus. Define the seril port (COM-PIN) t the Proteus s COM 4. Define the port t the m-file (the written progrm of servo motor control) of Mtlb GUI s COM2. Run both softwre nd strt controlling the servo motor using sliders Fig. 9: Virtul port communiction Fig. 10: The virtul interfce between Mtlb nd Proteus 92

J. Electricl Systems 9-1 (2013): 84-99 Referring to the whole controlling system, the servo controller receives position commnds through seril connection which cn be provided by using one input/output (I/O) pin of nother microcontroller, or PCs seril port. This pulse signl will cuse the shft to locte itself t the midwy position +/-90 degrees. The shft rottion on servo motor is limited to pproximtely 180 degrees (+/-90 degrees from center position). A 1-ms pulse will rotte the shft ll the wy to the left, while 2-ms pulse will turn the shft ll the wy to the right. By vrying the pulse width between 1 nd 2 ms, the servo motor shft cn be rotted to ny degree position within its rnge. 5. Hrdwre implementtion of servo motor control Figure 11 shows the schemtic digrm of the controlling system, nd the hrdwre of this system is depicted in Figure 12. The ppliction of MAX232 is used to regulte the signl from PC to microcontroller during the interfcing process. The chip receives signls -10V to +10V from PC for logic 0 nd 1 nd converts them into 0V nd 5V in logic 0 nd 1 for microcontroller in order to process the sending dt. Seril port cts s medium for sending the dt from PC to servo motor control circuit. This controlling system is using the Integrted Circuit (IC) LM 7805 to regulte the 5V voltge supply to entire circuit. A light-emitting diode (LED) is used s n indictor to determine the PWM output generted by microcontroller nd sent to the servo motor. The DC servo motor utilized in this hrdwre is Cytron RC Servo motor (C40R). The specifiction of this motor is given in Tble 1 [31]. PIC16F628A is the selected microcontroller chip to control the speed of DC servo [25]. RS-232 is stndrd for seril binry dt signls connected between dt terminl equipment nd dt circuit terminting equipment [32]. According to this stndrd logicl "0" hs voltge level between -15V nd -5V nd logicl "1" hs level between +5V nd +15V. The microcontrollers use 5V TTL-level (trnsistor-trnsistor logic) to trnsmit signls. Therefore, the signls should be converted by using MAX232 tht only needs 5V power supply to convert the signl from TTL-level to RS232 level nd reverse. RS232 is seril interfce tht trnsfers the dt bit by bit nd requires only two single wires, one, to send nd nother, to receive the dt. Most of digitl logic circuits nd processors operte with +5 volt. Usully the input circuit is unregulted power supply rnging from 9 volts to 24 volts (DC). For this reson, LM 7805 is plced in the hrdwre nd rects s regultor to supply +5 volt [33]. Fig. 11: schemtic digrm of the controlling system 93

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller Fig. 12: Hrdwre of servo motor control Tble 1: Specifiction of the RC servo motor Speed (s/60 ) 0.19 Torque (Kg.cm) 6.00 Pulse Width Rnge (ms) 0.546ms to 2.4ms Weight (g) 38 Ger mteril Servo type Plstic Stndrd Input voltge (V) 5 The rottionl ngle of DC servo motor is mesured mnully using the protrctor. One of the bldes will be mrked s reference point. The DC motor is plced t the centre of the protrctor nd ech movement of the slider in GUI Mtlb will rotte the servo motor nd the ngle cn be recorded. Figure 13 illustrtes the mesurement of ngle, the mximum nd minimum vlues of ngle in the slider re in the rnge of 0º to 180. The ngle must be limited to 180. For exmple, if the slider hs rnge of 90º to -60, it mens tht the mesured vlue by the instrument in the rnge of mximum nd minimum is 150º. Fig. 13: Angle mesurement 6. Result nd discussion The simultion is used to vlidte the results obtined from Proteus interfcing with Mtlb GUI nd with those found by the hrdwre interfcing in Mtlb GUI. The GUI is mnully controlling the desired rottion ngle of servo motor by the slider. Figure 14 94

J. Electricl Systems 9-1 (2013): 84-99 shows the 90º rottion of servo motor indicted by slider nd the input signl from the PC into the microcontroller. Tble 2 illustrtes the mesurement vlues of five motors tken during the simultion. Fig. 14: Servo motor 1 t 90º nd the input signl from PC Tble 2: The mesurement vlues of five motors tken during the simultion Servo Motor Slider Position (º) Servo ngle (º) PWM output (ms) Voltge Mgnitude PWM output (V) Sending signl from PC(mV) 1 2 3 4 5 90 90 2.35 2.54 214.52-30 -30 1.10 2.55 267.91-60 -60 0.80 2.58 290.07 80 80 1.95 2.52 300.09-40 -40 0.75 2.52 115.24 95 95 2.55 2.53 290.21-95 -95 550u 2.56 144.71 170 170 1.70 2.59 115.34 240 240 2.80 2.48 154.95 240 240 2.80 2.56 177.64 170 170 1.65 2.57 302.42 For rel time implementtion, the mesurements of input signls nd PWM output from the microcontroller were recorded in order to be compred with the signls obtined by the simultion. Figure 15 shows the rel time implementtion of the hrdwre. The initil mesurement of the input (7.20 mv) nd output signl (161 mv) re shown in Figure 16. Tble 3 illustrtes the mesurement vlues of five motors tken during the hrdwre testing. 95

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller Fig. 15: Rel time hrdwre testing Fig. 16: Sending signl from PC nd output from the microcontroller As seen from the softwre nd hrdwre results, the system is not operting s desired for some sent signls from the PC into the control circuit. The mesurement of signls from the PC is too smll nd these signls cnnot be operted by the microcontroller. But, the circuit nd GUI re functioning well in terms of rotting ngle. The hrdwre results show tht the output signls from microcontroller with shpe pproching the sine wve form. On the other hnd, the outputs of microcontroller supposed to be s squre wve nd exceeding the PWM shpe for DC drive. Finlly, comprison results between the simultion nd rel-time implementtion re given in Tble 4. As noted from the tble, the vlues of the simulted nd rel time signls re not similr. The functions of the virtul 96

J. Electricl Systems 9-1 (2013): 84-99 interfce nd the dtbse system my need to be expended to meet the different types of PC configurtions to perform n ccurte sending of signls into the hrdwre without loss of informtion. The comptibility of Mtlb nd Proteus, however, hs n influence under the present condition. Tble 3: The mesurement vlues of five motors Servo Motor Slider Position (º) PWM output (ns) Voltge Mgnitude PWM output (mv) Sending signl from PC (mv) 1 2 3 4 5 90 88.32 161.0 74.4-30 90.34 249.0 72.8-60 49.53 258.0 73.6 80 83.54 517.0 75.2-40 103.30 160.0 46.4 95 63.90 515.0 74.4-95 74.75 48.0 23.2 170 392.80 76.8 32.0 240-75.2 44.8 240-71.2 44.8 170 65.96 518.0 46.4 Tble 4: Comprison result of simultion nd rel-time testing Servo Motor Slider position ( ) Rottion ngle ( ) Simultion Rel time Signl sending (mv) Simultion Rel time Output from Microcontroller (mv) Simultion (ms) Rel Time (ns) PWM 1 2 3 4 5 90 90 214.52 74.4 2540 161 2.35 88.32-30 -30 267.91 72.8 2550 249 1.10 90.34-60 -60 290.09 73.6 2580 258 800 49.53 80 80 300.09 75.2 2520 517 1.95 83.54-40 -40 115.24 46.4 2520 160 750 103.30 95 95 290.21 74.4 2530 515 2.55 63.90-95 -95 144.71 23.2 2560 48.0 550 74.74 170 17 115.37 32.0 2590 76.8 1.70 392.80 240 24 154.95 44.8 2480 75.2 2.80-240 24 177.64 44.8 2560 71.2 2.80-170 17 302.42 46.4 2570 518 1.65 65.96n 97

Ahmed M, A, Hidr et l: Softwre Interfcing of Servo Motor with Microcontroller 7. Conclusion In this pper, microcontroller in Mtlb GUI is proposed to control the desired position of rottion ngle using the GUI sliders. Bsed on the regulted vlues, the sliders control the rottion of the servo motor. In rel-time ppliction, the sent dt from PC is too smll nd the microcontrollers re not pssing enough signls to produce the ctul desired rottions. In order to improve the ccurcy for rel-time ppliction, there is need dd mplifier for incresing the signls from PC to the microcontroller. The mjor contribution of this pper is the incorportion of two different softwres coding for rel time control of servo motor rottion ngle using GUI in Mtlb. References [1] [006]K. Seki, H. Yokoi & M. Iwski, Experimentl evlutions of friction behvior in micro-displcement region positioning for servo motor with ir berings, Proceeding of IEEE Interntionl Conference on Advnced Intelligent Mechtronics, 2012. [2] [009] B. Li, L. Go & G. Yng, Evlution nd compenstion of stedy gs flow force on the high pressure electro-pneumtic servo vlve direct-driven by voice coil motor, Energy Conversion nd Mngement 67: 92 102, 2013. [3] K. N. D. Perer, S. R. M. Fernndo, R. A. D. S Rnsinghe, A. U.S. & Rnthung, P. K. Jywrden, Computer controlled DC servo motor, Working pper, pp1-3, 2003. [4] [007]R. Wi, & R. Muthusmy, Fuzzy-Neurl-Network Inherited Sliding-Mode Control for Robot Mnipultor Including Actutor Dynmics, IEEE Trnsctions on Neurl Networks nd Lerning Systems, Vol. 24, NO. 2, 2013 [5] M. J. Pytr & D. M. Mlynek, Fuzzy logic implementtion nd pplictions, Book. New York: John Wiley Pres. p317, 1996. [6] [004]B. Bossoufi, M. Krim, S. Ionit & A. Lgrioui1, Nonliner non dptive bckstepping with slidingmode torque control pproch for PMSM motor, J. Electricl Systems 8-2: 236-248, 2012. [7] [008]A. Sdeghieh, H. Szgr, K. Goodrzi & C. Lucs, Identifiction nd rel-time position control of servo-hydrulic rotry ctutor by mens of neurobiologiclly motivted lgorithm, ISA Trnsctions 51: 208 219,2012. [8] [011] N. Yng, D. Li, J. Zhng & Y. Xi, Model predictive controller design nd implementtion on FPGA with ppliction to motor servo system, Control Engineering Prctice 20 : 1229 1235, 2012. [9] [015]A. M. Al-Busidi, Development of n eductionl environment for online control of biped robot using Mtlb nd Arduion, Proceeding of IEEE conference on Mectronics-REM, 1-8, 2012. [10] [014] J. Horng, Hybrid MATLAB nd LbVIEW with neurl network to implement SCADA system of AC servo motor, Advnces in Engineering Softwre 39:149 155, 208. [11] [016] N. Truong & D. Vu, Hrdwre-in-the-Loop pproch to the development nd vlidtion of precision induction motor servo drive using xpc Trget Proceeding of Ninth Interntionl IEEE conference on Computer Science nd Softwre Engineering, 1-5, 2012. [12] [017] L. Hongd1 & L. Fengxing, experiment nd Mtlb simultion of electric power steering system bsed on permnent mgnet c servo motor, Proceeding of IEEE Interntionl Conference on Computer Science nd Network Technology, 1-4, 2011. [13] [012]S. Shrp, A. Wicks, A. Ordys & G. Collier, Modelling of Pn nd Tilt Servo System, Proceeding of IEEE Interntionl Conference on Control, 1-5, 2012. [14] [013]L. Xiosheng, W. Yuqing, H. Nntin & H. Yue, The Networked Virtul Test System for Servo Motor nd Drive Bsed on LbVIEW, Proceeding IEEE 7th interntionl conference on Power Electronics nd Motion Control, 1-5, 2012. [15] C. C. Lee, Fuzzy logic in control systems: fuzzy logic controller-prt1, IEEE Trnsction System. Mn. Cybernetics., vo1.20 (no.2), pp.404-418, 1990. [16] A. Mehmet, & T. Ismil, Motion controller design for the speed control of DC servo motor, Interntionl Journl of Applied Mthemtics And Informtics, Volume 1.(4):131-137, 2007. [17] B. Tzeng, Y. C. Liu, M. S. Young, A preliminry study of fuzzy control prmeters nd Tguchi- method on DC servo motor control, Proceeding of IEEE conference on Industril Automtion nd Control: Emerging Technologies, pp. 30-34,1995. [18] [005] H. Yu, DSP-BASED Fuzzy Logic Servo Motor Control, Proceeding of IEEE Interntionl Conference on Control Engineering nd Communiction Technology, 1-4, 2012. [19] H.C, Pyung & W. L. Jeong, An observer design for time-dely control nd its ppliction to dc servo motor, Control Engineering Prctice Journl, vol. 2, pp. 263-270, 1994. 98

J. Electricl Systems 9-1 (2013): 84-99 [20] A. O. Dwyer, PID compenstion of time delyed processes, Proceedings of the Irish Signls nd Systems Conference, Dublin, Irelnd, June, pp. 5-12, 2000. [21] [003]A. Abbou, T. Nsser, H. Mhmoudi, M. Akherrz & A. Essdki, dspace IFOC fuzzy logic controller implementtion for induction motor drive, J. Electricl Systems 8-3 : 317-327, 2002. [22] [002] P.Srinivs & P.V.N.Prsd, DSP bsed speed control of 4 phse 8/6 switched reluctnce motor drive using DC split converter, J. Electricl Systems 8-1: 47-56, 2002. [23] [001] A. Boufi, J.P. Gubert & A. Choui, Direct power control scheme bsed on disturbnce rejection principle for three-phse PWM AC/DC converter under different input voltge conditions, J. Electricl Systems 8-4 : 367-383, 2012. [24] K. N. Se & S. Y. Wn, Fuzzy PID control with ccelerted resoning for dc servo motors, Journl of Engineering Appliction Artificil Intelligent, Vol. 7, (No. 5), pp. 559-569, 1994. [25] A. D. Lwrence, The microcontroller beginner s hndbook, (2nd Edition). United Sttes of Americ: Prompt Publiction. P3-5,1998. [26] R. Mtt., Servo motor control ppliction on locl interconnect network (LIN), Appliction Note Free scle Semiconductor 8/16 Bit Division Systems Engineering Austin, Texs, Rev. 1.0., 2005. [27] V. George, 16 chnnel seril servo controller for robotic pplictions, Fculty of Technologicl Applictions, Technologicl Eductionl Institute of Pireus, Greece retrieved from http://www.settlerobotics.org/encoder/200106/16csscnt.htm, August, 2010 [28] M. Bron, B. Kocherov, Vision Guided Motor Control for Semi-Autonomous Militry Vehicle, Finl Report, Institute Technology of Steven, 2007. [29] Micromeg Corportion, Controlling Lynx6RoboticArm, Website retrieved from http://www.micromegcorp.com, September, 2009. [30] Y. Y. Sergey, Prmeter estimtion nd speed control of PMDC servo motor using method of time moments, Sensors nd Trnsducers Appliction Journl, Vol. 119, (Issue 8), pp162-173, 2010. [31] Y. Lee, J. Lee & S. Prk, PID controller tuning for integrting nd unstble processes with time dely, Journl of Chemicl Engineering Science, Vol. 55, pp. 3481-3493, 2000. [32] Lbcentre Electronic, Proteus design suite, product guide. Website retrieved from.http//www.lbcenter.com, August, 2011 [33] Fbul Tech LLP., Virtul Seril Port, Website. Retrieved from http://www.fbultech.com/virtulserilport-kit, June, 2011. 99