Documente Academic
Documente Profesional
Documente Cultură
Brushed
DC Motor
By
Mr.Shoaib Naseem
Table of Contents
Abstract......................................................................................................................................ii
Objective....................................................................................................................................1
Introduction................................................................................................................................1
Componenet List........................................................................................................................2
Appendix A................................................................................................................................3
Program Code...........................................................................................3
ABSTRACT
This report provides a technical review for position and speed control of a
Brushed DC motor drive, including the background analysis using sensors and
its limitation. The goal is to improve the overall efficiency of system by
individually tackling the accuracy and repeatibility of system.The speed of the
DC motor is varied using the pwm pins of arduino in a open loop system.The
close loop control acquires a feed back from the rotary optical encoder which in
turn is fed to PID controller to achieve a steady accurate output value.
OBJECTIVE
The objective of this experimentation is to achieve optimal control over
the speed and position of of DC motor with highly effiecient performance.
INTRODUCTION
The speed control of a motor is frequently required in industrial
applications, robotics, home appliances, etc. The idea of a speed control system
is to maintain the speed of the motor at the desired value under various
condition. In this report, we have implemented a DC motor speed control system.
The speed of dc motor is directly proportional to the supply voltage.If the
supply voltage is varied ,the speed of motor varies as well.The variability in input
voltage is achieved though pulse width modulation (pwm) pins of an arduino.The
pwm signal is provided to L298 Dual H-bridge IC which inturns provides the
motor with a proportional voltage to the dutycyle from the Supply Voltage.
In the closed loop system ,the speed of motor is controlled through PID
controller. In practice, the DC motor is a nonlinear device and its speed varies
because of change in load demand, disturbances,etc. We have implemented the
PID controller algorithm which is a popular controller in industries. The motor
speed is sensed and calculated through by an optical rotary encode and
converted to feedback voltage. It is compared with the reference signal (i.e.
desired speed) by the error detector. The PID controller acts on the error signal
and generates appropriate control voltage. The PWM generator block than varies
the duty cycle of the voltage supplied to the motor to control its speed.Figure 1
shows the the overall schematic of the system.
COMPONENT LIST
Table 1.
S.No
Components
Quantity
Brushed DC Motor
01
Arduin UNO
01
01
Voltage Regulator
01
01
01
APPENDIX A
PROGRAM CODE
/*
IBT-2 1 Motor Control Board driven by Arduino with no motor reverse function.
Optical encoder board is FC-02 v2.0 twin encoder version and is connected to
Ardiuno pin 2 as only one encoder required
RPM read from optical encoder and use as feedback for PID calculation routine.
3
*/
CapTime = 0;
LastCapTime = 0;
//Controller Parameter
kp = 1.00; ki = 0.00; kd = 0.00; // Only using process part of PID routine at
present
Output = 0;
Serial.begin (9600);
}
//Interrupt subroutine function
void doEncoder(){
LastCapTime = CapTime;
CapTime = millis();
}
else{
Freq = 1000/(double)duration; //in Hz unit
}
PV = Freq*60/8; // Rpm unit '8' used in formula as there are 4 interupts per
revolution on encoder disk
compute(ref, PV); // Find controller output
sendCommand(Output); // Send command to DC motor
lastTime = now;
}
//Receive Command
byte val;
if(Serial.available()){
val = Serial.read();
switch (val) {
case 'A': ref = 0; break;
case 'W': ref += 50; break;
case 'S': ref -= 50; break;
case 'O': kp+=0.01;
Serial.println(kp); break;
case 'L': kp-=0.01;
Serial.println(kp); break;
case 'I': ki+=0.01;
Serial.println(ki); break;
case 'K': ki-=0.01;
Serial.println(ki); break;
case 'U': kd+=0.001;
Serial.println(kd); break;
6
count = 0;
}
7
else{
count++;
}
}
//The "sendCommand" function
void sendCommand(int cmd){
if(cmd>0) {
analogWrite(MotorPWM, cmd);
//digitalWrite(MotorIN_1,LOW);
//digitalWrite(MotorIN_2,HIGH);
}
else if(cmd<0){
analogWrite(MotorPWM, -cmd);
//digitalWrite(MotorIN_1,HIGH);
//digitalWrite(MotorIN_2,LOW);
}
else{
analogWrite(MotorPWM, 0);
//digitalWrite(MotorIN_1,LOW);
//digitalWrite(MotorIN_2,LOW);
}
}