**4. Experiment**

#### *4.1. Batting Experiment*

The batting task was performed based on the algorithms proposed in the previous sections. Snapshots of the robot arm hitting the oncoming ball to the target are shown in Figure 14. The target position for the ball is a blue net that is 0.57 m in the *x*-axis, −0.48 m in the *y*-axis, and −0.09 m in the *z*-axis from the robot base coordinate. We performed the experiment in the same way by changing the position of the target to 0.36 m for the *x*-axis and 1.06 m for the *y*-axis to −0.02 m for the *z*-axis. We conducted 30 batting experiments each, the success rate converged to approximately 40%.

**Figure 14.** Successive snapshots of batting task (sequence is horizontal to vertical).

We conducted two additional experiments to analyze the factors that influence the success rate. Since the trajectory prediction function of the ball is a function of position versus time (Equation (5)), the arrival position estimation error of the ball and arrival time estimation error of the ball are analyzed. If there is a large error in the estimated ball position or time, this error will affect the success rate of the batting task.

#### *4.2. Experiment to Analyze the Predicted Ball Position Accuracy*

We stopped the robotic arm at the predicted ball position without swinging to analyze the estimated ball position accuracy. We will call this experiment a bunt experiment, similar the action of the same name in a baseball game. The effect of the time error was separated by placing the end-effector of the robot arm at the position where the ball arrived. Thirty experiments were carried out, and the robotic arm was able to touch all the thrown balls (success rate is 100%). This experiment shows that the estimated ball position is accurate for ball batting. Figure 15 shows the positions of the batted balls in 30 experiments.

**Figure 15.** Shot group of the batted ball. In this bunt experiment, the robotic arm hit the ball with a 100% success rate.

#### *4.3. Experiment to Analyze the Accuracy of the Predicted Ball Arrival Times*

Data acquired from the stereo vision sensor includes time information together with image data. The time information is measured at the moment the shutter of the camera is closed, and this time information is called a time stamp. The timer cycle of the camera is 8 kHz, and a time stamp is calculated based on this cycle.

A red marker (Figure 4) was attached to the end-effector of the robot arm, and the position and time of the marker was measured with a vision sensor. To measure the time difference between each image, the robot arm drew a circle at a constant velocity of 17 degree/s with respect to the Y-Z plane. While the robot arm moved in a constant velocity circular motion, time information was measured along with the position of the marker. Figure 16 shows the marker positions of the end-effector when the robot arm moved at constant speed. A histogram comparing the time difference between two theoretical positions caused by constant circular motion and the time difference measured using a vision sensor is shown in Figure 17. The mean time difference error was −0.00057 s and the standard deviation was 0.0048 s. If the error pattern is biased, the time difference error can be compensated; however, in the case of such a random error, it is difficult to

compensate for the time difference error. Therefore, the following section describes the proposed method to compensate for the time error.

**Figure 16.** Marker position from vision sensor.

**Figure 17.** Time error for randomly selected data. Time error shows a random error pattern.
