Real Time FPGA-Based Ethernet Control Communication for Robotic Arm

. In this paper, an approach for real time control communication using Ethernet is proposed. The strategy to support this at the network level and include Field Programmable Gate Array (FPGA) implementation on the Ethernet platform for robotic arm. An embedded Ethernet controller is designed to send data packet via Ethernet Local Area Network (LAN). The transferring data also employs Arduino Mega as the medium of communication between FPGA board and the robotic arm. It is used as the receiver to receive data packet from FPGA board with the interface of Arduino Ethernet shield. The control operation on the robotic arm is performed once the desired data packet length is reached to the Arduino Mega. SolidWorks and MATLAB software are used to design the robotic arm and simulate the robotic arm working flexibility in real world respectively. The result of the average data packet delay between FPGA boards is lower in comparison to Arduiono board. The data packet can send successfully in through the network to test the robotic arm.


Introduction
Real time system is a system that produces instant output response within a specific amount of time without delay after receiving input signal [1].It has the advantages over the non-real time system because non real time systems do not produce immediate response and do not have accountability [2].Embedded communication network real time system is used in applications which require a set of synchronized data to be delivered in time and high response speed.Many field of application especially safety critical application use embedded communication network control to interact with real world due to flexible of designed system and less wiring complexity [3,4].Examples of safety critical application are military, robotics, medical, transportation system and avionics.Various types of communication control protocols which developed for network embedded real time system are used as a solution for communication problems.Altera DE2 and DE2-115 boards are used in this project as the embedded real time Ethernet controller system.
Currently, there are high demands from various industries to use different types of robot to perform different tasks in the workplace.The controller chosen to manipulate the robot is very important.Most of the digital control systems for conventional robots still employ microcontroller as the brain of the robot in which cannot keep pace with the new applications that require higher control performance especially when the robots are used for high speed manufacturing and medical operations [5].Although microcontroller such as Arduino is cheaper compared to FPGA but it cannot provide parallel processing at the same time which is required for most of the industrial robots control nowadays [6,7,8].
Hence, the development of real time FPGA controller is necessary to achieve higher control performance on the robotic arm.shield and Arduino Mega to control robotic arm.The fourth part is the development of the robotic arm.The overall flow chart of this project is shown in Figure 1.

System design development
In this section, the step by step methods used to complete this project are highlighted and explained in details.The explanations are important in complete the objectives of the project.Both software and hardware are used in this project.

Development of embedded ethernet controller for signal transmission affiliations
Ethernet is the main control communication protocol as this protocol is a low cost, robustness, easy to available, expendability and non-proprietary network communication solution.In order to control the Ethernet chip DM9000A in Altera DE2 FPGA board, a digital hardware system that contain components such as internal processor, RAM memory, parallel input/output interfaces, serial communication protocol, and Ethernet interface protocol will be built using SOPC builder tools in Quartus II software.It is used to run application program that handle the data transmitted to or received from the Ethernet controller chip.DM9000A from Davicom is a fully integrated and low pin count Fast Ethernet controller chip with a general processor interface, a media access control (MAC) unit, a 10/100Mbps PHY transceiver and 16K bytes SRAM.Ethernet protocol associated with DM9000A chip included in this digital hardware system works as a Media Access Controller which work along with the Nios II processor and external PHY chip.Besides, the interface for communication between MAC and external PHY chip is chosen as Media Independent Interface (MII) since this Ethernet controller only support data transfer rate of 10/100Mbps.
After Verilog code associated with the components of digital hardware system is generated using SOPC builder, this system need to be instantiated in our design's top level module in order for the components this system to perform its function.The main function of this system is to generate Ethernet packet in Altera DE2 board.The block diagram of digital hardware system is as shown in Figure 2.

Generation and transmission of ethernet packet from altera DE2 FPGA board to arduino mega via ethernet
Nios II processor is used to send the Ethernet packet from FPGA board to Internet by connecting Ethernet LAN cable through PHY layer via serial interface.The end point of the Ethernet packet will be stored at either server or computer.In this project, the Ethernet packet will send to the IP address of the Arduino Ethernet shield from Altera DE2 FPGA board when a push button is pressed.After this digital hardware system is created, an application program is written in C/C++ code through Nios II IDE software build tool.This application program is implemented in order to initialize the DM9000A Ethernet controller chip, generate Ethernet packets, and drive the Ethernet controller to send the packets over built network through external PHY chip of physical layer.

Interface between arduino ethernet shield and arduino mega to control robotic arm
Arduino Ethernet shield is interfaced with Arduino Mega to perform control operation on robotic arm.Arduino Ethernet shield is used to enable Arduino Mega to act as the medium of communication between FPGA board and robotic arm so that signal can be transferred via (RJ45) Ethernet LAN cable.Correct IP address need to be obtained from Arduino Mega after Ethernet shield has been connected onto it.Once the Ethernet packet has reach to the correct IP address of the Arduino Ethernet shield, the Arduino Ethernet shield will prompt the Arduino Mega to perform control operation on robotic arm.The hardware interface is shown in Figure 3.

Development of the robotic arm
Robotic arm with 3 degree of freedom and the end effector is a gripper is designed by using of SolidWorks software and simulated with MATLAB software.The robotic arm is capable of doing the task of pick and place of objects.All 3 links and joints are revolute.This robot is configured as an articulated robot.Estimation is being made for design material specification, theory to calculate the torque of the robotic arm is applied and its relationship towards rotational speed.
Servo motor is a rotary actuator that allows for precise control of angular position [9].In this project, type of analog servo motors HD-1501MG are used.Servo motor is the most suitable motor in this project because it is low cost and has a lot of advantage compared to the other motor such as stepper motor, brushless motor, ac motor, etc.The robotic arm is printed with 3D printer so that precise dimension guaranteed.Servo motors are used on the robotic arm.
By using SolidWorks software, the robotic arm is designed.After designing, simulation process must be carried out to make sure there is zero interference and to test on the robotic arm joints and links feasibility as in real world [10].

Development of real-time communication system between two FPGA devices
In this digital hardware system, Triple Speed Ethernet MegaCore is chosen as the Ethernet Controller instead of DM9000A.This is because the FPGA boards use to build this communication system is DE2-115 series and the Ethernet PHY chip (Marvell 8E1111) of this board can only support this Ethernet controller.Besides, a timer will be used to determine the transmission time and reception time of Ethernet packets at transmitter and receiver.This timer is implemented by using a 32-bit counter and its timing behavior is based on the internal clock frequency of DE2-115 FPGA board.
Practically, the Ethernet communication system is designed using two FPGA boards which communicate to each other based on their unique MAC address and Internet Protocol (IP) address.The experimental setup for this Ethernet real-time communication system is presented in Figure 4.One of the FPGA board will be setup as transmitter and the other FPGA board will be setup as receiver.The process of data transmission will be begun with transmitter send data with data bytes limited by user to receiver.During the process of data transmission, transmitter is allow to send data packets to receiver only by addressing transmitter to one of the receiver's unique IP address.The data packets transmitting time and data packets receiving time are determined from transmitter and receiver by triggering timer in NIOS II software build tool.These timers use counters with internal clock frequency of 10MHz to calculate both data packets transmitting time and receiving time.The obtained timing results will be recorded on workstations which connected to the FPGA boards.

Results and discussion
The Altera DE2 FPGA board transmits Ethernet data packet of different sizes to the Arduino Mega.If the data packet of greater or equal to 1200 bytes is received by the Arduino Ethernet shield, the Arduino Mega will perform control operation of pick and place object on two points.The object to be picked up is a sponge.The combine (Front, Left, Top and Trimetric) view of the robotic arm is shown in Figure 5.If the data packet size is greater or equal to 1200 bytes, the robotic arm is activated.The robotic arm picks and place operation is shown in Figure 6.
For the communication setup which used FPGA and Arduino board, the average transmission delay of each data packet is 16ms.From the data measurements, transmission delay of each data packet can be calculated by using the formula: The transmission delay for each data packet size is calculated and recorded in Table 1.According to Table 1, the average data packet transmission delay for FPGA-FPGA based communication system is about 1.0642ms and this delay is much smaller than the transmission delay of FPGA-Arduino communication system (16ms).This significant delay reduction is because FPGA development boards possess better features compared to Arduino board.These features include high processing speed, high precision, parallel processing, short development cycle and perfect combination of standardized programming structure of Verilog HDL.

Conclusion
In conclusion, the control communication is successfully developed at high data transfer for real-time control communication to communicate with other controller device for robotic arm with Arduino board and FPGA board via Ethernet.Through this implementation, the ability to communicate safety data directly over an Ethernet/IP network is achieved.The practical test results have shown that the delay is reduced by 93.3% after the receiver in a communication system is changed from Arduino board to FPGA board.

Figure 1 .
Figure 1.Flow chart of the project development

Figure 3 :
Figure 3: Hardware interface between Arduino Mega and Arduino Ethernet shield

Figure 4 :
Figure 4: Experimental setup for FPGA based communication system

Figure 5 :
Figure 5: Combine view of the robotic arm Once the static IP address of the Arduino Ethernet shield is obtained via Ethernet switch, the program of receiving Ethernet data packet from FPGA board and prompt robotic arm operation is uploaded into the Arduino Mega.The serial monitor in the Arduino software is open to observe when the data packet is reached to the Arduino.If the data packet size is greater or equal to 1200 bytes, the robotic arm is activated.The robotic arm picks and place operation is shown in Figure6.For the communication setup which used FPGA and Arduino board, the average transmission delay of each data packet is 16ms.From the data measurements, transmission delay of each data packet can be calculated by using the formula:

Figure 6 :
Figure 6: The robotic arm picks and place operation

Table 1 :
Data transmission delay for communication between two FPGA devices