Design of A 4 DOF Parallel Robot Arm and The Firmware 2020 Artificial Intell
Design of A 4 DOF Parallel Robot Arm and The Firmware 2020 Artificial Intell
a r t i c l e i n f o a b s t r a c t
Article history: This paper presents a firmware design and its implementation on a real time embedded system for driving a 4
Received 17 July 2020 DOF parallel robot arm. The firmware primarily comprised of two components to produce motion of the robot
Received in revised form 14 September 2020 arm: a) generation of continuous position coordinates and b) generation of actuating signals. These two compo-
Accepted 14 September 2020
nents were processed in two different microcontrollers with a common communication bus. The position gener-
Available online 21 September 2020
ation algorithm produced and transmitted continuous position data to the motion generation algorithm in the
Keywords:
form of G-code strings by reading the input positions which were previously stored by the user in EEPROM mem-
Robot firmware ory of the microcontroller. The receipt of a handshake signal synchronized the data transmission between these
Parallel robot arm components through a communication bus. An LCD display and keypad were used as human-machine interface
Automation (HMI) to communicate with the user to set the robot target coordinates. The mechanical structure of the robot
SoC microcontrollers, pot seedlings arm comprised of multiple links which were actuated by stepper motors. The workspace boundary were sensed
by limit switches. The kinematic equations represented the gripper position for the corresponding input joint an-
gles. A microcontroller was used to compute kinematic equations of the robot arm with the help of motion gen-
eration algorithm to generate actuation signals for the simultaneous movement of robot joints. The kinematic
equations were solved with the dual-core capability of the microcontroller using real time operating system
(RTOS), which made the computation faster with an average computation time of 198 μs per step. The developed
firmware was implemented and tested on a 4 DOF parallel manipulator using embedded microcontrollers for
continuous pickup and place of the paper pot seedlings for automating the metering of pot seedlings. The cycle
time taken for pickup and dropping of each seedling was 3.5 s with a success rate of 93.3%.
© 2020 The Authors. Publishing services by Elsevier B.V. on behalf of KeAi Communications Co. Ltd. This is an open
access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
https://doi.org/10.1016/j.aiia.2020.09.003
2589-7217/© 2020 The Authors. Publishing services by Elsevier B.V. on behalf of KeAi Communications Co. Ltd. This is an open access article under the CC BY license (http://
creativecommons.org/licenses/by/4.0/).
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
Nomenclature
173
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
174
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
trajectory at the specified linear speed of the manipulator. Further, accel- coupled with the platform. Thus, the rotation of the stepper motor was
eration at the beginning and deceleration at the end of the trajectory were converted into a linear motion in Z direction. A parallel jaw gripper was
provided to maintain smooth actuation. Once, the manipulator reached attached to the robot arm at the connecting point of the two passive links.
the target position, SGF sent a handshake signal to the PGF through serial The gripper was made to open and close using a servo motor. An-
bus to continue the cycle for the next position. other servo motor mounted on the passive link was attached to the grip-
per to provide the rotary motion of the gripper in planner coordinates.
2.2. Design of robot arm Four limit switches were provided at the robot arm frames to act as
sensing boundary of the robot arm. Two limit switches (limit switches
The validation of the proposed firmware architecture for operating a 1 and 2) sensed the boundary position of the active robot joints. The
robotic system was made by a) designing the mechanical structure of limit switches 3 and 4 detected the upper and lower boundary positions
the robot arm, b) deriving the kinematic equations of the robot arm, of the platform, in Z-up and Z-down directions, respectively.
c) designing the embedded hardware to actuate the mechanical system
and d) implementing the firmware in a deployable SoC microcontroller 2.2.2. Inverse kinematics of the robot arm
of the hardware. The following sections explain the practical implemen- The input joint angles θa1 and θa2 for the given gripper position were
tation of the proposed firmware architecture. computed with inverse kinematics. The geometric line diagram of the
parallel manipulator is shown in Fig. 5 with three operating regions to
2.2.1. Design of mechanical structure of robot arm visualize easily and to develop the implementable robot equations.
The 3D CAD model of a 4 DOF parallel robot arm is presented in The regions are separated based on the position of the end effector,
Fig. 4. It consisted of two active links those were driven by stepper mo- i.e., C(x, y) in the planar space.
tors through timing belt and pulley. One end of the two passive links Using cosine rule in triangle O1AC (referring Fig. 5), the inner angle
was joined together and the other ends were connected with the corre- of active arm 1.
sponding active links. Thus the combined motion of the active joints
provided a planner manipulation in X and Y direction. ! qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi
2
L1 2 −L2 2 þ k
The arm assembly platform, which comprised the robot links and ac- γ 1 ¼ acos where, k ¼ ðx þ L0 Þ2 þ y2 ð1Þ
tuation stepper motors was mounted on the support frames through a 2 L1 k
slider with a linear bearing that permitted motion only in ‘Z’ direction. An- Similarly, using cosine rule at triangle O2DC, the inner angle of active
other stepper motor mounted on top of the frame drove a lead screw arm 2
Fig. 4. CAD model of the developed robot arm to implement the proposed firmware.
175
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
Fig. 5. Geometric line diagram of the manipulator with its operating regions.
!
qffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffiffi y
L1 2 −L2 2 þ s2 β1 ¼ atan and β2
γ2 ¼ acos where, s ¼ ðx−L0 Þ2 þ y2 ð2Þ jL0þ xj
2 L1 s
y
¼ π−atan for the location of‘C’in region−1 ð4Þ
jL0 −xj
Based on the location of the manipulator point ‘C’ within the region,
the active arm linear angle with horizontal (β1 and β2) varies as:
y y
β1 ¼ atan and β2 β1 ¼ π−atan and β2
jL0 þ xj jL0 þ xj
y y
¼ atan for the location of‘C’in region−2 ð3Þ ¼ π−atan for the location of‘C’in region−3 ð5Þ
jL0 −xj jL0 −xj
Fig. 6. Block diagram of the electronic control circuit of the robot arm.
176
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
Component Specifications Functions The vertical distance of link, L2y ¼ L2 sin θa2 ð9Þ
ESP 32 Clock frequency: 240 MHz SGF firmware installed to drive the
CPU: 2 cores (32 bit), robot joint actuators Length between points Band C, LBC
Tensilica LX6 abs L1y , L2y
microprocessors ¼ min L1y , L2y þ ð10Þ
Memory: 520 Kib SRAM
2
Peripheral interfaces: 3
UART, 2 I2C 2.3. Design of embedded hardware for the robot arm
Arduino Clock frequency: 16 MHz PGF firmware installed to generate and
Mega CPU: 8 bit ATMEGA 2560 supply the motion control codes
Memory: 8Kb SRAM The electronic system incorporates the necessary hardware compo-
Peripheral interfaces: 4 nents to realize the robot arm motion. The block diagram of electronic
UART, 1 I2C components used and their associated connections are shown in
Buck Input: 36 V DC (max), To supply recommended constant DC
Fig. 6. The list of hardware components used with their specifications
converter current: 5A (max) power to actuators and
Output: 5 V and 12 V microcontrollers and functions are summarized in Table 2.
HMI Keypad To receive input from the user and to The SGF firmware deployed on dual-core ESP 32 microcontroller actu-
LCD display the operating parameters ated the stepper motors of robot joint by supplying the essential signals to
Actuators NEMA 17 Stepper motors To provide driving torque to the robot the corresponding motor drivers. It calculated both robot kinematic and
and joints
Servo motors (up to 180°
trajectory equations. Limit switches were also connected to the ESP 32,
rotation) to sense the robot joints whenever it reached the robot boundary. The
PGF firmware installed on the Arduino Mega board took input from the
HMI keypad and displayed the necessary data through an LCD. The
Mega board also controlled the gripper open/close and wrist rotation of
The active joint angles (θa1 and θa1) are determined by
the robot arm. A COM bus connected these two microcontrollers, trans-
θa1 ¼ β1 þ γ1 ð6Þ ferred data between them. Buck converters provided the required DC
voltage to these electronic components for their operation and actuation.
θa2 ¼ β2 −γ2 ð7Þ
2.4. Robot path planning
The transmission angle influences the manipulator stability θtr be-
tween active and passive links and is directly proportional to the dis- Robot path planning involves the generation of optimal reachable
tance between points B and C; which is determined by using the points in spatial coordinates from the present position of the manipulator
following equations. to the target location. Command G00 (rapid motion) and G01 (motion of
177
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
manipulator at specified speed) were used to move the end effector be- higher the resolution, better is the straight-line approximation, but
tween the specified coordinates (X, Y and Z) with a straight-line trajectory at the cost of increased computation. Hence, the processor needs to
using Bresenham algorithm. calculate the kinematic equations at a higher speed to supply the ac-
tuation signals to the corresponding stepper motors. By utilizing the
2.5. Computation of kinematic equations through dual-core advantage of dual-core computing capability of ESP 32 microcontrol-
ler, the complex algorithms were solved at a minimal time. Since all
The robot kinematics involves the computation of complex geo- the kinematic equations were required to be solved only by the SoC
metric equations to determine the angular positions and velocities microcontroller, the equations were divided into two parts, each
of the joints at minimal time. As discussed in the earlier section, was computed individually in different cores and the results were
Fig. 9. EEPROM memory stack and allocation of data in its associated storage locations.
178
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
combined to obtain the target angular position. The algorithm for en- address Mpp by navigating the corresponding menu and by entering
abling dual-core computation is given in Algorithm 1 and the block a numeric entity. The dropping position data were stored in the
diagram of dual-core computation is shown in Fig. 7. ESP32 was sup- memory by directing to ‘End effector position’ in dropping position
ported with RTOS (Real Time Operating System); thus multiple tasks menu. With the help of a keypad, the end effector could be moved
were created and ran those tasks simultaneously in different CPU to the desired position and the corresponding coordinates (X and
cores. Two sets of kinematic equations ran independently in cores Y) could be fetched from the SGF through COM bus to store the
1 and 2 by using ‘Semaphore’ (give or take) function by defining dropping point data in memory address Mdp. Elbow position for the
global variables that shared common data between both the cores. dropping coordinate were stored in address Mdep. In this particular
Finally, the computed data from both the cores were collected and
the target angular positions θa1 and θa2 were calculated.
179
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
application, there were multiple numbers of pickup points; which It consisted of five pickup positions and one dropping position. The
required multiple end-effector coordinates and elbow positions. algorithm was tested for continuous pick and drop of pot seedlings
These data were accessed and modified by the user by entering the loaded on a feeding conveyor. Forty numbers of pot seedlings were
pickup position number ‘k’ in menu sequence which could access picked and dropped by rotating the feeding conveyor to supply pot
the memory locations Mpdx(k), Mpdy(k) and Mpep(k) and these par- seedlings to the pickup positions. The average computation time (for
ticular data were stored in the specific memory address. 20 pickup positions i.e., four row of pot seedlings) required to solve
the kinematic equations were recorded. Function ‘micros ( )’ was used
Algorithm 2. Continuous pick and place operation. in the kinematics code block within the SoC microcontrollers of three
The procedural steps for the continuous pick and place operation are different modes and the data were recorded. Table 3 presents the com-
provided in Algorithm 2. It initialized the required variables and the parison of the average computation time to solve the computation of in-
data for pick and place were fetched from the EEPROM memory verse kinematic equation in different modes.
(Fig. 9). It generated the G code string required for the robot motion It was found that, ESP 32 SoC microcontroller computed the kine-
for approach coordinates and transmitted the string to the SGF which matics at less time as compared to the utilization of widely used
actuated the elbow and gripper. After the receipt of acknowledgement Arduino board. Further, usage of dual-core capability through RTOS im-
signal from SGF, the algorithm generated strings for gripping and drop proved the computation speed, which increased the operating speed.
coordinates for the pick and place of the present position. It
incremented the position data and actuated the robot until it was 3.3. Performance evaluation of the developed firmware implemented on the
equal to Mpp. The position data was again reset back to pick and place hardware to pick and drop the pot seedlings
from the initial point.
The robot arm was tested for seedling pickup and dropping. A total
3. Results and discussion of 40 pot seedlings were loaded on the cells of the feeding conveyor
for testing. The sequence of operation for picking and dropping of seed-
3.1. Data entry through HMI lings by the robotic arm is shown in Fig. 14(a–d).
The cycle time taken for pickup and dropping of each seedling was
The HMI system was connected to the PGF microcontroller to display 3.5 s (which maintained delicate picking and dropping of pot seedlings
data and to provide input to the SGF microcontroller for the actuation of without any damage at an average of 17 seedlings per min which is
the robot arm. The developed HMI control for the robotic system, which sufficient for walk behind type vegetable transplanters, Kumar and
comprises an LCD display and Keypad is shown in Fig. 10. The buttons of Raheman, 2011). The average success rate
the keypad were configured for multiple functions (up, down, left, right, (S ¼ Number of successfully picked seedlings
Totalnumberofseedlingsloaded
100Þ of the robot arm deployed
select, back and numerical entries) to access the data. with the proposed firmware for three trials was computed as 93.3%.
The entry of position data in EEPROM memory of the PGF microcon-
troller is shown in Fig. 11. By navigating the menu system through the 3.4. Comparison of the proposed firmware and the associated hardware
up/down and select buttons user could obtain ‘Enter value’ tab in the with existing systems
display (Fig. 11.a). User could change the number of pickup positions
by the buttons (Fig. 11.b). Then by pressing the select button, the en- It is required to compare the developed firmware and the hardware
tered data were saved in the corresponding EEPROM memory location on which the firmware was deployed. Table 4 presents the comparison
of the microcontroller (Fig. 11.c). This updated data were used by the of various features of the developed firmware and the associated hard-
PGF for the next operation cycle. ware with the existing systems.
The data entry for the dropping position in the corresponding mem- The SMC4-4-16A 16B CNC motion controller has built in firmware
ory address of the EEPROM is shown in Fig. 12. and already well established in several industrial NC machines. In cost
wise this controller is not suitable for operating with agricultural ma-
3.2. Operation of robot arm by the proposed firmware implemented on the chines. Compared to Raspberry pi based ROS system, the developed
embedded microcontrollers firmware with its associated hardware is much lower in cost. Also, the
performance of the developed system proved that it is well suited for
The developed firmware (both SGF and PGF) were deployed in SoC metering pot seedling for transplanting.
microcontrollers of the embedded hardware and it was implemented
on a 4 DOF parallel robot (Fig. 13). 4. Conclusions and future work
180
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
a) Navigate to drop menu b) Motor positions selection c) Move the robot joint
Fig. 12. Setting of motor positions for drop point in memory through HMI.
Fig. 13. Robot arm actuated by the proposed firmware for pick and drop of pot seedlings.
181
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
Table 4
Comparison of developed firmware and its associated hardware with existing systems.
Robot control firmware with hardware Cost (approx.) Number of controllable axis Applicability
Proposed system (Microcontrollers with HMI) Rs. 1800 Up to 5 axis Robotic applications
Raspberry pi with ROS and HMI Rs. 4000 Up to 6 axis Robotic applications
SMC4-4-16A 16B Rs. 60,000 Up to 4 axis Industrial CNC machines
182
R. K., H. Raheman and V. Paradkar Artificial Intelligence in Agriculture 4 (2020) 172–183
Araujo, A., Portugal, D., Couceiro, M.S., Rocha, R.P., 2015. Integrating Arduino-based edu- Rahul, K., Raheman, H., Paradkar, V., 2019. Design and development of a 5R 2DOF parallel
cational mobile robots in ROS. J. Intell. Robot. Syst. 77 (2), 281–298. robot arm for handling paper pot seedlings in a vegetable transplanter. Comput. Elec-
Arroyo G, Ochoa C, Silva J and Vidal G., 2004. Towards CNC Programming Using Haskell. In tron. Agric. 166, 105014.
Ibero-American Conference on Artificial Intelligence. Springer, Berlin, Heidelberg, pp. Surange, V.G., Gharat, P.V., 2016. 3D printing process using fused deposition modelling
386–396. (FDM). Int. J. Res. Eng. Technol. (IRJET) 3, 1403–1406.
Chen, W., Khamis, H., Birznieks, I., Lepora, N.F., Redmond, S.J., 2018. Tactile sensors for fric- Tiansong, L., Feng, G., Yilong, Y., 2019. Design of low-cost desktop robot based on 3D
tion estimation and incipient slip detection - toward dexterous robotic manipulation: printing technology and open-source control system. 2019 IEEE 3rd Information
a review. IEEE Sensors J. 18 (22), 9049–9064. Technology, Networking, Electronic and Automation Control Conference (ITNEC).
Dihingia, P.C., Kumar, G.P., Sarma, P.K., Neog, P., 2018. Hand-fed vegetable transplanter for IEEE, pp. 739–742.
use with a walk-behind-type hand tractor. International Journal of Vegetable Science Wijnen, B., Anzalone, G., Haselhuhn, A., Sanders, P., Pearce, J., 2016. Free and open-source
24 (3), 254–273. control software for 3-D motion and processing. Journal of Open Research Software 4,
Hu, J., Yan, X., Ma, J., Qi, C., Francis, K., Mao, H., 2014. Dimensional synthesis and kinemat- e2. https://doi.org/10.5334/jors.78.
ics simulation of a high-speed plug seedling transplanting robot. Comput. Electron.
Agric. 107, 64–72.
Rahul K. is persuing Master of Science at Indian Institute of Technology Kharagpur in Farm
Hwang, H., Sistler, F.E., 1986. A robotic pepper transplanter. Appl. Eng. Agric. 2 (1), 2–5.
Machinery specialization under Agricultural and Food Engineering Department. His re-
Joseph Raj, A.N., Sundaram, R., Mahesh, V.G., Zhuang, Z., Simeone, A., 2019. A multi-sensor
search focuses on implementation of robotics and automation in agricultural machinery.
system for silkworm cocoon gender classification via image processing and support
He is also interested in artificial intelligence, machine vision and mechatronic system de-
vector machine. Sensors. 19 (12), 2656.
sign.
Kamel, M., Stastny, T., Alexis, K., Siegwart, R., 2017. Model predictive control for trajectory
tracking of unmanned aerial vehicles using robot operating system. Robot Operating
Hifjur Raheman is a Professor in the Agricultural and Food Engineering Department of
System (ROS). Springer, Cham, pp. 3–39.
Indian Institute of Technology Kharagpur, India. His research areas are use of robotics in
Kruger, J., Gu, W., Shen, H., Mukelabai, M., Hebig, R., Berger, T., 2018, February. Towards a
agri-machinery, renewable energy operated agricultural machinery, alternate fuels from
better understanding of software features and their characteristics: a case study of
biomass (Biodiesel, producer gas) and bioelectricity production and tillage and traction
marlin. Proceedings of the 12th International Workshop on Variability Modelling of
improvement in tractors and power tillers.
Software-Intensive Systems, pp. 105–112.
Kumar, G.P., Raheman, H., 2011. Development of a walk-behind type hand tractor
Vikas Paradkar is Ph.D Student, Specialization in Farm machinery and Power, Agricultural
powered vegetable transplanter for paper pot seedlings. Biosyst. Eng. 110 (2),
and Food Engineering Department, Indian Institute of Technology Kharagpur, India. His re-
189–197.
search focus is on implementation of robot in vegetable transplanter.
Nejatimoharrami, F., Faina, A., Jovanovic, A., St-Cyr, O., Chignell, M., Stoy, K., 2017. UI De-
sign for an Engineering Process: Programming Experiments on a Liquid Handling
Robot. In 2017 First IEEE International Conference on Robotic Computing (IRC).
IEEE, pp. 196–203.
183