light tracking servomotor

Upload: piyush-ranjan

Post on 07-Jul-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 light tracking servomotor

    1/41

    BIRLA INSTITUTE OF TECHNOLOGY, MESRA

    RANCHI, JHARKHAND, INDIA

    MINOR PROJECT ON

    LIGHT TRACKING SERVO SYSTEM

    BY-

    AISHWARYA MISHRA (BE/10360/2012)

    PIYUSH RANJAN (BE/10345/2012)

    AKASH KUMAR (BE/10027/2012)

    ELECTRICAL AND ELECTRONICS ENGINEERING

    7th SEMESTER

    GUIDED BY-

    DR. (MRS.) S. CHAKRABORTY

    ASSOCIATE PROFESSORPROJECT GUIDE

    DEPT. OF EEE

    BIT MESRA

  • 8/19/2019 light tracking servomotor

    2/41

    CERTIFICATE

    This is to certify that the contents of this project report titled “Light Tracking

    Servo System” is a bona fide work carried out by Akash Kumar (BE/10027/2012),

    Piyush Ranjan (BE/10345/2012) and Aishwarya Mishra (BE/10360/2012); under

    my guidance and supervision in partial fulfilment of the requirement for the

    degree of Bachelor of Engineering in Electrical and Electronics Engineering.

    The contents of this report have not been submitted earlier in any other formand I hereby commend them for their work. 

    DR. (MRS.) S CHAKRABORTY

    ASSOCIATE PROFESSOR

    PROJECT GUIDE

    DEPT. OF EEE

    BIT MESRA

  • 8/19/2019 light tracking servomotor

    3/41

    CERTIFICATE OF APPROVAL

    The project titled ”light tracking servo system”  carried out by

    Mesers PIYUSH RANJAN, AKASH KUMAR and AISHWARYA

    MISHRA, is hereby approved as creditable study of

    engineering in Electrical and Electronics and is represented in

    a satisfactory manner.It warrants its acceptance as a pre-requisite in partial

    fulfilment in engineering for the award of BACHELOR OF

    ENGINEERING in ELECTRICAL AND ELECTRONICS

    ENGINEERING at Birla Institute of Technology, Mesra, Ranchi,

    India.

    Internal Examiner External Examiner

    Dr.(Prof) R.C. Jha,

    Professor and Head,

    Department of EEE,

    BIT Mesra, Ranchi

  • 8/19/2019 light tracking servomotor

    4/41

    ACKNOWLEDGEMENT

    We express our deep sense of gratitude to our project supervisor

    Dr.(Mrs). S Chakraborty, Professor, Department of EEE, under whose

    guidance we were able to learn and applythe concepts presented in

    this project. Their consistent supervision, constant inspiration and

    invaluable guidance have been of immense help in carrying out this

    project work with success.

    A sense of indebtedness extends from core of our heart to Dr. R C Jha,

    Professor and Head, Department of EEE for extending his facilities, and

    giving valuable suggestions at all times for pursuing this course.

    We are also thankful to staff and other faculties of our department for

    their help and suggestions on our project.

  • 8/19/2019 light tracking servomotor

    5/41

    ATTENDANCE

    NAME ROLL NO. TOTAL NO.

    OF CLASSES

    NO. OF

    CLASSES

    ATTENDED

    PERCENTAGE

    AKASH

    KUMAR

    PIYUSH

    RANJAN

    AISHWARYA

    MISHRA

    DR. (MRS.) S CHAKRABORTY

    PROFESSOR

    PROJECT GUIDE

    DEPT. OF EEE

    BIT MESRA

  • 8/19/2019 light tracking servomotor

    6/41

    PROGRAM EDUCATIONAL OBJECTIVES (PEO)-

    1.To understand the fundamentals of Science in general and Electrical and

    Electronics in particular to be able to analyse the problems with a futuristic

    approach. 2. To be confident in solving real-life engineering problems. 

    3.To develop an attitude for identifying and undertaking developmental

    work both in industry and the academic environment with emphasis on learning

    so as to excel in competitions at the global level. 

    4.To nurture communication and interpersonal skills to be able to work well in

    a team with a sense of ethics and moral responsibility for achieving goals. 

    PROGRAM OUTCOMES (PO)-A student shall:

    a)  Be competent in applying basic knowledge of science and

    engineering to obtain solution to a multi-disciplinary problem. b)  Gain knowledge of analyzing complex engineering problems. 

    c) 

    Be able to design system components and processes meeting allrules and regulations. 

    d)  Be capable of undertaking suitable experiments or research methods

    while solving a problem and would arrive at a conclusion after

    interpreting the data and experimental results. e)  Be confident in applying recent engineering practices and soft tools

    along with other techniques and resources. 

  • 8/19/2019 light tracking servomotor

    7/41

    COURSE OBJECTIVES-

    1.  Familiarize oneself with working and applications of servo motors.

    2.  To develop a light tracking servo system.

    3. 

    To develop mathematical model of the given system.

    4.  To analyze qualitatively the response of the system to various parameter

    changes.

    5.  To understand and implement various control techniques to better the

    performance of the system in an industrial environment.

    6.  To be able to simulate the model in a software environment.

    7.  To be able to implement it in hardware.

    COURSE OUTCOME-A student will be confident in-

    1.  Explaining the working and applications of servo motors.

    2. 

    Developing a functional light tracking servo system.3.  Developing a mathematical model of the system.

    4.  Analyzing the response of the system to various parameter changes.

    5.  Understanding and implementing various control techniques to

    better the performance of the system in an industrial environment.

    6.  Analysing the control system, step response and finding out best

    configuration which is at par with stability, efficiency and faster

    response.

  • 8/19/2019 light tracking servomotor

    8/41

    Mapping between course outcomes and program

    outcomes-

    Pos

    Course Outcomes

    A B c D E

    1  

    2       3         4      

    5       

    Mapping between course objectives and course outcomes-

    Course outcomes

    Course

    objectives

    1 2 3 4 5

    1    

    2    

    3  

     

     

    4      

    5      

    6      

    7          

  • 8/19/2019 light tracking servomotor

    9/41

    ABSTRACT

    The project discusses a light tracking servo model which has been built to

    simulate the movement of a light follower robot. A mathematical model is

    developed and a qualitative comparison of the mathematical model and the

    actual physical model is done to demonstrate the dynamics of a light tracking

    servo system. A hardware model has been designed using the sensors and

    servomotors which have been interfaced using a light tracking algorithm. Themathematical model has been adopted on the principle of servomechanism

    using a motor run by amplification of error signal. The software platform used

    for programming is Arduino (for algorithm) and Matlab (for simulation). Aim of

    this project is to understand the principles that govern a control system and

    using a physical example to explain the working of the system under various

    conditions producing various responses.

  • 8/19/2019 light tracking servomotor

    10/41

     

    CONTENTS

    1. INTRODUCTION

    2. APPLICATIONS OF LIGHT TRACKING SERVO SYSTEMS

    3. LITERATURE REVIEW

    4. SPECIFICATIONS OF THE PROJECT

    a) SERVOMOTOR

    b) LIGHT DEPENDENT RESISTORSc) MICROCONTROLLER

    5. STAGES OF THE PROJECT

    6. ALGORITHM

    7.RESULTS

    8. MATHEMATICAL MODELLING OF THE SYSTEM

    9.a) SIMULATION

    b) HARDWARE DESIGN

    10. CONCUSION

    11. REFERENCES

  • 8/19/2019 light tracking servomotor

    11/41

     

    1.  INTRODUCTION

    A servo motor is a dc, ac, or brushless dc motor combined with a position sensing

    device (e.g. a digital decoder). They are self-contained electrical devices that

    rotate or push parts of a machine with great precision. Servos are found in many

    places: from toys to home electronics to cars and airplanes. In a model car or

    aircraft, servos move levers back and forth to control steering or adjust wing

    surfaces. By rotating a shaft connected to the engine throttle, a servo regulates

    the speed of a fuel-powered car or aircraft. Servos also appear behind the scenes

    in devices we use every day. Electronic devices such as DVD and Blu-ray Disc

    players use servos to extend or retract the disc trays. In 21st-century

    automobiles, servos manage the car’s speed: The gas pedal, similar to the

    volume control on a radio, sends an electrical signal that tells the car’s computer

    how far down it is pressed. The car’s computer calculates that information and

    other data from other sensors and sends a signal to the servo attached to the

    throttle to adjust the engine speed. Commercial aircraft use servos and a related

    hydraulic technology to push and pull just about everything in the plane. And of

    course, robots might not exist without servos.

  • 8/19/2019 light tracking servomotor

    12/41

    2.  APPLICATIONS OF LIGHT TRACKING

    SERVO SYSTEMS

    For use in light follower robots, servo systems are indispensable. Some of the

    most important applications of light-tracking servo motors are-

    a)  Street lights

    b)  Alarm devices

    c)  To measure light intensity for applications that require greater precision

    d)  Cameras may use this technology to determine proper exposure time.

    e)  Laptops may use it in a circuit that varies screen brightness according to

    ambient light conditions.

    f)  As solar tracking systems in photovoltaic panels to increase their

    efficiency.

  • 8/19/2019 light tracking servomotor

    13/41

    3.  LITERATURE REVIEW

    Paul Batcheller in July 1992 wrote the “Analysis of Light Tracking servo

    system. The paper discusses a light tracking servo model which has been

    built to simulate the movement of a PV array. A mathematical model is

    developed and a qualitative comparison of the mathematical model and

    the actual physical model is done to demonstrate the dynamics of a light

    tracking servo system. An overall transfer function for a permanent

    magnet direct current (dc) motor was also developed. The motor transfer

    function is used in the development of an overall transfer function for the

    light tracking servo system. Using the overall transfer function, a

    computer simulation program within Matlab is used to simulate the

    dynamics of the servo system. A qualitative analysis of the Matlab results

    and the dynamics of the working physical model are compared to clearly

    illustrate the important dynamics of the system.

    A paper on “Solar Photovoltaic Servo Tracking Controlled System” was

    presented by Murad Shibli Abu Dhabi Polytechnic, Institute of Applied

    Technologies, UAE. The design of the system is based on the fuzzy

    reasoning applied to crisp sets. In this case, it can be easily implemented

    on general purpose microprocessor systems. Four light sensitive devices,

    such as LDR, photodiodes or phototransistors are mounted on the solar

    panel and placed in an enclosure. The four light detectors are screened

    from each other by opaque surfaces. Each pair of the light sensors is used

    to inform the controller on the orientation of the solar panel vertically and

    horizontally respectively.

    Daniel A. Pritchard had given the design, development, and evaluation of

    a microcomputer-based solar tracking and control system (TACS) in 1983.

  • 8/19/2019 light tracking servomotor

    14/41

    It was capable of maintaining the peak power position of a photovoltaic

    (PV) array by adjusting the load on the array for maximum efficiency and

    changed the position of the array relative to the sun. At large PV array

    system installations, inverters were used to convert the dc electrical

    output to ac for power grid compatibility. Adjustment of the inverter or

    load for maximum array output was one function performed by the

    tracking and control system. Another important function of the system

    was the tracking of the sun, often a necessity for concentrating arrays.

    The TACS also minimized several other problems associated with

    conventional shadow-band sun trackers such as their susceptibility to

    dust and dirt that might cause drift in solar alignment. It also minimized

    effects of structural war page or sag to which large arrays might be

    subjected during the day. Array positioning was controlled by Q single-

    board computer used with a specially designed input output board. An

    orderly method of stepped movements and the finding of new peakpower points was implemented. This maximum power positioning

    concept was tested using a small two-axis tracking concentrator array. A

    real-time profile of the TACS activity was produced and the data analysis

    showed a deviation in maximum power of less than 1% during the day

    after accounting for other variations [Daniel A. Pritchard, 1983].

    Ashok Kumar Saxena and V. Dutta had designed a versatile

    microprocessor based controller for solar tracking in 1990 .Controller had

    the capability of acquiring photovoltaic and metereological data from a

    photovoltaic system and controlled the battery/load. These features were

    useful in autonomous PV systems that were installed for system control

    as well as monitoring in remote areas .Solar tracking was achieved in both

    open loop as well as closed loop modes. The controller was totally

  • 8/19/2019 light tracking servomotor

    15/41

    automatic and did not require any operator interference unless needed

    [Ashok Kumar Saxena and V.Dutta, 1990].

    A. Konar and A.K. Mandal had given a microprocessor based automatic

    position control scheme in 1991. They had designed for controlling the

    azimuth angle of an optimally tilted photovoltaic flat type solar panel or a

    cylindrical parabolic reflector to get the illuminating surface appropriately

    positioned for the collection of maximum solar irradiance. The proposed

    system resulted in saving of energy . The tracking system was not

    constrained by the geographical location of installation of the solar panel

    since it was designed for searching the MSI in the whole azimuth angle of

    360” during the locking cycle. Temporal variations in environmental

    parameters caused by fog, rain etc., at a distance from the location where

    panel was mounted, did not affect proper direction finding [A. Konar and

    A.K Mandal, 1991].

    A. Zeroual et al.  had designed an automatic sun-tracker system foroptimum solar energy collection in 1997. They used electro-optical

    sensors for sun finding and a microprocessor controller unit for data

    processing and for control of the mechanical drive system. This system

    allowed solar energy collectors to follow the sun position for optimum

    efficiency. The system had been applied to control a water heating

    parabolic solar system for domestic uses. Many parameters had been

    controlled for system security such as temperature, pressure and wind

    velocity. The system had been tested for a long period in variable

    illumination. The result showed that it operated satisfactorily with high

    accuracy [A.Zeroual et al., 1997].

    Z.G. Piao et al. proposed a 150W solar tracking system in 2003. In solar

    tracking system, they used DC motors, special motors like stepper motors,

  • 8/19/2019 light tracking servomotor

    16/41

    servo motors, real time actuators, to operate moving parts. DC motors

    were normally used to operate solar tracking system but it was highly

    expensive to maintain and repair. The system was designed as the normal

    line of the solar cell always moved parallel to the ray of the sun. [Z.G. Piao

    et al., 2003].

    Jing-Min Wang and Chia-Liang Lu presented a novel and a simple control

    implementation of a Sun tracker that employed a single dual-axis AC

    motor to follow the Sun and used a stand-alone PV inverter to power the

    entire system. The proposed one-motor design was simple and self-

    contained, and did not require programming and a computer interface. A

    laboratory prototype has been successfully built and tested to verify the

    effectiveness of the control implementation. Experiment results indicated

    that the developed system increased the energy gain up to 28.31% for a

    partly cloudy day. The proposed methodology is an innovation so far. It

    achieves the following attractive features: (1) a simple and cost-effectivecontrol implementation, (2) a stand-alone PV inverter to power the entire

    system, (3) ability to move the two axes simultaneously within their

    respective ranges, (4) ability to adjust the tracking accuracy, and (5)

    applicable to moving platforms with the Sun tracker. [Jing-Min

    Wang and Chia-Liang Lu, 20

  • 8/19/2019 light tracking servomotor

    17/41

    4. PROJECT COMPONENT AND THEIR

    SPECIFICATIONS

    a) LIGHT DEPENDENT RESISTORS-

    LDRs or Light Dependent Resistors are very useful especially in light/dark sensor

    circuits. Normally the resistance of an LDR is very high, sometimes as high as

    10000 ohms, but when they are illuminated with light resistance drops

    dramatically.

    A light dependent resistor is a small, round semiconductor. Light dependent

    resistors are used to re-charge a light during different changes in the light, or

    they are made to turn a light on during certain changes in lights. One of the most

    common uses for light dependent resistors is in traffic lights. The light

    dependent resistor controls a built in heater inside the traffic light, and causes

    it to recharge over night so that the light never dies. Other common places to

    find light dependent resistors are in: infrared detectors, clocks and security

  • 8/19/2019 light tracking servomotor

    18/41

    alarms. One major benefit of LDRs is that they consume less power. It is made

    of cadmium sulphide compound which has the property of varying resistance

    with intensity of light. LDR or light dependent resistor is the main sensing

    element in the dual axis solar tracker we have worked upon. We plan to use 3

    or 5 LDRs that are positioned at the 3 corners of the solar plate.

    b) SERVOMOTOR-

    This is nothing but a simple electrical motor, controlled with the help of

    servomechanism. If the motor as controlled device, associated withservomechanism is DC motor, then it is commonly known DC Servo Motor. If the

    controlled motor is operated by AC, it is called AC Servo Motor. A servo system

    mainly consists of three basic components - a controlled device, a output sensor,

    a feedback system. This is an automatic closed loop control system. Here instead

    of controlling a device by applying variable input signal, the device is controlled

    by a feedback signal generated by comparing output signal and reference input

    signal. When reference input signal or command signal is applied to the system,

    it is compared with output reference signal of the system produced by outputsensor, and a third signal produced by feedback system. This third signal acts as

    input signal of controlled device. This input signal to the device presents as long

    as there is a logical difference between reference input signal and output signal

    of the system. After the device achieves its desired output, there will be no

    longer logical difference between reference input signal and reference output

    signal of the system. Then, third signal produced by comparing these above said

    signals will not remain enough to operate the device further and to produce

    further output of the system until the next reference input signal or commandsignal is applied to the system. Hence the primary task of a servomechanism is

    to maintain the output of a system at the desired value in the presence of

    disturbances. A servo motor is basically a DC motor(in some special cases it is AC

    motor) along with some other special purpose components that make a DC

    motor a servo. In a servo unit, you will find a small DC motor, a potentiometer,

    gear arrangement and an intelligent circuitry. The intelligent circuitry along with

    the potentiometer makes the servo to rotate according to our wishes.As we

    know, a small DC motor will rotate with high speed but the torque generated byits rotation will not be enough to move even a light load. This is where the gear

  • 8/19/2019 light tracking servomotor

    19/41

    system inside a servomechanism comes into picture. The gear mechanism will

    take high input speed of the motor (fast) and at the output; we will get a output

    speed which is slower than original input speed but more practical and widely

    applicable.

    Say at initial position of servo motor shaft, the position of the potentiometer

    knob is such that there is no electrical signal generated at the output port of the

    potentiometer. This output port of the potentiometer is connected with one of

    the input terminals of the error detector amplifier. Now an electrical signal is

    given to another input terminal of the error detector amplifier. Now difference

    between these two signals, one comes from potentiometer and another comes

    from external source will be amplified in the error detector amplifier and feedsthe DC motor. This amplified error signal acts as the input power of the dc motor

    and the motor starts rotating in desired direction. As the motor shaft progresses

    the potentiometer knob also rotates as it is coupled with motor shaft with help

    of gear arrangement. As the position of the potentiometer knob changes there

    will be an electrical signal produced at the potentiometer port. As the angular

    position of the potentiometer knob progresses the output or feedback signal

    increases. After desired angular position of motor shaft the potentiometer knob

    is reaches at such position the electrical signal generated in the potentiometerbecomes same as of external electrical signal given to amplifier. At this

    condition, there will be no output signal from the amplifier to the motor input

    as there is no difference between external applied signal and the signal

    generated at potentiometer. As the input signal to the motor is nil at that

    position, the motor stops rotating. This is how a simple conceptual servo motor

    works.

  • 8/19/2019 light tracking servomotor

    20/41

     

    c) ARDUINO MICROCONTROLLER-

    Arduino/Genuino Uno is a microcontroller board based on the ATmega328P. It

    has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6

    analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP

    header and a reset button. It contains everything needed to support the

    microcontroller; simply connect it to a computer with a USB cable or power it

    with a AC-to-DC adapter or battery to get started.. You can tinker with your UNO

    without worrying too much about doing something wrong, worst case scenario

    you can replace the chip for a few dollars and start over again.

    "Uno" means one in Italian and was chosen to mark the release of Arduino

    Software (IDE) 1.0. The Uno board and version 1.0 of Arduino Software (IDE)

    were the reference versions of Arduino now evolved to newer releases. The Uno

    board is the first in a series of USB Arduino boards, and the reference model forthe Arduino platform; for an extensive list of current, past or outdated boards

    see the Arduino index of boards. The Arduino/Genuino Uno can be programmed

    with the Arduino Software (IDE). Select "Arduino/Genuino Uno" from the Tools

    > Board menu (according to the microcontroller on your board). The ATmega328

    on the Arduino/Genuino Uno comes preprogrammed with a boot loader that

    allows you to upload new code to it without the use of an external hardware

    programmer. It communicates using the original STK500 protocol.

  • 8/19/2019 light tracking servomotor

    21/41

     

    TECHNICAL SPECIFICATIONS

    LDR: Range of 100 ohms -10k ohms

    SERVOMOTOR:

    Weight 55g

    Dimensions40.7 x 19.7 x 42.9

    mm

    Stall Torque8.5 kg cm (4.8V),

    10 kg cm (6V)

    Operating

    Speed

    0.20 sec/60d

    (4.8V), 0.16

    sec/60d (6V)

    Operating

    Voltage4.8 - 7.2 V

    Temperature

    Range 0 - 55 C

    ARDUINO MICROCONTROLLER:

    Microcontroller ATmega328P

    Operating Voltage 5V

    Input Voltage(recommended)

    7-12V

    Input Voltage (limit) 6-20V

    Digital I/O Pins14 (of which 6 provide PWM

    output)

  • 8/19/2019 light tracking servomotor

    22/41

    PWM Digital I/O Pins 6

    Analog Input Pins 6

    DC Current per I/O Pin 20 mA

    DC Current for 3.3V Pin 50 mA

    Flash Memory

    32 KB (ATmega328P)

    of which 0.5 KB used by

    bootloader

    SRAM 2 KB (ATmega328P)

    EEPROM 1 KB (ATmega328P)

    Clock Speed 16 MHz

    Length 68.6 mm

    Width 53.4 mm

    Weight 25 

  • 8/19/2019 light tracking servomotor

    23/41

    5. OPERATIONS UNDERTAKEN IN THE PROJECT 

    1. Signal processing: This stage involves conversion of analog signal

    obtained from the sensor to a digital value using analog to digital convertafter amplification and filtering of noises and then converting these digital

    values into the values that can be used to determine the intensity. 2. Algorithm: We have developed algorithm to compare the intensity

    values received from each of the 4 sensors, find the average values for

    top, down, left and right faces of the surface which will rotate in the

    direction of maximum intensity. Then we find out the difference between

    average values for each axis and compare it with a threshold voltage level

    (or digital value of the same) which is adjustable according to the

    environment (dark or bright so that fine control can be obtained). If the

    difference exceeds a threshold value in a given direction, the motor will

    turn the surface in the same direction until average intensity is

    normalised. 

    3.  Mathematical modelling: Once the information about theposition is received from microcontroller the mathematical model

    developed will convert the position instructed by the controller intoactual position required. Mathematical model is only a theoretical

    representation supported by some calculations done on the basis of the

    working of the light follower and it shows how the motor will respond

    actually( by performing a movement) when the instruction about the

    motion is given to it.

    4.  Simulation: Then we use the mathematical model to analyse whatwill happen if we take various case of the constants and gain values by

    running them through a program and finding out the response of thesystem. The simulation will show what will be the most suitable

    configuration parameters for designing the hardware.

    5.  Hardware Design: This involves using the values obtained fromsimulation to design a suitable hardware that can run to produce desired

    result. The hardware design also involves making an efficient design such

    that the performance of each of the sensors and actuators used in

    modelling is efficient and according to the simulation.

  • 8/19/2019 light tracking servomotor

    24/41

    6.  ALGORITHM

    We have used algorithm to compare the intensity values received from each

    of the 4 sensors, find the average values for top, down, left and right faces of

    the surface which will rotate in the direction of maximum intensity. Then we

    find out the difference between average values for each axis and compare it

    with a threshold voltage level (or digital value of the same) which is adjustable

    according to the environment (dark or bright so that fine control can be

    obtained). If the difference exceeds a threshold value in a given direction, the

    motor will turn the surface in the same direction until average intensity is

    normalised. Following is the flow chart for algorithm.

    No No

    Yes Yes

    No Yes Yes No

     

    START

    Read

    top,left,down,righ

    t sensors

    Calculate avt,

    avl,avd &avr

    Dvrt= |avt-avd| Dhrz= |avl-avr|

    Dvrt>thre

    shold?

    Dhrz>thr

    eshold?

    Avt>

     

    Avl>

     

    Pos=pos+1 Pos2=pos2

    +1

    Pos=pos-1 Pos2=pos2-

    1

  • 8/19/2019 light tracking servomotor

    25/41

    PROGRAM FOR ALGORITHM

    #include

    int ldrlt = 0; //LDR top leftint ldrrt = 1; //LDR top rigt

    int ldrld = 2; //LDR down left

    int ldrrd = 3; //ldr down rigt

    int pos2=0;

    int pos=0;

    Servo myservo;

    Servo myservo2;

    void setup()

    {

    Serial.begin(9600);

    // servo connections

    // name.attacht(pin);

    // horizontal.attach(9);

    //ertical.attach(10);

    myservo.attach(9);

    myservo2.attach(10);

    }

    void loop()

    {

    int lt = analogRead(ldrlt); // top left

    int rt = analogRead(ldrrt); // top

    right

    int ld = analogRead(ldrld); // downleft

    int rd = analogRead(ldrrd); // down

    rigt

    //int dtime = analogRead(4)/20; //

    read potentiometers

    int tol = analogRead(5);

    int avt = (lt + rt) / 2; // average value

    top

    int avd = (ld + rd) / 2; // average

    value down

    int avl = (lt + ld) / 2; // average value

    left

    int avr = (rt + rd) / 2; // average

    value right

    lt=lt-200;

    ld=ld-370;

    int dvert = avt - avd; // check the

    diffirence of up and down

    int dhoriz = avl - avr;// check the

    diffirence og left and rigt

    /*Serial.println("top left:");

    Serial.println(lt);

    delay(1000);

    Serial.println("top right:");

    Serial.println(rt);

    delay(1000);

  • 8/19/2019 light tracking servomotor

    26/41

    Serial.println("down left:");

    Serial.println(ld);

    delay(1000);

    Serial.println("down right:");

    Serial.println(rd);

    delay(1000);*/

    Serial.println("av top:");

    Serial.println(avt);

    delay(10);

    Serial.println("av down:");

    Serial.println(avd);

    delay(10);

    Serial.println("av left:");

    Serial.println(avl);

    delay(10);

    Serial.println("av right:");

    Serial.println(avr);

    delay(10);

    Serial.println("diffvert:");

    Serial.println(dvert);

    delay(10);

    Serial.println("diffhoriz:");

    Serial.println(dhoriz);

    delay(10);

    Serial.println("tolerance");

    Serial.println(tol);

    if (-1*tol > dvert || dvert > tol) //

    check if the diffirence is in the

    tolerance else change vertical angle

    {

    if (avt > avd)

    {

    pos=++pos;

    myservo.write(pos);

    if (pos > 180)

    {

    pos = 180;

    }

    }

    else if (avt < avd)

    {

    pos= --pos;

    myservo.write(pos);

    if (pos < 0)

    {

    pos= 0;

    }

    }

    Serial.println("position:");

    Serial.println(pos);

    }

    delay(10);

  • 8/19/2019 light tracking servomotor

    27/41

    if (-1*tol > dhoriz || dhoriz > tol) //

    check if the diffirence is in the

    tolerance else change vertical angle

    {

    if (avl > avr)

    {

    pos2=++pos2;

    myservo2.write(pos2);

    if (pos2 > 180)

    {

    pos2 = 180;

    }

    }

    else if (avl< avr)

    {

    pos2= --pos2;

    myservo2.write(pos2);

    if (pos2 < 0)

    {

    pos2= 0;

    }

    }

    Serial.println("position2:");

    Serial.println(pos2);

    }

  • 8/19/2019 light tracking servomotor

    28/41

    7.RESULTS

    The input of the sensor going to Arduino microcontroller was also given as an

    input to the Matlab program for a given period of sample time and intensity

    values and corresponding position values were recorded which have been

    shown through following figures-

    Fig 1:Intensity vs sample time for sensors and the average values

    Fig2: Intensity values for up and down sensors and corresponding position values (scaled)

  • 8/19/2019 light tracking servomotor

    29/41

     

    Fig3: Position and intensity curve red line indcating’down’ and geen indicating’up’ 

    Fig 4&5: The graph for left and right movement

  • 8/19/2019 light tracking servomotor

    30/41

     

    Fig 5:The sensor output values in digital value

  • 8/19/2019 light tracking servomotor

    31/41

    8. MATHEMATICAL MODEL OF THE SYSTEM

    Once the information about the position is received from microcontroller the

    mathematical model will convert the position instructed by the controller into

    actual position required. Mathematical model is only a theoretical

    representation supported by some calculations done on the basis of the working

    of the light follower and it shows how the motor will respond actually( by

    performing a movement) when the instruction about the motion is given to it.

    An overall transfer function is developed for the light tracking system by using

    block diagram algebra on the transfer functions of the photo detecting circuit,

    amplifier, and motor. The overall gain of servomotor which amplifies the error

    signal can be considered as a single variable K, where K is a proportionality

    constant with units of volts per radian. K can be adjusted using the voltage

    divider circuit that sends the signal to the microcontroller.

    A frequency domain block diagram for a position loop servo system is easily

    developed from the transfer functions of the motor and gain of the photo

    detector circuit and amplifier. Following the signal from the input to the output,

    a rotational error from the displacement of the photoresistors results in an error

    voltage. This voltage is converted to a rotational velocity by the motor. The

    rotational position output is related to the velocity of the motor by integratingthe velocity or, in the frequency domain, by dividing by s. The output position is,

    in effect, subtracted from the input position, which is represented by a direct

    line from the output to a summing junction with a negative sign into the

     junction.

    The parameters used in the mathematical model are-

    E(s) = ΘL(s)-ΘA(s)

    Va(s) = KE(s)

    Wa(s) = Gm(s)KE(s)

    ΘA(s) = Wa(s)/s= Go(s)E(s)

    ΘA(s) = (Go(s)/(1+Go(s)))*ΘL(s)=Gc(s)*ΘL(s)

    ΘL(s) is light position( position given by microcontroller) in radians; ΘA(s) is

    position of panel in radians; K= proportional gain achieved by the gain of

    amplification of the error signal(internal gain of analog servomotor); Va(s) is theamplified voltage applied to the motor used in the servomechanism; E(s) is the

  • 8/19/2019 light tracking servomotor

    32/41

    error signal; Gm(s) is the motor transfer function; Wa is the angular velocity;Go(s)

    is open loop t.f.;Gc(s) is closed loop t.f.

    Block diagram using the following parameter looks like-

    The equivalent electrical circuit of a dc motor is shown below. It can be

    represented by a voltage source (Va) across the coil of the armature. The

    electrical equivalent of the armature coil can be described by an inductance

    (La) in series with a resistance (Ra) in series with an induced voltage (Vc) which

    opposes the voltage source. The induced voltage is generated by the rotation

    of the electrical coil through the fixed flux lines of the permanent magnets.

    This voltage is often referred to as the back emf (electromotive force).

    Electrical Characteristics:

    Va  – VRa  – VLa - Vc =0

    VRa= ia Ra

    VLa= La di/dt

    Vc= KvWa

    Mechanical Characteristics:

    Performing an energy balance on the system, the sum of the torques of themotor must equal zero. Therefore,

  • 8/19/2019 light tracking servomotor

    33/41

    Te-Tw-Tw’-TL=0

    where Te is the electromagnetic torque, Tw ' is the torque due to rotational

    acceleration of the rotor, Tw is the torque produced from the velocity of the

    rotor, and TL is the torque of the mechanical load. The electromagnetic torqueis proportional to the current through the armature winding and can be

    written as

    Te = kt ia

    where kt is the torque constant and like the velocity constant is dependent on

    the flux density of the fixed magnets, the reluctance of the iron core, and the

    number of turns in the armature winding. Tw ' can be written as

    Tw’= J dWa/dt

    where J is the inertia of the rotor and the equivalent mechanical load. The

    torque associated with the velocity is written as

    Tw=BWa

    where B is the damping coefficient associated with the mechanical rotational

    system of the machine.

    Va- ia Ra - La di/dt – KvWa = 0 :Eqn1

    kt ia -Jdwa/dt- Bwa-TL=0 :Eqn2

    Transfer Function:

    sIa(s)- ia(0) = -Ra Ia(s) /La - KvΘa(s) /La- Va(s) /La 

    sΘa(s) – Wa(s)=kt Ia(s)/J - B Θa(s)/J – TL(s)/J

    Therefore,

    Θa(s)=(- kt Ia(s) – TL(s))/(Js+B)

    Ia(s) =(- KvΘa(s)+ Va(s))/( Las+ Ra)

    In the case of a sun tracking servo system, the only load torque to be

    concerned with is the friction in the system, which is relatively constant while

  • 8/19/2019 light tracking servomotor

    34/41

    the motor is moving. Since the change in TL is zero, it does not need to appear

    in the block diagram.

    Fig :Block diagram of motor

    Fig: Reduced block diagram of motor

    Fig: Servomechanism with motor & reduced block diagram of servomotor

  • 8/19/2019 light tracking servomotor

    35/41

    9. a) SIMULATION

      The simulation was done using a Matlab program where the final transfer

    function (in the last figure) was taken and its parameters were used for

    designing a system with a similar transfer function.

      The value of Ra, La, Jeq & Beq were taken from data sheet of the

    servomotor we bought ( V3003 Vega Robotics analog servo) and put in

    the logic.

      The values of K, Kp & Kt were not known so they were found out using

    trial method where an initial gain of K , Kp & Kt was considered to be 1

    and several adjustments were made while finding out the value.

      Optimum value of K, Kp & Kt was selected and the step response and bode

    plot was found out.

      These values were taken and put into a Simulink model (model was made

    only on the basis of mathematical equation and only the values were used

    so the output is not accurate; code was not used to generate the model

    nor it was designed using any electrical parameters to behave like an

    electrical circuit; it was only a block diagram representation of the

    transfer function we obtained).

      The simulation was done only for one axis as movement of both the axis

    is not linked through any mathematical equation. For this purpose it was

    considered that there is no magnetic coupling between two motor

    systems so that individuals results for single axis could be obtained

    easily.

      Results of simulation are shown below:-

    Fig: User Interface of the program

  • 8/19/2019 light tracking servomotor

    36/41

     Kp=1,Kt=1, K=1(low gain),25(mid),50(high)

    Fig Kp=.5, Kt=.5, K=1,25,50

    Fig: Kp=.5, Kt=.1

  • 8/19/2019 light tracking servomotor

    37/41

    Fig: Kp=.1, Kt=.1

    Fif: Kp=.01, Kt=.01

    Fig: Input position values to Simulink for Kp=.1, Kt=.1, K=20-30

    Fig: Output values

      It is seen that for unity gain values of K,Kv&Kt, system is highly over

    damped and response time & rise time is very large. This will make

    servomechanism slow to the response for the instruction.

  • 8/19/2019 light tracking servomotor

    38/41

      Again for higher values of K, the response improves but it is still highly

    over damped.

      Again by changing the values of Kv& Kt to median values we see that

    response is still over damped and slow.

     

    At the values Kv=.1, Kt=.1 the system is over damped for low values of

    gain, just underdamped for median values and underdamped severely for

    high values. So the faster rise time is achieved in high values (around 70)

    but response time falls behind the median value response time (around

    25). Since the value of response time is important to us so median value

    of gain can be used with given values of Kv& Kt for the design.

      The Simulink response for the same values shows extra over damping due

    to non- linearity of elements used in the block and it has only been used

    to show how the motor will produce an output in response to change of

    input. It is seen that at even these values of step response there will be

    some oscillation.

  • 8/19/2019 light tracking servomotor

    39/41

     

    b) HARDWARE DESIGN

     

    The entire circuitry rests on the rectangular panel of dimension

    55*170*14 mm.

      4 sensors for detecting light were placed on the four corners of the panel.

    The sensor were placed in accordance with a resistance of high value to

    form a potential divider circuit across which voltage could be taken(range

    of voltage 0-5 V)

      The wires from four sensors were brought to 4 analog pins of the

    microcontroller which uses an internal ADC to convert the analog voltage

    o/p of sensor to a digital value in the range of 0-1023 corresponding to 0-

    5 V.

      2 potentiometers were used  –  one pot for controlling the value of

    threshold to which the logic would respond which could be adjusted

    according to ambient light and the other for controlling the time delay

    after which the intensity value would be taken again.

      The supply for motors was given using 12V adapter circuit.

      To prevent activation of all sensors from a distant source of light, 4

    cardboard pillars were used surrounding the sensor in a semi-circle such

    that when light fell on one sensors, the pillars would cast a shadow on the

    other sensors causing them to deactivate. Same could be used for any of

    the two sensors causing a shadow on the other two sensors.

  • 8/19/2019 light tracking servomotor

    40/41

     

    10. CONCLUSION

    An algorithm for the project was developed. This algorithm was simulatedin Matlab environment and the intensity vs position values were obtained

    for various positions of light source. A mathematical model was

    developed for the servomotor used and various gain values were

    experimented obtain optimum values of gain and constants which was

    most suitable for the motor. The mathematical model was simulated in

    Matlab environment to produce desired output. Then finally a hardware

    was prepared based on the calculations and algorithm which was then

    simulated by areal light source.The following project was found to be a prototype for dual axis solar

    tracker circuits, ambient light follower circuit, light focusing circuit to read

    data from blu-ray and cd drives etc. The following project also worked as

    a platform to realise a real time working model of a closed loop system

    with various angles included like physical property and mechanical

    property of motor, sensors etc.

  • 8/19/2019 light tracking servomotor

    41/41

     

    11. REFERENCES 1. Design and Research of Dual-Axis Solar Tracking System in

    Condition of Town Almaty.

    1Shyngys Almakhanovich Sadyrbayev, 1Amangeldi Bekbaevich

    Bekbayev,

    1Seitzhan Orynbayev and 2Zhanibek Zhanatovich Kaliyev

    1Kazakh National Technical University, Almaty, Republic of

    Kazakhstan

    2Kazakh Academy of Transport and Communications, Almaty,Republic of Kazakhstan

    2. Designing a Dual Axis Solar Tracker For Optimum PoweR,First A.

    AASHIR WALEED Second B. DR. K M HASSAN University of

    Engineering and Technology, Lahore

    3. Design and Implementation of a Sun Tracker with a Dual-Axis

    Single Motor for an Optical Sensor-Based Photovoltaic System Jing-

    Min Wang * and Chia-Liang Lu,Department of Electrical Engineering,

    St. John’s University.

    4. Research papers by Daniel A. Pritchard, 1983

    5. Research papers by A.Zeroual et al., 1997

    6. Research papers by Z.G. Piao et al., 2003

    7. Research papers by A. Konar and A.K Mandal, 1991