You are on page 1of 9

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/289520277

AN FPGA BASED ROBOT CONTROLLER DESIGN AND IMPLEMENTATION

Conference Paper · May 2015

CITATION READS

1 2,257

2 authors:

Hüseyin Oktay Erkol Hüseyin Demirel


Louisiana State University Karabuk University
19 PUBLICATIONS 85 CITATIONS 34 PUBLICATIONS 137 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Hüseyin Demirel on 07 January 2016.

The user has requested enhancement of the downloaded file.


AN FPGA BASED ROBOT CONTROLLER DESIGN AND
IMPLEMENTATION

Hüseyin Oktay ERKOL*, Hüseyin DEMİREL**

*Karabuk University, Technology Faculty, Dept. of Mechatronics Engr. 78000, Karabuk, Turkey, E-mail:
oktayerkol@karabuk.edu.tr
**Karabuk University, Engineering Faculty, Dept. of Electrics-Electronics Engr. 78000, Karabuk, Turkey, E-mail:
husdemirel06@gmail.com

Abstract

In this study, a co-processor for six-legged robot is designed and implemented. Kinematic calculations are
complicated and many times we need a separate computation unit when we need high accuracy and precision. Co-
processor usage is widespread for decreasing the load on the main computation unit. The co-processor designed in this
study is specialized for servo motors controlled via serial port. The co-processor takes and sends the command via serial
port. It can compute the joint angels of an 18 degree of freedom (DOF) six-legged robot in real time. The experimental
studies are made by computer and on a robot prototype and taken good results.

Keywords: Six legged robot, Co-processor, Kinematics,

1 Introduction

Robotics is a popular study. Different type of robots has been designed until today. Legged robots are generally
more interesting because of they are similar to things in nature. They can have two legs like human, four legs like dog,
or many legs like insects and etc. Legged robots have more complex control structure in comparison with wheeled
robots. The mathematical model gets more complex with the increase of degree of freedom (DOF). So we need more
powerful microcontroller to solve mathematical model and control the robot. Many times we need more than one
microcontroller for solutions in desired accuracy and precision. In this case we can use a co-processor for decreasing the
load of main microcontroller and FPGAs are the most frequently used tool for designing a co-processor.

Vachhani et al developed a controller for kinematic calculation of mobile robot by FPGA in 2009 [1]. The
robot can follow a wall using the controller. Huang made studies for robots have four bidirectional wheels in 2013. He
used artificial immune system and ant colony algorithms [2,3]. Baturone et al embedded neuro-fuzzy techniques on an
FPGA for wheeled mobile robot in 2014 [4]. Cho and et al developed a multi axis motion system controller using FPGA
[5] in 2009 and it is applied on a robot arm. In another study, Juang et al developed a hardware for solving the
kinematic equations of a 4DOF robot arm [6]. The developed hardware is a co-processor takes the load on the main
processor. Zhu et al developed a solution for precision control of robot arm using virtual decomposition control method
and FPGA in 2013 [7]. Chou and et al designed a controller and driver for 3-axis robot used in food industry [8]. In the
study, FPGA is a co-processor and used to control permanent magnet DC motors.

This paper presents a co-processor designed and implemented for a six-legged robot. The co-processor can
solve the all kinematics of the robot and control the servo motors for realizing the motion. It receives the foot positions
via serial port and sends the joint angels to servo motors via serial port after solving the kinematics. A six-legged robot
designed for experimental study of this co-processor.

2 Material and method

The general structure of the co-processor and its relations with other hardware is given in Figure 1. The DSP
generates the foot positions and sends to the FPGA. The designed hardware on FPGA generates the joint angels using
the foot positions and sends them to the servo motors. All calculations are made simultaneously. Hardware on the
FPGA is developed by VHDL language.
Figure 1 Parallel structure of co-processor

On the FPGA, there are six parallel calculation units. When a foot position packet is received, each of the foot
position is given to the related calculation unit as a parameter. All joint angels are calculated synchronously using the
inverse kinematics and packaged. The joint angle package is sent to the motors via serial port. The functional block
diagram of the designed co-processor is given in Figure 2.

RECEIVER TRANCIEVER

UNPACKAGING PACKING

KINEMATICS CO-PROCCESSOR

Figure 2 The functional block diagram of the co-processor

The kinematic model embedded in the co-processor is based on a 3 degree of freedom leg structure. Each leg
of robot has the same mechanical structure and mathematical model. The leg drawing used in the design is given in
Figure 3. ai refers to the lengths and βi refers to the rotary joint angels. Denavit–Hartenberg parameters of the legs are
given in Table 1. The kinematic equations are solved based on these parameters and embedded in the co-processor.
Detailed information about a kinematic calculations can be found in [9].

Z0

β1
a3 β3

β2
a2

a1

Mechanic sensor
Figure 3 Basic leg parameters

Table 1 Denavit–Hartenberg parameters for 3-dof leg

i αi ai di βi
1 0 0 0 β1
2 90 84,146mm 0 β2
3 0 98,514mm 0 β3

2.1 Serial communication and package structure

A serial port is an electronic hardware that sends only one bit of any data at any time. It uses less data line and
has small connectors as an advantage [10,11]. An asynchronous serial data transmission example is given in Figure 4.
The data is sent bit by bit to the transmission line. It is an asynchronous transmission and each bit of data is sends in a
fixed period. The period is depends on the communication speed. As an example, if the communication speed is 9600
bit per second (bps), the period is 1s/9600=0,01ms. The widely used speeds are 9600-115200 bps and the most used
format is 8-N-1. 8-N-1 means that 8-bits data, no parity bit and one stop bit.

Figure 4 Serial data example

Structure of the serial port used on the designed co-processor is given in Figure 5. The clock block generates
the required clock pulses that the period is determined by the communication speed. On the transceiver side, input data
is sends using the output buffer and clock by the state machine. One start and one stop bit are added to the data for this
process. On the receiver side, data on the line is saved in input memory and transferred data memory by the state
machine.

Transceiver Receiver

Clock Clock

State Machine State Machine

Data Data Data Data


input memory memory output
Data
line
Output Buffer Input Buffer

Figure 5 The designed serial port block diagram

2.2 Servo motors and Package structure

In this study, smart servo motors controlled via serial port are used. The model of motors is Herkulex DRS-101
given in Figure 6 [12]. Up to 254 motors can be connected to only one data and power line. Its recommended input
voltage is 7,4V. Its inputs and outputs have TTL standards and its angular resolution is 0,325 degree. This type of
motors is suitable for robotic applications.
Figure 6 Herkulex DRS-101 servo motor

Motor pin descriptions are given in


Table 2 and general connection scheme is given in Figure 7. Motors are controlled via serial port. They use a
standard package structure which includes motor position, speed and other information. The package structure is given
in Table 3. The package starts with the 2-byte length header. After the header, there are package size information, motor
id (pID), command (CMD) perform by the motor, 2-byte length checksum for error check and other optional data. Total
length of the package can be maximum 216 byte. Detailed information can be found in reference [12].

Table 2 Details of motor connectors

Pin number Name Description


1 GND Ground connection
2 VDD Voltage input
3 TXD Serial port TX line
4 RXD Serial port RX line

Figure 7 General connection scheme of motors

Table 3 Details of communication packet

Pack Check Check Data


Header pID CMD
size Sum1 Sum2 [n]
0xFF 7- 0-
Value 1-9 - - -
0xFF 223 0xFE
Length Max.
2 1 1 1 1 1
(byte) 216

2.3 Package structure of co- processor

The co-processor receives the command from microcontroller via serial port in a special package format. This
format is different from the servo motors uses. The package structure is given in Table 4. The package starts with the 2-
byte length header. There is command byte after the header. Command is multiples of 6 and must be chosen to total leg
number. It is 6 for one leg, 12 for two legs or 24 for four legs. This co-processor is designed a six-legged robot and the
command is always 36. After command word, there are position parameters for each leg sequentially given in Table 5.
Each of position parameters includes the required X, Y, Z positions of the foot. The detailed information can be found
in [13] that our early study.
Table 4 The package structure co-processer uses

Position Position Position


Header Command parameter parameter parameter
1 2 N (max. 6)
0x41
Value 6-36 - - -
0x41
Length (byte) 2 1 6 6 6

Table 5 The structure of position parameters

Position parameter
Symbol (+/-)Px Px (+/-)Py Py (+/-)Pz Pz
Value 2B/2D 0-FF 2B/2D 0-FF 2B/2D 0-FF
Length (byte) 1 1 1 1 1 1

2.4 Electronics

The electronic hardware consists of mainboard, FPGA, DSP, sensors and a radio module. General block
diagram of electronic system is given in Figure 8. The main board is designed for this study. It has power supply for all
components, sensor circuits, indicators, data lines and connectors. The designed main board is shown in Figure 9. Board
input voltage is 7,4-12V and a li-po battery is used as voltage source. Same of the components are added for feature
works and not used in this study.

DSP FPGA

5V regulator Indicators

Connectors

XBee

Power line 18xservo


Data line motor 6xMechanic
sensor

Figure 8 General block diagram of electronic system


Figure 9 the designed main board and the DSP

The used microcontroller card in this study is STM32 F4 discovery [14]. It has an ARM Cortex-MF4 core and
168MHz clock speed. There is 1MByte flash on the board and a programmer. Its input voltage is 5V. All CPU pins are
usable by expanding slots. It used for sending the foot parameters to FPGA. The DSP board is given with main board in
Figure 9. FPGA board used in this study is Altera DE0-Nano given in fig xxx [15]. It has Cyclone IV EP4CE22F17C6N
chip, 32MB flash, 2Kb eeprom, 3-axis accelerometer, user buttons and input/outputs. It is suitable for robotic
applications. The designed co-processor is realized on this FPGA. Electro mechanic sensors are used to sense the foot
contacts with ground during the walking process. Electro mechanic switches are used as sensor is given in Figure 8. The
used radio module is XBee series 1 radio frequency data module [16]. It has maximum 115200 bps communication
speed, 3V input voltage, 100ft outdoor range. It is placed for further study, not used in this application.

3 Experimental study

Experimental study in this work has two steps. As the first step, the electronic hardware is connected to a
computer via serial port and foot positions are sent to the FPGA via serial port. On the other hand, the FPGA outputs
are taken from a second serial port and saved. The output of hardware and the theoretical calculations are compared.
The foot positions sent to the FPGA are shown in the Figure 10. The calculated joint angels are shown in Figure 11and
the comparison of theoretical and application results are given in Figure 12. The maximum error seen in this
comparison is about 1º.

60
Px
40

20
Position (mm)

Py
0
Pz
-20

-40

-60
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (s)

Figure 10 Sending foot positions in X/Y/Z


50
Teta2

Angle (degree)
0

Teta1
-50

-100
Teta3

-150
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (s)

Figure 11 Theorical joint angels of one leg

50
Teta2
Angle (degree)

Teta1
-50

-100
Teta3

-150
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
Time (s)

Figure 12 Comparison of theoretical results and the outputs of FPGA

The second step of the experimental study is made on a real robot. All electronic and robot with foot sensors
are seen in the Figure 13. In this system the foot positions for robot are sent by a DSP board. This experiment shows the
co-processor on the FPGA works with all functions what for designed.

Figure 13 The robot used for experimental study

4 Conclusions

In this study, a co-processor is designed and implemented for a six-legged, 18-DOF robot. It takes the load on
the main processor and provides more accuracy and precision results. It takes the command via serial port and can be
used with the servo motors controlled via serial port. A six-legged robot is designed and used for functional test of the
co-processor. This robot has six legs with 3-DOF and electro mechanic foot sensors for sensing the ground contact. For
future works, a robot design that has improved sensor system, wireless control capability and remote control interface is
planned.

References

[1] Vachhani L, Sridharan K, Meher PK. Efficient FPGA realization of cordic with application to robotic
exploration. IEEE Trans Ind Electron 2009;56:4915–29.
[2] Huang H-C. Intelligent Motion Control for Omnidirectional Mobile Robots Using Parallel ACO Algorithm.
Adv Mech Eng 2011;2013:131–6.
[3] Huang H-C. SoPC-Based Parallel ACO Algorithm and Its Application to Optimal Motion Controller Design for
Intelligent Omnidirectional Mobile Robots. IEEE Trans Ind Informatics 2012;9:1–1.
[4] Baturone I, Gersnoviez A, Barriga Á. Neuro-fuzzy techniques to optimize an FPGA embedded controller for
robot navigation. Appl Soft Comput 2014;21:95–106.
[5] Cho JU, Le QN, Jeon JW. An FPGA-based multiple-axis motion control chip. IEEE Trans. Ind. Electron., vol.
56, 2009, p. 856–70.
[6] Juang YS, Sung TY, Ko LT, Li CL. FPGA implementation of a CORDIC-based joint angle processor for a
climbing robot. Int J Adv Robot Syst 2013;10:1.
[7] Zhu WH, Lamarche T, Dupuis E, Jameux D, Barnard P, Liu G. Precision control of modular robot
manipulators: The vdc approach with embedded fpga. IEEE Trans Robot 2013;29:1162–79.
[8] Chou HH, Kung YS, Tsui TW, Cheng S. FPGA-based motion controller for wafer-handling robot. Trans Can
Soc Mech Eng 2013;37:427–37.
[9] Siciliano B, Sciavicco L, Villani L, Oriolo G. Robotics. Springer; 2009.
[10] Axelson J. Serial Port Complate. 2nd ed. Lakeview Research; 2007.
[11] Erkol HO, Demirel H. FPGA ile Seri Port Tasarımı ve Uygulaması. Otomatik Kontrol Ulus. Toplantısı,
TOK2013, Malatya: 2013, p. 132–5.
[12] Dongbu Robot, http://www.dongburobot.com/(Mart 2015).
[13] Erkol HO, Demirel H. A VHDL application for kinematic equation solutions of multi-degree-of-freedom
systems. J Zhejiang Univ Sci C 2014;15:1164–73.
[14] STMicroelectronics, http:// www.st.com/ (Mart 2015).
[15] Altera, https://www.altera.com/ (Mart 2015).
[16] Digi, http://www.digi.com/ (Mart 2015).

View publication stats

You might also like