Self-Balancing Robot
User Guide
1
www.terasic.com
July 12, 2018
Chapter 1
Using the Self-Balancing Robot
1
1
.
.
1
1
C
C
o
o
n
n
t
t
r
r
o
o
l
l
t
t
h
h
e
e
M
M
o
o
t
t
o
o
r
r
To keep the robot in vertical balance status, user need to control the rotation of the motor and make
sure the accelerated rotation direction is reversed to the robot tilt direction. User need to learn how
to control the rotation direction and speed of the motor.
This section describes how to control the motor forward rotation or reverse, also describes how to
control the speed of the motor. As general FPGA IOs of DE10-Nano are unable to drive the motor,
an extra motor drive chip or circuit is needed to drive the motors, the motor drive chip used on the
robot is Toshiba TB6612FNG, which can be used to control two DC motors simultaneously. As
shown in
Figure 1- 1
,
t
he control signals--- IN1, IN2, PWM (control signals of motor A and B) and
STBY are connected to FPGA, the control signals --O1 and O2 output to the motor. The way to
control the rotation direction and speed of the motors is described as below.
Figure 1- 1 Block Diagram of Motor Driver Control Function
Note:
As there are some photo couplers between the FPGA and TB6612FNG, the logic of control