Tuesday, December 28, 2010

How to Build a LINE FOLLOWER/LINE TRACER ROBOT






The basic connection diagram

LINE FOLLOWER/Line tracer ROBOT

The line follower robot is an autonomous robot i.e. it works automatically!!! . As all ilt for some robots are built for some specific task the purpose of the line follower is to follow a path given to it. The robot can follow a black line drawn in a white background or vice versa. It is also called a line tracer etc… Well that’s all about the basic background of a line follower

Construction

The construction of a line tracer isn’t rocket science… all we require is a basic knowledge of electronic circuitry and its components. If we have interest in it well we can finish the project within a week for newbie’s and if you really know what you are doing well a day or 2 would be more than sufficient. Now lest get started.

Basic Requirements

1> Electronic components (Electronic circuit)

2> Mechanical parts (For the body of robot)

Some of the most common components you will be requiring for building this robot would be

Resistors (1k,2.2k…), Capacitors (5mF..),LED’s , LDR’s or Photodiodes ,Pots (Potentiometers-Variable resistors) connection wires, IC Base, Soldering iron, solder, Copper board (Etching board if you know to design) etc…. Most importantly you will require a motor controller IC (LM342), A microcontroller (ATmeg-8, PIC …) and 2 Geared motors.

For the body of the robot you will have to have some (2-3) L shaped clamps depending upon how you plan to design, a small thick board (wooden, cardboard…)

The total cost would not be more than 1000/- as the only the costliest component is the geared motor which would cost between 200-300 each. Make sure that both the motors RPM (Rotations per minute) are same. Do check this for sure. A small difference of 2 or 3 RPM is all right as it can be adjusted. But a large variation would be unacceptable. Also a smaller RPM would be sufficient. We usually get motors with RPM ranging from 10RPM to 750RPM. Choose a range b/w 50-150 as it below it would be too slow and above it might be hard to control (Not that it cannot be done). Rest of the components can be got easily. Get dozens of LED’s (Min of 2 Required), Resistors of different rating, pots (1k,5k..), connection wires . if required you can build your robot using a bread board also. A list of components to buy is given in a list below. Always keep IC’s, components a little extra in hand as we cannot tell when something might turn faulty or burn out. Extra set of it would be always be helpful .

Theory of the Robot (HOW IT WORKS)

Well before we start actually building the robot lets know what is actually happening on the inside of it. Well we can divide the whole circuit into three parts

1> The sensing part (The sensors sense the line i.e. the path)

2> The controller part (The Microcontroller decides the course of action to be taken )

3> The Navigation part (The motors act accordingly to move through the path)

The sensing part consists of a set of LED’s and LDR/Photodiodes/Phototransistors. Let’s go back to our basics. We all know that the refection and absorption properties of light differ between colours to colour. Black absorbs all the light and doesn’t reflect much while the colour white absorbs maximum amount of light while reflecting back almost none. This principle is used for the sensing of the path. Here a track is painted in black with a white background or a white track is drawn in a black background. When the light from the LED’s hit the Black part of the track reflection of light will be minimum the sensor which is the LDR will be receiving minimum light while if the light from the white part then almost full light of the LED reaches the sensor. Now as the name suggests LDR-Light Dependant Resistor, the resistance of the LDR depends on the amount light reaching it. It ranges from 0 ohm in full light to 15Kohm in dark resistance. With this we can find the variations in the track i.e. where the black line is and where the white background is. Now we can convert this data into digital signals as HIGH or LOW. We can set it as required which becomes our base logic for writing the program for the control of the robot.

Now the data we get from the sensors are gathered and connected to the processing unit i.e. the microcontroller. we can also use Gates to program the same but the disadvantage is that once it is connected we cannot change its logic at any cost and also that it would be hard to troubleshoot it as the size and complexity increases. Now in here we will have to write a program to make the robot work. We can call this unit as the brain centre as this is where the all the control commands are sent and according to the logic written in here the robot works.

The commands/signals sent from the Microcontroller are received in the navigation unit. Here it consists of an IC L293D. It is a motor controller. We can control 2 motors with the same IC. It is basically similar to a H-Bridge. The IC’s inputs are from the Microcontroller and the outputs are connected to the geared motors. This IC helps in changing the direction of rotation of the motor. It is simple logic for the reversal. Usually in a DC motor if we reverse the poles of the battery connected, the direction of rotation would reverse automatically. Here it is done electronically.

To better understand the working a small track through which the robot would navigate is shown. Now we can see that as there are 2 wheels only for this robot and the only 3 actions that can be done are

1> Rotate forward

2> Rotate backward

3> Stop

Now by controlling these actions simultaneously on the motors the following would be the result

1> Both wheel Stop : Robot doesn’t move

2> Both wheel forward : Robot moves forward

3> Both Wheel Reverse : Robot moves Backward

4> Left wheel forward, Right wheel Stop : Robot turns Towards Right

5> Left wheel stop, Right wheel forward : Robot turns Towards left

6> Left wheel forward, Right wheel reverse : Robot turns 90deg towards right (Sharp right)

7> Left wheel reverse, Right wheel forward : Robot turns 90deg towards left (Sharp left)

The other combinations wouldn’t be required much. The above given are some of the most used basic controls that can be done.

THE circuit diagram and connection diagram is as given

Circuit Diagram :

here a s/w is kept for changing the mode

1> Follow a white line in a Black Background

2> Follow a Black line in a White Background

a 7-Segment display is connected. We can also use an LED (2 No's) for indicating in which mode is the Robot working i.e. In white mode or the black mode. There will be couple of more pins left out in the PIC which can be used for additional sensors or some other functions as required.

Tuesday, December 21, 2010

Basic Electrical

ABBREVATIONS

RESISTANCE

OHM’s LAW

V=I*R where V=Voltage

I=Current

R=Resistance

DC Resistance:

R= ρ*l/A Where ρ = Resistivity of teh material

l =Length of the conductor

A = Area of the conductor

ρ= 1 / Conductivity=Resistivity

Temperature dependance of a resistor

R =R0[α *(T-T0)+1] where R­­0=Resistance at Temperature T0

α =% change in resistivity / unit temperature

T =Temperature

AC resistance = 1.6*Dc resistance
note : AC resistance would be always greater than DC resistance because of 'SKIN EFFECT'

Resistance in series

When R1,R2, R3 are connected in series…..

Req=R1+R2+R3

Ø Voltages divides & Current remains same in a series circuit.

Resistance in parallel

When R1,R2,R3 are connected in parallel

1/Req=(1/R1+1/R2+1/R3) =

Req=(R1*R2*R3)/(R1+R2+R3)

Ø Current divides & Voltage remains the same in a parallel circuit.

Ø The equivalent resistance of two or more resistance is always less than the least value of the individual resistor.

VOLTAGE DIVIDER

When two resistance are connected as shown

1) The voltage across Resistor R2 is given as

Vout = R2/(R1+R2)*Vin Where Vout = Output voltage

Vin = Input voltage

The power P dissipated by a resistance R carrying a current I with a voltage drop V is:

P= (I^2)*R = VI = (V^2)/R

The energy W consumed over time t due to power P dissipated in a resistance R carrying a current I with a voltage drop V is:

W=(I^2)*R*t


CAPACITANCE

C=Q/V Where C= Capacitance

Q= Charge

V= Voltage

C=(Ebsilon0)*(Ebsilonr)*A/D Where C=Capacitance

A=Area

D=Distance b/w the plates

The Energy stored in a capacitor

W(stored)= C(V^2)/2 = (Q^2)/2C= QV/2

Current-voltage relationship…

I(t)=C dV/Dt Where (dV/dT)=Change in Voltage

The power P transferred by a capacitance C holding a changing voltage V with charge Q is:
P = VI = CV(dv/dt) = Q(dv/dt) = Q(dq/dt) / C

Capacitance in series….

When capacitances C1,C2,C3 are connected in series Equivalent capacitance is

1/Ceq=(1/C1+1/C2+1/C3)

Ceq= (C1*C2*C3)+(C1+C2+C3)

Capacitance in parallel….

When capacitances C1,C2 ,C3 are connected in parallel , the Equivalent capacitance is

Ceq=C1+C2+C3

Ø Capacitor blocks DC but passes AC

The power P transferred by a capacitance C holding a changing voltage V with charge Q is:
P = VI = CV(dv/dt) = Q(dv/dt) = Q(dq/dt) / C


INDUCTANCE

Voltage-Current relationship…

V=L dI/dT where (dI/dT)=Change in current

Inductance in series…

When Inductors L1, L2, L3 are connected in series the equivalent inductance

Leq=L1+L2+L3

When two coupled inductances L1 and L2 with mutual inductance M are connected in series, the total inductance Lt is:
Lt = L1 + L2 ± 2M
The plus or minus sign indicates that the coupling is either additive or subtractive, depending on the connection polarity.

Inductance in parallel...

When inductance L1,L2,L3 are connected in parallel ,their equivalent inductance

1/Leq = (1/L1+1/L2+1/L3)

Leq = (L1*L2*L3)/L1+L2+L3

The power P transferred by an inductance L carrying a changing current I with magnetic linkage Y is:
P = VI = LI(di/dt) = Y(di/dt) = Y(dy/dt) / L

The energy W stored in an inductance L carrying current I with magnetic linkage Y is:
W = LI2 / 2 = YI / 2 = Y2 / 2L


Voltmeter Multiplier

The resistance RS to be connected in series with a voltmeter of full scale voltage VV and full scale current drain IV to increase the full scale voltage to V is:
RS = (V - VV) / IV

The power P dissipated by the resistance RS with voltage drop (V - VV) carrying current IV is:
P = (V - VV)2 / RS = (V - VV)IV = IV2RS


Ammeter Shunt

The resistance RP to be connected in parallel with an ammeter of full scale current IA and full scale voltage drop VA to increase the full scale current to I is:
RP = VA / (I - IA)

The power P dissipated by the resistance RP with voltage drop VA carrying current (I - IA) is:
P = VA2 / RP = VA(I - IA) = (I - IA)2RP


Wheatstone Bridge

The Wheatstone Bridge consists of two resistive potential dividers connected to a common voltage source. If one potential divider has resistances R1 and R2 in series and the other potential divider has resistances R3 and R4 in series, with R1 and R3 connected to one side of the voltage source and R2 and R4 connected to the other side of the voltage source, then at the balance point where the two resistively divided voltages are equal:
R1 / R2 = R3 / R4

If the value of resistance R4 is unknown and the values of resistances R3, R2 and R1 at the balance point are known, then:
R4 = R3R2 / R1


Kennelly's Star-Delta Transformation

A star network of three impedances ZAN, ZBN and ZCN connected together at common node N can be transformed into a delta network of three impedances ZAB, ZBC and ZCA by the following equations:
ZAB = ZAN + ZBN + (ZANZBN / ZCN) = (ZANZBN + ZBNZCN + ZCNZAN) / ZCN
ZBC = ZBN + ZCN + (ZBNZCN / ZAN) = (ZANZBN + ZBNZCN + ZCNZAN) / ZAN
ZCA = ZCN + ZAN + (ZCNZAN / ZBN) = (ZANZBN + ZBNZCN + ZCNZAN) / ZBN

Similarly, using admittances:
YAB = YANYBN / (YAN + YBN + YCN)
YBC = YBNYCN / (YAN + YBN + YCN)
YCA = YCNYAN / (YAN + YBN + YCN)

In general terms:
Zdelta = (sum of Zstar pair products) / (opposite Zstar)
Ydelta = (adjacent Ystar pair product) / (sum of Ystar)


Kennelly's Delta-Star Transformation

A delta network of three impedances ZAB, ZBC and ZCA can be transformed into a star network of three impedances ZAN, ZBN and ZCN connected together at common node N by the following equations:
ZAN = ZCAZAB / (ZAB + ZBC + ZCA)
ZBN = ZABZBC / (ZAB + ZBC + ZCA)
ZCN = ZBCZCA / (ZAB + ZBC + ZCA)

Similarly, using admittances:
YAN = YCA + YAB + (YCAYAB / YBC) = (YABYBC + YBCYCA + YCAYAB) / YBC
YBN = YAB + YBC + (YABYBC / YCA) = (YABYBC + YBCYCA + YCAYAB) / YCA
YCN = YBC + YCA + (YBCYCA / YAB) = (YABYBC + YBCYCA + YCAYAB) / YAB

In general terms:
Zstar = (adjacent Zdelta pair product) / (sum of Zdelta)
Ystar = (sum of Ydelta pair products) / (opposite Ydelta)


KIRCHOFF’S LAW

Kirchhoff's Current Law
At any instant the sum of all the currents flowing into any circuit node is equal to the sum of all the currents flowing out of that node:
SIin = SIout

Similarly, at any instant the algebraic sum of all the currents at any circuit node is zero:
SI = 0

Kirchhoff's Voltage Law
At any instant the sum of all the voltage sources in any closed circuit is equal to the sum of all the voltage drops in that circuit:
SE = SIZ

Similarly, at any instant the algebraic sum of all the voltages around any closed circuit is zero:
SE - SIZ = 0

AC CIRCUITS

Impedance

The impedance Z of a resistance R in series with a reactance X is:
Z = R + jX

Rectangular and polar forms of impedance Z:
Z = R + jX = (R2 + X2)½Ðtan-1(X / R) = |Z|Ðf = |Z|cosf + j|Z|sinf

Addition of impedances Z1 and Z2:
Z1 + Z2 = (R1 + jX1) + (R2 + jX2) = (R1 + R2) + j(X1 + X2)

Subtraction of impedances Z1 and Z2:
Z1 - Z2 = (R1 + jX1) - (R2 + jX2) = (R1 - R2) + j(X1 - X2)

Multiplication of impedances Z1 and Z2:
Z1 * Z2 = |Z1|Ðf1 * |Z2|Ðf2 = ( |Z1| * |Z2| )Ð(f1 + f2)

Division of impedances Z1 and Z2:
Z1 / Z2 = |Z1|Ðf1 / |Z2|Ðf2 = ( |Z1| / |Z2| )Ð(f1 - f2)

In summary:
- use the rectangular form for addition and subtraction,
- use the polar form for multiplication and division.

Admittance

An impedance Z comprising a resistance R in series with a reactance X can be converted to an admittance Y comprising a conductance G in parallel with a susceptance B:
Y = Z -1 = 1 / (R + jX) = (R - jX) / (R2 + X2) = R / (R2 + X2) - jX / (R2 + X2) = G - jB
G = R / (R2 + X2) = R / |Z|2
B = X / (R2 + X2) = X / |Z|2
Using the polar form of impedance Z:
Y = 1 / |Z|Ðf = |Z| -1Ð-f = |Y|Ð-f = |Y|cosf - j|Y|sinf

Conversely, an admittance Y comprising a conductance G in parallel with a susceptance B can be converted to an impedance Z comprising a resistance R in series with a reactance X:
Z = Y -1 = 1 / (G - jB) = (G + jB) / (G2 + B2) = G / (G2 + B2) + jB / (G2 + B2) = R + jX
R = G / (G2 + B2) = G / |Y|2
X = B / (G2 + B2) = B / |Y|2
Using the polar form of admittance Y:
Z = 1 / |Y|Ð-f = |Y| -1Ðf = |Z|Ðf = |Z|cosf + j|Z|sinf

The total impedance ZS of impedances Z1, Z2, Z3,... connected in series is:
ZS = Z1 + Z1 + Z1 +...
The total admittance YP of admittances Y1, Y2, Y3,... connected in parallel is:
YP = Y1 + Y1 + Y1 +...

In summary:
- use impedances when operating on series circuits,
- use admittances when operating on parallel circuits.


Reactance

Inductive Reactance
The inductive reactance XL of an inductance L at angular frequency w and frequency f is:
XL = wL = 2pfL

For a sinusoidal current i of amplitude I and angular frequency w:
i = I sinwt
If sinusoidal current i is passed through an inductance L, the voltage e across the inductance is:
e = L di/dt = wLI coswt = XLI coswt

The current through an inductance lags the voltage across it by 90°.

Capacitive Reactance
The capacitive reactance XC of a capacitance C at angular frequency w and frequency f is:
XC = 1 / wC = 1 / 2pfC

For a sinusoidal voltage v of amplitude V and angular frequency w:
v = V sinwt
If sinusoidal voltage v is applied across a capacitance C, the current i through the capacitance is:
i = C dv/dt = wCV coswt = V coswt / XC

The current through a capacitance leads the voltage across it by 90°.


Resonance

Series Resonance
A series circuit comprising an inductance L, a resistance R and a capacitance C has an impedance ZS of:
ZS = R + j(XL - XC)
where XL = wL and XC = 1 / wC

At resonance, the imaginary part of ZS is zero:
XC = XL
ZSr = R
wr = (1 / LC)½ = 2pfr
The quality factor at resonance Qr is:
Qr = wrL / R = (L / CR2)½ = (1 / R )(L / C)½ = 1 / wrCR

Parallel resonance
A parallel circuit comprising an inductance L with a series resistance R, connected in parallel with a capacitance C, has an admittance YP of:
YP = 1 / (R + jXL) + 1 / (- jXC) = (R / (R2 + XL2)) - j(XL / (R2 + XL2) - 1 / XC)
where XL = wL and XC = 1 / wC

At resonance, the imaginary part of YP is zero:
XC = (R2 + XL2) / XL = XL + R2 / XL = XL(1 + R2 / XL2)
ZPr = YPr-1 = (R2 + XL2) / R = XLXC / R = L / CR
wr = (1 / LC - R2 / L2)½ = 2pfr
The quality factor at resonance Qr is:
Qr = wrL / R = (L / CR2 - 1)½ = (1 / R )(L / C - R2)½

Note that for the same values of L, R and C, the parallel resonance frequency is lower than the series resonance frequency, but if the ratio R / L is small then the parallel resonance frequency is close to the series resonance frequency.

Three Phase Power

For a balanced star connected load with line voltage Vline and line current Iline:
Vline = Ö3 Vphase
Iphase = Iline
Zphase = Vphase / Iphase = Vline / Ö3Iline
Sphase = 3VphaseIphase = Ö3VlineIline = Vline2 / Zphase = 3Iline2Zphase

For a balanced delta connected load with line voltage Vline and line current Iline:
Vphase = Vline
Iphase = Iline / Ö3
Zphase = Vphase / Iphase = Ö3Vline / Iline
Sphase = 3VphaseIphase = Ö3VlineIline = 3Vline2 / Zphase = Iline2Zphase

Power Triangle

There are Three kind of power i.e

True power is a function of a circuit's dissipative elements, usually resistances (R).

Reactive power is a function of a circuit's reactance (X).

Apparent power is a function of a circuit's total impedance (Z).

The relation between all the three of them are given as

P=True power , Measured in watts (W)

P = (I^2)*R

Q=Reactive power , Measured in Volt-Ampere-Reactive (VAR)

Q=(I^2)*X

S=Apparent power ,Measured in Volt-Amps (VA)

S=(I^2)*Z

TRANSFORMERS

Two types according to construction

1) Core type

2) Shell type

Induced EMF in the primary winding:

E1 = 4.44 * f * N1 * [Bm] * A

= 4.11 * f * N1 * [fi] Where N1=Number of turns in Primary winding

F=Frequency

[fi]=maximum flux in core

A=Area

[fi]=A*[Bm]

Form Factor = R.M.S Value/Average Value = 1.11

Transformation ratio :K=V2/V1

For an ideal two-winding transformer with primary voltage V1 applied across N1 primary turns and secondary voltage V2 appearing across N2 secondary turns:
V1 / V2 = N1 / N2
The primary current I1 and secondary current I2 are related by:
I1 / I2 = N2 / N1 = V2 / V1

For an ideal step-down auto-transformer with primary voltage V1 applied across (N1 + N2) primary turns and secondary voltage V2 appearing across N2 secondary turns:
V1 / V2 = (N1 + N2) / N2
The primary (input) current I1 and secondary (output) current I2 are related by:
I1 / I2 = N2 / (N1 + N2) = V2 / V1
Note that the winding current is I1 through the N1 section and (I2 - I1) through the N2 section.

For a single-phase transformer with rated primary voltage V1, rated primary current I1, rated secondary voltage V2 and rated secondary current I2, the volt-ampere rating S is:
S = V1I1 = V2I2

For a balanced m-phase transformer with rated primary phase voltage V1, rated primary current I1, rated secondary phase voltage V2 and rated secondary current I2, the voltampere rating S is:
S = mV1I1 = mV2I2

The primary circuit impedance Z1 referred to the secondary circuit for an ideal transformer with N1 primary turns and N2 secondary turns is:
Z12 = Z1(N2 / N1)2

The secondary circuit impedance Z2 referred to the primary circuit for an ideal transformer with N1 primary turns and N2 secondary turns is:
Z21 = Z2(N1 / N2)2

The voltage regulation DV2 of a transformer is the rise in secondary voltage which occurs when rated load is disconnected from the secondary with rated voltage applied to the primary. For a transformer with a secondary voltage E2 unloaded and V2 at rated load, the per-unit voltage regulation DV2pu is:
DV2pu = (E2 - V2) / V2
Note that the per-unit base voltage is usually V2 and not E2.

Tests done in a transformer…

1)Open circuit test (OC): Determines the core loss / High voltage left open

2)Closed circuit test (CC):

Losses in a transformer :

1) Core loss (Iron Loss) : Constant loss

1.1) Hysteresis loss: Wh=Bmax^1.6 * f ^ 2

1.2) Eddy Current loss: We=Bamx^2 * f ^ 2

2) Copper loss: I^2 * R loss. It is a variable loss

Voltage regulation