Download Full Document - Ahmet Özkurt`s Homepage

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

Distributed control system wikipedia , lookup

Mains electricity wikipedia , lookup

Opto-isolator wikipedia , lookup

Voltage optimisation wikipedia , lookup

Electric motor wikipedia , lookup

AC motor wikipedia , lookup

Brushless DC electric motor wikipedia , lookup

Induction motor wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Metadyne wikipedia , lookup

Immunity-aware programming wikipedia , lookup

Brushed DC electric motor wikipedia , lookup

Stepper motor wikipedia , lookup

Variable-frequency drive wikipedia , lookup

Rotary encoder wikipedia , lookup

Transcript
T.C.
DOKUZ EYLÜL UNIVERSITY
ENGINEERING FACULTY
ELECTRICAL & ELECTRONICS ENGINEERING
DEPARTMENT
MOBILE ROBOT LOCALIZATION with POSITION
CONTROL
Project Report
by
Ayhan ŞAVKLIYILDIZ - 2011502093
Burcu YELİS - 2010502069
Advisor
Yrd.Doç.Dr. Ahmet ÖZKURT
May,2015
IZMIR
ABSTRACT
The subject of this project is the motion control problem of wheeled mobile robots.
With reference to the unicycle kinematics, we review and compare several control strategies for trajectory tracking and pose stabilization in an environment free of obstacles.
Project is developed for a two-wheel differentially-driven mobile robot.
I
Contents
ABSTRACT
I
Contents
II
List of Tables
III
List of Figures
IV
1 INTRODUCTION
1
2 THE GOAL AND METHOD
2
2.1
Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
2.2
Reasons of Using Arduino . . . . . . . . . . . . . . . . . . . . . . . . . .
2
2.3
Hardware Components . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3
2.3.1
Arduino Mega 2560 . . . . . . . . . . . . . . . . . . . . . . . . .
3
2.3.2
L298N – Dual H- Bridge Motor Control . . . . . . . . . . . . . .
4
2.3.3
131:1 Metal Gearmotor 37Dx57L mm with 64 CPR Encoder . .
6
3 Algorithm
8
4 COST ANALYSIS
13
5 CONCLUSION
14
II
List of Tables
4.1
Cost Table
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
III
13
List of Figures
2.1
L298N – Dual H- Bridge Motor Control . . . . . . . . . . . . . . . . . .
4
2.2
Arduino Sketch Considerations . . . . . . . . . . . . . . . . . . . . . . .
6
2.3
131:1 Metal Gearmotor 37Dx57L mm with 64 CPR Encoder . . . . . . .
7
3.1
doEncoder() Function Algorithm . . . . . . . . . . . . . . . . . . . . . .
8
3.2
Mathematical expression for Pose of the Robot . . . . . . . . . . . . . .
8
3.3
doPose() Function Algorithm . . . . . . . . . . . . . . . . . . . . . . . .
9
3.4
doForward() Function Algorithm . . . . . . . . . . . . . . . . . . . . . .
9
IV
1. INTRODUCTION
Wheeled mobile robots are increasingly present in industrial and service robotics, particularly when flexible motion capabilities are required on reasonably smooth grounds
and surfaces. Several mobility configurations (wheel number and type, their location
and actuation, single- or multi-body vehicle structure) can be found in the applications.
The most common for single-body robots are differential drive and synchro drive (both
kinematically equivalent to a unicycle), tricycle or car-like drive, and omnidirectional
steering.
Beyond the relevance in applications, the problem of autonomous motion planning
and control of robots have some theoretical challenges. In particular, these systems are
a typical example of nonholonomic mechanisms due to the perfect rolling constraints
on the wheel motion.
In the absence of workspace obstacles, the basic motion tasks assigned to a wheel
mobile robot may be reduced to moving between two robot postures and following
a given trajectory. The robot position control indicates that the problem is truly
nonlinear; linear control is ineffective, even locally.
So the aim of this project is to provide robot position control in a theoretical approaches that reduce the errors.
1
2. THE GOAL AND METHOD
The goal of this project is designing a low-cost robot which has position control. In
this project, a robot which already exists in the school, was used. The goal is to:
• Research and choose small size and good features of hardware parts.
• Implement the system as fast as possible with cheap parts.
• Write the algorithm with minimax principle.
In this project, Arduino program was used for software implementation.
2.1
Arduino
Arduino is an open-source physical computing platform based on a simple microcontroller board, and a development for uploading software for the board.
Position control,pose setting and motor controller algorithm will be programmed on
Arduino.
2.2
Reasons of Using Arduino
• Arduino boards are inexpensive.
• The Arduino software runs on Windows, Macintosh OSX and Linux operating
system. A great majority of microcontroller systems are limited to Windows.
• The Arduino programming is easy-to-use.
• The Arduino software has open source tools and can be expanded.
• The Arduino hardware can be expanded.
2
2.3
2.3.1
Hardware Components
Arduino Mega 2560
Arduino is a very popular and easy to use programmable board for creating your
own projects. Consisting of a simple hardware platform and a free source code editor
with an easy “one-click compile/upload” feature, it’s designed to be really easy to use
without being an expert programmer.
Arduino is also the most popular microcontroller board for advanced users and all
kinds of more ambitious projects. It’s been used to make robots, home automation gadgets, automotive projects, for sensing and controlling lights, motors, locks and servos,
sound and video, interactive objects like animated sculptures, toys and games, radio
links and just about anything else you can dream up. It can even be a web server and
connect your projects to the Internet. A huge number of example projects (including
both hardware designs and software source code) are available to help beginners get
started.
3
2.3.2
L298N – Dual H- Bridge Motor Control
An H-Bridge is a circuit that can drive a current in either polarity and be controlled
by Pulse Width Modulation (PWM).
Pulse Width Modulation is a means in controlling the duration of an electronic
pulse. In motors try to imagine the brush as a water wheel and electrons as a the
flowing droplets of water. The voltage would be the water flowing over the wheel at
a constant rate, the more water flowing the higher the voltage. Motors are rated at
certain voltages and can be damaged if the voltage is applied to heavily or if it is
dropped quickly to slow the motor down. Thus PWM. Take the water wheel analogy
and think of the water hitting it in pulses but at a constant flow. The longer the pulses
the faster the wheel will turn, the shorter the pulses, the slower the water wheel will
turn. Motors will last much longer and be more reliable if controlled through PWM.
Figure 2.1: L298N – Dual H- Bridge Motor Control
4
Pins:
• Out 1: Motor A lead out
• Out 2: Motor A lead out
• Out 3: Motor B lead out
• Out 4: Mo (Can actually be from 5v-35v, just marked as 12v)
• GND: Ground
• 5v: 5v input (unnecessary if your power source is 7v-35v, if the power source is
7v-35v then it can act as a 5v out)
• EnA: Enables PWM signal for Motor A (Please see the ”Arduino Sketch Considerations” section)
• In1: Enable Motor A
• In2: Enable Motor A
• In3: Enable Motor B
• In4: Enable Motor B
• EnB: Enables PWM signal for Motor B
Specifications:
• Double H bridge Drive Chip: L298N
• Logical voltage: 5V Drive voltage: 5V-35V
• Logical current: 0-36mA Drive current: 2A (MAX single bridge)
• Max power: 25W
• Dimensions: 43 x 43 x 26mm
• Weight: 26g
5
Figure 2.2: Arduino Sketch Considerations
2.3.3
131:1 Metal Gearmotor 37Dx57L mm with 64 CPR Encoder
This powerful is a brushed DC gearmotor that have hardware features an integrated
quadrature encoder with 64 counts per revolution (CPR) of the motor shaft. DC
motors are intended for use at 12 V, though in general, these kinds of motors can run
at voltages above and below the nominal voltage (they can begin rotating at voltages
as low as 1 V). Lower voltages might not be practical, and higher voltages could start
negatively affecting the life of the motor.
Using the Encoder
A two-channel Hall effect encoder is used to sense the rotation of a magnetic disk on
a rear protrusion of the motor shaft. The quadrature encoder provides a resolution of
64 counts per revolution of the motor shaft when counting both edges of both channels.
To compute the counts per revolution of the gearbox output, multiply the gear ratio
by 64. The motor/encoder has six color-coded, 11 (28 cm) leads terminated by a 1*6
female header with a 0.1 pitch. This header works with standard 0.1 male headers and
our male jumper and precrimped wires. If this header is not convenient for your
application, you can pull the crimped wires out of the header or cut the header off. The
following table describes the wire functions:
6
Figure 2.3: 131:1 Metal Gearmotor 37Dx57L mm with 64 CPR Encoder
Cable Color and Names:
• Red : motor (connects to one motor terminal)
• Black : motor (connects to the other motor terminal)
• Green: encoder GND
• Blue : encoder Vcc (3.5 – 20V)
• Yellow : encoder A output
• White : encoder B output
The Hall sensor requires an input voltage, Vcc, between 3.5 and 20 V and draws a
maximum of 10 mA. The A and B outputs are square waves from 0 V to Vcc approximately 90 degree out of phase. The frequency of the transitions tells you the speed of
the motor, and the order of the transitions tells you the direction.
7
3. Algorithm
In this project, whole algorithm was written by us. Firstly, encoder output has
been tested. Because encoder CPR(counter per revolute) values did not fit to encoder
datasheet values. Hence, according to these measured counter values doEncoder() function was constructed.
After doEncoder() function construction, interrupts were attached to the digital
pins(2 and 3) of the Arduino Mega and interrupts were written in the initialization
of the program. The encoder algorithm was shown in below figure:
Figure 3.1: doEncoder() Function Algorithm
Secondly doPose() and doForward() function was constructed according to desired
coordinate points by using the mathematical expression below:
Figure 3.2: Mathematical expression for Pose of the Robot
8
Pose function was shown in below figure:
Figure 3.3: doPose() Function Algorithm
Forward function was shown in below figure:
Figure 3.4: doForward() Function Algorithm
9
The main program is given below figure:
10
11
12
4. COST ANALYSIS
Product
Arduino Mega
Motor Driver L298N
DC Brushed Motor with Encoder
Other Materials
Total
Quantity
1
1
2
-
Unit
70
20
80
Table 4.1: Cost Table
13
Price
TL
TL
TL
-
Total Price;
70 TL;
20 TL;
160 TL ;
20 TL ;
270 TL;
5. CONCLUSION
Every project progresses in the direction of theory. But the theoretical procedure
might change with economical and environmental reasons. In order not to run into
a problem, theoretical procedure has to be prepared with regard to economical and
environmental reasons.
In this paper, the road map has been explained as a process of the project. The
software part of the robot has been researched and explained. Pose function, forward
function,mathematical expressions, encoder function have been mentioned. Arduino
has been mentioned related to the software part which based on Arduino microcontroller.
The challenging part of this project is to reading the encoder counts, mathematical
expressions and wheel errors. In this point, hardware implementation calculations
should be sensitive for the main program was written in a good looped algorithm.
14