ANGULAR POSITION CONTROL OF DC MOTOR USING SHORTEST PATH ALGORITHM

Similar documents
EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 11 Motor Control

Microcontroller Based Closed Loop Speed and Position Control of DC Motor

DC Motor Speed Control using PID Controllers

Speed Control of DC Motor Using Microcontroller

Automatic Railway Gate Control & Track Switching

EEE3410 Microcontroller Applications Department of Electrical Engineering. Lecture 10. Analogue Interfacing. Vocational Training Council, Hong Kong.

MICROCONTROLLER PRODUCTS. AN428 Using the ADC and PWM of the 83C752/87C752. Author: Greg Goodhue December Philips Semiconductors

Modeling, Simulation and Implementation of Speed Control of DC Motor Using PIC 16F877A

Sensors and Sensing Motors, Encoders and Motor Control

Small DC Motor Control

Sensors and Sensing Motors, Encoders and Motor Control

L E C T U R E R, E L E C T R I C A L A N D M I C R O E L E C T R O N I C E N G I N E E R I N G

UNIVERSITY OF JORDAN Mechatronics Engineering Department Measurements & Control Lab Experiment no.1 DC Servo Motor

combine regular DC-motors with a gear-box and an encoder/potentiometer to form a position control loop can only assume a limited range of angular

Control of Electrical Lights and Fans using TV Remote

Control System for Lamp Luminosity. Ian Johnson, Tyler McCracken, Scott Freund EE 554 November 29, 2010

Chapter 7: The motors of the robot

νµθωερτψυιοπασδφγηϕκλζξχϖβνµθωερτ ψυιοπασδφγηϕκλζξχϖβνµθωερτψυιοπα σδφγηϕκλζξχϖβνµθωερτψυιοπασδφγηϕκ χϖβνµθωερτψυιοπασδφγηϕκλζξχϖβνµθ

MICROCONTROLLERS Stepper motor control with Sequential Logic Circuits

Assembly Language. Topic 14 Motion Control. Stepper and Servo Motors

EE 314 Spring 2003 Microprocessor Systems

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

Monitoring of Intravenous Drip Rate

Mechatronics Engineering and Automation Faculty of Engineering, Ain Shams University MCT-151, Spring 2015 Lab-4: Electric Actuators

Experiment Of Speed Control for an Electric Trishaw Based on PID Control Algorithm

International Journal of Advance Engineering and Research Development. Wireless Control of Dc Motor Using RF Communication

M54516P MITSUBISHI SEMICONDUCTOR <TRANSISTOR ARRAY> 5-UNIT 500mA DARLINGTON TRANSISTOR ARRAY

Figure 1: Motor model

unit: mm 4130 Parameter Symbol Conditions Ratings Unit Maximum supply voltage 1 V CC 1 max No input signal 50 V Maximum supply voltage 2 V CC

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

Transistor Output SMALL OUTLINE OPTOISOLATORS TRANSISTOR OUTPUT SCHEMATIC. MAXIMUM RATINGS (TA = 25 C unless otherwise noted) Rating Symbol Value Unit

INTEGRATED CIRCUITS. AN1221 Switched-mode drives for DC motors. Author: Lester J. Hadley, Jr.

ECE 511: MICROPROCESSORS

Small Signal Pulse Detection

DC SERVO MOTOR CONTROL SYSTEM

Latest Control Technology in Inverters and Servo Systems

TL494 PULSE-WIDTH-MODULATION CONTROL CIRCUITS

Brushed DC Motor PWM Speed Control with the NI myrio, Optical Encoder, and H-Bridge

Introduction. Theory of Operation

DC-Motor Driver circuits

Brushed DC Motor Microcontroller PWM Speed Control with Optical Encoder and H-Bridge

Micromouse Meeting #3 Lecture #2. Power Motors Encoders

Lock Cracker S. Lust, E. Skjel, R. LeBlanc, C. Kim

Electronics Design Laboratory Lecture #6. ECEN2270 Electronics Design Laboratory

Feed-back loop. open-loop. closed-loop

HIGH ISOLATION VOLTAGE AC INPUT DARLINGTON TRANSISTOR TYPE SOP OPTOCOUPLER

Four Quadrant Speed Control of DC Motor with the Help of AT89S52 Microcontroller

TOSHIBA BIPOLAR LINEAR INTEGRATED CIRCUIT SILICON MONOLITHIC TA7736P,TA7736F

TL594 PULSE-WIDTH-MODULATION CONTROL CIRCUIT

Brushed DC Motor System

Design and Implementation of DC Motor Speed Control Based on TMS Microcontroller

School of Engineering Mechatronics Engineering Department. Experim. ment no. 1

I 2 C RedBot & DC Motor Servo Motor Control

TLP627,TLP627-2,TLP627-4

NEC's HIGH ISOLATION VOLTAGE SINGLE TRANSISTOR TYPE MULTI OPTOCOUPLER SERIES

NEC's HIGH CTR, 4 OR 16 PIN SOP OPTOCOUPLER

Administrative Notes. DC Motors; Torque and Gearing; Encoders; Motor Control. Today. Early DC Motors. Friday 1pm: Communications lecture

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

Experiment#6: Speaker Control

TL594 PULSE-WIDTH-MODULATION CONTROL CIRCUITS

OPTICALLY ISOLATED ERROR AMPLIFIER FOD2711 DESCRIPTION FEATURES APPLICATIONS PIN DEFINITIONS 9/6/02

EE-SX1330. Photomicrosensor (Transmissive) Ultra-Compact Slot / SMD Type (Slot width: 3 mm) Ordering Information

DESIGN OF A TWO DIMENSIONAL MICROPROCESSOR BASED PARABOLIC ANTENNA CONTROLLER

AEIJST - January Vol 4 - Issue 1 ISSN Automatic Railway Gate Controller by Using AT89C51

Sensors & Actuators. Sensors Photo-Transistor. Actuators Motor Specifications. Noise. Motor Model Motor Drivers. Internal model Operation Biasing

Laboratory Exercise 1 Microcontroller Board with Driver Board

DC motor control using arduino

TL594C, TL594I, TL594Y PULSE-WIDTH-MODULATION CONTROL CIRCUITS

COMP 4550 Servo Motors

The Bipolar Junction Transistor- Small Signal Characteristics

CHAPTER 4 CONTROL ALGORITHM FOR PROPOSED H-BRIDGE MULTILEVEL INVERTER

Hashemite University Faculty of Engineering Mechatronics Engineering Department. Microprocessors and Microcontrollers Laboratory

TL494M PULSE-WIDTH-MODULATION CONTROL CIRCUIT

ELG3331: Digital Tachometer Introduction to Mechatronics by DG Alciatore and M B Histand

MOBILE ROBOT LOCALIZATION with POSITION CONTROL

Project Proposal. Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen

Application Note, V1.0, Aug AP XC88x/XC878 Series. Microcontrollers

Actuators. DC Motor Servo Motor Stepper Motor. Sensors

Electromagnetic spectrum

TLP631,TLP632 TLP631,TLP632. Programmable Controllers AC / DC Input Module Solid State Relay. Pin Configurations (top view)

Learning Objectives:

TL494C, TL494I, TL494M, TL494Y PULSE-WIDTH-MODULATION CONTROL CIRCUITS

MicroToys Guide: Motors N. Pinckney April 2005

A PID Controller for Real-Time DC Motor Speed Control using the C505C Microcontroller

TLP127 TLP127. Programmable Controllers DC Output Module Telecommunication. Pin Configurations (top view)

n Measuring range ,02 N m to N m n Clockwise and counter-clockwise torque n Low linearity deviation of ± 0.05 % F.S.

Technical Information for Photomicrosensors

FEATURE: Fast Response Time. High Analytic. Cut-Off Visible Wavelength λp=94nm High sensitivity. Lead Free product, in compliance with RoHS. AKE GKE D

HIGH COLLECTOR TO EMITTER VOLTAGE DARLINGTON TRANSISTOR TYPE MULTI PHOTOCOUPLER SERIES

TL494 PULSE-WIDTH-MODULATION CONTROL CIRCUITS

Exercise 5: PWM and Control Theory

PWM BASED DC MOTOR SPEED CONTROLLER USING 555 TIMER

Designing the VCNT2020 into an Application

Understanding RC Servos and DC Motors

Lab Exercise 9: Stepper and Servo Motors

Absolute encoders - SSI

MicroToys Guide: Motors A. Danowitz, A. Adibi December A rotary shaft encoder is an electromechanical device that can be used to

MOC215-M MOC216-M MOC217-M

TA7736P,TA7736F TA7736P/F DC MOTOR DRIVER IC FEATURES TOSHIBA BIPOLAR LINEAR INTEGRATED CIRCUIT SILICON MONOLITHIC

Electronics Design Laboratory Lecture #4. ECEN 2270 Electronics Design Laboratory

Transcription:

EE 712 Embedded Systems Design, Lab Project Report, EE Dept. IIT Bombay, April 2006. ANGULAR POSITION CONTROL OF DC MOTOR USING SHORTEST PATH ALGORITHM Group Number: 17 Rupesh Sonu Kakade (05323014) <rupeshsk@sc.iitb.ac.in> LtCdr S Saravanan (05323407) <sarva@sc.iitb.ac.in> Supervisor: Prof. P. C. Pandey Abstract Position control finds wide applications in industry, especially in aerospace, automotive and mechatronics applications. A feedback driven, proportional control for a 12 V DC motor was implemented using microcontroller AT 89C2051, to achieve fast response with no overshoot. The set point for the controller was given using 4 DIP switches. The position of the motor shaft was monitored using a Gray coded disc fixed to the shaft of the motor. A 4-bit feedback was provided by using an array of Infrared LEDs and photo transistors. The motor was controlled using the PWM technique. Variable speed, consequent to proportional control action, was achieved by varying the duty cycle of the pulses. The motor was driven using H bridge driver IC L 293 D. The program was written in Assembly Languauge of 8051. The program converted Gray code corresponding to the present position of the shaft to binary code, used it to compute the error and generated pulses with duty cycle proportional to the magnitude of error. An algorithm to enable the motor to take the shortest path to reach the set point was also implemented. 1. Introduction A DC motor position control finds wide applications in servo systems and mechatronics. The speed of a DC motor can be controlled by controlling the Armature Voltage or Field Voltage. The following are few of the simple methods of controlling a DC motor shaft position. (a) Open loop - without feedback of current position, method is ineffective and inaccurate in the presence of load disturbance. (b) On-off controller - motor is turned on with maximum torque till it reaches set point and switches off, this may result in overshoots and oscillations. (c) Single directional control - reaches set point in a single direction only, EE 712 Lab Project Report Page 1 of 15

resulting in larger settling time in 50% of the cases. The angular position of a DC motor can also be controlled by varying the torque generated by varying the armature voltage or field voltage. In most digital applications, PWM (Pulse Width Modulation) is generally used to control the speed of the DC motor. It is relatively easier to generate pulses of varying duty cycles with a microcontroller or microprocessor. The pulses with varying duty cycle when applied to the armature will result in variable torque proportional to the duty cycle. The control methodology used in this project is to apply a average voltage proportional to the error between actual position and the set point and reduce the average voltage as the current position approaches the set point. This kind of control is very effective in systems with high inertia as an inherent property, so that no control effort is essential when the set point is reached. 2. Problem statement The objective was to control the angular position of the DC motor using a microcontroller. The total angle of 360 degrees was equally divided into 16 sectors. The sectors were numbered from '0' to '15'. The set point or the desired position is conveyed to the microcontroller as a 4 bit number - binary equivalent of the sector number. The microcontroller should move the motor shaft to the desired angular position or sector with the following features. (a) (b) (c) (d) Using feedback data of current position By taking the shorter path With minimum settling time Without any overshoot 3. Design approach The control action had to achieve the set point when motor was working against a load. Hence, a 12 V DC, permanent magnet, geared motor was chosen for the project. The motor had a maximum speed of 15 RPM when full armature voltage of 12 V was applied across it. Microcontroller AT 89C2051 was used to control the motor shaft position. Since the total number of sectors was 16, shaft position could be represented with 4 bits of binary number. The desired sector was set with 4 DIP switches that were interfaced with the micro controller. The data of present shaft position was fed back to the controller using an array of 4 infra red (IR) LEDs and 4 Photo transistors. Optical sensor MOC 7811 was used to assemble the array of LEDs and sensors. The datasheet of the sensor is placed at appendix A. The biasing circuit for the IR LEDs (D0, D1, D2 and D3) and the sensors (S0, S1, S2 and S3) is shown in Fig. 2. The Gray coded disc, fixed to the motor shaft, was positioned between the LED array and the sensor array. As the motor shaft rotates IR light is blocked/allowed depending on the position of the shaft. Thus the position of the shaft is converted into Gray code and transmitted to the port 1 of the micro controller. EE 712 Lab Project Report Page 2 of 15

MICRO CONTROLLER DIP SWITCH PWM D0 D1 BIASING CIRCUIT H BRIDGE DC MOTOR CODED DISC Fig.1: General block diagram of angular position control of DC motor The program converts the Gray code received by the microcontroller to binary code and computes the offset/error from the set point. The microcontroller generates pulses of frequency 50 Hz. The duty cycle was varied from 95% to about 0% (as shown in Table 1) depending on the magnitude of the error. The microcontroller also generates two direction signals (A0 and A1) for taking the shortest path to reach the set point. The direction signals and pulses are given to the driver IC L293D which has an H Bridge circuit shown in Fig 3. The datasheet of L293D is placed at appendix A. The H Bridge was used to achieve bi- directional control. The driver circuit generates pulses of 12 V peak and at the same frequency as input. These pulses were applied to the motor s armature. T = Ton + Toff Ton Duty Cycle = Ton+ Toff EE 712 Lab Project Report Page 3 of 15

Fig.2: H-bridge circuit diagram Error (bitwise) Table 1: Look up Table for Timer registers value (Duty Cycle) Ton Percent Duty Cycle TH0 (in Hexadecimal) 0 0.0 ms 0.0 % (0.36 %) FF 99 1 4.0 ms 20.0 % F1 99 2 6.5 ms 32.5 % E8 99 3 9.0 ms 45.0 % DF 99 4 11.5 ms 57.5 % D6 99 5 14.0 ms 70.0 % CD 99 6 16.5 ms 82.5 % C4 99 7 19.0 ms 95.0 % BB 99 TL0 (in Hexadecimal) 4. Design of circuit Biasing Circuits for IR LED and IR Phototransistor: To detect the actual position of the shaft (and hence the encoder disk attached to the shaft) four pairs of Infrared (IR) LEDs and Photo transistors were used. Few specifications required for designing the biasing circuits are described below: IR LED: 1. Forward Current: 50 ma (max) Typical value: 20mA EE 712 Lab Project Report Page 4 of 15

2. Forward Voltage: 1.0 to 2.3 V Typical value: 1.2V 3. Radiant Power: 10mW 4. Wavelength of radiation: 740nm IR Phototransistor: 1. Dark Current: 100nA (max), 5nA (typ) 2. Light current: 0.4 to 1.24mA, 1mA (typical) 3. V CE (sat): 0.4 V (max), 0.15 V (typical) 4. Maximum collector current: 40mA 5. Response time: 6 microseconds. Based on the above data it was decided to design biasing circuits to have following specifications: IR LED: Forwards Current: 25 ma. IR Phototransistor: V CE (sat): 0.4 V (max) I C : around 0.5 to 1 ma. Fig. 3 IR LED and Sensor Biasing Circuit EE 712 Lab Project Report Page 5 of 15

For IR LED: Vcc Vf R = If 5 1.24 R = 20mA R = 150.4Ω Used standard value resistor of R = 150 Ω. With R = 150 Ω, I F = 25.067mA For IR Phototransistor: Vcc Vce( sat) R = Ic 5 0.2 R = 0.5mA R = 9600Ω Used a standard value resistor of R = 10 kω. With R = 10 kω, I C = 0.48 ma. 5. Algorithm The following algorithm was used to generate the assembly language program of the controller. Step 1 : Initialize the Microcontroller Port1 as input port Step 2 : Initialize the Timer 0 and Timer 1in mode 1 Step 3 : Set PWM output to low Step 4 : Read port 1. Lower nibble gives set point and upper nibble gives Gray code of current position Step 5 : Convert Gray code to binary code Step 6 : Compute error. Step 7 : Generate pulses of 50 Hz with duty cycle proportional to error at Pin 3.2 Step 8 : Generate direction signals (A0 and A1) at Pin 3.3 and 3.4. Step 9 : Go to step 4 6. Test procedure to show how the design achieves the requirement of the problem The microcontroller with the motor was initially tested without feedback. The current position was provided with DIP switches. For every set point, the microcontroller generated pulses of duty cycle proportional to the magnitude of error. This enabled the measurement of the speed of the motor for different values of error, i.e. the speed at EE 712 Lab Project Report Page 6 of 15

Fig 4: Array of four IR LED and Photo transistor pair which the controller will try to nullify error. Then the sensors were assembled and mounted. When biased, the assembly generated Gray code corresponding to the position of the motor shaft. Then various set points were set in the input DIP switches and after the motor settled in its final position, data was recorded. EE 712 Lab Project Report Page 7 of 15

Motor drive circuit: Direction Signal from Microcontroller, A0 PWM Pulses from Microcontroller + 5 V Pin 7 To Motor (Red) To Motor (Black) GND L293D Pin 6 GND Pin 3 GND Pin 2 + 12 V Direction Signal from Microcontroller, A1 Fig 5: Motor Drive Circuit 7. Test results The motor was found to track the set point in shortest path. The following test results were achieved with the feedback control. Current position : 1100b Set point : 0000b Settling time : 4.5 seconds Overshoot : 0 A step change to 1110 is given Current position : 1100b Set point : 1110b Settling time : 1 second Overshoot : 0 8. Discussion of the results The results obtained were satisfactory. The microcontroller was able to move the shaft to the desired position with no overshoot. For a change in a set point it always EE 712 Lab Project Report Page 8 of 15

followed the shortest path. Even when sensors were moved from their original position the disk was moved within no time, so that desired position got locked to the sensor position. 9. Conclusion and suggestions for further improvement The DC motor position control that was realized using AT 89C2051 microcontroller showed satisfactory results. The control system was shown to be effective for systems with high inherent inertia. An additional module to generate proportional plus integral control action instead of proportional only, needs to be developed so as to maintain the shaft at the desired position against load. 10. References [1] Jonathan W. Valvano. Embedded Micocomputer Systems - Real time interfacing, Thomson Brooks/Cole, 2005. [2] Muhammad Ali Mazidi, The 8051 Microcontroller and Embedded Systems, Pearson Education, 2005. [3] K.J. Ayala, "The 8051 Microcontroller: Architecture, Programming, and Applications", Penram International, 1996. [4] Fairchild Semiconductor Corporation. Phototransistor optical interrupter switch, 2001. Datasheet, available on the web at http://www.datasheet.in/datasheethtml/m/o/c/moc70p_fairchildsemiconductor.pdf.html. [5] Texas Instruments. Quadruple half H bridge driver, 1990. Datasheet, available on the web at http://www.datasheet.in/datasheet- html/l/2/9/l293dne_texasinst ruments.pdf.html. EE 712 Lab Project Report Page 9 of 15

Appendix A: Photographs of Various Assemblies Ph.1 Array of IR LEDs Ph.2 Array of Phototransistors EE 712 Lab Project Report Page 10 of 15

Ph. 3 Coded Disc of Shaft Encoder Ph. 4 Optical Shaft Encoder Assembly fixed to the Motor EE 712 Lab Project Report Page 11 of 15

Ph. 5 IR LED and Sensor Biasing Circuit Ph. 6 Microcontroller and Drive Circuit EE 712 Lab Project Report Page 12 of 15

Ph. 7 Full Assembly EE 712 Lab Project Report Page 13 of 15

Appendix B: Assembly Language Program org 0000h sjmp start org 0030h start: mov tmod,#11h ; Both timers are in mode 1 mov p3,#00h ; PWM output low mov p1,#0ffh ; Port 1 as a input port. Upper 4-bits = Gray, ; Lower 4-bits = Set point (Binary) clr a mov 20h,a mov 21h,a back: mov a,p1 ; Read both input and set point mov b,a anl a,#0f0h ; Mask upper 4-bits i.e., Gray code swap a acall conv ; Gray to binary conversion mov r2,a ; r2 = Y mov a,b anl a,#0fh ; Mask lower 4-bits i.e., Set point mov r3,a ; r3 = Ysp clr c subb a,r2 mov 00h,c anl a,#0fh clr c subb a,#08h jb 00h,noinv cpl c ; Move Sign bit to Bit addressable ; location 00h of internal RAM ; Check if error magnitude is more than 08h noinv: mov 08h,c mov a,20h xrl a,21h jnb acc.0,forward clr p3.3 setb p3.4 sjmp reverse ; For reverse direction (clockwise) forward: clr p3.4 setb p3.3 EE 712 Lab Project Report Page 14 of 15

reverse: mov a,r3 ; a = Ysp (Set point) mov b,r2 ; b = Y (Output) jb p3.3,norev ; Or we can use jb p3.4 xch a,b ; Do the reverse subtraction norev: clr c subb a,b anl a,#0fh ; pwm generator mov dptr,#duty movc a,@a+dptr ; Get the duty cycle data into th0 mov th0,a mov tl0,#99h ; tl0 found to be constant = 99h mov th1,#0b7h ; Timer 1 to set frequency of 50Hz mov tl1,#0ffh setb tr0 setb tr1 setb p3.2 again: jnb tf0,again clr tr0 clr tf0 clr p3.2 wait: jnb tf1,wait clr tr1 clr tf1 sjmp back conv: org 0200h mov dptr,#grtbi movc a,@a+dptr ret ; Gray to Binary conversion ; Look up table for Gray to Binary conversion org 0300h grtbi: db 00h,01h,03h,02h,07h,06h,04h,05h,0fh,0eh,0ch,0dh,08h,09h,0bh,0ah ; Look up table for timer 0 register th0 org 0400h duty: db 0ffh,0f1h,0e8h,0dfh,0d6h,0cdh,0c4h,0bbh end EE 712 Lab Project Report Page 15 of 15