SmartCrawler: An In-pipe Robotic System with Wireless Communication in Water Distribution Systems

— Water Distribution Systems (WDS) are critical infrastructures that deliver potable water to residential areas. Incidents to pipelines cause water loss and contamination in pipelines. Hence, water quality monitoring is one of the requirements for utility managers to ensure the health of water. However, it is challenging to access all parts of the WDS since they are long and comprise pipes with different configurations and sizes. In this paper, we propose a size-adaptable and modular in-pipe robot so-called “SmartCrawler” that works based on wheel wall–press mechanism. We develop a two-phase motion control algorithm that enables reliable motion in straight and non-straight configurations of in-service pipelines. The controller in phase 1 stabilizes the robot in the straight paths and tracks the desired velocity with high-level linear quadratic regulator (LQR) and low-level proportional-integral-derivative (PID) based controllers. The controller in phase 2 with a designed error-check-submodule and velocity controller, enables the robot to steer to the desired directions at non-straight configurations. The performance of the two-phase controller is evaluated with experimental and simulation results. Wireless underground communication is a challenging task for underground applications. We propose a bi-directional wireless sensor module based on active radio frequency identification (RFID) that works in 434MHz carrier frequency and evaluate its performance with experimental results. At the end of this work, we design the printed circuit board (PCB) for the SmartCrawler that embeds the electronic components in a confined and sealed environment. The simulation and the experimental results prove the proposed robotic system can be used for in-pipe missions where wireless communication is needed to communicate with the robot during operation.

mobile sensors as they have passive motion and are moved with water flow in the pipeline. Due to passiveness of their motion and complicated configuration of pipelines, the mobile sensors are not directed to the desired location for retrieval, unless that part of the network that is considered for sensor operation is shut down and isolated from the rest of the network. Thus, it is required to design the sensor modules that are automotive during operation in which their motion is independent of the flow. In-pipe robots are promising alternatives for these tasks as they can embed various sensor modules for doing different tasks (e.g., leak detection, measuring the concentration of target analytes in water, inspecting pipelines visually, etc.) in the pipelines.

A. Literature Review
Most robots are actuated either by pneumatic actuators [8]- [10] or electrical actuators (i.e. DC motors) [11]- [22].  There is not a reliable robotic system that can be used for water quality monitoring in distribution systems with large pipe diameters and adaptability to wide pipe changes.  Lack of a fully automotive in-pipe robot that can work in in-service distribution networks and withstand the highly pressurized pipelines.  The current robots cannot inspect long distances of inservices networks.  Since distribution networks comprise pipelines with different sizes and configurations, and the in-pipe robots need to negotiate them and this problem is not welladdressed in the literature.  Bi-directional wireless communication link is required in the underground robotic applications that is not welladdressed in the literature.

C. Our Contribution
In our previous works, we designed a modular in-pipe robot [33], characterize its components [34] toward fully automotive system in operating networks, and provided a dynamical modeling for it [35]. We will mention our contribution at the end of each section, however, our contribution in this work can be listed in following:  We propose and validate a multi-phase motion controller algorithm for the robot that enables the robot to have reliable motion in straight and non-straight configurations of pipelines in in-service networks.  We propose and experiment a wireless sensor module that facilitate reliable communication link and multi-parameter measurement. The communication link provides data transmission from the robot to the base station and motion control command from the base station to the robot.  We design the printed circuit board (PCB) for the robot that controls the motion of the robot, processes sensor measurements and communicates wirelessly with the base station.  We improve our robot design to locate the PCB and design seal mechanism to protect it from outside environment.

A. Design
The design of SmartCrawler is inspired from Ascento robot [36] which is a two-wheeled mobile robot with inverted pendulum. SmartCrawler also uses flexible mechanism with gear-motors as actuator. It comprises one central processor unit, three arm modules, and three actuator modules. The arm modules are anchored on the central processor with 120° angle. The motion mechanism of the robot is that the wheels at the end of the arm modules press the pipe wall and the gear motors provide traction force and move the robot in pipe. It benefits from the characteristics of soft robots like flexibility and motorized robots such as dexterity and mobility. In Fig. 1, the overall view of the SmartCrawler and its components, range of adaptability, and the robot in pipe are shown.
In following, we provide a brief explanation of the SmartCrawler's components:

1) Central Processor Unit:
Two parts compose the central processor; one part locates the sensor modules (i.e. the sensing part) and the other part locates the electronic embedded system in the central processor (i.e. control part). The central processor hosts a sensing unit, a data processing unit, a control unit, and a power unit. The power unit provides energy for the mobility and the embedded system of the robot. Fig. 2 shows the CAD design of the central processor and its components (More details in [33]).

2) Arm Module
Pipelines are composed of pipes with different sizes that require the robot to be size-adaptable. To this aim, we designed arm modules in which three passive springs are connected to the central processor and Boomerang-shape arms (see Fig. 3). The arms rotate about the central processor without friction, using ball bearings (More in [33]).

3) Actuator Module
At the end of each arm module, an actuator module is located that includes a gear motor equipped with incremental encoders, a motor cover, a wheel, and a pair of ball bearing. The gear motors are fixed on the arm by the motor cover, and directly connected to the wheel. We covered the wheel with rubber in our design to increase the friction between it and pipe surface in which guarantees pure rolling of wheels. The wheel is connected to the arm with ball bearings. Fig. 4 shows the CAD design of one actuator module and its components (More in [33]).

B. Characterization
The robot operates in WDS while the system remains in service and few works considered the application of in-pipe robot in operating systems [37]. The pressurized operation environment affects the robot parameters and we need to have comprehensive understanding of the operation conditions. To this aim, we simulated an extreme operation condition that the robot moves with high velocity against the flow with the common flowrate in the standard guidelines in our previous work [34] with computational fluid dynamics (CFD) work. The simulation results provide the maximum stress and forces on the robot and based on the results of the flow simulation, we characterized the following mechanisms and components:

1) Gear Motor
We selected a customized gear-motor based on the CFD work to provide sufficient torque and fast motion for the robot (More details in [34]).

2) Spring Stiffness
For reliable motion in pipe, there should be sufficient friction force between the wheels and the pipe wall. The friction force is provided by passive springs in the arm modules and we characterized the spring stiffness to provide sufficient normal force for the wheels to press pipe wall in all configurations of the arms [34].

3) Power Consideration
We also performed power profiling for the electronic components of the SmartCrawler and provided a recursive approach in our previous work that calculates the minimum battery capacity and operation duration, 3 hours, considering the extreme operation condition [34].

C. Modelling
The free-body diagram of the robot in a pipe is shown in Fig.  5. We present the degree of freedom (DOF) of the robot with linear velocity, , rotation around the y-axis, , and rotation around the z-axis, . The equations of motion of the robot are presented as follows:  are the gear-motors torque and wheel radius, respectively. Full representation of the system's dynamical equations is presented in our previous work [35]. Fig. 6 shows the prototype of the robot. Since the robot operation environment is in potable water, there are health considerations that we addressed in [33]. We prototyped the designed components with 3D printing technology the designed components of the robot with Acrylonitrile butadiene styrene (ABS) material. The modular design of the robot facilitates easy disassembling and maintenance. The general parameters of the robot are listed in Table I.

III. TWO-PHASE CONTROL DESIGN, SIMULATION, EXPERIMENT, AND DISCUSSION
Distribution systems ( Fig. 7 [45]) comprise pipelines with different configurations. The robot experiences change in pipe diameter during operation, there is high velocity flow in which applies huge disturbances on the robot. Due to sediments and corrosion, aging pipes have non-circular and uncertain shapes. The robot needs to track a desired velocity in pipelines and steer to the desired directions at non-straight configurations like 90degree bends and T-junctions. Hence, there is a need for motion controller to handle these uncertainties and disturbances and enables the robot to steer to the desired direction at non-straight configurations.     We use multi-phase control algorithm in this project that facilitates reliable motion in different configurations of pipelines. In straight paths, the PID-LQR controllers are used and in the non-straight paths, a differential motion controller is proposed based on PID controller and a designed error-check sub-module. The proposed controller enables the robot to move smoothly in straight paths and change its direction in Tjunctions and bends, which are common non-straight configurations in pipelines [46]. First, we design the stabilizervelocity tracker controller in straight paths and evaluate its performance with experiments. Then we design the controller in non-straight paths and evaluate its performance with simulation results.

1) LQR Stabilizer Controller
In the stabilization of the SmartCrawler, our goal is to locate the central processor at the center of the pipe during operation. State-feedback controllers are good candidates to this aim [47], however to design a state feedback controller, we need statespace representation format of our system while the governing dynamical equations of the system are highly nonlinear. To this aim, we decoupled the dynamic equations of the system into two sets: One set is related with the robot linear motion, (1), and the other set is related to the orientation of the robot, (2) and (3). We consider ( ) = [̇̇] as stabilizing states (see Fig. 8) that need to be kept at zero value during operation. Hence, we linearized (2) and (3) around the equilibrium point that is = [0 0 0 0] and derived system's auxiliary matrices. We can write: Auxiliary matrices are calculated by substituting and in (7) and (8) where is the controller input at the equilibrium point.
= [ 0 1 0 0 0 0 1 0 ] is the system's output matrix. The system's auxiliary representation in state-space form is: following onwards, we will design a state feedback controller based linear quadratic regulator (LQR) controller [48]. To this aim, we define a cost function  where weights s and weights . The cost function, ( ), depends on and is minimized when is: where is calculated with algebraic Riccati equation [47]: is then used to calculate the LQR stabilizer's output, , that is: = − s (13) The proposed LQR controller, keeps ( ) at the equilibrium point which results in the central processor remains in the center of the pipe during operation.

2) Velocity Controller
In addition to stabilization, the robot also needs to move independent of water flow with a desired velocity. To this aim, we design a velocity controller based on proportional-integralderivative (PID) controller. The angular velocity of the robot's wheels are approximately equal in the straight path, hence the relation between the linear velocity of the robot and the encoder output is calculated as: where , , and are the number of pulses per wheel turn that the motors' encoders generate, wheel radius, and the time between two consecutive pulses, respectively. In the velocity controller, the desired velocity is translated to the desired angular velocity, , based on (14) and three PID regulators track the desired angular velocity (see Fig. 9). The commands from PID controllers are amplified with L298N to drive the motors.
The robot needs both stabilization and velocity tracking features simultaneously, hence, The LQR stabilizer and velocity controllers are combined and shown in Fig. 10.

3) Controller Performance Evaluation with Experimental Results:
A testbed is developed to evaluate the performance of the stabilizer-velocity controller (see Fig. 11a). An inertial measurement unit (IMU) that includes an accelerometer and gyroscope (BMI160 breakout from Bosch Sensortec.) is located at the center of the robot on the central processor.
The IMU sends linear acceleration and gyro data of the robot to the microcontroller unit (MCU) via an inter-integrated circuit (I2C) protocol. The Arduino Mega2560 microcontroller board based on the ATmega2560 microcontroller is used as the MCU. Three ENX EASY 16 incremental encoders with six channels that work with Hall Effect and provide angular velocities of the motors are connected to the MCU. To control the velocity of the motors and also their direction, L298N, dual full-bridge motor driver are used. Each driver board controls two motors. As we have three motors, two L298N boards are used. We used a 15 A.h super lithium-ion battery with 12 V to power the actuation units (i.e. gear-motors). The pipe that the robot moves in is a 14-in diameter SCH.40 PVC pipe. Since the IMU outputs are noisy and have a DC baseline, it is not feasible to calculate the rotational angles, directly from the IMU (i.e. by integration). Hence, we computed the rotational angles with Mahony complementary filter [49] which is an optimal sensor fusion to calculate roll, pitch, and yaw angles using the IMU outputs. The robot's linear velocity is computed by the encoders' output (14). The control algorithm is programmed in the Arduino Integrated Development Environment (IDE) and connected to MATLAB2020 with MATLAB support package for Arduino hardware. We monitored the velocity of the robot and Mahony filter angles ( and ) in MATLAB2020 in real-time. We evaluated the performance of the developed control algorithm with different initial values for and desired linear velocities in four iterations. In Figs. 11b, 11c, and 11d, the robot velocity and the robot-controller performance for and are shown, respectively. Each curve shows the results for each iteration. The robot is at rest (i.e. zero velocity) at the time each iteration In iteration 1 (The blue curve in Fig. 11), 0 and 0 are −4° and −3°, respectively. Besides, they converge to zero and fluctuate around zero value with ±2° margin in around two seconds. The fluctuation margins are the same for other iterations as well. In this iteration, the desired linear velocity for the robot is 0.1 m/s. The robot reaches the desired velocity in around two seconds. In iteration 2 (The red line in Fig. 11), the initial value for 0 and 0 are −14° and −11°, respectively; and the desired linear velocity for the robot is 0.2m/s. The stabilizing states converge to zero in two seconds and the robot reaches 0.2 m/s velocities in less than three seconds. In iteration 3 (The orange line in Fig. 11), 0 and 0 are −9° and +5°, respectively. The robot reaches to desired linear velocity (i.e. 0.3 m/s) in four seconds and stabilizes the stabilizing states in one second. The stabilization duration is around one second in iteration 4 (The pink line in Fig. 11) and the time the robot reaches the desired linear velocity of 0.35 m/s in five seconds. The experimental results prove that the developed stabilizervelocity tracker controller can control the velocity of the underactuated robot and stabilize it in the highly uncertain environment of pipelines. For example, over time, the minerals in water cause sediments in pipes, which make the internal shape of the pipe non-circular, and there is no prior information about them. Another example is phalanges in pipes that are used to create junctions and bends. The phalanges make a rapid and sudden change in pipe shape that requires the control algorithm to stabilize the robot against the impact these sudden shape changes impose on the robot. The developed controller in this phase, stabilizes the robot against these uncertainties and disturbances and tracks a desired velocity.

B. Phase 2: Controller Algorithm for Non-Straight Paths (i.e. 90°-bends and T-junctions)
The controller in this phase, steers the robot to the desired direction in non-straight paths. It comprises a trajectory generator, an observer, an error-check sub-module, and three PID regulators that control the velocity of the wheels.
The trajectory generator creates differential motion based on the geometry and the actuator architecture of the robot. Different angular velocities of the wheels change the orientation of the robot. Fig. 12 shows the algorithm that the trajectory generator works based on, and the representation of the coordinate system on the robot and the numbered wheels.
To make a counterclockwise rotation around the y-axis ( >0), wheel 3 has the angular velocity that is maximum velocity, wheel 2 has the minimum angular velocity, and wheel 1 has the average velocity of wheels 2 and 3. Clockwise rotation around the y-axis ( <0) is similar to counterclockwise motion with the difference that wheels 2 and 3 have maximum and minimum velocity, respectively. For a counterclockwise rotation around the z-axis ( >0), wheels 2 and 3 have the maximum velocity and wheel 1 has minimum velocity and to acquire clockwise motion around the z-axis ( <0), wheel 1 has the maximum velocity and wheels 2 and 3 have minimum velocity. We call this algorithm as variable velocity allocation (VVA) and the maximum and minimum velocities are calculated based on the desired speed that guarantees smooth motion. We reached to the maximum velocity of 60 rpm,   The observer of the controller includes the IMU and the gear motors' encoders. Three PID regulators track the desired velocities that the trajectory generator has assigned for the wheels (i.e. one PID controller is associated with one wheel). An error-check submodule is designed that checks the status of the rotation and allows the controller in this phase to continue until the desired rotation around the desired axis has been acquired (see Algorithm 2). Once the desired rotation is completed, the controller switches to phase 1 (see Fig. 13).
We evaluate the performance of the proposed controller in 90° bends and T-junctions that are common non-straight paths in WDS [46].

1) Controller Performance Evaluation at 90-degree Bend:
We did co-simulation in ADAMS and MATLAB to evaluate the performance of the proposed controller in 90° bend and Tjunctions. Fig. 14a shows the robot in a bent pipe with 12-in (30 cm diameter). The front path is a 90° bend and the robot needs to rotate 90° clockwise around the y-axis (i.e. = −90°). The sequence of motion during simulation is shown in Fig. 14a with numbers from one to six. In Fig. 14b, the robot's angular velocities around x-axis, y-axis, and z-axis are shown. The blue curve is the angular velocity around the y-axis. The robot's angular velocity around the y-axis ranges between −10°/s and −25°/s. The pink-colored curve shows the angular velocity of the robot around the x-axis. The angular velocity around the xaxis ranges between +1°/s to −5°/s during motion. The red curve in Fig. 14b shows the robot's angular velocity around the z-axis that ranges ±1°/s during motion. The angular velocities around the axes show that the robot rotates −90° around the yaxis, −8° around the x-axis, and ≈ 0° around the z-axis. The rotation angles around each axis during this simulation show the robot along with the developed controller can pass through bends smoothly. We repeated our simulations in different pipe diameters and validated that the robot can pass through the bends with dimeters ranges from 9 in (23 cm) to 22 in (56 cm) with the proposed control algorithm.

2) Controller Performance Evaluation in T-junctions:
The robot in a 12-in (30 cm) diameter pipe with a T-junction path ahead is shown in Fig. 15a. The robot needs to rotate 90° counterclockwise around the y-axis (i.e. = +90•). The robot starts moving and the wheel that is further to the junction curvature, loses its contact with Pipe (I) and due to pretension in springs, contact with the Pipe (II) wall. Other wheels smoothly enter Pipe (II). The robot's angular velocities around the x-axis, y-axis, and z-axis along with the robot's linear speed are shown in Fig. 15b; the right vertical axis shows the linear speed in m/s and the left vertical axis shows angular velocities in °/s. The solid blue curve shows the robot's angular velocity around the y-axis. The velocity is between +25°/s and +75°/s most of the time. However, in a short period, the velocity reaches +200°/s and −50°/s. The solid red curve shows the robot's angular velocity around the x-axis. It has values range between -37°/s and +25°/s during motion. The solid pink curve shows the robot's angular velocity around the z-axis. The angular velocity around the z-axis oscillates between −50°/s to +100°/s and most of the time is positive. At the end of the rotation, the rotation around the z-axis is not near zero as can be seen in Fig. 15a, photo number six. The dotted blue curve shows the robot's linear speed during rotation. The values for linear velocity start from zero and range between 0.15 m/s and 0.25 m/s. However, the robot's speed is constant; it rotates smoothly during the motion. The simulation results show the proposed controller at phase 2 enables the robot to change its direction in the challenging environment of T-junctions as there is minimum available contact space for the wheels. We repeated our simulations in T-junction with different diameters and validated the robot can pass through the T-junctions with diameters range from 9-in (23 cm) to around 15-in (38 cm). The pretension in the springs makes the wheels be in contact with pipe walls most of the time during rotation at T-junction and the duration at which the wheel loses its contact with the pipe wall is short enough that the robot does not collapse. Also, the rotation around the z-axis (at the end rotation) is cancelled when the controller switches to phase 1. In the proposed two-phase controller, the idea is that the path after a junction is a straight that is aligned with the WDS standards [46], hence the controller switches from non-straight phase (phase 2 in Fig. 13) to straight phase (phase 1 in Fig. 13). Also, the switching from straight phase to non-straight phase is performed via wireless communication system and that is beyond the scope of this paper.
There are different control algorithms in the literature. The fuzzy-based controllers are good options in precise trajectory tracking, rise time, and energy expenditure [50]  drawback is using them, it is not possible to negotiate complicated configurations of pipelines [50], [51]. Also, the performance of fuzzy-based controllers are similar to the conventional proportional-integral-derivative (PID) controllers [52]. However, using PID controllers alone does not guarantee maneuverability for in-pipe robots [43]. Combination of linear quadratic regulator (LQR) controllers showed promising results in-pipe robots [53], however there is still the problem of negotiation of non-straight paths for in-pipe robots. For some robots, different actuation modules are required for rotation aside from driving that leads to the system complexity [54], [55]. To reduce the system complexity, differential mechanisms are suggested that offer both translational and rotational motions with one set actuator module [56] and also, in terms of motion control, phase selection is suggested in the literature in which the robot enters to different phases of motion control based on the configuration type with the inability to negotiate vertical paths [57]. Also, the effect of flow presence is not welladdressed in the literature in different configurations of pipelines [37].
We used the two-phase motion controller that enables the robot to negotiate straight and non-straight configurations of pipelines against disturbances and uncertainties in in-service networks. The designed controller for non-straight path enables the robot to rotate a desired amount, around desired axis with one set of actuator module that leads to system simplicity.
We validated the performance of the proposed controller in bends and T-junctions that is a big challenge for in-pipe robot, especially in large pipes of WDS and not discussed in the literature [5], [11], [25], [39], [43], [50], [52], [57]- [59]. We also defined the size limitation of the robot in passing the bends and T-junctions.

IV. WIRELESS COMMUNICATION
In our application, the receiver(s) is located outside pipeline and there should be easy discovery between the wireless sensors module on the robot and the receivers (Fig. 16). Also, we need a wireless system that can penetrate the harsh underground environment where there is high signal attenuation [26] and it is bidirectional. Bi-directionality is required to facilitate sensor measurement transmission from the robot to the base station and motion controls command transmission from the base station to the robot. Also, we need multi-parameter measurement and transmission which is highly desired based on industry interview.
We propose a wireless communication system based on active low frequency (RFID) technology that facilitates easy discovery between the transceivers and also can work in low  frequencies that results in better penetration in harsh environments [26], [60].
RFID is the technology where two transceivers communicate whenever they are close to the range of each other [60] and seven layers of communication (open system interconnection model (OSI)) [61] are abstracted. So, there is no need to synchronize the connecting devices before data transmission starts and communication establishment is fast enough as soon the two transceivers come near the range of each other.

A. Bi-directional Wireless Sensor Module based on RFID in the SmartCrawler Robot
In this research, we design a wireless sensor module based on the proposed active RFID wireless system using CC1200 from Texas Instruments (TI) Inc© as physical layer. It can receive and send data and has 128 bytes data FIFO for both TX and RX sides. CC1200 is connected to the MCU and its functions are controlled by the MCU. Up to five sensors are connected to five analog to digital Converter (ADC) channels of the MCU and the sensor measurements are processed and located to the buffer register of the CC1200 for transmission. Next, we configure the CC1220 registers and our goal is to ensure a reliable communication link with maximum throughput. The register configuration is facilitated by SmartRF module [62] that derives the proper value for registers based on the desired features. We configured the radio signal to have 434 MHz carrier frequency to be able to penetrate the underground environment [26]. Also, to receive the maximum possible signal strength at receiver side [63], we configured the maximum transmission power that CC1200 can support (i.e. 14dBm) [64] and to have the maximum throughput, we configured the symbol rate of 1250 symbols per second (sps) and modulation format of 4-Gaussian frequency-shift keying (4-GFSK) that is the maximum throughput of CC1200 [64], [65] (see Table II).

B. Experimental Results
We set an experiment to measure the received signal strength (RSS) of the transmitted signal of our wireless sensor module, and also the packet error (i.e. the number of packets that are received incorrectly). In this experiment, five FlexiForce sensors are connected to five channels of the MCU and dynamic range of the sensors is similar to the chemical sensors. The MCU is connected to the CC1200 evaluation module and both are powered by a battery. The wireless sensor module is immersed in bucket of water and sends the sensor measurements, continuously (see Fig. 17). In real application, the receiver is located above ground in a few meters away from the sensor module [66] and in this experiment, we locate the transceiver 10m away from the wireless sensor module and receives the data packets. A graphical user interface (GUI) offered by SmartRF Studio is connected to the reader and shows the RSS of the data packets and bit and packet errors. The average RSS in our experiments is measured -61dBm in 2 minutes duration of the experiment that is stronger than the power threshold, −80dBm, for correct realization at receiver   side [67]. Also, the bit and packet error was measured at ≈ 0% in the experiment (see Table III). We further repeated our experiments and increased the distance between the transceivers and measured RSS in each distance (Fig. 18a). The maximum read range of our proposed wireless sensor module is 19.5 m in a pipe with water. The received power is a function of the transmitted power and also path loss of the environment [68]: is the received power, transmitted power, antenna gain at transmitted side, and antenna gain at receiver side, respectively. + 0 is the path loss of the environment where is the path loss of the underground environment and 0 is the path loss model in free space and computed as: 0 = 32.4 + 20 log( ) + 20 log( ) (16) In (16), is the distance between transmitter and receiver and is the frequency of the carrier signal. Fig. 18b shows the path loss of the environment.
In this section, we designed a wireless sensor module that can be used for multi-parameter measurements and transmission of up to five parameters in water that is improvement compared to our application [69]. The bidirectional wireless module penetrates underground environments at higher read range [67], [70], [71].

V. PRINTED CIRCUIT BOARD (PCB) DESIGN
The PCB of the SmartCrawler includes the power management circuit, analog drivers for the robot's actuators, analog sensors, and a low-power embedded system that controls the motion of the robot, acquires the sensors data, and provides the bidirectional data communication link with the base station. We explain about each section briefly as follows.

1) Power Management:
A 12V lithium rechargeable battery with a capacity of 18A.h is the power source to the system. Regarding the analog and digital circuits as the main sub-circuits of the electrical design, three DC voltage levels of 12V, 5V, and 3.3V need to be regulated and supplied. Therefore, while the battery voltage (VBAT) supplies the motor drives directly, it is stepped down to less than 6V through a high-efficiency DC-DC buck converter (TPS62150, Texas Instrument -TI-), and then is regulated to 5V and 3.3V through a dual-channel low-noise low drop-out linear voltage regulator (TPS7A87, TI). The two-step voltage regulation provides efficient power consumption.

2) Microprocessor and Digital Circuit
A low-power microcontroller (ATmega2560, Atmel) is the heart of the embedded system. It controls the robot drivers, establishes a serial peripheral interface (SPI) data communication with the CC1200, and communicates with the IMU (i.e. BMI160) through an inter-integrated circuit (I2C) protocol.    3) The Robot Drivers and Analog Circuit: To drive three wings of our robot, two high-current full-bridge dual drivers (L298, STMicroelectronics) provide the electrical control for the motors. Besides, each motor is equipped with an encoder that measures the angular velocity of the motors as discussed earlier in this paper. Also, the system is equipped with a piezoelectric diaphragm micropump (mp6, Bartels Mikrotechnik) for pumping liquids inside our robot with varying flow rates controlled by a controller (mp6-OEM). Furthermore, five analog sensors are added to the system. In Fig. 19, the hardware architecture of the PCB and the connection of different components are shown and Fig. 20 shows the PCB board. The location of the PCB in the central processor is shown in Fig. 21.

VI. CONCLUSION
The in-pipe robot system we proposed in this research benefits from the characteristics of soft robots with the underactuated mechanism that provides high maneuverability for chattered environments, and dexterity of the traditional wheeled mobile robots. The two-phase controller enables a fast and stable motion in the highly pressurized environment of the water pipes. Switching between two phases of the controller enables smart navigation for the robot. The active radio frequency identification (RFID) that we proposed in this paper enables a reliable wireless communication for the robot (i.e. sensor measurement transmission) in the highly attenuate of underground environment. The experiment results showed a 10m read range with -61dBm received signal strength (RSSI). The combination of the robotic sensor, multiphase controller, and the wireless communication system suggests promising system for water quality monitoring and leak detection in large pipes of water distribution systems (WDS). In our future work, we will develop an operation procedure that facilitates smart navigation and data transmission during operation for the SmartCrawler. To this aim, some radio transceivers are placed above-ground and the robot moves underground inside pipeline (see teaser image). The robot switches its wireless communication between different transceivers. Also, the motion commands from the transceivers, enables the robot to switch from phase 1 to phase 2 of the motion control algorithm.