Design and Implementation of FPGABased Robotic Arm Manipulator Mohammed Ibrahim Mohammed Ali Military Technical College, Cairo, Egypt Supervisors: Ahmed S. Bahgat 1, Engineering physics department Mahmoud Safwat Hamed 2, Electronic engineering department Ahmed Medhat Youssef 3, Aircraft electric systems department Military Technical College, Egypt, 1 a.s.bahgat48@gmail.com, 2 mshamid2014@gmail.com, 3 ammyk_khater@yahoo.com Abstract Robotic arm manipulators have a wide variety of applications. It is the core of manufacturing process in all factories nowadays. In this paper, the design, implementation and control of modified design of a six degrees of freedom (DOF) LYNX6 robotic arm FPGAbased controller is introduced. In LYNX6 arm, the lengths of the arms are modified and we used FR4 material to achieve the lightweight requirements of the arm structure. LYNX6 arm has 5 DOF plus a grip movement (51). It is also similar to human arm from the number of joints point of view. Servomotors are controlled by pulsewidth modulated (PWM) signals that control the position of the servo actuator. To position the robotic arm in 3D space, the angle of each joint must be set. A MATLAB GUI is designed to pick the desired (X, Y, Z) coordinates from the user, check the robot domain, perform the inverse kinematics algorithm and send the angles data serially through wireless module to FPGA controller to generate the necessary pulsewidth modulated signals for the motors. The controller architecture is implemented on a Xilinx spartan3 FPGA evaluation board ug VHDL. FPGA with its large number of I/O pins and parallel procesg capabilities is suitable for interfacing and controlling the six motors at the same time. The proposed FPGAbased controller offered flexible, standalone, and compact design with high system reliability [1, 2]. Keywords VHDL,LYNX6,PWM,Arm manipulator LYNX6 is a good alternative for such robot manipulators, because it is inexpensive, flexible and similar to industrial, robot arms. Lynx 6 robot arm has five directions of motion (DOF) plus a gripper movement (51). It is also similar to human arm from the number of joints point of view. These joints provide shoulder rotation, shoulder back and forth motion, elbow motion, wrist up and down motion, wrist rotation and gripper motion. It has three arms that are connected together ug servomotors mechanism and these three parts are connected to a base that is rotating ug base servomotor as shown in figure 1. I. INTRODUCTION Humans are fortunate that the human body is overall, a nearly perfect intelligent machine which can lift heavy loads, it can move itself around, and it has builtin protective mechanisms to feed itself when hungry. Robots are often modeled after humans if not in the form then at least in function. For decades, scientists and experimenters have tried to duplicate the human body, to create machines with intelligence, strength, mobility, and autosensory mechanisms. Like the human body, the body of the robot holds all its vital parts. The body is the substructure that prevents its electronic and electro mechanical parts from spilling out. Robot bodies go by many names, including frame and chassis, but the idea is the same [3]. There are many industrial applications uses those robotic arms; for examples: pick and place application, welding, spray painting, polishing, material handling, water jet cutting and many more. Generally, all applications above use almost the same design robot arm but the different is the software programming depending on the applications. Figure 1 Side and top view of Lynx 6 To position the robotic arm in 3D space, the angle of each joint must be set. If the physical dimensions of the robotic arm and the angles of all joints are known, the position of any point in the robotic arm assembly can be calculated by starting from the base and calculating the position of each joint successively, until the x, y, z coordinates of the point of interest are determined. This is called forward kinematics. The opposite calculation, calculating the required angle for each joint that results in the point of interest being located at a specific x, y, z coordinates, is called inverse kinematics. MATLAB GUI program is designed to pick the desired (X, Y, Z) coordinates from the user, check the robot domain, perform the inverse kinematics algorithm and send the angles data serially through a wireless module to an FPGA board to control the servomotors. A servomotor is a small DC motor with the following 1
components added: some gear reduction, a position sensor on the motor shaft, and an electronic circuit that controls the motor's operation. The gear reduction provided in a servo is large. Servomotors are typically used for angular positioning, such as in radio controled airplanes. They have a movement range of 0 up to 180 degrees, but some extend up to 210 degrees. Typically, a potentiometer measures the position of the output shaft at all times so the controller can accurately place and maintain its position. In practice, servos are used in radiocontrolled airplanes to position control surfaces like the elevators and rudders. They are also used in radiocontrolled cars, puppets, and of course, robots. Servos are extremely useful in robotics. The motors are small and have built in control circuitry, and are extremely powerful for their size. The servomotors are controlled ug pulse width modulated signal. Pulse width modulation (PWM) is a technique to provide logic '1' or '0' for a specified period. It is a square wave, which, when sufficiently fast, creates an effective average voltage on the line. The ratio of high pulse length to period of the signal is called the duty cycle. By varying the duty cycle, you can vary the average voltage as shown in figure 2. II. ROBOT KINEMATICS: The transformation between the joint space and the Cartesian space of the robot is very important [712]. Robots are operated with their servo motors in the joint space, whereas tasks are defined and objects are manipulated in the Cartesian space. The kinematics solution of any robot manipulator consists of twosub problems forward and inverse kinematics. Forward kinematics will determine where the robot s manipulator hand will be if all joints are known whereas inverse kinematics will calculate what each joint variable must be if the desired position and orientation of endeffector is determined. Hence, Forward kinematics is defined as transformation from joint space to Cartesian space whereas Inverse kinematics is defined as transformation from Cartesian space to joint space. For our Lynx6 Robotic Arm the angles definition is as shown in figure 3 Figure 3 Modeling of Lynx6 Robotic Arm angles A. Figure 2 Relation between pulse width and angle Field Programmable Gate Arrays (FPGAs) are used to provide the required PWM signal to control the servomotors. FPGA is a regular structure of logic cells (or modules) and interconnect, which is under your complete control. This means that you can design, program, and make changes to your circuit whenever you wish. FPGAs are digital ICs that contain programmable logic blocks along with configurable interconnects between these blocks. Design engineers can configure such devices to perform tremendous variety of tasks. FPGA with its large number of I/O pins and parallel procesg capabilities is suitable for interfacing and controlling the six motors at the same time. The proposed FPGAbased controller offered flexible, standalone, and compact design with high system reliability. The main controller is designed based on Spartan3 kit.the Spartan 3 family of FieldProgrammable Gate Arrays is specifically designed to meet the needs of high volume, and teffective consumer electronic applications. FORWARD KINEMATICS: In this section we are concerning with translation between the angles of the robotic arm and the corresponding position relative to these values. The following equations represent the forward calculations. (90 ) (180 ) (1) B. (90 (180 INVERSE KINEMATICS: ) ) (2) (3) (4) In this section we are concerning with translation between the position and the corresponding angles of the robotic arm relative to these values [12]. Inverse Kinematics analysis determines the joint angles for desired position and orientation in Cartesian space. The following equations represent the inverse calculations. 2
tan 5 90 6 Where m masses of arms and load. l lengths of arms. g gravity acceleration. 7 2 8 Where tan We have now four equations with five unknowns, so assuming that the third link is to be horizontal or by taking the angle of this link from the user. Then, 9 14 This torque equation is considered as a static position but it will differ in case of dynamics as it differs from up or down as the weight component may be in the direction of motion or against the motion. For the arm to move from a rest position, acceleration is required. To solve for this added torque, it is known that the sum of torques acting at a pivot point is equal to the moment of inertia (I) multiplied by the angular acceleration. To calculate the extra torque required to move (i.e. create an angular acceleration) you would calculate the moment of inertia of the part from the end to the pivot. In the case of a robotic arm, the moment of inertia must take into consideration. For each joint, the moment of inertia is calculated by adding the products of each individual mass (mi) by the square of its respective length from the pivot (li). All the previous discussion concludes to use a higher torque motor than the calculated static torque values. The block diagram of the robotic arm system that describe the whole design of the robot arm control system as shown in figure 5. 11 III. TORQUE CALCULATION 13 IV. ROBOTIC ARM CONTROL SYSTEM 10 Torque is defined as a turning or twisting force. The force acts at a length from a pivot point as shown in figure 4. In a vertical plane, the force acting on an object is the acceleration due to gravity multiplied by its mass. a b θ3 c θ2 θ4 ml m1 m2 m3 Figure 4 Forces acting on robot arm The torque equations are as follows: 12 3 Figure 5 Block diagram of the Robotic arm control system
The ( X,Y,Z ) data and gripper angle is input to a MATLAB GUI interface as shown in figure 6,the domain shown in figure 7 is checked for the desired position, the inverse kinematic is calculated and through the wireless module the data is transmitted to the Spartan3 kit to control the servomotors according to the received data. JZ862 wireless module is used as the wireless data transmission in short distance. With the characteristics of small size, weight, low power consumption, good stability and reliability, it can provide bidirectional data transmission, test and control for users ug serial data communication. Ug the FPGA architecture make the design of the control circuit is very easy as it has millions of gates that are used in the design of the control circuit. The servomotors need PWM signals to operate hence, VHDL programming is used for implementing the required circuitry to generate PWM signals for the motors [4, 11]. It consists of counter with certain frequency and is reset every 20 ms and ug the comparator to check the counter data with the required PWM coming from hold circuit that hold data for 20 ms. The FPGA schematic of PWM module is shown in figures 8 and 9. Figure 8: Schematic diagram of the PWM Module. Figure 6: MATLAB GUI interface The robot domain is calculated based on the forward kinematics equations and based on the lengths of arms of the robot and the range of angles of the servo motors and based also on the constrains of the mechanical design. Figure 9: Top level of PWM module. Figure 7: RZ Robot domain V. CONCLUSION Robotic arms show a variety of applications all over the world nowadays. The manipulation and control of the robotic arms required a lot of mathematical calculation as well as control circuits. In this paper, a robotic arm controller is designed and implemented ug the Spartan3 kit FPGA architecture. The robotic arm design is based on the Lynx6 arm manipulator with some modification in the material and lengths of the arms. Calculation of the angles of the motors is carried out ug MATLAB software with a GUI interface. The angles are sent to the FPGA ug serial communication. The designed robotic arm system ug the Spartan3 FPGA offers flexible, standalone, and compact design with high system reliability. 4
REFERENCES [1] Iovine J, PIC Robotics: A Beginner s Guide to Robotics Projects Ug the PICmicro, McGraw Hill, 2004. [2] Iovine J, Robots, Androids, and Animatrons: 12 Incredible Projects You Can Build, McGraw Hill, 2001. [3] Lunt K., Build Your Own Robot, A. K. Peters Ltd., 2000. [4] Boylestad, R., and L. Nashelsky Electronic Devices and Circuit Theory, Englewood Cliffs, N.J.: Prentice Hall. (1992). [5] P. Myke Programming Robot Controller. McgrawHill. (2003). [6] Fu, K.S., Gonzalez R.C., Lee, C.S.G (1987). Robotic: Control, Seng, Vision and Intelligence. Singapore: McGrawHill Book Company. [7] Saeed B.Niku Introduction to Robotics Analysis, Systems, Application. Pearson Education, (2001). [8] Dan W. Patterson Artificial Neural Network Theory and Applications. Printice Hall, Inc. (1996). [9] David Cook Robot Building for Beginners. New York Apress, (2002). [10] David Cook. Intermediate Robot Building. New York. Apress. (2002) [11] FPGA Implementation of Multilevel Space Vector PWM Algorithms Prawin Angel Michael, Dr.N. Devarajan, Member, IEEE [12] Software Development for the Kinematic Analysis of a Lynx 6 Robot Arm. Baki Koyuncu, and Mehmet Güzel. 5