You are on page 1of 7

2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq

FPGA Cyclone II based the Mobile Robot Control


System
Reem Ibrahim Mohammed Saad Mutashar Abbas Abbas H. Issa
Department of Electrical Engineering Department of Electrical Engineering Department of Electrical Engineering
University of Technology - Iraq University of Technology - Iraq University of Technology - Iraq
Baghdad, Iraq Baghdad, Iraq Baghdad, Iraq
gardnie91@yahoo.com 30099@uotechnology.edu.iq 30050@uotechnology.edu.iq

Abstract— Mobile robots are expected to be used in harsh and evolution of technologies. Mainly there are three
non-organized environments. Such as the applications that robots methodologies available, ASICs which refers to Application
need to Collection of information from complex conditions for Specific Integrated Circuits, general-purpose microprocessors
their functioning which have become very common, especially in and microcontrollers and finally Field Programmable Gate
places that are hard to reach by humans. The wireless capability, Array (FPGA). The first choice is very efficient and provides
avoid obstacles and speed/position controllers have taken great very high performance, but still costly and less flexible option
interest in the design of mobile robots because of the extensive [5]. On the other hand, a microprocessor lacks the essential
use in industrial and service fields. Therefore, the realization of circuitry on one chip causes the need for additional devices,
efficient and robust robot system still a challenging task. This
components and signals such as Input /Output buffer control
paper presents a mobile robot with an Artificial Neural Network
(ANN) controller implemented on Altera FPGA mini-board with
signals and memory. In contrast, microcontrollers overcome
wireless capability to move to a specific distance by avoiding the these limitations by including the additional devices and
obstacle. This system uses Nios II/e soft-core processor signals on the chip. However, it still has deficiency in terms of
instantiated in ANN control of the motors based on the data time-limitation, permanent circuitry and the specific instruction
provided by the sensors. The design shows flexibility in hardware set that the programmer should follow to write programs.
and software, where the design can be modified easily by FPGA seems very promising that overcome most of these
inserting more complex function due to the capacity of FPGA in problems appropriately by containing millions of logical gates
contrast to existing microcontroller or microprocessor -based that can be configured to perform any specific function.
designs. In comparison with previous research, the application of
robots based on the existing design is the presence of
This paper presents a low cost, accurate, and wireless based
microcontroller such as Arduino with FPGA. In the research, the autonomous mobile robot. The implementation uses the ANN
only FPGA offering the possibility of adding more complex controller and System On Programmable Chip (SOPC)
functions to the ability of the robot is used. methodology with obstacle avoidance ultrasonic sensors
implemented on Altera mini FPGA board.
Keywords- Mobile Robot, Intelligent Controller, ANN, FPGA,
Sensors II. RELATED WORKS
Significant efforts have been made by researchers to find
I. INTRODUCTION the best methodologies to control the speed and position of
There are many justifications for using robots, but most mobile robots, starting with PID controllers to executing smart
importantly is to protect people from working in hazardous controllers with high efficiency. This part highlights some
places and dealing with dangerous substances such as author’s efforts in the field of the automotive mobile robot.
explosive chemicals and radioactive material. Mobile robots
In 2012, researchers proposed the neural network controller
need speed/position controller that needs to be efficient and
for autonomous mobile robot [7]. The robot moved in an
robust. Therefore, it has taken a lot of efforts by researchers to
overcrowded environment by detecting and bypassing the
realize this goal. The best choice is the intelligent control that
obstacles. Infra-red (IR) sensors for back, left and right sides
combines artificial intelligence techniques with the control
are used while ultrasonic sensor is mounted in front. The
engineering to design an automatic system which can also be
actuator system represented by two DC motors and one stepper
sensed, planned, learned and behaved in a smart way [1, 2, 3,
motor. Although, the superior performance to learn I/O non-
4]. The control system of a mobile robot is similar to any
linear relationship presented by NN, the response still suffers
control system which consists of basic parts the plant,
from the high settling time and overshoot. A very close work to
controller and the implementation platform of this controller.
propose NN controller for a mobile robot is introduced. The
Obstacles avoidance is a key and a decisive factor of
system uses a Multilayer Perceptron (MLP) trained by
autonomous control that gives the robot the ability to reach the
MATLAB with three ultrasonic sensors functioning to provide
destination without any collision. The movement of the robot is
information to the NN controller [8]. The authors claimed that
restricted if not impossible without the avoidance of obstacle
neural networks are excellent tools for obstacle avoidance
facility [5]. There are several choices available for controller
hardware implementation as a result of the continuous

978-1-7281-1587-0/18/$31.00 ©2018 IEEE


186

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq
mobile robots due to the ability of NN to work with imprecise
information.
An inverse NN velocity controller for two-wheel mobile
robots is presented in 2017 [9]. The NN is trained to function
inverse dynamics of motors. The simulation environment is
used to compare the proposed inverse NN controller with PI
controllers. The results showed that superior performance is Fig. 1.
achieved using an inverse neural controller. Block diagram of the proposed mobile differential robot.

A stable following control rule for Rhombus-type Lunar


Exploration Wheeled Mobile Robot (RLEWMR) is presented
[10]. The Wavelet Transform and Probabilistic Neural
Network (WTPNN) is adopted for the control system
combined with the capability for accurate approximation in
order to model RLEWMR’s unknown dynamics. To learn the
parameters of WTPNN, adaptive learning algorithms are
proposed for weight and robust compensator online. The
efficiency and effectiveness of the controller are explored by
simulation and experiment. The results show the successful
application of the control system on mobile robots to track
different reference trajectories with robust control
performance.
Recently in 2018, the dynamic formulation of wheeled
mobile robots is targeted [11]. The system proposes a 3-stage Fig. 2. Overall system’s block diagram.
controller for stable tracking namely positioning error, PID and
inverse dynamics. The system presented good pursuit,
capacities notwithstanding when self-assertive blunders are A. OFF-chip hardware subsystem
presented in figured torque. Additionally, a fluffy approach for This part comprises the external devices which include data
versatile robot control is considered by scientists also. transmit/receive unit; the sensors, the motor driving unit and an
To increase the mobile robot performance, a given Fuzzy interface block (buffers).
framework frontal camera is proposed [12]. The proposed In order to wirelessly communicate with the robot, the HC-
framework comprises of three phases, the principal 05 Bluetooth model is used for this purpose. This model is a
incorporates getting data from the frontal camera and process non-expensive and compatible with many devices such as
the picture to discover the way, the introduction for various laptops, mobile phones, and others. The addition of Bluetooth
areas are evaluated in the second stage; lastly, the guiding to robot gives it greater ability to interact with the user and
heading of the versatile robot is controlled by the fluffy communication. Using Bluetooth capability, the user can send
framework. Although, the good results produced in this work, the set point from a PC which is used by the robot to move to a
using a camera in a mobile robot requires huge processing specific distance. To distinguish and maintain a strategic
capability and high power consumption. distance from the obstacles in the track of the robot, ultrasonic
Although a lot of achievements have been done in mobile sensor HC-SR04 is used for this purpose. The sensor contains
robots, the research gab still opens as a hot topic especially the two openings one is used to send ultrasonic bursts while the
limitation of hardware implementation with reconfigurability second one receives echo signal. The sensor interfaced with
feature. FPGA utilizing two sticks, in particular, Trig and Echo.
Likewise, the robot utilizes three ultrasonic sensors to
recognize impediments on the front, left and right sides. To
III. METHODOLOGY make the robot moves to a specific distance, speed encoded is
The entities of the proposed mobile system are depicted in required. This device converts the mechanical motion to an
Fig. 1. The interface of the system consists of a PC with electrical signal that can be used for distance, speed and/or
Bluetooth capability and a differential robot equipped with position control. Applications that employ encoders to control
FPGA Altera board, a motor driving circuit, two DC Motors, specific parameters are closed-loop feedback or closed-loop
Bluetooth model, buffer interfacing circuit and sensing circuits. control systems. In this work, two HC-020K double speed
measuring module incremental encoders to measure the
The design details of the system hardware are described in angular displacement for wheels are used.
this part. The main purpose is to describe how the H-bridge is
used to control the motors besides the work of sensing units For the robot to move in all directions and at a different
and the connection with FPGA. The whole system divided into speed, it requires a driving circuit to function properly. L298N
two subsystems as depicted in Fig. 2. H-bridge circuit and Pulse Width Modulation (PWM)
generated by FPGA are used to control the two DC motors.
This gadget contains two parallel H-bridges to control every
DC engine with three pins for each engine where two pins are

187

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq
utilized for bearing control while the third one provided by engines relying upon the prerequisites of the
PWM to control the speed. The speed of engines is balanced by system.
controlling the obligation cycle of PWM flag. For example, the
turn of the engine is equivalent to supply voltage if there 2. Non- SoPC System
should be an occurrence of 100% obligation cycle and is like Non-SoPC units are needed in addition to the SoPC system
half voltage of the power supply if half obligation cycle is these units are the PWM generator for DC engines, encoder
connected. Finally, the operating voltage of all off-chip meter, and an ultrasonic unit.
circuitry is 5 V and most FPGAs are working with 3.3 voltage
level as well as the EP2C5T144C8 board from Altera used in  PWM Generator: The speed of the DC motors
this research. Therefore, to make the signals exchanged controlled by applying a PWM signal to the enable pin of
between off chip devices and FPGA in a compatible way with the H-bridge. The model of PWM contains 5 bit binary
protection for FPGA itself, SN74LS244 supports are counter connected to 32-to-1 multiplexer’s select lines By
incorporated as an interface amongst them and the FPGA. changing the number of progressive ones connected to the
information inputs, the obligation cycle of PWM will be
B. ON-Chip Hardware Subsystem changed in like manner. Therefore, the higher the duty
This part constitutes the system’s brain which consists of cycle will be achieved with the more successive ones
SoPC that comprises Nios II/e soft processor, memory and I/O applied.
ports. Moreover, some non-SoPC models are created utilizing  Encoder counter: To measure the speed and the distance
VHDL to perform particular capacity. the car to travel on, this 16 bit counter is used to count the
number of pulses generated by the speed encoder. Each
wheel has its own counter.
1. The SoPC System  Ultrasonic model: This model responsible for sending
and receiving signals from ultrasonic sensor. The model
The Nios- II 32-bit embedded soft-core processor is the
essence of SoPC subsystem, it includes the following items: generates an output signal with high logic if the distance
from obstacle less than 15 cm and low logic otherwise.
 NIOS II Processor: the standard of the order is the
NIOS II Soft-Core Processor down a clock of 50MHz. IV. IMPLEMENTATION AND RESULTS
 On-Chip memory: a memory of 16Kbytes is applied The first step is made to analyses the DC motors
to stock the program. performance using Matlab simulation. The results are achieved
 UART: to connect the Bluetooth model in order to after calculating the physical parameters of the DC motor used
send and receive data. in this paper are given in Table I. By substituting these values
 I/O Peripherals: to control the equipment section, a in equation (1) and (2) [13]. The transfer function of from the
few info/yield peripherals are required. The input Voltage V(s) to output angle ϴ(s) and the transfer
peripherals are portrayed as following: function of from the input voltage V(s) to output speed (s)
will be as shown below:
 ultrasonic_f: is a 1-bit input flag that alludes to
the front ultrasonic sensor; it goes high when   (s) / v(s)   / s[( Ls  R)( Js  b)]   2  
obstacle detected.
 ultrasonic_r: is a 1-bit input flag that alludes to  w(s) / v(s)   / [( Ls  R)( Js  b)]   2  
the right ultrasonic sensor; it goes high when
obstacle detected.
 ultrasonic_l: is a 1-bit input flag that alludes to TABLE I. PARAMETERS VALUE OF DC MOTORS
the left ultrasonic sensor; it goes high when Physical parameter symbol value
obstacle detected. Electric resistance R 5.61 Ω
 right_encoder: is a 15-bit input flag that gets the
Electric inductance L 2.29
digital signal of the right speed encoder counter.
 left_encoder: is a 15-bit input flag that gets the Motor to que constant K 0.16 /
digital signal of the left speed encoder counter. Damping of the mechanical system b 5.0526
 In1_motorA and in2_motorA: each is a 1-bit −3
product, the signal associated with the H- Moments of inertia of the rotor J 0.4366 . 2
embankment chip to control the course of motor
A.    s  / v  s   0.01/ s  0.5s  1  0.01s  0.1  0.0001 
 In3_motorB and in4_motorB: each is a 1-bit
product, the signal associated with the H-  w  s  / v  s   0.01/ 0.5s  1  0.01s  0.1  0.0001]  
embankment chip to control the course of motor
B. The control system simulated in MATLAB program, a
 motorAen and motorBen: is a 32-bit yield flag response for both speed and position is obtained with two types
that is utilized change the speed of the two dc of controllers which are PID and NN controller. For the
designed PID controller, tuning PID Parameters by MATLAB

188

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq
will obtain the values of KP, Ki, and Kd as (13.737, 40.35 and - (0.432996, 0.03101 and -2.1729 respectively) (0.01755, 4.8971
0.6743 respectively) (34.45, 1.234 and 12.836 respectively) for and 0.04363 respectively) for speed and position control
speed and position control respectively. This type of controller respectively. And NN controller constructed of eight neuron
has overshoot as shown in simulation result for both speed and in the first hidden layer, one neurons in the second hidden
position control in Figs. (3, 4) respectively. layer

Fig. 3. The system response and error for PID speed controller.

Fig. 6. Internal structure of the NN model.

Fig. 4. The system response and error for PID position controller.

After that, NN controller is designed, the training NN


controller by Levenberg-Marquardt back propagation algorithm
to perform inverse function of the plants Levenberg-Marquardt
since it provides a quick preparing of the ANN contrasted with
alternate calculations of better than average inclination that has
been seen clearly from test comes about. For better system Fig. 7. Simulink between NN and PID for speed DC motor controller.
performance the algorithm uses the error signal to modify the
weights of the connections is presented. The classical BPNN
Algorithms are widely used for solving many practical
problems; it can be converted into MAT- LAB/Simulink
model by the order (gensim) as shown with the system
simulation of DC motor speed and position in Fig. 5.

Fig. 8. Simulink between NN and PID for position DC motor controller.

The system step response comparison made for controllers


Fig. 5. The Simulink Neural network block. type which clarifies the NN preference for speed and position
The ANN model and the weights block are depicted in control, as shown in Fig. 9 As a result of this performance,
Fig. 6. Each of the 8 neurons for the first hidden layer has input ANN is chosen to be implemented on Altera FPGA device.
multiplication summation with vector dot product-process The implemented hardware NN controller on FPGA has
weight. been done by connecting the PC with FPGA board through a
The system simulation with PID controller and NN USB cable and supply the board of FPGA. The hardware
controller of DC motor speed and the position indicated in results for speed controller and position by NN controller
Figs. 7 and 8 respectively, a PID was used for PID parameters shows in Fig. 10.
optimization automatically in a Simulink model containing a
PID controller block. The optimum response will obtain with
this controller by choosing the values of Kp, Ki, and Kd as

189

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq

Fig. 9. Simulation comparison results of PID and ANN controllers.

Fig. 12. The block diagram file of the final system.

Fig. 10. Hardware results for speed controller and position by NN controller. TABLE II. COMPILATION SUMMARY OF THE PROPOSED SYSTEM

Quartus II 11.1 is utilized to actualize the SoPC subsystem FAMILY CYCLONE II


which is worked around the Nios-II 32-bit inserted delicate
center processor. When every one of the peripherals is DEVICE EP2C5T144C8
determined and doled out base locations, the framework is TOTAL LOGIC ELEMENTS 2374/4608 (51%)
created. Fig. 11 demonstrates the SoPC developer with the TOTAL COMBINATIONAL FUNCTIONS 2167/4608(47%)
entire SoPC framework, DEDICATED LOGIC REGISTERS 1255/4608(27%)
TOTAL REGISTERS 1255
TOTAL PINS 19/89 (21%)
TOTAL MEMORY BITS 92160/119808 (77%)

Fig. 11. Screen shot of SoPC builder system.

For non SOPC components, VHDL coding is used to


generate encoder counter, ultrasonic and PWM generator
models on Quartus II with the frequency of 5 KHz. As
mentioned earlier, the counter is needed to count the number of
pulses from the right and left encoders.
After the generation of all models, the whole system is Fig. 13. Final product mobile robot control system
generated. An image record of the NIOS II framework is made; The product part of the advanced controller utilizes
the non SOPC units are associated with it. The pins are distinctive firmware codes to program the Nios II subsystem.
allocated to each signal. Fig. 12 demonstrates the last square For ANN part, the training parameters are extracted from
graph/schematic record (final system) in Quartus II. MATLAB and implemented as a C code to be run on the Nios
The compilation and download of the whole system were processor. As depicted in Fig. 14, the robot first looks for the
successful on Cyclone II as shown in Fig. 13. The compilation set point from PC through Bluetooth. Once the data received,
report depicted in Table II, states that the proposed system the robot stars to read data from the three ultrasonic sensors.
utilizes 51% of the total logic elements, 1255 registers, 21% of On the off chance that a hindrance is recognized on the way,
the total pins and 77% of the total memory bits. the auto will move to the correct heading to check it; it will
maintain a strategic distance from the obstruction on the way
The overall hardware form for the mobile robot system is from the privilege if nothing is on this side. The auto will move
shown in Fig. 13. to one side heading to examine it as well when a hindrance is

190

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq
seen on the right; it will proceed with its way from this course the PC and move accordingly. The SOPC approach is used to
if no requirement is recognized there. At the point when the design the system to achieve several benefits, it is flexible in
auto maintains a strategic distance from the obstruction, it will both hardware and software. It is designed around the Nios II/e
search for the way again utilizing the already said strategy. The soft-core processor instantiated in ANN control of the motors
auto will stop when the set point is finished or when based on the data provided by the sensors. The designer can
impediments are distinguished on the way and its two sides. use the exact components that fit his application. Moreover, the
reconfiguration and alteration of the framework should be
possible whenever by including another segment or erasing a
current one. The elasticity of FPGA provides the possibility to
add more functions for the robot such as smart arms and other
tools. Although, the robot can travel in the environment with
obstacle avoidance, using this robot in an indoor environment
especially for hazard area rises the need to keep the robot away
enough from the serious risk is very crucial which the future
direction for this research.

REFERENCES
[1] Huang, L., Qu, H., Fu, M., & Deng, W. (2018, August). Reinforcement
Learning for Mobile Robot Obstacle Avoidance Under Dynamic
Environments. In Pacific Rim International Conference on Artificial
Intelligence (pp. 441-453). Springer, Cham.
[2] Roland S. Burns, "Advanced Control Engineering", first published,
Butterworth-Heinemann, Linacre House, Jordan Hill, Oxford, 2001.
[3] Ehlert, P. A. (1999). The use of Artificial Intelligence in autonomous
mobile robots. Delft University of Technology Faculty Information
Fig. 14. The flowchart of the program. Technology and Systems Delft.
[4] Zafar, M. N., & Mohanta, J. C. (2018). Methodology for Path Planning
To send the set point from the PC, Tera Term is an open- and Optimization of Mobile Robots: A Review. Procedia Computer
Science, 133, 141-152.
source software which implemented terminal emulator
[5] Liu, Y., Chen, D., & Zhang, S. (2018, April). Obstacle avoidance
program is used to emulate serial port communication. The method based on the movement trend of dynamic obstacles. In 2018 3rd
screen shot of the software is shown in Fig. 15 which states the International Conference on Control and Robotics Engineering (ICCRE)
send set point and counter status. (pp. 45-50). IEEE.
[6] HADDJI Isma, HAFNAOUI Iman , SOPC Based Automated Self
Parking Car ‘INGENIEUR D’ETAT’ In Electrical Engineering Option
:Control , June 2011.
[7] Rouabah, H., Abdelmoula, C., & Masmoudi, M. (2012, May). The
realization of a Neural Network controller for vehicle-type mobile robot
navigation. In Design & Technology of Integrated Systems in Nanoscale
Era (DTIS), 2012 7th International Conference on (pp. 1-4). IEEE.
[8] Medina-Santiago, A., Camas-Anzueto, J. L., Vazquez-Feijoo, J. A.,
Hernández-de León, H. R., & Mota-Grajales, R. (2014). Neural control
system in obstacle avoidance in mobile robots using ultrasonic sensors.
Journal of applied research and technology, 12(1), 104-110.
[9] Cerkala, J., & Jadlovska, A. (2017). Application of neural models as
controllers in mobile robot velocity control loop. Journal of Electrical
Engineering, 68(1), 39-46.
Fig. 15. Screen shot of Tera Term. Software. [10] Zuo, Y., Wang, Y., & Liu, X. (2017). Adaptive robust control strategy
for rhombus-type lunar exploration wheeled mobile robot using wavelet
transform and probabilistic neural network. Computational and Applied
V. CONCLUSION Mathematics, 1-24.
This paper offered a model for DC motor which is used for [11] Gupta, V., Bendapudi, N., Kar, I. N., & Saha, S. K. (2018, March).
moving the robot. Two types of controllers are designed such Three-stage computed-torque controller for trajectory tracking in non-
holonomic wheeled mobile robot. In Advanced Motion Control (AMC),
as conventional PID and the intelligent NN controllers. The 2018 IEEE 15th International Workshop on (pp. 144-149). IEEE.
NN Controller implemented on the FPGA board. The [12] Rubio, Y., Picos, K., Orozco-Rosas, U., Sepúlveda, C., Ballinas, E.,
simulation results explain that the ANN controller is the best Montiel, O., ... & Sepúlveda, R. (2018). Path Following Fuzzy System
and the most suitable. The PID still suffers from unsuitable for a Nonholonomic Mobile Robot Based on Frontal Camera
parameters such as nonlinearity, high peak overshoot, and slow Information. In Fuzzy Logic Augmentation of Neural and Optimization
response. Using FPGA board in mobile robot control system Algorithms: Theoretical Aspects and Real Applications (pp. 223-240).
Springer, Cham.
gives it many advantages like fast computing to avoid obstacles
[13] A. CHOWDHURY , D.DEBNATH, " DC MOTOR POSITION CONTROL USING
in the unknown environment during the motion because of the STATE SPACE TECHNIQUE",INTERNATIONAL JOURNAL OF ADVANCES IN
FPGA ultra-fast operation that could even reach a gigahertz. SCIENCE AND TECHNOLOGY (IJAST).
The autonomous robot successfully receives the set point from

191

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.
2018 Third Scientific Conference of Electrical Engineering (SCEE), University of Technology - Iraq

192

Authorized licensed use limited to: Universidad Militar Nueva Granada. Downloaded on January 12,2021 at 03:12:25 UTC from IEEE Xplore. Restrictions apply.

You might also like