**3. Implementation of the palletizer robot**

considering *T1 = 0.15* Nm and angular velocity of the motor as *n<sup>1</sup> = 9.9835* rad/s; thus, the

To obtain the internal velocities along the gear train, we use the torque equation defined as:

is the same as the motor velocity, *n<sup>2</sup>*

Therefore, torque and angular velocity at the output gear train are 9.1124 Nm and 1.5693 rpm,

mass in kg that the gripper can carry if the robotic arm length were 1 m. In our case, the robotic arm length is 0.20 m, a value that represents one-fifth of the reference value 1 m. By considering that, torque increases in the same factor as the orthogonal length to the applied force decreases, and the final mass that our robotic arm of 0.20 m in length can carry is as follows:

0.20 m → 5(0.9289 kg) = 4.6445 kg (6)

*Z*\_\_1 *Z*2

**Table 1.** Relation between power supply and torque of the servomotor (Lego datasheet [14]).

*n*\_\_1 *n*2

Following this procedure, **Table 2** shows the torque values for 3–8 gears.

respectively. If the final torque is divided by the gravity force (g = 9.81 m/s2

Then, the torque of gear 2 is obtained using Eq. (3), yielding

**#Gear Torque (Nm) Angular velocity (rpm)**

 0.45 31.7783 1.35 10.5928 1.35 10.5928 4.050 3.5309 4.050 3.5309 9.1124 1.5693

**Table 2.** Torque and angular velocity of gearbox.

*n*\_\_1 *n*2

is given by:

= 95.335 ∙ (8⁄24) = 31.7783 rmp (4)

= 0.15 ∙ (95.335⁄31.7783) = 0.45 Nm (5)

(3)

), then we obtain the

driven power of the gearbox is *1.4975* W.

As the angular velocity *n<sup>1</sup>*

*n*<sup>2</sup> = *n*<sup>1</sup> ∙

*T*<sup>2</sup> = *T*<sup>1</sup> ∙

*T*<sup>2</sup> = *T*<sup>1</sup> ∙

**% Power supply Angular velocity (rpm)**

100 135.490 75 95.335 50 61.183 25 25.207

174 Advanced Path Planning for Mobile Entities

The robotic arm assembly requires bricks, girders, angle brackets, gearwheels, three servomotors and four touch sensors included in the Lego kit. Two of the servomotors move the mechanical part of the arm up and down, providing a degree of freedom. The third servomotor is used for closing and opening the griper. One of the touch sensors is at the base of the arm with the aim of sensing the lower position of the arm; similarly, a second touch sensor is located for sensing the higher position that can be reached by the arm. Third and fourth sensors are located on the gripper for measuring the opening and closing degrees controlled by the servomotor. A 3D model of the final robotic arm designed on Google SketchUP® [15] is illustrated on **Figure 4**, and the real robotic arm is shown in **Figure 5**; the gripper consists of four jaws to guarantee that object will be securely held.

The gearbox was designed in line with the required force and velocity to take and move an object from one place to another, without forcing the servomotors. The gearbox uses 8 gears: 3 of 16 teeth, 4 of 24 teeth and 1 of 36 teeth; it was designed following the analysis described in Section 2.3).

Once the robotic arm was built, we slightly modified the DaNI robot structure with the aim of mounting the robotic arm on it. In general, we replaced the rear omnidirectional wheel of

**Figure 4.** 3D model of the robotic arm designed on Google SketchUP®.

**Figure 5.** Robotic arm designed using Lego kit.

DaNI for a caster wheel of 1 inch. The wheel was fixed onto the chassis of DaNI creating free space to mount and fix the robotic arm. A 3D model of the mobile robot designed on Google SketchUP is shown in **Figure 6** and the real palletizer robot is shown in **Figure 7**.

## **3.1. A-star algorithm**

The robot trajectory starts in an initial position from which the robot moves to the object location, then it goes to the pallet and, finally, it moves back to the initial position. The final path establishes horizontal and diagonal trajectories that represent the minimal costs to achieve the goal.

The planning technique used was the so-called A-star algorithm [16], which basically consists in the research of the best first trajectory that provides the shortest path from all possible roads. The final path is the union of partial movements that the robot must perform to get to the final position, that is, intermediate points before reaching the goal. Here, we use the term of nodes to refer these intermediate points that can be seen also as neighboring or adjacent points to the actual robot position. For each intermediate point, the A-star algorithm evaluates the next trajectories that could be reached based on minimal cost [17]. Thus, a final path

Design and Implementation of a Demonstrative Palletizer Robot with Navigation…

http://dx.doi.org/10.5772/intechopen.72872

177

**Figure 8** illustrates a scene that we will use as an example of how to get from position A to B using the A-star algorithm. It is important to point out that two lists are needed to save the adjacent nodes: (1) open list for adjacent nodes that will be compared and (2) close list for

The first step to the A-star algorithm is to include the initial node position A to the close list. Thus, the iterative search starts including to the open list all reachable nodes from the initial node A, while unreachable nodes are, for instance, the occupied nodes. In accordance with **Figure 8**, eight nodes were included, depicted as squares and the arrows inside

*F*(*x*) = *G*(*x*) + *H*(*x*) (7)

Eq. (7) computes the shortest path possible to the goal node B in the fewest moves.

guides the robot to a goal position warranting safe navigation.

nodes that cannot be considered anymore.

point to their parent node.

**Figure 7.** Final palletizer robot.

**Figure 6.** 3D model of the DaNI robot designed on Google SketchUP®.

Design and Implementation of a Demonstrative Palletizer Robot with Navigation… http://dx.doi.org/10.5772/intechopen.72872 177

**Figure 7.** Final palletizer robot.

**Figure 6.** 3D model of the DaNI robot designed on Google SketchUP®.

DaNI for a caster wheel of 1 inch. The wheel was fixed onto the chassis of DaNI creating free space to mount and fix the robotic arm. A 3D model of the mobile robot designed on Google

The robot trajectory starts in an initial position from which the robot moves to the object location, then it goes to the pallet and, finally, it moves back to the initial position. The final path establishes horizontal and diagonal trajectories that represent the minimal costs to achieve the goal.

SketchUP is shown in **Figure 6** and the real palletizer robot is shown in **Figure 7**.

**3.1. A-star algorithm**

**Figure 5.** Robotic arm designed using Lego kit.

176 Advanced Path Planning for Mobile Entities

The planning technique used was the so-called A-star algorithm [16], which basically consists in the research of the best first trajectory that provides the shortest path from all possible roads. The final path is the union of partial movements that the robot must perform to get to the final position, that is, intermediate points before reaching the goal. Here, we use the term of nodes to refer these intermediate points that can be seen also as neighboring or adjacent points to the actual robot position. For each intermediate point, the A-star algorithm evaluates the next trajectories that could be reached based on minimal cost [17]. Thus, a final path guides the robot to a goal position warranting safe navigation.

**Figure 8** illustrates a scene that we will use as an example of how to get from position A to B using the A-star algorithm. It is important to point out that two lists are needed to save the adjacent nodes: (1) open list for adjacent nodes that will be compared and (2) close list for nodes that cannot be considered anymore.

The first step to the A-star algorithm is to include the initial node position A to the close list. Thus, the iterative search starts including to the open list all reachable nodes from the initial node A, while unreachable nodes are, for instance, the occupied nodes. In accordance with **Figure 8**, eight nodes were included, depicted as squares and the arrows inside point to their parent node.

Eq. (7) computes the shortest path possible to the goal node B in the fewest moves.

$$F(\mathbf{x}) = G(\mathbf{x}) + H(\mathbf{x})\tag{7}$$

corner node of A is *H = 40* because four nodes are required to get there from B. Thus, the lowest value of F is 40 being the right node chosen as the first move that must be performed by the robot (see **Figure 9(b)**). Also, this node is added to the close list to avoid considering it again. During the next iterations of the algorithm, the new initial position is the node resulting from the last iteration; so all previous nodes in the open list are moved to close list, and the open list will contain the neighbor nodes to such initial node. In addition, the values of *F(x), G(x)* and *H(x)* are updated to search for the next low cost node. In our example, only four nodes are added to the open list corresponding to up, down and diagonal nodes to the node under evaluation. Thus, the next node added is the lower right corner node, as it throws the lowest value of *F(x) = 54*. Once again, the iterative process starts by adding new neighbor nodes to the open list and computes the cost function to find the closest node in the open list with the lowest cost. This recursive process ends when the final node is added to the close list. **Figure 10(a)** shows the nodes added to the close list after five iterations of the A-star algorithm in blue. On the same figure, image b shows the final shortest path possible, starting from the goal B and going to the parent node backwards.

Design and Implementation of a Demonstrative Palletizer Robot with Navigation…

http://dx.doi.org/10.5772/intechopen.72872

179

As mentioned before, the NXT brick can be programmed in LabVIEW code to perform the

Moreover, to perform a safe and coherent navigation, the path planning algorithm is programmed on the sb-RIO reprogrammable card of the robot, that is, following the abovementioned A-star

The LabVIEW Robotics software provides a module of the A-star algorithm which computes an optimal path to get to goal position [18]. The path includes horizontal and vertical trajectories of the robot, left or right rotations and diagonal displacements. However, our mobile robot can only

**Figure 10.** (a) Nodes computed by the A-star algorithm at each iteration and (b) path to get from node A to node B.

technique. In this chapter, we explain robotic arm motion and pathfinder algorithm.

**3.2. Programming the palletizer robot**

**2.** Open and close the gripper to take the box.

**3.** Open and close the gripper to leave the box on the pallet.

robotic arm movements:

**1.** Move up and down the arm.

**Figure 8.** Environment to go from A to B.

where *F(x)* = cost of the shortest path to the goal, *G(x)* = cost of the movement from A node to an intermediate node and *H(x)* = cost of the possible movement to go from an intermediate node to the goal.

Every node on the open list is evaluated using this equation, and the node with the lowest *F(x)* value is chosen. The value *G(x)* represents the costs involved in reaching the neighbor nodes. Horizontal or vertical nodes are weighted as 10 (because there is one node to get there). Then, diagonal moves are weighted as 14 because this is the closest without choosing a diagonal. *H(x)* value is estimated using the Manhattan distance, but many other distances can be used as well. Such distance considers only vertical or horizontal moves to get to the final goal from any intermediate node, ignoring diagonal moves and obstacles on the way. This does not imply that all the environment must be free of moving or static obstacles; it is just the real physical distance between two nodes, after a second weighted value excludes possible paths with occupied intermediate nodes. The punctuation after computing Eq. (7) in our example is shown in **Figure 9(a)**. As the method does not consider obstacles, the shortest distance from B to right node of A is *H = 30* because this node is reachable in three nodes. Similarly, the upper right

**Figure 9.** A-star algorithm. (a) First iteration of the algorithm and (b) the lowest cost node.

corner node of A is *H = 40* because four nodes are required to get there from B. Thus, the lowest value of F is 40 being the right node chosen as the first move that must be performed by the robot (see **Figure 9(b)**). Also, this node is added to the close list to avoid considering it again.

During the next iterations of the algorithm, the new initial position is the node resulting from the last iteration; so all previous nodes in the open list are moved to close list, and the open list will contain the neighbor nodes to such initial node. In addition, the values of *F(x), G(x)* and *H(x)* are updated to search for the next low cost node. In our example, only four nodes are added to the open list corresponding to up, down and diagonal nodes to the node under evaluation. Thus, the next node added is the lower right corner node, as it throws the lowest value of *F(x) = 54*.

Once again, the iterative process starts by adding new neighbor nodes to the open list and computes the cost function to find the closest node in the open list with the lowest cost. This recursive process ends when the final node is added to the close list. **Figure 10(a)** shows the nodes added to the close list after five iterations of the A-star algorithm in blue. On the same figure, image b shows the final shortest path possible, starting from the goal B and going to the parent node backwards.
