SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 1(2); September (2020), pp. 76–80
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

Design of An Embedded Humanoid Soccer Robot based on
Image Processing
Yuheng Zhang, Yizhun Peng, Lianchen Zhao, Zhou Zhang, Wanlong Peng
Tianjin University of Science and Technology, China

ARTICLE INFO
Article History
Received 24 October 2019
Accepted 25 July 2020
Keywords
Humanoid robot
Dual controller
Erial communication
Images processing

ABSTRACTAs a humanoid robot, the humanoid soccer robot integrates artificial intelligence with competitive
sports skillfully. It is an intelligent control system which integrates mechanical structure,computer, circuit design, automatic control, decision-making, communication, and othertechnologies. In recent years, it is a very good research platform in the field of artificial
intelligence and robots. This paper designs a humanoid soccer robot based on STM32 processor,
and completes the theoretical analysis and experimental verification, the specific work is asfollows:Through theoretical analysis and experimental verification, the stability, working
parameters and the division and cooperation of STM32 and 51 series single-chip computers ofhumanoid soccer robot system are analyzed, and determine the final control scheme. STM32drives the camera to collect information, process images and make decisions. STC12C5A60S2controls the robot steering gear to complete the corresponding action. Serial communication isused between the two controllers. The peripheral circuit mainly includes OV7725 camera moduleand TFT-LCD LCD display module. In order to recognize and approach soccer by humanoidsoccer robot and kick soccer into the goal, we should design the action programs such as straightwalking, left turning, right turning, head scanning course, left translating, right translating andkicking. Reasonable images processing and decision algorithms are also designed. Finally, thecontrol program is developed on Keil software platform for debugging. The experimental results
show that the humanoid soccer robot designed in this paper can accurately identify the soccer balland the goal, and accurately complete the kicking actions, which meets the relevant requirementsof the expected design and scheme.

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

robot uses image processing to quickly find the football,track it and shoot. The soccer robot designed in this paper
is designed according to the human body shape. It has ahead, two arms and two legs, and can stand on both feet
and walk on both feet. Robots can perceive the external
environment through sensors equivalent to humanperception, and sensors must be installed in a position
similar to human perception. At the same time, the robot
can recognize the orange, white and green color target, andcan track the object with regular shape and single color.
According to the design requirements, the soccer robot
must be able to complete the basic movements such as
straight line, left turn, right turn, kicking the ball, and cancorrectly recognize the soccer, goalkeeper and goal
through machine vision, and the distance between therobot and the ball is 0.5 meters.

1. Introduction
As a research product of artificial intelligence in thefield of robotics, humanoid robots are the frontier andhotspot in the field of robotics. As a member of thehumanoid robot family, soccer robot is a dynamic
experimental platform with high degree of confrontation.
Humanoid robots can imitate human thinking mode toperceive the characteristics of the external environment
and make judgments and make corresponding actions tocomplete a task [1]. The performance requirements of thehumanoid soccer robot are very high. The humanoidsoccer robot not only has the ability to walk, but also has
the ability to play difficult actions such as football. Thisnot only requires the humanoid soccer robot's body to havegood coordination and stability, but also requires thehumanoid soccer robot to have visual function [2]. The

Corresponding author’s E-mail: pengyizhun@tust.edu.cn URL: www.tust.edu.cn

76

3.2. Introduction of controllers and peripheral
modules

2. System scheme design
This design uses a dual-controller control scheme. The
hardware mainly includes the humanoid soccer robot trunk,steering engine, controller, camera and display screen.
STM32 is used as the main controller to collect andprocess images. STC12C5A60S2 is used as the slave
processor to control the robot to complete thecorresponding actions. STM32 and ST12C5A60S2 SCM
use serial port to communicate. The flow chart of STM32
and STC12C5A60S2 is shown in Figure 1.

The main controller used in this design is STM32F103,
32-bit microcontroller, based on ARM Cortex-M3 core,
LQFP-144 package. Compared with similar controllers,
CPU can process data quickly and support multi-path
execution of data instructions. The CPU operating voltage
range is 2.0-3.6V. With external button battery, it canrealize power-off data storage. This chip has very highperformance, excellent real-time performance, reasonable
and rich peripherals, low power consumption, low price,rich software support package [4], rich and comprehensive
technical information, easy to develop, which is very
suitable for this design.
The slave controller selected in this design is the control
board with STC12C5A60S2 single chip microcomputer as
the core. Most of the components adopt the full surface
mounting technology. The design of the control board isreasonable and powerful [5]. All the external interfaces ofSTC12C5A60S2 series single chip microcomputer are
expanded for convenient use. It is shown in Figure 3.

Fig.1. The flow chart of STM32 and STC12C5A60S2

3. Design of robot hardware system
3.1. Robot structure design
This design uses the SHR-8S humanoid robot of Beijing
Senhan Technology Co., Ltd. According to the relevant
requirements of hardware, the height of the robot isdesigned to be 360 mm, its shoulder width is 165 mm, its
chest thickness is 115 mm, and its mass is 1.5 kg. It is
composed of head, arm, hip, thigh, etc. It is a small
humanoid robot. In this design, another steering gear is
installed on the head, which combines the two degrees offreedom of the head itself, so that the information of thesoccer field can be collected quickly. The position of 17 +1 steering gear is 2 at the head, 2 at the left and right arms,
1 at the left and right shoulders, 1 at the left and right hip
joints and 4 at the left and right legs respectively [3]. The
design of the structure is shown in Figure 2.

.
Fig.3. STC12C5A60S2

The camera selected in this design is OV7725 camera,
300000 pixels, high frame rate, up to 120 frames per
second [6], high-speed dynamic, can quickly capture
position information, suitable for robot to capture theposition of football. The data format of the output image
supports YUV (422 / 420), yCbCr422 and RGB565. The
output data format identified in this design is RGB format,
which is convenient for feature extraction in the future [7].
The data collected by the camera is cached in the FIFO
cache on the back of the camera, and then the external
devices obtain the captured image data through the signal
pin below by Figure 4.

Fig.4. OV7725 camera

Fig.2. Robot picture

77

The display screen is used to display the image
information captured by the camera in real time. It candetermine the effective collection range of the camera foreasy programming and debugging. The display screen isused as a calibration reference medium to determine theaction that the robot will perform based on the football
position displayed on the display screen, thus completingthe task of tracking football and shooting. The display
screen selected in this design is the 3.2-inch TFT LCD
screen that is shown in Figure 5. This screen has theadvantages of light weight, high reliability, low driving
voltage and much less power consumption than CRT
screen, which saves a lot of energy [8].

conversion from RGB space model to YUV and HSVmodel involves a lot of calculation, which will be a greatburden on the controller of soccer robot and seriously
affect the real-time performance of robot. For the robot
recognition, there are only three colors: green, orange andwhite. The color is less and the shape of the recognition
object is regular. In RGB color space, the recognition
effect is not greatly interfered by experiments under
different light intensity. Considering the relatively simple
calculation of RGB model, the RGB color space is selectedin the design.
The image collected by the camera is an RGB color
image, which can be recognized from the image by STM32
image binarization method, and then the subsequentdecision-making tasks can be completed. Throughrepeated experiments under different light conditions, thethreshold value of image segmentation is determined, andthen the image is segmented into background and target,achieving good experimental results. The comparison
before and after processing is shown in Figure 6.

Fig.5. LCD screen

4. Analysis of football recognition and control
program
4.1. Soccer recognition

Fig.6. Original graph and binary partition graph

RGB, YUV and HSV are commonly used color spaces
for robots [9]. RGB is the physical primary color, Y is thebrightness signal, U and V are the chroma signal, H is thehue, S is the saturation and V is the brightness, theconversion formula is as follows:
𝑌𝑌 = 0.299𝑅𝑅 + 0.587𝐺𝐺 + 0.114𝐵𝐵�𝑈𝑈 = −0.147𝑅𝑅 − 0.289𝐺𝐺 + 0.436𝐵𝐵
𝑉𝑉 = 0.615𝑅𝑅 − 0.515𝐺𝐺 − 0.1𝐵𝐵
V = max(R, G, B)

𝑉𝑉 − min(𝑅𝑅, 𝐺𝐺, 𝐵𝐵)𝑖𝑖𝑖𝑖 𝑉𝑉 ≠ 0
S=�
𝑉𝑉
0 𝑖𝑖𝑖𝑖 𝑉𝑉 = 0⎧⎪60(𝐺𝐺−𝐵𝐵)
𝑆𝑆

4.2. The design of robot decision
In this design, LCD screen is used to display the image
after binary image processing, and LCD screen is used as
calibration reference, that is to say, it can display 24 linesand 240 columns of pixels in the middle part collected bythe camera. According to the position of the target
displayed on the LCD screen to determine the next action
to be performed by the soccer robot, Figure 7 is aschematic diagram of the LCD screen area with 24 linesand 240 columns of pixels, and the number at the bottomof the figure is the number of columns of pixel points.

(1)

(2)
(3)

𝑖𝑖𝑖𝑖 𝑉𝑉 = 𝑅𝑅

Fig.7. Schematic diagram of the LCD screen

60(𝐵𝐵−𝑅𝑅)(4)
H = 120 +𝑖𝑖𝑖𝑖 𝑉𝑉 = 𝐺𝐺
𝑆𝑆⎨⎪240 + 60(𝑅𝑅−𝐺𝐺) 𝑖𝑖𝑖𝑖 𝑉𝑉 = 𝐵𝐵⎩𝑆𝑆
RGB model is seldom used in artificial intelligencebecause it is easy to be affected by the light. However, theIn the process of approaching a soccer, in a line of pixels:
if the pixels on each column marked with a number are
white, that is, the robot does not see the soccer, the robot
heads up; if the pixels on each column marked with a78

5. Conclusion and future work

number are black, the robot sees the soccer, and the soccer
is in front of the robot, the robot lowers its head and goesstraight for one step; if the pixels in the 129 and 110
columns are all Black, no matter whether the othercolumns are black or white, it is considered that the soccer
is in front of the robot, and the robot lowers its head andgoes straight for one step; if only the pixels in column 0
are black or the pixels in column 0 and column 20 are black,and the soccer is on the left side of the robot, the robot
turns left; if only the pixels in column 239 are black or thepixels in column 239 and column 219 are black, and thesoccer is on the right side of the robot, the robot turns right.
From approaching football decision-making program toshooting decision-making program: the robot camera
rotates upward along the x-axis from the initial position
until the football is detected, and the rotation angle is set
as α. As shown in Figure 8, when α ≥ 2.22 °, theapproaching football decision-making program isexecuted; when α < 2.22 °, the foot ball has reached thefoot of the robot, and the shooting decision-making
program is executed as shown in Figure 8.

Based on STM32F103 single chip microcomputer, thispaper studies the humanoid soccer robot system, designs athreshold binary image processing algorithm and soccer
tracking and shooting program, and applies the algorithm
and program to build the hardware system of humanoidsoccer robot, which can recognize and track the objects
with single color and regular shape. And completed thefootball tracking and shooting tasks well. The wholesystem hardware is simple and clear, and the software
efficiency is high and the logic is strong.
Although the design meets the design requirements, due
to the limited level of the author and the limitation ofresearch time and test conditions, the following
improvements are needed for the design and research ofhumanoid soccer robot:
The height of the soccer robot must be increased, andthe shooting speed must be accelerated to meet therequirements of the next stage of the game, that is, tocomplete the air ball shooting, so the driving source ofeach joint must have greater torque, and the robot system
must make some improvements in the control of thesteering gear with large torque. At present, soccer robots
do not perform well in shooting angle control. The solution
is to add gyroscope to the robot body, which makes therobot control system add gyroscope interface. This design
only completes the design requirements in the simple
competition environment, but also needs to study thesoccer recognition, tracking, shooting and other issues in
the more complex environment.

Fig.8. Definition of αReferences

In the process of shooting, as the goalkeeper robot usually
stands in the middle of the goal, the design of this robot
shoots left or right instead of in the middle to avoid thegoalkeeper robot. The robot heads up and turns left todetect the left edge of the goal line, as shown in Figure 9.
When more than nine columns of pixels marked withnumbers on the LCD screen are black, it is considered that
there is no goalkeeper in front of the left edge of the goalline. The robot shoots at the left edge, otherwise it shootsat the right edge of the goal line.

1. Nagatani K, Kiribayashi S, Okada Y, et al., Emergency
response to the nuclear accident at the Fukushima Daiichi
Nuclear Power Plants using mobile rescue[J]. Journal ofField Robotics, 2013, 30(1), pp 44-63.
2. Haipeng Li, Research on vision of humanoid soccor robot
based on arm[D]. Hebei: Yanshan University, 2013.
3. Ke Liu, Research and implementation of target recognition
algorithm and action planning in humanoid robot [D].
Hebei: Yanshan University, 2011, pp. 7-8.
4. Tian Deyong, PWM experiment teaching based on STM32timer [J]. Electronic technology and software engineering,2019 (20), pp. 102-103.
5. Yuan Yongchao, Deng jiongfeng. Research on automobileanti-theft device based on STC12C5A60S2 [J]. Computer
products and circulation, 2019 (07),178.
6. Zhimin Ren, Design of an image real-time display system
based on OV7725 [J]. Fujian computer, 2013, 29 (01), pp.
128-130.
7. Caixia Zhao, Research on target dynamic tracking based on
STM32 mobile robot [D]. Inner Mongolia: Inner Mongolia
University, 2017.

Fig.9. Goal edge

798. Xiaoliang Chu, Analysis of TFT-LCD technology
development trend [J]. Electronic world, 2018 (20), pp. 7374.
9. Wenping Xi, Jian Zhang, Design of vision recognition
system for humanoid soccer robot based ARM [J].
Microcomputer and application, 2015, 34 (09), pp. 51-53.

Mr. Wanlong Peng

Authors Introduction
Mr.Yuheng Zhang

Dr. Yizhun Peng

Mr. Lianchen Zhao

Mr. Zhou Zhang

He is a first-year master candidate
in Tianjin University of Scienceand Technology, majoring incontrol engineering. His research
field is intelligent robot. He won
the third prize in the Robot
Challenge 2019
humanoidsumo item.

He is an Associate Professor inTianjin University of Science &Technology. He received adoctor's degree in control theory
and control engineering from theInstitute of Automation，Chinese
Academy of Sciences, in 2006.His
research field is intelligent robot
and intelligent control.
He is currently the master course
student in Tianjin University ofScience & Technology. His
research field is artificial
intelligent. His research direction isnatural language processing andmachine learning.
.

He is now an underground inTianjin University of Science &Technology. His research field isembedded development.

80

He is currently the master course
student in Tianjin University ofScience & Technology. Principle ofautomatic control, his research field
is about intelligent robot. During hisstudy, he has participated in andwon awards as university robot
competition.