Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Linear Control Systems

(EE-333)

Complex Engineering Problem


Spring 2019

PROJECT COMPONENTS:
 Arduino UNO - Microcontroller
 IR sensor
 DC Motor
 Weight: 54 grams
 Features 2 threaded mounting holes
 Can be operated in either direction, simply reverse power supply
polarity

PROJECT WORKING:
 Motor is connected to supply.
 Microcontroller is connected by PC which is operating on a given
code.
 A motor with a two pole armature and magnetic stator.
 The + and – signs shows where the current is applied to the
commutator which supplies the current.
 IR sensor takes input from the motor and give output to the
arduino.
 Code processes, output rpm on serial monitor

LEFT CENTER RIGHT


LED Di-electric barrier IR Sensor

USED PINS:
1: vcc+5
2: ground
3: Connected to arduino
4: not connected – analog output

LabVIEW:
CODE:

//EE_wave
//RPM_meter

double rpm ;
unsigned long oldtime =0;
unsigned long t;
const int dataIN = 2;
boolean something;
boolean prev;

void setup()
{
pinMode(dataIN,INPUT);
Serial.begin(115200);
attachInterrupt(0,isr,CHANGE); //attaching the interrupt
}

void loop()
{
//delay(1000);
}

void isr() //interrupt service routine, only in pin number 2


or pin number 3
{
//detachInterrupt(0);
something = digitalRead(dataIN);
if (prev != something)
{if (something == HIGH)
{
t = millis()-oldtime; //finding total time for one rev
oldtime = millis();
rpm=(60000/t);
}
prev = something;
}
if (Serial.available() > 0)
{
char inbyte=Serial.read();
if (inbyte=='D')
{
Serial.print("DSU");
Serial.print(rpm);
Serial.println("DSU");
}
}
}

TRANSFER FUNCTION:
K/(TS+1)
K=DEL(Y)
K=(5000-0)
K=5000
Y(t)=0.63(K)+Yo
Y(t)=0.63(5000) +Yo
Y(t)=3510
From graph
At,
y-axis:Y(t)=3510
X-axis=0.6
T=t1-t0
T=0.6-0
T=0.6sec

T.F=5000/(0.6S+1)

Flow Chart:

START

void void loop()


setup()
void isr()

T = mills-
oldtime()

if(serial.available()
>0)

if(inbyte = = ‘D’)

RPM
MATLAB:

close all
clear all
a=xlsread('lvtemporary_113904.tmp.xlsx')
x=a(:,1)
y=a(:,2)
num=[5000]
den=[0.6 1]
g=tf(num,den)
step (g)
hold on
plot(x,y)

You might also like