background image

Description of the Warthog Robotics SSL 2017

Project

Rafael G. Lang, Guilherme C. de Oliveira,

Heloisa J. Barbosa, N´ıcolas dos S. Rosa,

Bruno C. Henriques, Anderson H. de Siqueira,

Ivan N. da Silva, and Roseli A. F. Romero

Warthog Robotics

University of S˜

ao Paulo at S˜

ao Carlos

400 Trabalhador S˜

ao-carlense Ave, S˜

ao Carlos, S˜

ao Paulo, Brazil

warthog@sc.usp.br

http://www.warthog.sc.usp.br

Abstract.

This paper presents the main modifications since the last

Team Description Paper of Warthog Robotics and a general explanation
of the current project, presenting RoboCup SSL team WR Magic, devel-
oped since 2011 by the Warthog Robotics group from the University of

ao Paulo at S˜

ao Carlos. This project merges the best features from older

projects developed by the groups GEAR and USPDroids. The mechani-
cal structure is a mixed design using aluminum and composite materials
and contains four DC motors for locomotion. The system architecture
is based on the GEARSystem library, with a new decision tree strategy
module, and powered by some filtering algorithms on the vision module.
The team presents full game capability with accurate and fast responses
to strategy and referee commands.

Keywords:

Mobile Robotics, RoboCup, Artificial Intelligence, Embed-

ded Electronics, Warthog Robotics.

1

Introduction

At the beginning of 2011 the groups GEAR and USPDroids merged creating the
Warthog Robotics, a group of the departments of Electrical Engineering of the

ao Carlos School of Engineering and the Computer Sciences of the Institute of

Mathematics and Computer Science of the University of S˜

ao Paulo at S˜

ao Car-

los. The group counts with about 100 members students of Computer Science,
Electrical, Mechatronic and Computer Engineering and develops robotics tech-
nologies, applying most of them at the robot soccer. And current is the champion
of the RoboCup Latin American Open.
The mechanical structure and the electronic boards are the same from the last
year, described briefly on this paper, and detailed information can be found in
[1] [2]. The next sections present the newest modifications of WR Magic fea-
tures details, most of them on the computer systems (artificial intelligence and
computer vision systems).

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

2

Warthog Robotics

2

Mechanical Structure

The mechanical structure is the same of the last year, accommodating the loco-
motion system with its four Faulhaber 2342 DC motors, the kicking device, and
the dribble device mounted with shock absorber system and linked to another
Faulhaber 2342 DC motor. The upper part houses the three electronic boards,
the battery and the kick capacitor using glass fiber plates; and the cover is a
front cut cylinder with protected wheels and openings for the kicking and dribble
devices. All mechanical structure is made of aluminum and composite materials
as shown in figure 1.

Fig. 1.

Internal mechanical assembly of the 2016 Warthog Robotics SSL robot (same

of last years).

3

Electronic Devices

The electronic devices are the same of last year, composed of three electronic
devices: MainBoard, MotorBoard and KickBoard and detailed information can
be found in [1] [2]. The main improvement was in the PID, which were contin-
uous, changed to discrete and later applying N filter in discrete PID, improving

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

Description of the Warthog Robotics SSL 2017 Project

3

the performance of the controller.

The initial implemented controller was a Continuous PID, which, according

to the Digital Controller [5], was inconsistent since we’re dealing with a mi-
crocontroller system (robot). After identifying this situation was proposed the
implementation of a Discrete PID.

Continuous PID - The previous controller implemented in the robots used
the following equations:

u

(

t

) =

K

p

e

(

t

) +

K

i

Z

t

0

e

(

τ

)

+

K

d

de

(

t

)

dt

e

(

t

) =

SetP oint

P lantOutput

:

Error

Discrete PID - The first controller proposed to adequate the control system
was a Discrete PID Controller. In the discrete domain, the operation of the
controller is not continuous, since its actuation is periodized by a certain
interval

T

0

(sampling time) [5]. The equations used in this controller are

presented below [13]:

Controller Transfer Function - The proposed controller has the following
relations between its calibration constants and its zeros location. The
equation below showing the model in the discrete time that represents
the controller.

G

P ID

(

z

) =

q

0

(

z

z

01

)(

z

z

02

)

z

2

z

z

01

+

z

02

=

q

1

q

0

z

01

z

02

=

q

2

q

0

Calibration Process - Next, it’s presented the calibration processes used
for determining the controller coefficients:

1. First, it’s necessary to guess an initial value of the maximum speed

of the motor over load. The motor’s datasheet informs that the max-
imum motor speed is 8100 RPM. Then, a speed on load of 7000 RPM
was assumed.

2. Next, the value of the coefficient

q

0

was defined by analyzing the

controller’s behavior for

u

(

k

= 0). In addition, we studied the worst

cases of controller output (

±

12

V

) and error

Speedmax

.

u

(0) =

V oltage

M ax

= 12

V

e

(0) =

Speed

M ax

= 733

.

04

rad/s

q

0

=

u

(0)

e

(0)

=

12

733

.

04

= 0

.

016370222718024

3. The discrete model of the motor plant was defined:

G

=

0

.

0435

4

.

14

e

10

s

2

+ 2

.

106

e

5

s

+ 0

.

00192

The discrete counter-part with a sampling time of 0.001 seconds is
described by:

Z

=

1

.

94

z

+ 0

.

03726

z

2

0

.

9127

z

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

4

Warthog Robotics

4. The MatLab RLTOOL tool was used to optimize the coefficients of

the discrete controller of the discrete plant of the Motor. But first,
it’s necessary to find the zeros location.

G

P ID

(

z

) =

q

0

(

z

z

01

)(

z

z

02

)

z

2

z

Obtained values:

z

01

= 0

.

823840

z

02

=

0

.

030368

5. Found the positions of the real zeros, it’s possible to obtain the val-

ues of the coefficients

q

1

e

q

2

of discrete controller by the following

equations:

z

01

+

z

02

=

q

1

q

0

z

01

z

02

=

q

2

q

0

Isolating the coefficients:

q

1

=

q

0

(

z

01

+

z

02

) =

0

.

012989313360516

q

2

=

q

0

z

01

z

02

=

4

.

095563400170131

e

04

Controller Equation - Found the calibration coefficients through MatLab
RLTOOL tool, the next step were to implement the following equation
in the microcontroller:

u

(

k

) =

u

(

k

1) +

q

0

e

(

k

) +

q

1

e

(

k

1) +

q

2

e

(

k

2)

q

0

=

K

1 +

T

D

T

0

q

1

=

K

1 + 2

T

D

T

0

T

0

T

i

q

2

=

K

T

D

T

0

Where The parameters

T

0

,

T

i

, and

T

d

denote the time constants of the

proportional, integral, and derivative terms respectively, and

K

the pro-

portional gain.

Discrete PID with N filter - In many PID controllers, the constant N is added
to the derivative term, which acts as a low pass filter and attenuates high
frequency noise components (

f

>

N), which would cause a high unwanted

derivative gain (derivative has zero at 0).

K

d

=

K

d

s

N

s

+

N

In real applications, the controller’s output signal can be very noisy, for
this reason it’s quite common to utilize the derivative term with a N filter
constant. Thus, it also was studied this second discrete PID approach [5].

Controller Transfer Function - Discretizing the derivative term using the
Backward Euler method, we have that the controller’s transfer functions
is [5] [13]:

C

(

z

) =

K

p

+

K

i

T

s

z

z

1

+

K

d

N

(

z

1)

(1 +

N T

s

)

z

1

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

Description of the Warthog Robotics SSL 2017 Project

5

Controller Equation - Since our final objective is to implement in a micro-
controller, we need to change the representation of the transfer function
of a different equation representation, as presented below.

C

(

z

) =

U

(

z

)

E

(

z

)

=

b

0

+

b

1

z

1

+

b

2

z

2

a

0

+

a

1

z

1

+

a

2

z

2

b

0

=

K

p

(1+

N T

s

)+

K

i

T

s

(1+

N T

s

)+

K

d

N

b

1

=

(

K

p

(2+

N T

s

)+

K

i

T

s

+2

K

d

N

)

b

2

=

K

p

+

K

d

N

a

0

= (1 +

N T

s

)

a

1

=

(2 +

N T

s

)

a

2

= 1

Rearranging the terms,

a

0

U

(

z

) +

a

1

z

1

U

(

z

) +

a

2

z

2

U

(

z

) =

b

0

E

(

z

) +

b

1

z

1

E

(

z

) +

b

2

z

2

E

(

z

)

u

[

k

] =

a

1

a

0

u

[

k

1]

a

2

a

0

u

[

k

2] +

b

0

a

0

e

[

k

] +

b

1

a

0

e

[

k

1] +

b

2

a

0

e

[

k

2]

Where the constants depend on Kp, Kd, Ki, N and Ts. We also used
the RLTOOL for obtaining the optimized controller of the motor. Next,
we calculate the coefficients for the above equation and implement the
discrete controller with N filter.

u

(

k

) = 1

.

6931

u

(

k

1)

0

.

6931

u

(

k

2)+0

.

0209

e

(

k

)

0

.

0291

e

(

k

1)+0

.

0099

e

(

k

2)

4

Computer Systems

The WR Magic Project software is now based on five sub-projects developed by
the group: the GEARSystem library, the WRBackbone server application, the
redesigned WRCoach strategy application, the newest WREye vision filtering
application, and the newest WRStation radio communication application.

4.1

GEARSystem

The GEARSystem, same used the last years, is a distributed system library that
provides communication between all system modules [9]. It is built over CORBA
and allows a distributed execution of the modules.

The library architecture is minimalist, with four basic elements: Server, Sen-

sor, Controller and Actuator. The sensors can create teams, players and balls
and set their information (position, orientation, velocity, etc). Controllers may
read these information and send commands to the actuators (move, kick, drib-
ble, etc). Actuators read, decode these commands and execute them. The Server
connect all those elements. This architecture allows the easy development of new
software based on the four main modules, and detailed information can be found
in [1] [2].

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

6

Warthog Robotics

4.2

WRBackbone

The backbone is the Server module on the GEARSystem architecture. It doesn’t
have any significant function other than acting as the server that connects all
modules.

4.3

WRCoach

The coach is the Controller module on the GEARSystem architecture and is
responsible for setting the strategy to the team. A simplified snippet of the soft-
ware architecture is presented in figure 2. The subsequent paragraphs describe
the Coach architecture; a full description of the software is available in [2] and
in Brazilian Portuguese at [10].

Fig. 2.

Simplified diagram of the modules of the WRCoach software.

The focus of this year’s research was optimization and fixes to the current

code, aiming for a more stable version of the software. Two of some corrections
are presented below.

The first aims to remove a

not a number

error presented at the code. The

WRCoach’s final output is a float that represents a speed in the x, y and theta
axis for a certain robot. But if a mistake occurs to some place in the code,

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

Description of the Warthog Robotics SSL 2017 Project

7

like a division by zero, it could result in a not a number being send to others
softwares and even propagate to the robot firmware. To prevent that, was add
a simple routine that will check every time before sending the desired speed if
it is a not a number and the set it to zero. Because WRCoach runs at 50Hz,
one or two interaction requesting zero speed does not affect the robot movement.

The second fix involves the pass and attack behavior, as the decision tree has

a different way of thinking about attack and pass. Now the attacker has a little
more complex behavior that involves decide if it’s better kick to opponent goal
directly or pass, choosing which has a clear path to goal, and the attacker has
also to trap the ball when necessary. Become the attacker more complex, the
receiver could be make simpler, just standing in a point that has free path to
the goal and to the attacker in a predetermined area, and switching to attacker
behavior when the ball is coming to it, so it can easily trap the ball.

4.4

WREye

The eye is the Sensor module on the GEARSystem architecture and is responsi-
ble for receiving the data from ssl-vision software, filtering the data, and inserting
it on the system.

It is basically composed by the Kalman, Noise, Loss and Multi Object filter,

a more detailed explanation of it can be found in [2].

4.5

WRStation

The station is the Actuator module on the GEARSystem architecture and is
responsible for sending the commands generated by WRCoach to the robots. It
essentially connects via USB using QtSerialPort [11] to a custom station board
that reproduces the commands wireless.

5

Improvements for 2017

The mechanical and electronic projects are the same from 2015, the main im-
provement for 2017 will be in the embedded software in telemetry system. This
improvement is aimed at taking a lot of data that allow make a more faithful
rigid body system, to have a model of robot more real as possible and increase
the quantity of controllers applied in the robot.
The new three-tier control model for the robot still under development with one
controller of the robot’s velocity, one motor speeds and high-level one for the AI
modules.
The presented WRCoach structure is completely new and allows more control
over the AI components, facilitating the coding execution.

pdftohtml_folder/2017_TDP_Warthog_Robotics-html.html
background image

8

Warthog Robotics

6

Conclusion and Future Work

In computer system, the improvement of the coach described in [2] was a great
change in the strategy of the WRCoach and turn it more complex. Having that
in mind, the improvements in the year of 2016 were focused on the optimization
of the current code, making the algorithm more stable and efficient.
The developed hardware is robust, reliable and provides an excellent platform
to the strategy systems, and the improvements were focused in the embedded
software as show in this paper, like the controller of the robot.
Future works will be focused mainly in those areas, improving the software WR-
Coach and the embedded software of the robot like the controller.

7

Acknowledgments

The authors would like to thank all Warthog Robotics team for the help and
friendship; the University of S˜

ao Paulo for the facilities and financial support;

the Griffus, Embraer, Caster, Infox companies for the technical sponsorship; and
all others that helped us during the project.

References

1. Lang, R.G., Bernardo, A.M., Oliveira, G.C., Menezes, H.B.B., Ramos, L.C., Roque,

L.G.S., Silva, I.N., Romero, R.A.F.: Description of the Warthog Robotics 2015
project. In: 2015 RoboCup (2015)

2. Lang, R.G., Oliveira, G.C., Menezes, H.B.B., Rosa, N.S., Correa, R.A., Gomes, V.H.,

Silva, I.N., Romero, R.A.F.: Description of the Warthog Robotics 2015 project. In:
2016 RoboCup (2016)

3. Nordic Semiconductor: High Frequency 2.4 GHZ Wireless Transnciever. Data Sheet

(2007)

4. Olivera, V.A., Aguiar, M.L., Vargas, J.B.: Sistemas de Controle - Aulas de Labo-

rat´

orio. EESC-USP, Brasil. (2005)

5. Aguiar, M.L.: SEL359 - Controle Digital,2015. EESC-USP, Brasil. (2015)
6. Pressman, A.I.: Switching Power Supply Design. McGraw-Hill. (2003)
7. Mohan, N., Undeland, T.M., Robbins, W.P.: Power Electronics - Convertes Appli-

cation and Design. Wiley (2002)

8. Tse, C.K.: Complex Behavior of Switching Power Converter. CRC Press. (2003)
9. Lang, R.G., Romero, R.A.F., Silva, I.N.: Development of a Distributed Control

System Architecture. In: 2014 Latin American Robotics Symposium. (2014)

10. WRCoach v2 documentation. Division of Artificial Intelligence - Warthog Robotics,

available at

https://www.assembla.com/spaces/warthog-dia/wiki/WRCoach_v2

.

11. Qt Company: QSerialPort documentation, available at

http://doc.qt.io/qt-5/

qtserialport-index.html

.

12. Wikipedia: PID Controller, available at

https://en.wikipedia.org/wiki/PID_

controller

.

13. Control

System

Labs:

Discrete-time

PID

Controller

Im-

plementation,

available

at

http://controlsystemslab.com/

discrete-time-pid-controller-implementation/