{'fraction_non_alphanumeric': 0.026746549695089335, 'fraction_numerical': 0.010769944010555971, 'mean_word_length': 5.104048759251198, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 1, 'lorem ipsum': 0, 'www.': 12, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modeling and Control of a Soft Robotic Fish with Integrated Soft Sensing

more lifelike forms of locomotion, but also as a tool to understand complex biomechanics through the use of robotic model animals. Herein, the control of the undulation mechanics of an entirely soft robotic subcarangiform ﬁ sh is presented, using antagonistic fast-PneuNet actuators and hyperelastic eutectic gallium – indium (eGaIn) embedded in silicone channels for strain sensing. To design a controller, a simple, data-driven lumped parameter approach is developed, which allows accurate but lightweight simulation, tuned using experimental data and a genetic algorithm. The model accurately predicts the robot ’ s behavior over a range of driving frequencies and a range of pressure amplitudes, including the effect of antagonistic co-contraction of the soft actuators. An amplitude controller is prototyped using the model and deployed to the robot to reach the setpoint of a tail-beat amplitude using fully soft and real-time strain sensing.


Introduction
Despite the recent proliferation of computation, sensing, and actuation at a small scale, robots still lag behind their natural counterparts. Much of this observed performance deficiency stems from differences in structure, in particular the use of compliant structures with distributed strain sensing and mechanical feedback. Such compliance and flexibility in animals are often exploited to adapt to unpredictable changes and enhance stability through morphological intelligence, [1] thereby enhancing robustness.
In nature, one of the strongest evolutionary pressures is the need to conserve energy. As a consequence, most natural structures are highly adapted for efficient locomotion and are able to maintain that efficiency across a range of situations and movement speeds. For example, salmon can swim for weeks upstream while fasting, [2] and facing rapidly changing flow conditions and locomotion demands, thus exhibiting energy storage and conservation mechanisms barely dreamt of by robotics engineers. In fish, significant energetic efficiency is derived by exploiting the stiffness of their body structure, [3] converting energy from the fluid to the body, [4][5][6][7] resulting in propulsion being generated passively. The internal dynamics and the mechanisms through which soft structures are exploited for attaining this remarkable energy efficiency are underexplored. The interplay between active and passive stiffness control is the subject of fundamental science and offers significant potential for biomimetic technology transfer.
Investigating the underlying mechanisms present in soft structures oscillating in moving fluids will enhance robot mobility and offer important insights in neuromechanics, by creating robots that can function as "model animals" for biomechanics research. [8] Understanding the efficiency of natural movement can ultimately have applications beyond pure locomotion, including energy harvesting, wearable devices, and broader embodied intelligence. [9] Soft metamaterials can integrate energy-harvesting functionality, which sheds light on the broad application potential of soft robotic technology. [10][11][12][13] However, to truly take advantage of soft materials and hyper-redundancy in soft robots, controllability is required, [14] which in turn requires novel sensors and design techniques. Salient examples of highly flexible structures for locomotion in nature are found in the water. [15] Undulation is the most fundamental form of locomotion and basal to all vertebrate taxa. Lateral undulation is also preserved in extant fish, salamanders, and reptiles. [16] Swimming by caudal fin oscillation produces one of the most efficient forms of locomotion in the animal kingdom in terms of cost of transport, [17,18] as well as the highest speeds achievable underwater. [19] Recreating the swimming abilities of pelagic fish in a robot would enhance access to vital marine data, DOI: 10.1002/aisy.202000244 Soft robotics can be used not only as a means of achieving novel, more lifelike forms of locomotion, but also as a tool to understand complex biomechanics through the use of robotic model animals. Herein, the control of the undulation mechanics of an entirely soft robotic subcarangiform fish is presented, using antagonistic fast-PneuNet actuators and hyperelastic eutectic gallium-indium (eGaIn) embedded in silicone channels for strain sensing. To design a controller, a simple, data-driven lumped parameter approach is developed, which allows accurate but lightweight simulation, tuned using experimental data and a genetic algorithm. The model accurately predicts the robot's behavior over a range of driving frequencies and a range of pressure amplitudes, including the effect of antagonistic co-contraction of the soft actuators. An amplitude controller is prototyped using the model and deployed to the robot to reach the setpoint of a tail-beat amplitude using fully soft and real-time strain sensing.
avoid the noise, entanglement, and other problems faced by conventional screw propellers, [20] and allow scientists to better understand the underlying locomotion physics. [21] Ichthyologists and engineers have worked together to develop soft swimming robots as experimental platforms to answer questions in biomechanics, including robotic swimmers, which can reach comparable speeds to hunting tuna. [22] Although most bioinspired underwater vehicles have been predominantly rigid in their components, [23] adding compliant components in swimming robot design has also proven to be energy efficient; [24] therefore, a great deal of recent effort has been focused on the development of soft actuators and sensors, [9] to extend the capabilities of the swimming robots and better replicate the observed locomotion mechanics of aquatic vertebrate swimming. [25] Other examples include robots that can replicate the rapid "C-start" maneuver seen in carangiform fish [26] and acoustically controlled swimming robots that are capable of 3D swimming. [27] Biorobotic fish with soft paired fins showed the advantages of soft actuators in fluid applications, [28] as well as the potential to use such actuators on fins as large-scale flow sensors. [29] Power provision in soft robotics is a persistent challenge, and research is ongoing into soft fish with various actuation power sources, for instance, robots powered by electrolytic vascular systems, [30] robots actuated by dielectric elastic actuators [31] or cyclic hydraulic systems. [32] Freely swimming fish must match the frequency of body undulation with the incident flow to swim efficiently. However, in a completely passive fin system, changes in frequency will also result in changes to amplitude and spatial wavelength, which will affect thrust production and drag. [33] To optimize performance across a range of speeds, swimming fishes change the amplitude of their undulation and their body stiffness. [34] Replicating this behavior requires closed-loop control based on sensory information, and efforts have been made in control algorithm development for undulatory locomotion. [35,36] When designing an effective control algorithm for bioinspired systems, an accurate model is typically of significant benefit, whether for mathematical demonstration of stability, computational tuning of gains, or evaluating robustness and noise tolerance.
Soft systems are underactuated and typically have vast state spaces as well as material nonlinearities, making both modeling and control of soft robots a considerable and ongoing challenge. Typically, modeling soft robots involves finite element simulations [37] or black-box data-driven methods using machine learning tools. [38] However, such simulations are computationally intensive and difficult to generalize to other systems. Equally, directly prototyping and testing a control algorithm experimentally with hardware in the loop without simulation would be labor-intensive and likely to produce suboptimal results. Where oscillatory dynamics, rather than fine positioning, are of interest, inertial forces play a large role, and the effect of local hyperelastic deformations and material nonlinearities have a reduced impact on the overall output behavior. Instead, we show that it is possible to capture swimming locomotion with linear coefficients, using experimental data to produce a computationally light model that can be used for control design but still captures the system's salient behavior. In this spirit, we used the lumped parameter model, which is common in modeling elastica [39][40][41] and was also used in robotic fish. [42] The optimal parameters of the model, which can best enable the model to resemble the actual behavior of the fish, were found using a genetic algorithm. The same algorithm was reported to be used in finding the maximal propulsive velocity of a robotic fish. [43]  www.advancedsciencenews.com www.advintellsyst.com

Results and Discussion
This study combines the pneumatically actuated system presented in Jusufi et al. [44] with the strain sensors used in Park et al. [45,46] and implements closed-loop control of swimming using entirely soft sensors and actuators. Time-lapse sequence images of the robotic fish undulatory locomotion are provided in Figure 1. The tip-tip deflection of the fish robot is at the same level compared to brown trout of the same size [3] and a frequency range of 0.8-1.2 Hz is chosen, in which many free swimming fish are observed to operate. We develop and use a computationally lightweight, hydrodynamic model of the soft robotic fish, suitable for control design and optimization. We convert the data of two soft strain sensors to useful proprioceptive information and show stiffness change through antagonistic co-contraction of the soft actuators. We develop a feedback controller using the soft actuators and the eutectic gallium-indium (eGaIn) sensors with a control approach, which is robust and noise-tolerant with both the simulation and swimming experiments.

Fish Robot Model Performance
The robotic fish was first tested in the air with minimal fluid reaction forces, making it possible to capture the actuator dynamics alone. Good agreement was found between model predictions and experiments in both air ( Figure 2A) and water ( Figure 2B), including when the overlap between the left and the right actuators' "on" states was incorporated to produce a stiffening/ unstiffening effect ( Figure 2C,D). Some examples of models are provided in the GitHub repository (GitHub link: https://github. com/yuhsianglin0517/SoftFishModelAIS.git). The overlap fraction of the opposing actuators was increased from À10% to 10% in 5% increments, with negative overlaps representing "dead time" (neither actuator inflated) in control pressure series, which provided us a comparison to the stiffening effect caused by co-contraction. This produced a noticeable change in the kinematics, reducing the maximum swing rates during lateral movements, and reducing the dwell time at maximum excursion that resulted from a square wave driving signal.
Once the behavior of the actuator was accurately modeled in air, the fish was placed in water, and the changes in the kinematics were recorded over the same ranges of the driving frequency, the pressure, and the co-contraction as we did in the air. In antiphase activation at a constant frequency, the model accurately predicted the response across the range of frequencies.

Elastic Strain Sensor Performance
Testing the eGaIn sensor attached to the soft robotic physical model showed that it was able to capture the fish deflection in real time ( Figure 3A). Compared with the ground truth kinematics from videography, the sensor response was linear (R 2 ¼ 0.952, Figure 3B) with a relative error that is well modeled by Gaussian noise with a standard deviation of 0.4% ( Figure 3C).
The noise on the sensor does not come from the sensor itself, which produces low noise resistance changes when measured with high-resolution analog inputs in a tension test machine. Because the sensor performance is temperature related, it is www.advancedsciencenews.com www.advintellsyst.com important to note that all the experiments were conducted at room temperature. The noise instead comes from the limited resolution of the analog-to-digital converter (ADC) of the microcontroller used (10 bit), and the effects of additional compressive strains on the sensor from fluid reactions and deformation of the pneumatic actuator it is mounted to. However, the sensor is still well below the noise level that would impede the controllability of the entire system. The sensors remained functional after several continuous tests for weeks, indicating that the sensors have good fatigue tolerance. When a sensor failed, it was due to an issue with the wiring harness, rather than failure of the silicone channel itself.

Feedback Controller Performance
With the model and the sensor performance well established, we prototyped an amplitude control system in Simulink (Matlab R2020a) ( Figure 4A), including the effect of sensor noise. To create a controllable reference from the oscillating strain signal, we extracted the maximum amplitude every half period, updating the error signal at each point that the bending angle crossed zero. We used a proportional-integral-derivative (PID) controller to adjust the pressure in response to the measured amplitude.
The model allowed us to quickly tune the gains, without risking the hardware, and examine the effect of sensor noise.   www.advancedsciencenews.com www.advintellsyst.com We found that the controller was robust to the noise levels well above the error levels observed in the sensor data ( Figure 4B-D). Figure 4D shows the controller response to a series of step inputs at a noise comparable to the noise level that was measured from the eGaIn sensor during undulation ( Figure 3B-C).

Closed Loop Soft Robotic Swimming
The gains tuned in the model were then deployed to the microcontroller for testing in the physical fish. A linear fit based on the fish was tested in both air and water to examine different operating conditions ( Figure 5). The controller was able to maintain a constant amplitude to within a reasonable margin, and respond to step changes in the demanded amplitude. The setpoints in water were set lower than the setpoints in air because higher pressure was required in the water to reach the same bending angle in the air. To prevent the actuators from being overinflated, we decided to set the setpoints in the water lower than in the air.

Discussion
As a result, we successfully show that we can build a data-driven model, which can capture the actual behavior of the soft robotic fish precisely and develop a control strategy based on the behavioral prediction given by the model. The soft sensor itself effectively captured the bending of the fish robot. The principal sources of noise in the output stemmed not from the structure or manufacturing of the strain sensor but the limitations of the electronics (e.g., the10 bit ADC) and imperfections in the attachment of the sensors and the actuators. Future iterations may benefit from the integrated manufacture of both strain-sensing channels and actuators. This could allow incorporation of multiple strain-sensing regions, which may allow considerably more sophistication in the feedback control; the soft sensor effectively averages the entire curvature of the fish robot, and so is not able to capture higher modes in the midline kinematics with multiple inflection points. Also, the elastic strain sensor was mainly used to measure strain instead of curvature; therefore, making changes in the microchannel geometry might also improve the sensor performance in sensing the curvature. [47] The response of the controller is also limited by the use of the peak amplitude, which means that the control input is only updated twice per oscillation period. This may limit the ability of the control to respond to rapid changes in incident flow in a freely swimming fish. Additional sensors or alternative inputs may be required to reach the controllability needed for robust swimming.
Although the theory and experiment demonstrate the basic efficacy of the sensors, the actuators, and the controller, the ability to evaluate the performance of the fish is fundamentally limited by the use of a static tank. Including freestream flow will have a significant effect on the most efficient swimming gaits. This would also allow better validation of the "hydrodynamic model" and allow the incorporation of more useful performance measures, such as thrust and efficiency, into the control design. www.advancedsciencenews.com www.advintellsyst.com

Conclusion
In this study, we have presented an approach to control a soft robotic fish using a lightweight modeling scheme to design a simple controller for a pneumatic soft robot. This allowed the implementation of closed-loop control in an entirely soft robotic system. The model accuracy was validated by robot experiments in both air and water, incorporating stiffness change through antagonistic co-contraction. The results were sufficient to design the feedback controller based on the robot model, which controls the undulation amplitude with the implemented soft eGaIn sensor. The model will now accelerate additional, more sophisticated control design and guide further development of the soft robot.
The current controller adjusts the amplitude by adjusting the actuator pressure in a static water tank. Future work will incorporate testing at different flow speeds and add additional layers to the control. The artificial lateral line sensors can be used to achieve body curvature sensing in the soft robotic fish as affected by different flow profiles. Live fish use their lateral line mechanoreceptors to sense the water flow, and researchers have been trying to fabricate artificial lateral line sensors and integrate them into robotic fishes. [48][49][50] The future control schema will then include adjusting the frequency and co-contraction to dynamically optimize the swimming gait in response to ambient conditions. Ultimately, this will allow a better understanding of the swimming mechanics of fish, including the role of stiffness control in achieving adaptable but efficient locomotion underwater.

Experimental Section
Soft Pneumatic Fish: The design and the dimensions of the soft robotic fish used in this study are described in detail in Jusufi et al. [44] The soft robot was built based on a simple, abstracted fish geometry with a central plastic sheet (Plastic Shim Stock, 0.5 mm, Artus) forming a fin and a spine, and a pair of silicone fast-PneuNet [51] actuators (Dragon Skin 20, Smooth-On) on either side forming the muscles on the lateral sides of the fish. The fast-PneuNet actuators were then symmetrically glued to the plastic shim with a moisture-cured silicone sealant (ELASTOSIL E43, Wacker). By actuating both actuators at the same time, how muscles modulate the structural stiffness by co-contraction, which is referred to in biomechanics as the simultaneous contraction of both the agonistic and antagonistic muscles, can be approximated. [52] Hyperelastic Strain Sensors: The development of the soft strain sensor followed the concept elaborated in Park et al. [45,46] The sensors are composed of a silicone elastomer-based microfluidic channels (Ecoflex 00-30, Smooth-On) that are filled with conductive liquid metal eGaIn (Sigma-Aldrich). When a strain is applied to the sensor, a change of the crosssectional area of the eGaIn-filled channel causes a change in electrical resistance. This principle was found to be useful for sensing the undulation of the soft robotic fish [53] as well as some wearable devices. [54][55][56] The microfluidic sensor is suitable for an underwater application for two reasons: First, the sensor signal is not affected by change of the ambient pressure due to the incompressibility of the liquid, [57] and second, the temperature sensitivity is relatively low compared to other strain sensors, such as strain gauges. [58] To increase the sensibility of the sensor, the soft strain sensor was prestretched to the length of the robot and both ends of the sensor were firmly attached to the robot using tapes and cable binders. A constant current with the amplitude of 125 mA was supplied to the soft strain sensors, whose electrical resistance ranges 3 AE 1, and amplified by a noninverting amplifier circuit, which was built with a chip containing two operational amplifiers (LM358-N, Texas Instrument), with the gain of 4.2 to generate a voltage in a proper range (1575 AE 525 mV) as the sensor output signal ( Figure 6A). The constant current circuit was built with an adjustable positive linear voltage regulator (LM317, Texas Instrument), which is capable of supplying more than 1.5 A over an output-voltage range of 1.25-37 V. The voltage across the sensor terminals was then logged to the computer via a universal serial bus (USB) using the microcontroller. The sensor measurements could thereby be compared with the data retrieved from the videos to verify the fidelity of the soft eGaIn strain sensor under dynamic conditions and used to provide sensory feedback information for the feedback control.
Swimming Experiment Setup: A setup was developed to drive the fish robot and analyze its swimming behavior ( Figure 6A). Compressed air was supplied by a pressure regulator, which was set to the required upstream pressure: from 0.9 to 1.1 bar in the modeling experiments  To control the pressure amplitude in the feedback control experiments, a digital pressure regulator (ITV0050-3BS, SMC) was used, which received an analog input signal from a digital-to-analog converter (DAC) (MCP4725, MICROCHIP). The activation of the two fast-PneuNet actuators was controlled by two-directional solenoid valves (SYJ7320-5LOU-01F-Q, SMC) respectively. Sending control signals to the directional solenoid valves, reading the sensor value, and sending the control signals to the digital pressure regulator based on the sensor information were all implemented on the microcontroller (ATmega328 on Arduino Uno, Arduino). The fish robot was clamped and mounted on a 150 mm long, 20 mm Â 30 mm rectangular aluminum section with a 2 mm wall thickness and immersed in a water tank with an outer dimension of 0.5 m Â 0.5 m Â 1.5 m and, based on a previous study of mounting positions, [53] the sensor was mounted on the fish actuator along the longitudinal axis and both ends of the sensors were taped on the fish body ( Figure 6B,C). For the modeling experiments, the undulation frequency, the pressure of the compressed air, and the overlapping fraction of the opposing actuators were the experimental parameters. The frequency range was set from 0.8 to 1.2 Hz, the pressure range was set from 0.9 to 1.1 bar, and the range of the overlapping fraction was set from À10% to 10%, whereas the negative value was posed as a dead time when both actuators were not activated.
The undulatory locomotion was recorded by a high-speed camera (S-Motion 2987, AOS) and the camera was equipped with a lens (QundS-25, AOS) ( Figure 6). The videos for training the model were recorded at 200 frames per second (fps), and later videos recorded to validate feedback control performance used 100 fps. The trigger of the high-speed camera was synchronized with the main program driving the soft robotic fish.
Modeling Approach: To model the actuator dynamics, a lumpedparameter approach was taken, treating the soft silicone robot fish ( Figure 7A) as a chain of rigid elements connected by hinges with nonlinear stiffness functions ( Figure 7B), with hydrodynamic forces derived from the slender body theory treated as point loads on individual elements.
Internal mechanics: The robot is divided into n rigid links, where every two of them are connected by a hinge containing a moment generator, a stiffness, and a damping coefficient, representing the structural response of the inflated actuator. In this model, n ¼ 4 was chosen, which enabled the model to describe up to a second vibration mode of the fish robot.
The moment M i generated by the left and the right fast-PneuNet actuators is represented by the pressure difference between the actuators where P L and P R are the supplied air pressure in the left and the right actuator, respectively, as a function of time t with time delay t d and the coefficient C τp,i represents the scalar factor between the pressure and the moment generated. The term t d is used to express the inevitable time delay appearing in the data transmission between the valve state commands and the actual activation of the fast-PneuNet actuators.
Stiffness of the joint k i is related to the summation of the air pressures of the left and right chambers because of the stiffening effect from the co-contraction; therefore, it is described as follows where k const,i is the linear static stiffness term and the coefficient C kp,i is the scalar factor between the pressure and the stiffness. The use of a linear static stiffness term k const is supported by mechanical testing of the robot in Jusufi et al. [44] Then, the equation of motion of each hinge can be formulated as follows Where the variable θ i is the bending angle of the joint i in the local joint coordinate system. I i represents the moment of inertia of the following link of the joint i and b i stands for the damping coefficient of the joint i. The model was implemented using the Simscape Multibody library in Matlab/Simulink to produce equations of motion for the system of jointed links and simulated with a variable step solver with a relative tolerance of 10 À3 .
Hydrodynamic model: The hydrodynamic loads on the system were approximated with a slender body model, following the derivation in a study by Azuma. [59] The resulting fluid forces were decomposed as two perpendicular point loads in the lateral and axial (thrust) directions, acting at the midpoint of each rigid link. A full derivation of the equations used is included in the Supporting Information.
Data-driven optimization: Experimental midline kinematics were extracted from videography, and the values were linearly interpolated to match the timebase and the spatial position between the simulation and the experiment. The stiffness parameters of the hinges were then optimized by comparing the ground-truth kinematics with the simulation output positions (Figure 8). The mean squared error between the model and the experiment summed over all timesteps was used as an objective function for optimization where θ ij andθ ij are the observed and predicted local bending angles at each joint, and the subscripts i and j are indices representing the joint location and the time step, respectively. In the experimental data, bending angles were defined by the change in the angle of the local tangent to the fish midline ( Figure 8). Five parameters (t d , C τp , k const , C kp , and b in Equation (1)- (3)) were optimized to find the best fitting model for the ground truth behavior. Using different parameters for each hinge was not found to be necessary to account for manufacturing inconsistencies, which greatly reduced the dimensionality of the problem.
A genetic algorithm was used for minimization, adapting the software from Kelly. [60] The simulation was sufficiently lightweight that the increased computational overhead from using a stochastic optimization B A www.advancedsciencenews.com www.advintellsyst.com approach was not significant. An initial population size of 100 was run for 250 generations, although this only resulted in a small improvement over a population of 30 runs for 50 generations (requiring 6% of the simulation run count).

Supporting Information
Supporting Information is available from the Wiley Online Library or from the author. www.advancedsciencenews.com www.advintellsyst.com