Nothing Special   »   [go: up one dir, main page]

Embedded Control System For Mobile Robots With Dif

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

42 Acta Electrotechnica et Informatica, Vol. 17, No. 3, 2017, 42–47, DOI: 10.

15546/aeei-2017-0025

EMBEDDED CONTROL SYSTEM FOR MOBILE ROBOTS


WITH DIFFERENTIAL DRIVE

Michal KOPČÍK, Ján JADLOVSKÝ


Department of Cybernetics and Artificial Intelligence, Faculty of Electrical Engineering and Informatics,
Technical University of Košice, Letná 9, 042 00 Košice, Slovak Republic, Tel.: +421 55 602 4218,
E-mail: michal.kopcik@tuke.sk, jan.jadlovsky@tuke.sk

ABSTRACT
This article deals with design and implementation of control system for mobile robots with differential drive using embedded
system. This designed embedded system consists of single control board featuring ARM based microcontroller which control the
peripherals in real time and perform all low-level motion control. Designed embedded system can be easily expanded with additional
sensors, actuators or control units to enhance applicability of mobile robot. Designed embedded system also features build-in
communication module, which can be used for data for data acquisition and control of the mobile robot. Control board was
implemented on two different types of mobile robots with differential drive, one of which was wheeled and other was tracked. These
mobile robots serve as testing platform for Fault Detection and Isolation using hardware and analytical redundancy using
Multisensor Data Fusion based on Kalman filters.

Keywords: embedded system, mobile robot, motion control, microcontroller, fault detection and diagnostics

1. INTRODUCTION weighted averaging or Kalman filter (KF). Similar


approach of FDI with application in mobile robotics was
Mobile robotics these days experiences huge described in [2]. Some other applications are maze
expansion in many different fields such as service mapping and shortest path finding using image
robotics, military, education or recreation. There are many processing, line following or supervisory control.
different types of mobile robots, like wheeled or tracked, For designed embedded electronics the Robot
walking robots or flying drones. Operating System (ROS) communication package was
Mobile robots with wheels and tracks are still the most created, which is capable to control motion of the robot
widespread among other types, mainly because relatively and can read multiple parameters from mobile robot. This
simple control system and very effective and precise ROS package was successfully tested on remote computer
performance of motion. These mobile robots are used in connected via Bluetooth and on minicomputer Raspberry
service robotics as home appliances (robotics vacuum Pi placed directly on the mobile robot.
cleaners), in industry they are used as robotics The first part of this paper deals with design of the
storekeepers (Kiva robots) or in education (Khepera). control system for mobile robots with differential chassis
There are some open source mobile robotics platforms based on embedded system with 32-bit ARM
such as e-puck [1], or mobile robots based on low-cost microcontroller. Second part describes Diagnostic System,
Arduino modules, their disadvantage that they are either which will be implemented in mobile robot control system
designed for specific chassis or they require multiple software in future work. The last part is devoted to sample
modules to fulfill basic needs to control mobile robot. applications that use described mobile robots with control
Many existing types of mobile robots uses distributed system in several different applications.
control architecture, where low level control is performed
using microcontrollers and high level control is covered
by computers with operating system. 2. STRUCTURE OF MOBILE ROBOT CONTROL
The main motivation for this work was to design SYSTEM
universal control system for small mobile robots with
differential driven chassis which can be easily expanded Whole mobile robot consists of electronics
with additional sensors such as Inertial Measurement (microcontroller, drivers and sensors), mechanics (chassis,
Units (IMU), magnetometers or different types of distance actuators and wheels or tracks) and control system
measuring sensors. Huge advantage is ability to expand (program for microcontroller). Given parts may vary
designed system with minicomputer such as Raspberry Pi depending on specific application. In this chapter we
to perform more computing power demanding task such present mobile robots developed in our Department of
as image processing or Simultaneous Localization and Cybernetics and Artificial Intelligence, Faculty of
Mapping (SLAM). Electrical Engineering and Informatics, Technical
Primary the mobile robots described in this article was University of Košice.
designed for the purpose to test Fault Detection and Block diagram of sample mobile robot with its internal
Identification (FDI) algorithms based on hardware and connections is shown in Fig. 1, where essential parts are
analytical redundancy, where measures from different Control board and mechanics and optional parts are sensor
sensors and mathematical models are fused together using board and minicomputer Raspberry Pi.
Multi Sensor Data Fusion (MSDF) algorithms based on

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk
Acta Electrotechnica et Informatica, Vol. 17, No. 3, 2017 43

This circuit board also features expansion connector


which supplies power and communication interfaces to
daughter boards. Communication interfaces available
through this expansion connector are Serial Peripheral
Interface (SPI), Inter Integrated Circuit (I2C) and
Universal Asynchronous Receiver and Transmitter
(UART). Picture of mobile robot control board is shown
in Fig. 2.

2.2. Mechanics of mobile robots

Designed electronics has been tested with two


different chassis, one with wheels and one with tracks. In
both types of robots we used the same type of Lithium
Polymer (Li-Pol) battery with nominal voltage of 7.4 V
and capacity 850 mAh. Both types of mobile robots are
shown in Fig. 3.

Fig. 1 Block diagram of mobile robot control system with


extensions

2.1. Electronics

Electronics consists of single double sided Printed


Circuit Board (PCB) with ARM based microcontroller
STM32F103. This microcontroller has 32-bit ARM M3
core with clock frequency up to 72 MHz. It features Fig. 3 Mobile robots MiroSot (left) and TrackBot (right)
multiple high speed counters with automatic quadrature without any extensions
signal decoders that are used to measure speed of the
motors equipped with incremental encoders. Given 2.2.1. Mobile robot for robotic soccer of MiroSot
microcontroller can be programmed and debugged using category
Serial Wire Debug (SWD) interface, using Joint Test
Action Group (JTAG) interface or using bult-in It is wheeled mobile robot with dimensions
bootloader. 75 x 75 x 50 mm and weight about 400 g. As actuators
As motor driver there is L298P dual full H-bridge there are two DC Faulhaber micromotors 2224U006SR
integrated circuit, with shunt resistors for current sensing. with built-in high resolution encoders IEH2-4096. Chassis
Sensed voltages from shunt resistors are amplified using consists of aluminium frame joined together using
operational amplifiers with RC low pass filter to eliminate machine screws. The shaft of the motor is directly
noise caused by PWM input signal. The motor driver is connected to the wheel using spur gears, where one gear is
capable of driving motors with continuous current up to on the shaft of the motor and second one is fitted in wheel
2 A when using appropriate heat sink. of the robot itself from the inside.
On this board there is communication Bluetooth With given encoders, wheels and gear ratio, the robot
module HC-05, which serves to two purposes. One has resolution of 724 pulses per millimeter (ppm) and can
purpose is establishing connection with computer or reach top speeds about 2.5 m/s.
smartphone to control mobile robot and second purpose is
to wirelessly upload program to microcontroller. 2.2.2. Tracked mobile robot TrackBot

TrackBot is small tracked robot with dimensions about


90 x 90 x 40 mm. Robot weights approximately 300 g and
features two ESCAP 16 DC motors with built-in encoder
and planetary gearbox. Shaft of the motors is directly
connected to the drive wheels. As tracks we used
POLOLU-1415 rubber tracks.
This mobile robot has resolution 119 ppm, top linear
speed is about 400 mm/s and angular speed is about
8 rad/s.

2.3. Mobile Robot Control System (MRCS)

MRCS implemented in microcontroller was divided


into several function parts. Whole control system is
Fig. 2 Image of designed electronics of mobile robots written in native C language designed especially for

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk
44 Embedded Control System for Mobile Robots with Differential Drive

microcontrollers, but with some minor changes this 2.3.2. Motion control
MRCS can be implemented under Windows or Linux
machine. This part of control system handles all motion control
Whole mobile control system is executed and managed of mobile robot from regulation of the speed of wheels
using interrupts from timers and peripherals and some (tracks) to generation of waypoints. It consists of several
functionality is managed using Direct Memory Access parts (layers) where every higher layer depends on
(DMA) to relieve computational power when transferring functionality of lower layers. Whole motion control
large amount of data. On Fig. 4 is shown conceptual system was described in more detail in [3].
diagram of whole MRCS.
Wheel speed regulation
This layer performs feedback regulation of the speed
of wheels. Wheel speed regulation consists of two nested
feedback PSD controllers, where one is used to control
current flowing through armature of the motor and second
one control overall speed of the wheel.
The PSD controllers can be easily enhanced with
feedforward component as described in [4]

Robot speed control


This layer is used to translate linear and angular
velocities of the robot to speed of the wheels using
kinematic model of the robot. It also handles acceleration
and deceleration in angular and linear direction.

Motion control to waypoint


Motion of the robot is based on set of waypoints
generated by user or higher layer of motion control. There
are two types of waypoint. First is for linear motion,
Fig. 4 Conceptual diagram of structure and interconnections
where the robot follows straight line between two
between modules of mobile robot control system waypoints and second is for rotation along the axis of
robot. This layer also features function which smoothly
switches between reference lines, when there are multiple
2.3.1. Hardware Abstraction Layer (HAL) waypoints set to linear motion, to ensure jerk free motion.

This part of control system serves as bridge between Trajectory generation


hardware of mobile robot and other parts of control The highest level of motion control is used to generate
system. Its purpose is to relive programmer of the higher set of waypoints based on input parameters of curve. To
level program from the need to know exact structure of generate waypoints we use Bézier curves, where input
electronics or given microcontroller. parameters are actual position and speed and desired end
HAL performs all necessary measurements from location and speed. From these parameters there is
sensors and initializes necessary peripherals. It executes generated set of waypoints, which are passed lo lower
time critical functions from other parts of the MRCS like level of motion control system.
computation of wheel speed regulators, motion control,
readout of data from sensors or communication interface. 2.4. Communication interface

This part of firmware is used as a gateway between


MRCS and other systems like Robot Operating System
(ROS), or custom control program. Using communication
interface other system have access to all functionality of
mobile robot starting from motion control to all data from
sensors.
Packets have form of strings which represents data and
commands with variable length. Transmitted data packets
from control system can be requested or unrequested.
Requested data packet follows every received command
packet and unrequested data packets are generated on
events or periodically using system for subscribing of
parameters. Data packets generated on events have three
levels. First levels of events are messages with
information about achieved waypoints or press of the user
button. Higher two event levels carry information about
non critical and critical errors in system, like discharged
Fig. 5 Block diagram of Hardware Abstraction Layer battery or communication bus problem.

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk
Acta Electrotechnica et Informatica, Vol. 17, No. 3, 2017 45

As default as interface is used UART connected to PC robot and its system. Example of this analytical
via Bluetooth module, but this interface can be redirected redundancy is calculation of linear and angular speed of
to other peripheral or module capable of transceiving data. the robot based on current flowing through armature of
Communication interface features function used for DC motors.
subscribing desired parameters like position, data from
sensors or control actions. These subscribed parameters
are then sent via communication interface with defined
period of time. This is main tool for collecting of the data,
which are then used for offline or online data analysis.

2.5. User program

There is program space reserved for user program,


where user can control robot using string commands just
like control via communication interface, or directly by
functions from firmware libraries of control system, User
When writing user program, programmer doesn’t have
to worry about timings or delays of this program, because
all control system functionality is executed in parallel with
user program using interrupts of microcontroller.
Fig. 6 Block diagram of proposed diagnostic system
2.6. Localization
Data preprocessing is also first stage of FDI by
For the purpose of feedback motion control, motion capturing faults of data caused by communication bus
control system needs to know position of robot in plane or problems and intermittent single measure faults in data.
space. In designed MRCS there is currently implemented Some of the functionality is handled by HAL, like unit
relative localization based on odometry, where conversion and data acquisition using peripherals of
information from incremental sensors transformed to microcontroller.
relative position using kinematic model of the robot. Sample block diagram of data preprocessing for
Obtained position is however burdened with error, current sensors to linear and angular speed conversion is
which increases with any motion op the robot. This shown in Fig. 7, where LPF stands for Low Pass Filter
localization error is caused by slippage between robot and Units conversion block is used to transform voltages
wheels and surface. measured by Analog to Digital converters to currents.
To minimize this error, we are planning to enhance
mobile robots with sensors of relative and absolute
motion, specifically gyroscope, accelerometer and
magnetometer based on Micro-Electro-Mechanical
System (MEMS). Information from these sensors and
from odometry will be processed using MSDF to obtain
more precise relative position as position gained only
from odometry.

3. DIAGNOSTIC SYSTEM (DS)

Diagnostic system is based on hardware and analytical Fig. 7 Block diagram of sample data pre-processing
redundancy, where information from multiple sensors and
mathematical models are put together using MSDF. 3.2. Fault Detection and Isolation
Proposed diagnostic system is currently under testing
on data measured from sensors and other relevant parts of FDI consists of residual generation, which is done by
MRCS. Diagnostic system was described in more detail in combining of the data using MSDF. For each sensor there
[5]. Whole diagnostic system is spreaded over multiple is independent residual generator that combines output
parts of MRCS, especially HAL, FDI and localization. from all other sensors using KF, whose output is
subtracted from the output of given sensor.
3.1. Data preprocessing This type of FDI is also capable of identifying unusual
or unwanted states of the system like skid of the robot or
This part of DS is used to prepare data from individual bump to the obstacle. These unusual states may show
sensors in the way of collecting, transforming and similar signs as faults of the sensors, some of them can be
filtering. Collecting of the data means receiving data from distinguished by taking in count information from
physical sensor using peripheral of microcontroller. This multiple residuals. For example error of the magnetometer
is done in HAL of MRCS. Transforming of the data is can be mistaken with unusual state caused by magnetic
calculation of the raw data to physical units based on field from metal object or permanent magnet placed near
calibration data. mobile robot.
This part is also used to generate analytical All residual are processed using simple expert system
redundancy based on mathematical models of mobile to determine actual state of the sensors and mobile robot.

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk
46 Embedded Control System for Mobile Robots with Differential Drive

Simplified block diagram of designed FDI for four restricted dimensions and weight compete against each
sensors is shown in Fig. 8, where ω1-4 are measures from other. The whole system consists of three, five or ten
sensors after data preprocessing, e1-4 are error attributes mobile robots per team (depending on league), camera
from data preprocessing, r1-4 are residuals and E is placed above gaming pitch and central computer.
information about faults and state of the system. There is Each player has color sticker with team color and other
separate FDI for linear and angular speed. colors for identifying of the robots and their position.
Central computer runs ROS with several nodes to control
robots. Main nodes are in this application are image
processing node to determine positions of all robots,
strategy planning node to calculate reference trajectories
for robots, motion control node to control motion of
mobile robots and communication node to transfer
commands between computer and robots. Image
processing and MiroSot category was described in [7].

Fig. 8 Block diagram of Fault Detection and Isolation

3.3. Localization using Multisensor Data Fusion


Fig. 10 Mobile robots in robotic soccer application
There are several ways how to fuse data from multiple
4.2. Maze solving
sensors to form one more precise and robust result. In our
case we decided to use KF like in the FDI part. MSDF is
For the purpose of maze solving, the standard MiroSot
sensitive to errors of the input data, but in this case the
mobile robot was enhanced by minicomputer Raspberry Pi
final MSDF uses information about errors and state of the
and camera. Main control board of the robot
system from FDI part, to take inputs only from correct
communicates with Raspberry Pi using UART interface,
sources. This is done by selecting appropriate matrix from
bypassing Bluetooth module. Raspberry Pi is used for
database of steady gain Kalman matrices calculated for
image processing based on output from camera and for
every state of the system. MSDF with application in
controlling of the motion of the robot. Output from image
mobile is described in [6].
processing algorithm is information about relative position
of the robot in current cell of maze and presence of nearby
walls. From relative position based on image processing
and information about position from mobile robot, the
correction of robots position is calculated and sent back to
the MRCS. This way the error of the localization
calculated by the MRCS is eliminated. Information about
nearby walls from image processing is passed to maze
solving algorithm that decides which way the robot should
go and sends relative coordinates directly to motion
control system of robot as waypoints. For maze solving
we implemented and tested Flood Fill algorithm, which is
described in more detail in [8].
Fig. 9 Block diagram of localization system using MSDF

4. SAMPLE APPLICATIONS

Proposed MRCS was implemented and tested in


multiple applications, which are part of bachelor and
diploma theses and semestral projects. In this chapter we
present some of them.

4.1. Mobile robotic soccer of category MiroSot


Mobile robot soccer of category MiroSot is
competition where two teams of small mobile robots with Fig. 11 Mobile robot in maze solving application

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk
Acta Electrotechnica et Informatica, Vol. 17, No. 3, 2017 47

4.3. Line following using camera [3] JADLOVSKÝ, J. – KOPČÍK, M.: Distributed
Control System for Mobile Robots with Differential
In this application was used TrackBot mobile robot Drive, 2016 Cybernetics & Informatics (K&I),
with Raspberry Pi zero and camera. The line is detected Levoča, 2016, pp. 1–5, ISBN 9781-5090-1832-1.
using image processing on images from camera. To follow
line, robot uses algorithm, which determines distance of [4] JADLOVSKÝ, J. – KOPČÍK, M.: Basic Motion
the line from the center of the robot and calculates linear Control of Differential-Wheeled Mobile Robot
and angular velocities, which are sent to MRCS. ALFRED, Advances in Intelligent Systems and
Computing. - Switzerland : Springer, 2014, Vol. 316,
2015, pp. 73–80, ISSN 2194-5357.
[5] KOPČÍK, M.: Diagnostics of Sensors and Actuators
Within Distributed Control System, SCYR 2015 -
15th Scientific Conference of Young Researchers:
Proceedings from conference, Herľany, 2014, pp.
214–215, ISBN 978-80-553-2130-1.
[6] KOPČÍK, M.: Multisensor data fusion for
differential wheeled mobile robots, SCYR 2014 -
14th Scientific Conference of Young Researchers:
Proceedings from conference, Herľany, 2015, pp.
Fig. 12 TrackBot in line following application 223–226, ISBN 978-80-553-1714-4.
5. CONCLUSIONS [7] JADLOVSKÝ, J. – VARGA, M. – KOPČÍK, M.:
Image Processing for Localization of Mobile Robots,
In this article we presented control system for mobile Electrical Engineering and Informatics 6:
robots with differential drive, using embedded electronics Proceedings of the Faculty of Electrical Engineering
with 32-bit ARM based microcontroller. Proposed mobile and Informatics of the Technical University of
robot control system was implemented and tested in Košice, 2015, pp. 574–577, ISBN 978-80-553-2178-
various applications using two types of chassis with 3.
minimal software changes. In this article the Fault [8] JADLOVSKÝ, J. – KOPČÍK, M. – SEGIŇÁKOVÁ,
Detection and Isolation and MultiSensor Data Fusion was S.: Introduction into maze mapping and the shortest
proposed, which will be implemented in control system in path finding, Electrical Engineering and Informatics
the future work. 6: Proceedings of the Faculty of Electrical
Engineering and Informatics of the Technical
ACKNOWLEDGMENTS University of Košice, 2015, pp. 621–625, ISBN 978-
80-553-2178-3.
This publication arose thanks to the support of the
Operational Programme Research and development for Received March 2, 2017, accepted July 11, 2017
the project "Centre of Information and Communication
Technologies for Knowledge Systems" (ITMS code BIOGRAPHIES
26220120020), co-financed by the European Regional
Development Fund (20%), by the Research and Michal Kopčík was born on 17.1.1989. In 2013 he graduated
Development Operational Program for project: University (MSc) with distinction at the Department of Cybernetics and
Science Park Technicom for innovative applications with Artificial Intelligence of the Faculty of Electrical Engineering
knowledge technology support – 2nd phase, ITMS code and Informatics at Technical University of Košice. Since
September 2013 he works as PhD. student at the Department of
313011D232, co-financed by the ERDF (40%), grant Cybernetics and Artificial Intelligence. His scientific research is
TUKE FEI-2015-33: Research Laboratory of Nonlinear focusing on mobile robotics in connection to embedded systems,
Underactuated Systems (30%) and also this publications fault detection and isolation and multisensor data fusion. He also
also arose thanks to grant KEGA - 001TUKE-4/2015 participates in various research projects.
(10%).
Ján Jadlovský works at the Department of Cybernetics and
REFERENCES Artificial intelligence of Technical University of Košice as a
Assoc prof. He is a graduate of Technical University of Košice,
[1] MONDADA, F. et al.: The e-puck, a Robot Faculty of Electrical Engineering. In terms of pedagogy he
focuses on the issues of proposal and implementation of
Designed for Education in Engineering, Proceedings
distributed systems that control production processes. In his
of the 9th Conference on Autonomous Robot Systems science-research based activities he is oriented towards
and Competitions, Castelo Branco, Portugal, 2009, distributed control systems, image recognition, complex
vol. 1, num. 1, pp. 59–65. functional diagnostics of single purpose regulators, diagnostics
of production control systems, creation of information and
[2] STERGIOS, S. I. – SUKHATME, G. S. – BEKEY,
control systems with application of the latest information
G. A.: Sensor fault detection and identification in a technology. He is a chief executive of company
mobile robot, Proceedings of the 1998 IEEE/RSJ KYBERNETIKA, s.r.o., Košice, that is oriented towards design
Intl. Conference on Intelligent Robots and Systems, engineering, implementation and operation of production and
Victoria, B.C., Canada, October 1998, pp. 1383– diagnostic systems in the electrical engineering, mechanical and
1388, ISBN 0-7803-4465-0. metallurgical production.

ISSN 1335-8243 (print) © 2017 FEI TUKE ISSN 1338-3957 (online), www.aei.tuke.sk

You might also like