Download table of contents

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Electronic engineering wikipedia , lookup

Mains electricity wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Resilient control systems wikipedia , lookup

Power engineering wikipedia , lookup

Buck converter wikipedia , lookup

Voltage optimisation wikipedia , lookup

Transistor wikipedia , lookup

Electrification wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Power MOSFET wikipedia , lookup

Alternating current wikipedia , lookup

Integrated circuit wikipedia , lookup

Electric motor wikipedia , lookup

Control system wikipedia , lookup

Brushless DC electric motor wikipedia , lookup

Rectiverter wikipedia , lookup

Immunity-aware programming wikipedia , lookup

AC motor wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Opto-isolator wikipedia , lookup

Induction motor wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Stepper motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Transcript
Speed and Direction Control
For a DC Motor
Final project report for the class of Electrical Machines
Submitted to
Dr. Mohammad Salah
Department of Mechatronics Engineering
The Hashemite University
By
Ali Hilmi Hadabeen
( 1031296 )
First Semester 2012/2013
ABSTRACT
Many systems have DC motor, and we need to control the direction and speed of rotation to
perform specific functions.
This project about interfacing the motor with the computer to make the controlling easy and
accurate .
ii
TABLE OF CONTENTS
ABSTRACT .................................................................................................................................... ii
TABLE OF CONTENTS ............................................................................................................... iii
LIST OF FIGURES ....................................................................................................................... iv
LIST OF TABLES ...........................................................................................................................v
SECTION 1: Introduction ................................................................................................................1
1.1 Problem Statement ............................................................................................................1
1.2 Scope and Objectives ........................................................................................................1
1.3 Motivations and Importance .............................................................................................1
1.4 Methodology and Implementation ....................................................................................2
SECTION 2: System Description and Design .................................................................................3
2.1 System Description and Components ...............................................................................3
2.2 System Design ..................................................................................................................3
2.3 Block Diagrams and Flowcharts .......................................................................................7
2.4 Drive Circuit .....................................................................................................................7
2.5 Calculations and Parts Selection .......................................................................................8
2.6 Final Design ....................................................................................................................10
SECTION 3: Discussion ................................................................................................................11
3.1 System Advantages and Disadvantages ..........................................................................11
REFERENCES ..............................................................................................................................12
iii
LIST OF FIGURES
Figure 2.2.1: Pin configuration of L239D............................. .........................................................4
Figure 2.2.2: connect the transistor to the Arduino..............................................................................4
Figure 2.2.3: LabVIEW Block Diagram.............................................................................................5
Figure 2.2.4: Front Panel....................................................................................................................6
Figure 2.2.5: System Flowcharts.........................................................................................................7
Figure 2.2.6: Final Design.....................................................................................................................10
iv
LIST OF TABLES
Table 2.2.1: output logic ..................................................................................................................8
v
SECTION 1: Introduction
1.1 Problem statement
Controlling the direction of the rotation of DC motor depend on the polarity of the power source, there
are many way to inverse the polarity but we need to choose one depend on digital signal, because we
need to control it by computer !.
To control the speed we need to control the current of the motor. But it need analog signal, And because
of using a computer as controller we should use appropriate PWM circuit !
1.2 Scope and Objectives
In this project we design an interfacing circuit to connect the motor with computer , and design a
program to control the motor.
Unfortunately, there is no feedback signal. We did not use sensor to measure the speed and
correct the system error!
1.3 Motivations and Importance
Controlling DC motor is an important part of Mechatronics major projects, the interfacing circuit
make it very easy to be in automatic system.
1
1.4 Methodology and Implementation
To connect the computer with the motor we should connect it to microcontroller first, to make a
continuous connection between the components, then we connect the motor to the
microcontroller.
The power supply of the motor should be separate from the power source of the microcontroller,
so we need to use IC that use an external power supply to run the motor but use a microcontroller
signal to control the direction.
The same thing for current, we use a transistor to control how much current pass throw the
circuit. The microcontroller control the current of the base which control the current between the
collector and emitter.
2
SECTION 2: System Description and Design
2.1 System Description and Components
We use a permanent magnet dc motor in our project, and the following components as
interfacing circuit :
• L239D DC motor drive.
• Arduino Microcontroller.
• TIP121 transistor .
And connect it to the computer, then we interfacing the Arduino microcontroller with LabVIEW
program. Finally, we design a program o control the motor.
2.2 System Design
as shown in Figure 2.2.1 the L239D chip can control two motor but we us it for one .
we connect the motor to the output pins ( pin number 3 and 6).
Vs ( pin 8) should be connect to the power source , we connect it to the microcontroller which
give 5V, and its enough to run the motor .
All GND pins (Arduino, L239D) connected together.
3
Figure 2.2.1: Pin configuration of L239D
Then we connect the TIP121 transistor as shown in Figure 2.2.2.
The Base pin connected to pin #3 in Arduino because it can provide analog signal, which will
use in controlling the speed.
Figure 2.2.2: connect the transistor to the Arduino
4
To control the Arduino we design a LabVIEW program with the Block Diagram shown in figure
2.2.3 and front panel shown in figure 2.2.4 .
Figure 2.2.3: LabVIEW Block Diagram
5
Figure 2.2.4: Front Panel
6
2.3 Block Diagrams and Flowcharts
The block diagram in figure 2.2.5 demonstrates the main components of the system, in addition
it
also
clarifies
how
each
component
is
interfaced
with
the
other
parts.
Figure 2.2.5: System Flowcharts
2.4 Drive Circuit
ENABLE (#1), INPUT1 (#2), and INPUT2 (#7) connected to the Arduino.
Digital signal will send to these pins , the output function shown in table 2.2.1
The codes sent from computer to Arduino will give a digital value ( 0,1) and that will determine the
direction of rotation .
Moving the knob in the front panel of the program will give the Arduino codes to send analog signal to
the base pin of the transistor that allow flowing current from collector to emitter depending on the current
of the base.
7
Pin 1
Pin 2
Pin 7
Function
High
Low
High
Turn clockwise
High
High
Low
Turn anti-clockwise
High
Low
Low
Stop
High
High
High
Stop
Low
Not applicable
Not applicable
Stop
Table 2.2.1: output logic
2.5 Calculations and Parts Selection
2.5.1 Arduino :
The key features of the Arduino are summarized as follows;
• 13 digital I/O pins (6 of which could be as PWM outputs).
• 6 analog inputs.
• USB connection.
• External power supply.
• 32 KB flash memory (2 KB are reserved for the bootloader).
• 1 KB EEPROM.
8
The open-source Arduino environment that can be downloaded from their website makes it easy to write
code and upload it to the controller. Different language programs can be used to program it.
The beauty of Arduino boards is how easy and straight forward using one can be, having all the I/O pins
with easy connections for rapid prototyping without the need to solder any wires, and a built-in
voltage regulator which makes it possible to connect external power sources without needing for any
extra components.
2.5.2 L239D:
this chip can use DC motors and power supplies of up to 36 Volts, and the chip can supply a maximum
current of 600mA per channel, the L293D chip is also a type of H-Bridge.
This means we can essentially reverse the direction of current and thus reverse the direction of the motor.
It works by having 4 elements in the circuit commonly known as corners: high side left, high side right,
low side right, and low side left. By using combinations of these, we are able to start, stop and reverse the
current. we could make this circuit out of relays but its easier to use an IC – The L293D chip is pretty
much 2 H-Bridge circuits, 1 per side of the chip or 1 per motor.
The bit we really care about in all of this is the 2 input pins per motor that do this logic and these, more
importantly for our needs, can be controlled from the Arduino board.
We also don’t have to worry about voltage regulation so much because it allows for 2 power sources – 1
direct source, upto 36V for the motors and the other, 5V, to control the IC which can be supplied from the
Arduino power supply since Arduino has built-in voltage regulator.
2.5.3 TIP121:
The TIP121 are really great for controlling high-power devices from microcontroller, The TIP121 can
handle switching up to 60V, and the amperage is limited to 5A, or up to 8A pulses of 300µs. that will give
us wide range to choose the motor.
2.5.4 Motor:
As we mention previously we have a wide range to choose ! but we choose 5 volte permanent magnet dc
motor to supply it from Arduino , so we did not use extra power source.
9
2.6 Final Design
The final design shown in Figure 2.2.6 show the complete connections between all component. After that
we upload a firmware on Arduino from LabVIEW files to complete the connections.
Figure 2.2.6: Final Design
10
SECTION 3: Discussions
3.1 System Advantages and Disadvantages
3.1.1 Advantages:
The interfacing with computer is a very important advantage, especially in automatic system , or in the
system that controlled by using the internet .
It is also easy to use different motors, because the components have a wide range of specifications, we
can add more motors with a little change in the system.
3.1.2 Disadvantages :
There is no speed sensor in this system, no feedback signal to correct the input value ,
No indication about real speed of the motor!
We can add speed sensor to the system easily, but it will increase the cost.
11
REFERENCES
• http://www.arduino.cc/
• https://decibel.ni.com
• http://www.alldatasheet.com
12