0% found this document useful (0 votes)
276 views10 pages

Speed of Control of Motor Arduino Matlab Simulation PDF

The document summarizes a research paper that presents a speed control system for a DC motor using an Arduino microcontroller programmed through MATLAB Simulink. Some key points: - The system uses an Arduino Uno board programmed via Simulink to generate PWM signals to control the speed and direction of a DC motor connected to an L293D motor driver. - It aims to provide a low-cost control system without the need for expensive data acquisition devices (DAQs) by taking advantage of Arduino's programmability and Simulink modeling. - The paper describes implementing the system and performing live speed control of the motor from Simulink through the Arduino board.

Uploaded by

vince kafua
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
276 views10 pages

Speed of Control of Motor Arduino Matlab Simulation PDF

The document summarizes a research paper that presents a speed control system for a DC motor using an Arduino microcontroller programmed through MATLAB Simulink. Some key points: - The system uses an Arduino Uno board programmed via Simulink to generate PWM signals to control the speed and direction of a DC motor connected to an L293D motor driver. - It aims to provide a low-cost control system without the need for expensive data acquisition devices (DAQs) by taking advantage of Arduino's programmability and Simulink modeling. - The paper describes implementing the system and performing live speed control of the motor from Simulink through the Arduino board.

Uploaded by

vince kafua
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

Journal of Analysis and Computation (JAC)

(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861


Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal

SPEED CONTROL OF DC MOTOR BY USING ARDUINO THROUGH


MATLAB SIMULATION
1M.Midhun,2U.Naresh Babu ,3M.Sasank, 4M.Nikhilesh,5B.Saran, 6Ch.Nanaji
1,3,4,5,6
UG Scholar, Dept. of EEE, Narayana Engineering College, Nellore, A.P., INDIA
2
Assoc. Professor, Dept. of EEE, Narayana Engineering College, Nellore, A.P., INDIA.
ABSTRACT:
Now a days the practical control systems are connected to a computer through expensive DAQ’s.
When DAQ’s are updated, it implies a very high cost and difficulties are bigger. The problem of
control practices using Analog control DAQ’s is difficult to achieve a required frequency pulse and
also in Digital control DAQ’s the coding is necessary. New Arduino based DAQ must be adopted for
control systems in order to avoid hardware changes. These ARDUINO boards are used to perform a
specific task by means of embedded C programming in ARDUINO IDE and also be programmed by
using Simulink in MATLAB. By using ARDUINO boards we can implement the modern control
techniques and by developer boards we can have communication with mobile using Bluetooth modules
or by WIFI or Ethernet cable to connect to internet also. By applying this technology to machines, we
can achieve smooth control on machines. In this project the control system consists of Computer with
Matlab Simulink software used to program Arduino board by the base of this we can control the speed
and direction of the DC Motor with PWM Technique.

keywords – DAQ’s, Arduino, Matlab Simulation, DC Motor.

I. INTRODUCTION
The main Objective of this work is to use low cost hardware, to connect Simulink with a real system[1].
Nowadays, the practical prototypes are connected to a computer through expensive DAQs. When computers or
DAQs are updated, it implies a very high cost. In the case of internal DAQs, connected on an internal bus of the
computer, the difficulties are bigger. New Arduino based DAQ must be adapted to the lab prototypes in order to
avoid hardware changes or modifications on it[2].
II. EXISTING SYSTEM
The problem of control practices using analog circuits is difficult. For example usage of IC555 timers in
control practices. In IC555 timers the availability of RC combination circuits are difficult to achieve a required
frequency pulse. So we cannot get the effective control of speed from these circuits and designing of circuits is
also difficult. In digital control practices microcontrollers and microprocessors can be used for effective control,
but the problem lies in coding of microcontrollers and microprocessors, which requires knowledge of embedded C
or python, etc. and depth knowledge on architecture of microcontrollers. Thus in this paper we concerned about
speed control of DC motor as main objective.
DRAWBACKS OF ANALOG SYSTEM:
➢ It requires more analog components.
➢ It has complex circuitry for implementing efficient algorithms.
➢ It is hard to find faults in analog systems
➢ Once an analog circuit is designed for a specified task, it cannot be used for other tasks.
➢ Communication devices cannot be added to analog systems

DRAWBACKS OF DIGITAL SYSTEMS :

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 1


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
➢ Digital system provides superior performance then analog systems.
➢ But to use the digital system we need to have a good microcontroller programming knowledge.
➢ It is hard to learn and implement.
➢ Live monitoring of system using microcontroller is difficult by using normal software.
III.PROPOSED SYSTEM
The proposed system consists of PC with Simulink (Simulink support packages for Arduino) used to
program Arduino Uno the microcontroller board Arduino Uno powered with AT Mega 328 microcontroller[3]. We
have designed a H-bridge motor driver for speed and direction control of DC motor. By the Arduino board and to
provide PWM signals to the motor driver L293D[4].
For the Controlling we have a DC motor with IR sensor based quadrature encoder used to detect speed
and direction of motor[5]. Here we used the feedback to calculate only the speed and direction reversal is shown
by using voltmeter in DMM (Digital Multi Meter).
OBJECTIVE:
i. To vary the speed of DC motor by using Pulse Width Modulation technique.
ii. We can reach required variable speed with better performance.
iii. Reduce the cost occurred for the controlling as well as operating of Geared DC motor.
iv. For controlling purpose it is easy and consuming less time.
v. Operation is flexible.
vi. Based on PWM pins we can control any number of DC motors simultaneously.
SCOPE:
i. Design an adjustable speed control system of DC motor by using micro controller programmed by
Simulink.
ii. Build hardware for the system.
iii. Live control of hardware can be done by Simulink.
IV. COMPLETE HARDWARE IMPLEMENTATION
The figure shown below is the hardware implementation diagram, the main component in controlling the motor is
motor driver, it is capable of controlling both the speed and direction of motor.

Figure 4.1: Complete Hardware Implementation Diagram

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 2


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
ARDUINO UNO 328 :
Arduino is a single-board microcontroller meant to make the application more accessible which are
interactive objects and its surroundings. The hardware features with an open-source hardware board designed
around an 8-bit Atmel AVR microcontroller or a 32-bit Atmel ARM. Current models consists a USB interface, 6
analog input pins and 14 digital I/O pins that allows the user to attach various extension boards[6].

Figure 4.2: Arduino Uno Developer Board


TECHNICAL SPECIFICATION:

Microcontroller ATmega328
Operating Voltage 5V
Input Voltage 7-12V
Input Voltage (limit) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 Ma
DC Current for 3.3V Pin 50 Ma
Flash Memory 32 KB of which 0.5 KB used by boot loader
SRAM 2KB
EEPROM 1 KB
Clock Speed 16 MHz
LED_BUILTIN 13
Operating Temperature -40°C to +105°C
CPU Speed 1MIPS for 1MHz

Table 4.1: Specification of Arduino UNO 328

V. PROGRAMMING ARDUINO USING SIMULINK SUPPORT PACKAGES

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 3


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
1. SIMULINK SUPPORT PACKAGES FOR ARDUINO
To use the Simulink for programming Arduino we need have Simulink support packages for Arduino
INSTALL, UPDATE, OR UNINSTALL SUPPORT PACKAGE:
INSTALL SUPPORT PACKAGE:
1. On the MATLAB Home tab, in the Environment section, click Add-Ons > Get Hardware Support
Packages.

2. In the Add-On Manager window, find and click the support package, and then click Install.

UNINSTALL SUPPORT PACKAGE:

1. On the MATLAB Home tab, in the Environment section, click Add-Ons > Manage Add-Ons.

2. In the Add-On Manager window, find and click the support package, and then click Uninstall.

COMPLETE ADDITIONAL SETUP TASKS:

If you clicked Setup Later at the end of the Add-On Manager Installation process, you can restart hardware setup
process.

• On the MATLAB Home tab, in the Environment section, click Add-Ons > Manage Add-Ons.
When the Add-On Manager opens, click Setup

• Enter target updater in the MATLAB Command Window.

GETTING STARTED WITH ARDUINO HARDWARE:


Simulink Support Package for Arduino Hardware enables you to create and run Simulink models on
Arduino board. The target includes a library of Simulink blocks for configuring and accessing Arduino sensors,
actuators and communication interfaces. Additionally, the target enables you to monitor and tune algorithms
running on Arduino board from the same Simulink models from which you developed the algorithms[1].

Figure 5.1: Simulink blocks for Arduino

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 4


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal

VI .SIMULINK CODE FOR ARDUINO

SIMULINK MODEL FOR MOTOR CONTROL :

In this model the duty ratio can be taken from two sources but using control switch related to subsystem1either of
the source is selected based on the requirement. The duty ratio is given to the Direction and ON/OFF controller
and based on the direction and enable switches it forwards the duty ratio to the motor driver then motor drives
gives duty ratio to the Arduino PWM block. Then Arduino produces PWM signals to the Motor Drive.

Figure 6.1: Simulink Code for motor control

DIRECTION AND ON/OFF CONTROLLER BLOCK :

Figure 6.2: Directions and ON/OFF Controller block

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 5


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
In this block the duty ratio from either Simulink constant source or potentiometer is fed to out1 or out2
port based on the condition of ENABLE and DIRECTION input port values, which are controlled by the switches
ENABLE SWITCH and DIRECTION SWITCH.

MOTOR DRIVER BLOCK:

Figure 6.3: Motor Driver block

In this block the duty ratio is send to PWM block of Simulink Support packages. In between that a
limiter is used to limit duty ratio value in between 0 & 100. Then a Gain block is placed with a value of ‘2.55’ ,it
helps in conversion of duty ratio (0 to 100) to PWM block working range of 0 to 255. E.g. If we want produce a
PWM signal of duty ratio 25% , then 25*2.55 is fed to the PWM block.

ENCODER BLOCK :

Encoder block is used to calculate the speed of the motor from the real time system using IR sensor data (Square
Pulse).

Figure 6.4: Encoder Block

Digital Input block (Pin12) is used to take digital data from real time system; here It is used to read the
IR sensor’s data (Square Pulse).
During positive edge of the square pulse from motor encoder the TRIGGERED SUBSYSTEM is
activated, it calculates the speed of the motor for every cycle of square wave by using the formulae

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 6


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
Speed = 60/T*N RPM …( 5.1)

Where T = Time period of square wave

N = No. Of Counts per revolution = 60 for the DC Motor used.

Figure 6.5 :Triggered Subsystem in Encoder block


In this Triggered subsystem the time period ‘T’ is calculated using digital clock, unit delay and
comparator block. Here unit delay block gives time of previous positive edge of square wave and digital clock
give the current time for the next positive edge, but calculating the difference between them, Time period of the
square wave is calculated and substituted in the Eq: 5.1 , to calculate the speed of the motor.

VII. EXPERIMENTAL RESULT

CONTROL WITH SIMULINK:

Figure 7.1: Result analysis for an input from Simulink constant source block

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 7


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal
BLUE Duty Ratio ORANGE Actual Speed of Motor
The result shows that the motor is responding to the Simulink input linearly, here in the scope a graph for
variation of Duty ratio and Speed of DC Motor are plotted with respect to time .
CONTROL WITH POTENTIOMETER:

Figure 7.2: Result analysis for an input from Potentiometer


BLUE Duty Ratio ORANGE Actual Speed of Motor
The result shows that the motor is responding to the Potentiometer input linearly, here in the scope a
graph for variation of Duty ratio and Speed of DC Motor are plotted with respect to time.
FORWARD DIRECTION OF DC MOTOR:

Figure 7.3: Forward direction of DC motor


In the above figure we can observe that the Direction Switch is in down position and giving a value 0 to
the direction input to the DIRECTION AND ON/OFF Subsystem, and then a positive voltage across the motor
terminals is shown in DMM.
REVERSE DIRECTION OF DC MOTOR:

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 8


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal

Figure 7.4: Reverse direction of DC motor


In the above figure we can observe that the Direction Switch is in up position and giving a value 1 to the
direction input to the DIRECTION AND ON/OFF Subsystem, and then a negative voltage across the motor
terminals is shown in DMM, it represents the change of direction of motor.
SCOPE FOR FUTURE WORK:
The control technique for speed control of DC motor can also be extended to
• Three phase induction motor speed control.
• Energy efficient motor controlling.
• AC voltage regulator both single phase and three phases.

CONCLUSION:
The paper proposes a new technique for speed control of DC motor, it is done by varying the duty ratio
of the H-Bridge Motor Driver.
Conventional methods are reliable and accurate but these methods involve complex circuitry and control.
Even though conventional methods are used for speed control. This method provides smooth control technique for
speed control even up to rotor standstill position with less power dissipation, simple circuitry easy control with
low cost and effective speed control of DC motor.
This technique achieves result with utmost accuracy as in case of conventional methods, this has been
proved in this paper. The proposed technique for speed control and direction control of DC motor.
This technique of programming Arduino, eliminated the use conventional C-code for Arduino. External
mode in Simulink provided a great opportunity to log real time data and change parameters of real time system.
Thus we conclude that the technique of using Simulink and Arduino together has overcome all the drawbacks of
existing systems.

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 9


Journal of Analysis and Computation (JAC)
(An International Peer Reviewed Journal), www.ijaconline.com, ISSN 0973-2861
Volume XIII, Issue II, Jan-June 2019, UGC Approved Journal

REFERENCES:
[1] R.Barber, M.Horra, J.Crespo: Control Practices using Simulink with Arduino as Low Cost Hardware.
Preprints of the 10th IFAC Symposium Advances in Control Education. The International Federation Automatic
Control, August 28-30,2013 University of Sheffield, UK.
[2] Y.V. Niranjan Kumar, P.Hima Bindu, A.Divya Sneha, A.Sravani: A Novel Implementation of Phase Control
Technique for Speed Control of Induction Motor using ARDUINO. ISSN 2250-2459, ISO 9001:2008 Certified
Journal, Volume 3, Issue 4, April 2013.
[3] A.Soriano, L.Marin, M.Valles, A.Valera, P.Albertos: Low Cost Platform for Automatic Control Education
Based on Open Hardware. Preprints of The 19th World Congress. The International Federation of Automatic
Control. Cape Town, South Africa. August24-29,2014.
[4] Khan Masoom Raza, Mohd.Kamil, Pushpendra Kumar: Speed Control of DC Motor by using PWM.
International Journal of Advanced Research in Computer and Communication Engineering. ISSN(online) 2278-
1021, ISSN(print) 2319 5940, Vol 5,Issue 4, April 2016.
[5] Patrick Olabisi, Israel Megbowon and Isaiah Akintunde: Programming The PIC16F877 A Microcontroller for
Speed Control of DC Motor. IOSR Journal of Electrical And Electronics Engineering (IOSR-JEEE) e-ISSN:
2278-1676, p-ISSN: 2320-3331, Volume 10, Issue 2 Ver.III (March- April. 2015), PP 79-85.
[6] I G.A.P. Raka Agung, S.Huda, I W.Arta Wijaya: Speed Control for DC Motor with Pulse Width Modulation
(PWM) Method using Infrared Remote Control Based on ATmega 16 Microcontroller. ISBN:978-1-4799-6127-6
Bali, 5-7 November 2014, ICSGTEIS 2014.

M. Midhun, U. Naresh Babu, M. Sasank, M. Nikhilesh, B. Saran, Ch. Nanaji 10

You might also like