You are on page 1of 3

This paper describes a proportional-integral-derivative (PID) control system of DC motor based on an

Arduino Uno board. The dc motor speed measured by means of an encoder is controlled by varying
the voltage level applied by pulse with modulation (PWM). A graphical user interface (GUI) based
application is builded in LabVIEW environment to control Arduino Uno board. DC motor will move
with the speed set by the user either in LabVIEW or Arduino IDE. PID controller compares the actual
speed of the DC motor with the set speed and will try to minimize the error.

Proportional-Integral-Derivative (PID) control is the most common control algorithm used in industry
and has been universally accepted in industrial control. Proportional-Integral-Derivative (PID)
controllers are by far the most adopted controllers in industry owing to the advantageous
cost/benefit ratio that they are able to provide. In the last century, a large number of researchers
have considered them, and industrial products have improved their functionality significantly [1].
The basic idea is that the controller reads the system state by a sensor. Then it subtracts the
measurement from a desired reference to generate the error value [2].

Labview Interface for Embedded Platforms (LINX) by LabVIEW MakerHub, as the successor to
Labview Interface for Arduino (LIFA), provides easy access to control them based on NI-VISA drivers.
LabVIEW LINX Toolkit, is an add-on to LabVIEW that adds the tools for development with Raspberry
Pi, BeagleBoard and Arduino. LINX firmware needs to be uploaded to the board via USB interface. It
allows communication between PC, embedded platform, sensors and other devices interconnected
using USB, I2C and SPI to access analog/digital I/O pins and PWM pins [3], [4].

The speed of DC motors is controlled using pulse width modulation (PWM), a technique of rapidly
pulsing the power on and off. The percentage of time spent cycling the on/off ratio determines the
speed of the motor, e.g. if the power is cycled at 50% (half on, half off), then the motor will spin at
half the speed of 100% (fully on). Each pulse is so rapid that the motor appears to be continuously
spinning. A control system is an interconnection of components forming a system configuration that
will provide a desired system response. DC Motor will be interfaced with LabVIEW using ATmega 8A
Microcontroller. The role of Microcontroller is to pass the set speed to the DC motor using the PWM
pins and to get the data (speed) from the motor using encoder through Interrupt [].
Figure 1 shows the block diagram of the proposed system. It contains a personal computer (PC) with
LabVIEW graphical programming environment, GUI application, LINX and an Arduino Uno board, an
H-bridge motor driver and the DC motor with quadrature encoder.

Arduino can control the dc motor speed and take feedback from encoder. Moreover, the graphical
user interface based application implemented in LabVIEW is designed to control Arduino Uno, used
as data acquisition board. The acquired signal is send to the PC for display. The hardware
components and the LabVIEW software applications are described in detail below. The power
supply, 12V is to feed the dc motor through H-bridge.

In this research, the dc motor speed control is done with the help of an Arduino Uno
microcontroller. And then, in order to compensate the feedback signal, the encoder on DC motor is
used as a sensor. The system hardware shown in Figure 2 consists of fourth components, which are:
(1) Arduino Uno board, (2) H-bridge L298, (3) Power supply and (4) DC motor with encoder. The fifth
component is a PC and the Arduino board is connected to him. The gear motor is a powerful 12V
brushed DC motor with a 19:1 metal gearbox and an integrated quadrature encoder that provides a
resolution of 64 counts per revolution of the motor shaft.

The Arduino Uno is a low-cost, easy to use microcontroller development board, designed to develop
interactive sensor applications. It is based on Atmel ATmega328 microcontroller chip, running at
16Mhz with 32KB flash memory and 2KB of RAM. It has 20 digital input/output pins (of which 6 can
be used as PWM outputs and 6 can be used as analog inputs)[6].

The H-bridge L298 is used as motor driver to control the motor from LabVIEW via Arduino board. It
supply the DC motor and allows to drive motors in both directions, clockwise (CW) or counter-
clockwise (CCW), by reversing the polarity of the motor supply voltage. The main components are
four switching elements S1, S2, S3 and S4 (transistors), actuated diagonally. The block diagram of the
used H-bridge circuit is shown in Figure. 3.

The operation of an H-bridge circuit is described as follows. The motor has two leads. To turn the
motor in CW diretion, a positive voltage will be applied to the left lead, and the right lead should be
connected to ground. In this case S1 and S4 are switched on, and S2 and S3 are switched off. Inverse,
if we want to rotate the motor in CCW direction, S1 and S4 are switched off, and S2 and S3 are
switched on. The voltage polarity is reversed and this fact causes the motor to rotate in the opposite
direction.

A quadrature encoder is an incremental encoder with two output channels used in many general
automation applications where sensing the direction of movement and speed are required. Each
channel provides a specific number of equally spaced pulses per revolution and the direction of
motion is detected by the phase relationship of one channel leading or trailing the other channel.
Encoder speed can be determined by either of two methods: pulse counting or pulse timing.
The structure of the electromechanical system of a DC motor is shown in Figure, it includes the
armature current (ia), armature resistance (Ra), armature inductance (La), source voltage (va), back
emf voltage (Eb) torque on the motor shaft (TM), external resistance torque (load) (TL).

You might also like