Terasic Self-Balancing Robot User manual

Self-Balancing Robot
Getting Started Guide
1
www.terasic.com
July 12, 2018
y94

Self-Balancing Robot
Getting Started Guide
I
www.terasic.com
July 12, 2018
CONTENTS
CHAPTER 1
INTRODUCTION
...............................................................................................................................1
1.1 PACKAGE CONTENTS.................................................................................................................................................1
CHAPTER 2
COMPONENTS AND FUNCTIONS
...............................................................................................3
2.1 PARTS AND FUNCTIONS .............................................................................................................................................3
2.2 DE10-NANO KITAND MOTOR DRIVER BOARD.........................................................................................................6
CHAPTER 3
SETUP ELEMENTS
..........................................................................................................................1
3.1 CONFIGURATION MODE SWITCHES ...........................................................................................................................1
3.2 OPERATION MODE SWITCHES ...................................................................................................................................2
3.3 LEDS ON THE MOTOR DRIVER BOARD .....................................................................................................................3
3.4 LEDS ON DE10-NANO BOARD .................................................................................................................................4
CHAPTER 4
BASIC OPERATIONS
......................................................................................................................6
4.1 CONNECT POWER PORT.............................................................................................................................................6
4.2 POWER ON THE ROBOT..............................................................................................................................................7
4.3 KEEPABALANCED STATE .........................................................................................................................................8
4.4ATTITUDE CONTROL..................................................................................................................................................8
CHAPTER 5
ADVANCED FEATURES DEMONSTRATION
.............................................................................9
5.1 OBSTACLE AVOIDANCE DEMONSTRATE......................................................................................................................9
5.2 SMARTPHONE APPCONTROL..................................................................................................................................10
5.3 IR REMOTE CONTROL.............................................................................................................................................19
CHAPTER 6
CHARGING THE BATTERY
..........................................................................................................21
CHAPTER 7
RESTORE FACTORY SETTING
..................................................................................................23
7.1ARM VERSION RESTORING.....................................................................................................................................23
7.2 NIOS VERSION RESTORING ....................................................................................................................................25
ADDITIONAL INFORMATION
.....................................................................................................................................28

Self-Balancing Robot
Getting Started Guide
1
www.terasic.com
July 12, 2018
Chapter 1
Introduction
Based on the Terasic DE10-Nano SoC board platform, designed and manufactured independently
by Terasic, the Self-Balancing Robot is a Multi-functional kit. It can implement advanced features
like object following, obstacle avoidance and so on. It can also be remote controlled by an Android
Smartphone’s APP and IR remote control. This guide describes in detail how users can make the
robot work.
1
1.
.1
1
P
Pa
ac
ck
ka
ag
ge
e
C
Co
on
nt
te
en
nt
ts
s
Figure 1-1 shows the package contents of the Self-Balancing Robot kit
Figure 1-1 Self-Balancing Robot package
The Self-Balancing Robot kit package contents:
①Self-Balancing Robot
②Lithium Battery

Self-Balancing Robot
Getting Started Guide
2
www.terasic.com
July 12, 2018
③Lithium Battery Charger
④IR Remote Control
⑤Mini USB Cable
⑥Micro USB Cable
⑦Quick Start Guide

Self-Balancing Robot
Getting Started Guide
3
www.terasic.com
July 12, 2018
Chapter 2
Components and Functions
2
2.
.1
1
P
Pa
ar
rt
ts
s
a
an
nd
d
F
Fu
un
nc
ct
ti
io
on
ns
s
This chapter will describe the robot’s components and the functions of the components, such as the
ultrasonic module, motors, wheels and driving board power interface. Figure 2-1, Figure 2-2,
Figure 2-3 and Figure 2-4 show all the components and specify their function.
Figure 2-1 Self-Balancing Robot components
⑴Ultrasonic module:implements obstacle avoidance.
⑵Battery package:helps to protect the batteries and avoid bumping and damaging the battery.
⑶Motors:drive the Self-Balancing robot wheels.
⑷Wheels:implements the Self-Balancing robot’s movement.

Self-Balancing Robot
Getting Started Guide
4
www.terasic.com
July 12, 2018
Figure 2-2 Self-Balancing Robot components
⑸Ethernet port:implements connecting to the ethernet when users develop their own designs on
the Self-Balancing robot.
⑹OTG port:implements Host or Device mode when users develop their own design on the
Self-Balancing robot.
⑺UART serial port:implement the communication between the board and PC when users develop
their own design on the Self-Balancing robot.
Figure 2-3 Self-Balancing Robot components

Self-Balancing Robot
Getting Started Guide
5
www.terasic.com
July 12, 2018
⑻DE10-Nano Development Board power supply jack:5V power supply port.
⑼HDMI TX port:users can connect the Displayer to HDMI interface when they make image
processing designs.
⑽USB Blaster II port:users can download their own programs to the board through the connector.
⑾Motor driver board power jack:connects to the battery power supply port and provides power
for the Self-Balancing robot.
⑿Main power Switch:power on or power off the Self-Balancing robot.
⒀Battery power output plug:connect to motor driver board power port.
Figure 2-4 Self-Balancing robot components
⒁Battery charging jack:connects the charger to charge the battery.
⒂Battery:the Self-Balancing robot’s power source.

Self-Balancing Robot
Getting Started Guide
6
www.terasic.com
July 12, 2018
2
2.
.2
2
D
DE
E1
10
0-
-N
Na
an
no
o
K
Ki
it
t
a
an
nd
d
M
Mo
ot
to
or
r
D
Dr
ri
iv
ve
er
r
B
Bo
oa
ar
rd
d
The Self-Balancing Robot control system consist two boards, Terasic DE10-Nano FPGA board and
Motor Driver board (BAL board) as shown in Figure 2-5. The FPGA on the DE10-Nano is
responsible for all the functions of the balance and control system. The motor driver board receives
the control signal from the de10-nano to control the motor rotation. There are also some sensors and
communication devices on the motor driver board. These devices can provide the status data of the
robot and external communication interface to FPGA. For detailed hardware information, please
refer to 03_Hardware_Manual.pdf which can be found in the CD package.
Figure 2-5 DE10-Nano and Motor Driver Board

Self-Balancing Robot
Getting Started Guide
1
www.terasic.com
July 12, 2018
Chapter 3
Setup Elements
This chapter will introduce the switches and buttons that can be set on the Self-Balancing Robot. It
explains the meaning and function of the setting.
3
3.
.1
1
C
Co
on
nf
fi
ig
gu
ur
ra
at
ti
io
on
n
M
Mo
od
de
e
S
Sw
wi
it
tc
ch
he
es
s
The Self-Balancing Robot equips a Cyclone SoC FPGA, which means that the ARM processor is
embedded in the FPGA. Therefore, there are two processor options available to control the Robot.
One is to use the ARM processor and the other is implement a NIOS II processor in the FPGA. The
kit provides the factory code for both processor. To switch between these two processor modes, user
need to select via the mode select switch(MSEL[4:0]).
If user want to select ARM to control the robot, the MSEL[4:0] needs to switch to "01010", as
shown in Figure 3-1. Thus, when the robot is power on, the FPGA will boot from the Micro SD
card and run the Linux byARM processor to control the robot.
Figure 3-1 Set MSEL[4:0] to 01010

Self-Balancing Robot
Getting Started Guide
2
www.terasic.com
July 12, 2018
When MSEL[4:0] is set to "10010", as shown in Figure 3-2.The FPGA will boot from the
configuration device(EPCS). Then, after FPGA is configured, the NIOS II processor will control the
robot. For users who is beginners to learn FPGA, using NIOS II processor will be easier than deal
with the ARM processor. The factory default setting of the robot is Nios version, when switch the
robot to ARM version and power on it, users need to wait about 20 seconds before the LED7 is light
on.
Figure 3-2 Set MSEL[4:0] to 10010
3
3.
.2
2
O
Op
pe
er
ra
at
ti
io
on
n
M
Mo
od
de
e
S
Sw
wi
it
tc
ch
he
es
s
Figure 3-3 shows the SW0 and SW1 on the DE10-Nano board, Table 3-1 describes the
corresponding modes and functions when SW0 and SW1 are set to different positions.
Figure 3-3 SW0 and SW1 on DE10-Nano board

Self-Balancing Robot
Getting Started Guide
3
www.terasic.com
July 12, 2018
Table 3-1 SW0 and SW1 purpose
SW[1:0]
Setting
Robot mode and
function
Description
00
Default mode
(Bluetooth and IR
mode)
The robot can be controlled by smartphone
APP and IR remote control
10
Default mode and
Obstacle Avoidance
The robot can be controlled by a
smartphone’s APP and IR remote control,
it implements the obstacle avoidance
function (Only IR remote control supports)
01
Object following &
Obstacle Avoidance
The robot implements the object following
and Obstacle Avoidance (In this mode, the
robot will not be controlled by smartphone
APP and IR remote control)
11
Debug mode
Only supports ARM version robot, the
control program will stop running, users
need to reboot the robot or run the program
again to control the robot. Normally it is
used to debug the robot.
3
3.
.3
3
L
LE
ED
Ds
s
o
on
n
t
th
he
e
M
Mo
ot
to
or
r
D
Dr
ri
iv
ve
er
r
B
Bo
oa
ar
rd
d
Figure 3-4 shows the LED1 and LED2 on the motor driver board, Table 3-2 describes the
functions of LED1 and LED2.

Self-Balancing Robot
Getting Started Guide
4
www.terasic.com
July 12, 2018
Figure 3-4 LED1 and LED2 on the motor driver board
Table 3-2 Motor driver board LEDs functions
LED name
Description
LED1
Indicates the power supply status to motor driver
board
LED2
Indicates the motor driver board provides 5V power
to the DE10-Nano board
3
3.
.4
4
L
LE
ED
Ds
s
o
on
n
D
DE
E1
10
0-
-N
Na
an
no
o
B
Bo
oa
ar
rd
d
Figure 3-5 shows the 3.3V power LED, CONF_D LED and other LEDS on the DE10-Nano board,
Table 3-3 describes the LEDs functions.

Self-Balancing Robot
Getting Started Guide
5
www.terasic.com
July 12, 2018
Figure 3-5 Indicator LEDs on DE10-Nano board
Table 3-3 Indicator LEDs on the DE10-Nano board
LED name
LED status
Description
3.3V power
LED
Light On
Illuminate when 3.3V power is active
CONF_D
Light On
DE10-Nano board Configuration done
LED7
Light On
Robot is keeping balanced status
LED6~5
1--Light On
0--Light off
00--robot is in default mode (Bluetooth & IR control)
01--robot is in default mode and implements obstacle
avoidance function
10--robot implements object following and obstacle
avoidance function
LED4
Light On
Battery power supply voltage is lower than 10.5V
LED3
Light On
Robot is turning right
LED2
Light On
Robot is turning left
LED1
Light On
Robot is moving backward
LED0
Light On
Robot is moving forward
Note: When LED3~0 are all lit indicates the robot is in DEMO mode.

Self-Balancing Robot
Getting Started Guide
6
www.terasic.com
July 12, 2018
Chapter 4
Basic Operations
This chapter illustrates the basic operations on how to start the robot when users receive it.
4
4.
.1
1
C
Co
on
nn
ne
ec
ct
t
P
Po
ow
we
er
r
P
Po
or
rt
t
Remove the red protective cap from the output plug of the battery power, as shown in Figure 4-1.
Figure 4-1 Remove the protective cap
Insert the output plug of battery power into the input port of the motor driver board, as shown in
Figure 4-2.

Self-Balancing Robot
Getting Started Guide
7
www.terasic.com
July 12, 2018
Figure 4-2 Connect the battery power connector to the power input port
4
4.
.2
2
P
Po
ow
we
er
r
o
on
n
t
th
he
e
R
Ro
ob
bo
ot
t
Place the robot on the plane, keep it in a horizontal state, then set the power switch of the motor
driver board to ON position, as shown in Figure 4-3.
Figure 4-3 Set SW1 to ON position

Self-Balancing Robot
Getting Started Guide
8
www.terasic.com
July 12, 2018
4
4.
.3
3
K
Ke
ee
ep
p
a
a
B
Ba
al
la
an
nc
ce
ed
d
S
St
ta
at
te
e
When the LED7 on the DE10-Nano board is lit, please release the robot, it will keep balance
automatically, as shown in Figure 4-4.
Figure 4-4 LED7 lights on shows the robot is in balance state
4
4.
.4
4
A
At
tt
ti
it
tu
ud
de
e
C
Co
on
nt
tr
ro
ol
l
The robot can perform posture recognition in real time through the acceleration sensor and the
gyroscope and achieve balance by controlling the motors and adjusting the posture. For example,
pick up the robot, it will detect that its current state is not in a horizontal state, when the robot is
placed on a horizontal plane, the robot will access its current balance status and adjust accordingly
and keeping it in balanced state without any external help. If an external force causes the robot to
tilt forward, the motors will quickly produce the forward motion torque to compensate for the angle
of the tilt and maintain the balance of the robot. If an irregular object is placed on the robot, the
robot body will maintain balance.

Self-Balancing Robot
Getting Started Guide
9
www.terasic.com
July 12, 2018
Chapter 5
Advanced Features Demonstration
Based on the DE10-Nano SoC FPGA platform, Terasic’s Self-Balancing Robot can implement
attitude algorithm, perform motion control, and execute movements autonomously, such as moving
forward, turning right & left, power monitoring, object following and obstacle avoidance. Line
following and obstacle avoidance are described below.
5
5.
.1
1
O
Ob
bj
je
ec
ct
t
f
fo
ol
ll
lo
ow
wi
in
ng
g
a
an
nd
d
O
Ob
bs
st
ta
ac
cl
le
e
a
av
vo
oi
id
da
an
nc
ce
e
d
de
em
mo
on
ns
st
tr
ra
at
te
e
Once the ultrasonic module is assembled on the robot, object following and obstacle avoidance can
be implemented with the module.
When the robot is in object following and obstacle avoidance is on (SW[1:0] is on “01” position, as
shown in Table 3-1), if the ultrasonic sensor detects the obstacle is in front of the robot and the
distance is within 10 cm, the robot will automatically move backward, which will implement the
obstacle avoidance function, as shown in Figure 5-1.

Self-Balancing Robot
Getting Started Guide
10
www.terasic.com
July 12, 2018
Figure 5-1 Obstacle avoidance demonstrate
When an object is in front of the ultrasonic module and moves slowly and the distance is within 10
cm~20 cm, the robot will continue to move along with the object, which will implement the object
following function, as shown in Figure 5-2.
Figure 5-2 Object following demonstrate
5
5.
.2
2
S
Sm
ma
ar
rt
tp
ph
ho
on
ne
e
A
AP
PP
P
C
Co
on
nt
tr
ro
ol
l
The robot can be remote controlled by a Smartphone APP, this section describes how to control the

Self-Balancing Robot
Getting Started Guide
11
www.terasic.com
July 12, 2018
robot by APP.
5
5.
.2
2.
.1
1
A
An
nd
dr
ro
oi
id
d
A
AP
PP
P
C
Co
on
nt
tr
ro
ol
l
◼DownloadAPP
Users can download and install the Android Smartphone APP by scanning the QR code below (See
Figure 5-3) or download the APP file from the link:
http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=238&No=109
6&PartNo=4
After the installation is completed, theAPP icon is shown as Figure 5-4,
Figure 5-3 Download QR code of the APP
Figure 5-4 Android APP icon
◼Connect APPand Robot
Power on the robot, set SW0~3 of the DE10-Nano to Down position, as shown in Figure 5-5.

Self-Balancing Robot
Getting Started Guide
12
www.terasic.com
July 12, 2018
Figure 5-5 Set SW0~3 to Down position
Run the robot APP, click the search icon on the upper right corner of the APP GUI, as shown in
Figure 5-6
Figure 5-6 Click the search icon on theAPPGUI
Other manuals for Self-Balancing Robot
2
Table of contents
Other Terasic Robotics manuals
Popular Robotics manuals by other brands

Janome
Janome JSR4400N SCARASeries Operation manual

Zimmer
Zimmer DVR Series Installation and operating instructions

OnRobot
OnRobot UR CB3 Series user manual

Universal Robots
Universal Robots UR-6-85-5-A user manual

Thames & Kosmos
Thames & Kosmos TUMBLING HEDGEHOG Experiment manual

EasyRobotics
EasyRobotics PROFEEDER X user manual