Vous êtes sur la page 1sur 9

De La Salle University Science and

Technology Complex

Application
of PID
Controller
A self-balancing pole using angle sensor
and microprocessor

Adrian Abiera, Levin Cruz, Dino Ligutan, Jonathan


Macaraig

I.

Introduction

Our project is an application of controlling a DC motor. In this project, a


Proportional-Integral-Derivative (PID) controller design for a DC motor angular
position control was made using the MPU-6050 sensor and the GizDuino v4.1
microcontroller. In controlling DC motor angular position systems, PID control
algorithms with coefficients tuned for optimizing operation are used. What the
PID controller does is to control the position and maintain it at a certain point
and be able to accept new set-point values dynamically. Modern position control
environments require controllers that are able to cope with parameter variations
and system uncertainties. Basically, when the motor is turned into any angle, it
would then return to its reference angle which is at 0 degrees.

II.

Theoretical Framework

Figure 2.1. The MPU-6050 angle sensor


The MPU-6050 is a 6 DOF (Degrees of Freedom) or a six axis IMU sensor,
which means that it gives six values as output. Three values from the accelerometer
and three from the gyroscope. The MPU 6050 is a sensor based on MEMS (Micro
Electro Mechanical Systems) technology. Both the accelerometer and the gyroscope
is embedded inside a single chip.
Part/Item
VDD
VLOGIC
Serial Interface Supported
PIN 8
PIN 9
PIN 23
PIN 24

MPU 6050
2.375-3.46 V
1.71V to VDD
I2C
VLOGIC
AD0
SCL
SDA

Figure 2.2. The Gizduino board


It is a tool for implementing a program you have designed. Gizduino is
programmed using the IDE (Integrated Development Environment). With Serial RXTX disable switch. Atmega168P ICs are low power but its also the same functions of
ATmega168 IC.
Part/Item
Power Input
Microcontroller
Debugger Port
I/O Port
DC Power Output
On-board Crystal
PCB dimension
III.

gizDuino V4.1
External: 8-12 V USB: 5V
ATmega 168/168P
ICSP
20 I/Os
3.3V
16MHz and 12 MHz
2.7 x 2.1 in

Methodology
1. The MPU-6050 sensor is attached to a small PCB assembly to hold
interconnecting wires. The small PCB assembly is attached to a pole that
must be made to stay in upright position by the DC motor.
2. The pole is attached to the shaft of a DC motor. The DC motor is then
attached to a frame to be mounted on a breadboard.
3. The terminals of a DC motor are connected to the output of the H-bridge
motor driver circuit.
4. The control terminals of the motor driver circuit is then attached to Arduino
digital out pin 9 and 11. The two pins corresponds to forward and reverse
motor operation.
5. The potentiometers for proportional, integral, derivative and set point
control are then attached to Arduino analog input pins A0 to A3 respectively.

6. All components are placed on a standard size breadboard connected to a


power supply. The Arduino board is to be powered by a USB printer cable
attached to the computer.
7. The Arduino microcontroller is to be programed by a computer to perform
the necessary control of DC motor.

Block Diagram
Arduino

Reference
Angle

Motor
Driver Circuit

DC Motor

MPU 6050
(Angle
Sensor)
Figure 3.1. Block diagram of the system

Schematic Diagram

Figure 3.2. Schematic diagram of the system

IV.

Experimental Setup
a. Components
i. DC motor
ii. MPU-6050 (Angle Sensor)
iii. 4 - 100K Potentiometer
iv. Motor Driver Circuit
v. Arduino
b. Actual circuit

Figure 4.1. Right side view of the system

Figure 4.2. Top view of the system


V.

Data & Results

Figure 5.1. The response of the system when the stick is initially on the left
side.

Figure 5.2. The response of the system when the stick is initially on the
right side.

Figure 5.3. The response of the system subjected to disturbances.


Figure 5.1 shows the response of the system when the stick initially
points to the left side. Notice the fast response of the system as the angle
is quickly reduced close to zero. By defining the response time as the time
it took for the angle from

90 ( 10.1 ) =81

to

90 ( 10.9 )=9 , the

response time is approximately 327 ms. The response curve does not
manifest any overshoot or oscillations, but is not yet zero. The error is
made smaller as time progresses due to the integral action.
Figure 5.2 shows the response of the system when the stick initially
points to the left side. Notice again the fast response of the system as the
angle is quickly reduced close to zero. By the same definition of response
time as given above, the response time is approximately 134 ms. The
response time is smaller than is shown in Fig. 5.1, but notice that there is
a manifestation of an overshoot. The overshoot made the angle less than
the reference angle but it is made closer to zero as time progresses due to
the integral action.
Figure 5.3 shows the response of the system when already stabilized to
reference angle. At about

t=2.5 s , a rightward impulse disturbance was

subjected to the system by forcing the stick to move to the right. Notice
the quick response and the oscillatory motion as the system tries to bring
back the stick to upright position. When the stick is forced to move to the

left at about

t=5.9 s , no oscillatory motion occurs but it takes more time

for the system to take the stick back to upright position again. The
asymmetry of these results is due to the characteristics of the DC motor
itself as discussed in the previous paragraph.

VI.

Conclusion & Recommendations


The group was able to construct a system that can balance a pole on
an upright position regardless of the initial position. The control was
achieved by designing a feedback system to ensure that the required
response of the system is met. The Arduino board can be used as a PID
controller to implement a digital PID that is still capable of controlling the
response of the DC motor through pulse width modulation technique. The
setting of proportional, integral and derivative constants were set to 200,
15 and 11 respectively to obtain a fast time response and minimize the
overshoot. However, the system is asymmetrical in terms of its output due
to the characteristics of the DC motor.
In order to improve upon the system, the DC motor may be replaced
by a type of DC motor whose characteristics allows it to move at any
angle freely so that the asymmetrical response can be eliminated.
Furthermore, a smaller sampling time is necessary to ensure that the
errors can be eliminated arbitrarily. A more efficient algorithm must be
developed that can obtain more samples from the angle sensor in a short
amount of time.

Vous aimerez peut-être aussi