{'fraction_non_alphanumeric': 0.038825031928480205, 'fraction_numerical': 0.013026819923371647, 'mean_word_length': 4.564187588820464, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Manipulator for scanning of the pipes external surface

The paper presents a very simple manipulator, which can describe a circular trajectory, in order to position a scanning device for inspecting the external surface of a pipe. The open kinematic chain has only three active joints, and for equally spaced scanning positions around the pipe, its inverse kinematics is derived by help of elementary geometry. The manipulator was built as a part of a mobile robot, serving for inspection and monitoring of the pipelines in the oil and gas industry. Being a demonstrator, its joints actuators are micro RC servos, so a calibration operation of each one was also performed.


Introduction
The oil and gas industry is increasingly helped, for hard work, by automatic machines. Due to high risk of fire or explosion, the installations have to be periodically inspected by robotic devices, but most of these ones are designed to operate inside the pipe [1]. An external inspection could be advantageous for not dismantling the pipeline, but such a robot has to be able to avoid obstacles, like flanges, and to turn when meets an elbow [2].
During development of a mobile robot, aimed to travel along the pipelines, looking for defects (cracks, corrosion, leakage, insulation damage), the need of a scanning mechanism was revealed. This one has to move a camera and other sensors (C&S) around the pipe for inspecting its circumference, and position the C&S at equally distanced points on a circle, centered on the pipe axis, while the C&S incidence line is on radial direction of the pipe. Even not so time-effective as devices which enclose the pipe, such as coils, and inspect the entire circumference at once, the proposed scanning method has the advantage to be appropriate for obstacle avoidance. A sensor surrounding the pipe would be heavier, increasing the robot payload, and also should open and remove from pipe, when the robot approaches to an obstacle.

Scanning mechanism
The new developed manipulator consists of three bars open chain mechanism, with active joints (A, B, C). Joint C actuator positions the support for camera and other sensors. It is shown in figure 1, where the point C describes a circular trajectory, in order to keep constant, the distance between instrumentation and the external surface of the pipe, while the scanning device is oriented along the radial direction of the pipe.

Fig.1. Kinematic sketch of the 3 bar open chain
As it can be noticed in figure 2, the open chain manipulator with the active joints A, B, can keep a constant distance to the external surface, if the two levers connected to these joints have equal lengths (AB=BC=l).

Fig.2. Open chain manipulator
Supposing the joints A and B are powered by RC servos (micro), with limited angular stroke (180°), scanning of the surface ADC can be performed by a second manipulator. This way, the scanning duration can be shorten by a factor of 2. Referring again to figure 2, the circular trajectory of the joint C has the radius R, which is depending on the pipe radius/diameter (r), the size of the manipulator element from joint C and the sensors size and their working range. A minimum value is figured above, when the manipulator levers are tangent to the pipe circumference. So where: b -bar width. Generally, the trajectory radius is calculated as: where: d -distance within the sensors working range, and lC -length of the bar linked in the middle by joint C, for which a constant mass distribution was assumed.  Figure 2 shows an extreme position, with points A and C diametrically opposite, and the joint B on the circular trajectory of radius R. This position corresponds to one end of the scanning trajectory. The other end of the scanning trajectory is when the joint C is moved to A. According to figures 1 and 2, the third bar, denoted by camera is rotated to get the requested orientation for scanning the pipe. For scanning the other half of the circle, the open chain should be positioned on the trajectory ADC. When calculating the manipulator dimensions, the recommended distance between sensors and the pipe surface (d) and sensors frame size (lC) should be determined. The circular trajectory radius, R, is calculated with (2) and = √2 (3)

Inverse geometric model
Regularly, the position of the controlled point, C(x,y), of the simplest open chain manipulator (figure 1), is described by the following equations: The particular trajectory of the controlled point C(x, y), is taken into consideration by adding the circle (figure 3) equation:

Fig.3. Trajectory of the controlled point C
Another particularity of the mechanism is the equal length of two arms. This fact is a consequence of the point C' belonging to the completely half circle ABC, with the limits C'  C and C'  A. In these circumstances, the equation (5), after introducing (4), becomes: Finally, the equation, which allows determining the positions of the active joints (A, B), for the imposed circular trajectory of the controlled joint, C, is the following: The equation (7) verifies the extreme positions of the point C' along the half circle. When C'  C, 1 = 4 , 2 = 2 , and when C'  A, 1 = -2 and 2 = . Both are solutions for the equation (7), as it can be verified. Even it is quite simple to derive, for example 2 corresponding to allocated values of 4 ], the scanner positions should be equally spaced on the circular trajectory, when acquiring data about the pipe surface (image, humidity, temperature, sound, etc.).

Fig.4. Manipulator describing circular trajectory
For this purpose, the half-circle trajectory is partitioned in small arches with equal length (π/n). The number of divisions, n, depends on the sensors specifications, in order to cover the entire surface of the pipe. In As from figure 4, 1 + + 2 = 2 , it results the values of 1: It results, that, for k=0,1,2…n, the positions of the arm AB correspond to equally spaced positions of C, on the circular trajectory. In figure 4, it can be simply observed that: And also: ≮ ′ ′+≮ ′ ′ = ≮ ′ ′ + 2 = By comparing the equation (11), and the equation (12), it results: For verifying these results, the extreme positions of joint C, on the half-circle trajectory are considered, C' C (k=0) and, C' A (k=n). For = 0, it results: Similarly, for, = , The expected results, previously verified by the analytical method, are obtained again. Figure 4 can also provide orientation angle of the camera and of the other sensors support, which should be aligned to the pipe radial direction ( in the figure 1 or ≮ ′ ′ in figure  4). From figure 4, it results: In order to command the position of the manipulator's arms, as well as the direction of the scanning axis, an effective method is to obtain the results of the above-presented algorithm, by previously offline calculation. These ones will be stored in the microcontroller memory and recalled by the control program, when necessary. For this purpose, the number, n, of the half circle division was chosen to be =24, corresponding to an angle 24 = 7.5 .
It is enough for the small-scale demonstrator, which was built to prove the concept of the robot development. An Excel worksheet helped for calculations, by applying the developed geometric algorithm, as well as to raise a scattered diagram with markers, showing the scanning trajectory (figure 5).

Experimental research
The built manipulator is adapted to the small scale robot and mounted on its clamping mechanism (figure 6.). The second movement for scanning the entire surface of the pipe is the crawling of the robot clamping device, along the pipe, during inchworm locomotion of the robot. As active joints there were used micro servos ECO-16, which can develop a torque of 216 N.mm at 4.8V or 245 N.mm at 6V. The micro servo's weight is 16.2 g, but also the other components, like levers and sensors case are light, being 3D printed from Nylon 645.

Fig.6. Scanning mechanism attached to the robot
The first test performed upon the micro servo was to determine the payload which it is able to raise, if it is located in joint A, and the two arms are collinear, in horizontal position. Additional masses were added at the arms end, the maximum value that could be raised being 245g. This is about twice the manipulator weight, including servos, and more than the scanning miniature sensors could weight. The second test refers to the control of the micro servos, in order to attend to the desired positions. For this purpose, the experimental stand, shown in figure 7, was set up. This one consists of one 10-Bit 360º Programmable Magnetic Rotary Encoder AS5040, an Arduino Nano board and one micro servo, coupled to a shaft, which rotates a two-pole magnet in front of the AS5040 chip (figure 8). This shaft is supported by ball bearings, mounted in one white part of the frame, formed by two screws and two white parts ( figure 7). The other white part supports the AS5040 chip. The rotary encoder can measure maximum 1024 steps/revolution, at a sampling rate of 10.42 kHz, which corresponds to a resolution of 0.35156°. Due to the communication through synchronous serial interface, this resolution is used only if the magnet angular speed is less than 610 rpm. In the case of micro servo ECO-16, its datasheet specifies the maximum angular speed as 60°/0.09s=111rpm.
The Arduino Nano board was used for giving out commands to the servos and data acquisition from the rotary encoder. The open source Arduino Software [4] (IDE) was used together with the Servo Library, so the commands are also expressed as desired angles not as pulses with durations within the range 1-2 ms. Moreover, the regular angular positions of a RC servo, considered to be included in the range -90°…90°, were shifted with 90°, to comply with the regular 0°…180° of the rotary encoder. For each micro servo there were raised calibration diagrams by use of the data acquired in the vectors: An example of the calibration diagram of one micro servo is presented in figure 9.  The markers denote the measured values, while the line is the best polynomial approximation with the least square method: Anyway, this polynomial, which seems to match well to the correspondence between the actual angle (sensor angle) and the desired (target) one is of little use, due to the method of lookup table already decided to be adopted for commands. Therefore, a corrected command can be calculated, by linear interpolation if make use of the calibration diagram (figure 10).

Fig.10. Command correction using linear interpolation in the calibration diagram
This time, the desired value is chosen on the ordinate axis (figure 10) and the command value is obtained on the abscissa axis. The interpolation is linear, because all the marked points (measured) are united with straight lines.

Conclusions
During development of a mobile robot for pipeline inspection, without its dismantling, the need for a scanning manipulator was revealed. This one had to move the scanning instrumentation around the pipe, at equally spaced positions, depending on the sensors scanning range. A simple, but novel solution was developed, able to move on a circular trajectory, and the most important, to have a perfectly accurate inverse geometric model. Moreover, this one was solved by use of elementary geometry, having results which are independent on the circular trajectory radius, if the two arms of the kinematic chain have the length equal to the trajectory radius multiplied by √2 .
The built manipulator was provided with micro servos as actuators for active joints, so, due to their hobby status, it was necessary a calibration operation for each one, in order to correct the target command for the desired output angle.