Bending angle prediction and control of soft pneumatic actuators with embedded flex sensors: a data-driven approach

In this paper, a purely data-driven modelling approach is presented for predicting and controlling the free bending angle response of a typical soft pneumatic actuator (SPA), embedded with a resistive flex sensor. An experimental setup was constructed to test the SPA at different input pressure values and orientations, while recording the resulting feedback from the embedded flex sensor and on-board pressure sensor. A calibrated high speed camera captures image frames during the actuation, which are then analysed using an image processing program to calculate the actual bending angle and synchronise it with the recorded sensory feedback. Empirical models were derived based on the generated experimental data using two common data-driven modelling techniques; regression analysis and artificial neural networks. Both techniques were validated using a new dataset at untrained operating conditions to evaluate their prediction accuracy. Furthermore, the derived empirical model was used as part of a closed-loop PID controller to estimate and control the bending angle of the tested SPA based on the real-time sensory feedback generated. The tuned PID controller allowed the bending SPA to accurately follow stepped and sinusoidal reference signals, even in the presence of pressure leaks in the pneumatic supply. This work demonstrates how purely data-driven models can be effectively used in controlling the bending of SPAs under different operating conditions, avoiding the need for complex analytical modelling and material characterisation. Ultimately, the aim is to create more controllable soft grippers based on such SPAs with embedded sensing capabilities, to be used in applications requiring both a ‘soft touch’ as well as a more controllable object manipulation.


Introduction
Soft pneumatic actuators (SPAs) with internal fluidic channels (commonly referred to as PneuNets) are made of highly stretchable elastomer materials, which deform upon the pressurisation of the internal channels to create a predefined motion [1]. The response of this type of actuators is governed by its morphology, which is defined by the geometry of the internal fluidic channels and the properties of the materials used in fabrication. Inserting a flexible but inextensible strain limiting layer, in the form of a paper or fabric, at the base of the SPA prevents it from elongating and forces it to generate a bending motion that is analogous to that of a human finger. Hence, this class of bending actuators is being adopted as compliant soft gripper fingers, which are able to passively conform to objects of complex geometries and adapt to dimensional variations and location uncertainty [2,3]. In addition, the soft nature of the elastomer materials used to create these soft gripper fingers, allows grasping of delicate objects safely without damaging their surface [4].
On the other hand, the complex deformation exhibited by the nonlinear elastomer materials, commonly used to create the SPA based fingers, are difficult to model and control accurately [5]. Some examples of recent work addressing the modelling and characterisation of bending SPAs include; an experimental characterisation of the geometry of bending and rotary SPAs [6,7], finite element analysis (FEA) of cylindrical SPAs for surgical applications [8], theoretical modelling of a soft snake robot based on the bending SPAs [9], and a detailed analytical and finite element modelling of a single chamber fibre-reinforced bending SPA [10]. One of the main challenges associated with the analytical and FEA modelling approaches is the need for accurate material models and relevant material coefficients, which can accurately describe the nonlinear behaviour of the hyperelastic materials used. This becomes even more complex when SPAs are made of combinations of different materials, or when equipped with external reinforcements or embedded components. Furthermore, there is some uncertainty in the manual process commonly followed in fabricating SPAs due to human error. This could result in variations in the geometry or material properties of fabricated SPA samples, which would influence their bending response. Therefore, it would be interesting to investigate a simpler approach for predicting and controlling bending SPAs, based on experimental data that implicitly accounts for the effects of uncontrollable variations in the morphology.
The main contribution of this paper is in the proposition of a purely data-driven modelling approach that utilises feedback from inexpensive commercially available sensors, to derive empirical models that can be used for predicting and controlling the free bending response of soft actuators. This data-driven modelling approach was initially introduced in our previous work [11], and is further extended here by utilising the derived empirical models for controlling the free bending response of SPAs based on real-time sensory feedback. Recent relevant work demonstrated how the free bending angle can be accurately controlled using a feed-forward controller, which relies on detailed analytical models describing the physical behaviour of fiber-reinforced bending actuators specifically [10]. Yet, the data-driven approach presented here is not constrained to a specific actuator morphology or input actuation pressure, since it is entirely based on the generated experimental data. Thus, this approach not only avoids the need for deriving precise physical and material models that could be difficult to achieve in some cases, but also the experimental data generated from real tests implicitly accounts for variations that are otherwise difficult to model mathematically. The primary requirement of this approach however, is to generate sufficient experimental data that describes the behaviour of the modelled SPA under different operating conditions, so that the derived models can be further generalised to new untrained scenarios. Hence, equipping SPAs with reliable sensing capabilities becomes essential to generate the required sensory feedback.
The paper proceeds with a review on relevant work addressing the modelling and control of bending SPAs aided by different techniques for embedding sensory feedback. This is followed by a summary of a common fabrication process that can be followed to create typical bending SPAs, while embedding a flex sensor inside. Afterwards, in Section 4, the platform involving the use of pneumatic control board and a high-speed imaging system is presented, explaining how the SPAs are actuated under different operating conditions to collect the required experimental data. In Section 5, the data-driven modelling of the relation between the acquired sensory feedback and the bending angle measured using the vision system is derived using regression analysis and neural networks. The results obtained using both techniques are presented, comparing their prediction accuracy when tested with a new dataset acquired at untrained operating conditions. Moreover, in Section 6, the derived empirical model is utilised as part of a closedloop PID controller to control the bending of the SPA to a desired target value. Finally, the paper ends with some conclusions regarding the outcomes of the proposed data-driven approach, highlighting the planned future work.

Review on sensor enabled control of SPAs
Despite the fact that the passive compliance of SPA based soft fingers is desired for adapting to sources of variations and uncertainties without the need for expensive sensing and complex control, it also has the drawback of limiting their application to simple pick and place tasks that do not require controlled manipulation and feedback about the grasp quality. The absence of active sensing also means that the orientation of a grasped object with respect to the soft gripper would be unknown, since the grasp was achieved passively. Hence, accurate object positioning would be difficult to achieve, which is required in applications such as assembly tasks for example. Thus, equipping SPA based soft fingers with some level of sensing capabilities that do not hinder their desired softness and compliance would result in more controllable SPAs with enhanced functionality and wider application involving more complex manipulation tasks.
The primary controllable input parameter that can be varied during the actuation of soft actuators is the pressure of the pneumatic supply, which in turn controls the input pneumatic flow rate. The internal pressure response can be easily measured using common pressure sensors connected to the pneumatic supply tubes, and can be used to control the bending of a SPA if the model relating the input pressure to the bending angle response is known in advance. This has been demonstrated for a soft fibre-reinforced actuator, which used an angle filter to estimate the bending angle based on the pressure measurements and a PID controller to meet the target bending angle [10]. The main challenge in sensing however is to directly measure the bending motion of SPAs as they curve towards their base, without actually hindering this passive behaviour. Hence, a flexible sensor is required that can be embedded at the base layer of an SPA, where extension is restricted by the constraint layer, to provide a measurable change in a physical parameter that can be directly related to the witnessed bending motion. This is one of several applications motivating research over the past few years into developing new concepts for flexible and stretchable sensors, which can be integrated with soft bodies in general [12]. The main soft sensing techniques that could be smoothly integrated with soft gripper fingers specifically for measuring and controlling their bending angle can be classified into three main approaches as follows: (1) The first approach is adding different forms of carbon content into an elastomer material, in order to make it conductive and hence becoming a soft sensing element that changes in resistance when strained. This type of conductive elastomer sensor has been incorporated with a two-fingered soft gripper design that is actuated using linear displacements [13], to detect grasped objects and recognise their different sizes using an adaptive neuro-fuzzy controller [14]. The main challenge with conductive elastomer sensors is the difficulty in producing sensors with consistent electrical properties, since repeated deformation may affect the distribution of carbon particles within the elastomer material. Also, stable electrical connections are difficult to achieve and may be a source of additional fluctuations in the sensory readings. Yet, the process of fabricating conductive elastomer sensors is potentially scalable through a customised 3D printing process of carbon grease inside a silicone elastomer reservoir [15]. (2) A popular soft sensing approach now is achieved by filling patterns of micro-channels imprinted within an elastomer body with a conductive liquid metal (EGaIn). Different physical parameters can be measured depending on the geometry and pattern of the conductive channels [16]. Previous work demonstrated the use of this sensing approach to measure parameters such as: Multi-axis forces [17], strain [18], curvature [19], and pressure [20]. The concept was integrated with a SPA based gripper to achieve accurate position and force control using feed-forward models in conjunction with a PID controller [21]. It was also used to control the bending of soft beams actuated by an antagonistic pair of SMAs [22], and was integrated with a soft gripper to detect the presence of an object while grasping [23]. However, the process of creating the embedded micro-channels and injecting conductive liquid metal is still a manual multi-stage process that is not easily repeatable. In addition, the conductive EGaIn material is quite expensive, though usually needed only in small quantities. The strain feedback from this approach was reported to be mostly linear and highly repeatable, but suffered from some hysteresis at higher strain rates as the EGaIn material is allowed to refill the micro-channels [18]. (3) An alternative soft sensing approach is achieved by simply embedding commercial resistive flex sensors within the strain limiting layer of bending SPAs. The flex sensors are made of thin films that can easily bend and change in resistance upon bending [24]. This has been adopted with SPA based gripper fingers for haptic identification, by clustering the Readings from the embedded flex sensors so that a trained algorithm can identify the grasped objects [25]. Another attempt for embedding flex sensors within soft gripper fingers was presented by [26], were the feedback was used to control the shape of the soft fingers actuated using antagonistic shape memory alloys. The main advantage of this approach compared to using conductive silicone rubber or conductive EGaIn channels, is the fact that it relies on simple and inexpensive commercially available sensors that can be easily wired and embedded within the strain limiting layer of SPAs. Additionally, the response of the sensor was found to be repeatable at different input pressures once encapsulated within the SPA body [11]. However, achieving a consistent sensory response for different SPA samples cannot be guaranteed, since the process of embedding the sensor is still manual and the response of different sensor samples is not identical. Hence, each fabricated SPA with an embedded flex sensor still needs to be individually calibrated.
The work presented here follows the third sensing approach for measuring the bending angle of a typical SPA based soft finger design. This is achieved by correlating the readings from the embedded flex sensors in conjunction with the internal pressure readings from onboard pressure sensors, to the actual bending angle measured using a developed vision system. This combination of multi-sensory feedback enables better estimations of the bending angle, without the need for deriving accurate physical and material models. Feeding the internal pressure to the model allows reliable predictions at varying input pressures during both the actuation and retraction phases, even if the system is disturbed with some pressure losses. In addition, the static bending due to gravitational forces is accounted for, by including the initial bending angle as an additional variable in the model. This allows for more accurate predictions of the absolute bending angles at different orientations of the soft actuator, which would be necessary when used as part of a robotic gripper.

Fabrication of SPAs with embedded flex sensor
The conventional technique for fabricating SPAs relies on moulding silicone rubbers into the required shape, using 3D printed moulds with the negative of the features to imprint, followed by bonding the parts together after curing to create the final shape of the actuator [1]. A soft finger based on a standard bending SPA design with ribbed channel morphology (shown in Fig. 1), was fabricated from a common silicone rubber material (Ecoflex-50 1 ). The dimensions of the soft finger were based on the results of previous work characterising the bending response and force generation of a set of soft fingers with variable internal channel dimensions [7]. To fabricate the soft finger, the body is divided it into three main parts (labelled on Fig. 1): (1) The main body moulded from Ecoflex-50 with the imprinted fluidic channel pattern, (2) the bottom base made also from EcoFlex-50 or a stiffer elastomer if desired, which seals the internal channels, (3) and a strain limiting layer in a form of a sheet of paper between those two parts. This layer is necessary to prevent the finger from extending, allowing only a bending motion towards its base. Here, we also attach a flexible resistive sensor 2 to the strain limiting layer, in order to change in resistance as the soft finger bends. The sensor is thin and flexible, so it does not hinder the desired bending response, but causes a small increase in the overall stiffness of the soft finger.
The procedure involved for fabricating the soft bending fingers with embedded sensing can be summarised in the following steps: 1) Printing moulds: The moulds with the negative of the geometry featured required to be imprinted are designed and 3D printed from ABS filament using a Lulzbot TAZ5 printer. 2) Mixing and degasing: EcoFlex-50 is prepared by mixing equal volumes of the provided components and stirred well for a maximum of 2 min. The mixed material is then quickly placed in a vacuum chamber for degassing at 900 mbar for about 5 min. This extracts trapped air bubbles that could create weak points in the stretchable soft body. 3) Moulding: the mixed material is then carefully poured in the 3D printed moulds to create the two parts of the soft finger with imprinted features, and then left to cure. The curing process can be accelerated by placing the moulds in an oven at 50°for around an hour. 4) Strain limiting layer: two pieces of paper are cut into the required dimensions to create the strain limiting layer which will fit between the two parts of the soft finger. 5) Embedding flex sensor: The flex sensor is positioned between those two sheets of paper and glued together to form one flexible but not extendable layer, which is embedded at the interface between the two moulded parts as shown in Fig. 2 below. 6) Demoulding and bonding: both parts of the soft finger are demoulded and dipped in a freshly mixed EcoFlex material at their joining faces, to act as a bonding agent. The prepared strain limiting layer is placed on top of the base part and the main body of the finger is then placed and aligned on top. 7) Pneumatic connection: once the bonding layer cures, a needle is inserted at the base of the finger to penetrate through the internal channels, which will be pneumatically actuated. A tube is then connected to the other end of the needle to deliver the controlled pneumatic supply.
The outlined fabrication process uses inexpensive materials and requires fairly simple equipment to implement. However, the manual nature of the process could introduce variations during different stages of the fabrication process including: the material preparation, mould printing, sensor placement, and manual bonding. This uncertainty in the actuator dimensions and material properties is one of the factors limiting the accuracy of analytical models that are derived based on theoretical values, which are difficult to guarantee. Hence, the datadriven modelling approach considered here is encouraged, as variations in the fabrication process due to human error will be implicitly accounted for within the experimental data. Moreover, the focus of the work presented here is on modelling and controlling the free bending response of individual soft fingers with embedded sensing, which can be then connected to a gripper for controlled grasping applications. Fig. 3 shows a proposed soft gripper prototype utilising four bending SPAs with embedded flex sensors, acting as controllable soft finger that are easily interchangeable. A customisable 3D printed interface secures the individual soft fingers in the desired configuration and holds the pneumatic tubes and sensors' wiring in place. This results in a modular soft gripper design that can be reconfigured to modify the number and location of individual soft finger modules according to the application needs. The aim is ultimately to achieve accurate positioning in complex manipulation tasks using such simple and inexpensive hardware.

Experimental testing
An experimental setup was constructed to systematically test fabricated SPA samples, embedded with the flex sensor at variable operating conditions. This includes controlling the pressure and duration of the input pneumatic supply, as well as setting the initial orientation of the actuator. The pneumatic supply flows through a 1.6 mm diameter needle attached to the end of the supply tube. The needle passes through a locating hole inside the 3D printed fixture, which guides it to pierce the actuator at the base of its internal channels. This allows easy and fast switching between different SPA samples, without the need for bonding the pneumatic tubes directly to the actuator body. The initial orientation 'ϕ' of the soft actuator can be varied by simply rotating a 3D printed fixture that securely holds the soft actuator to a fixed frame, and is measured from the positive x-axis as illustrated in Fig. 4.

Internal pressure control using high speed valves
As for varying the pressure of the pneumatic supply, this is achieved through high speed valves on a pneumatic control board that was based on the design proposed by the soft robotics toolkit 3 . The board includes solenoid valves (SMC-VQ110U-5 M) controlling the flow of pneumatic supply, pressure sensors (Honeywell-ASDXAVX100PGAA5) measuring the resulting internal pressure, and an Arduino Mega board that is programmed to control the timing of the actuation and the effective pressure supply. The on-board pressure sensors and the embedded flex sensors are interfaced with the Arduino board to feedback the resulting sensory readings at 100 Hz for each actuation test conducted. The resulting sensory feedback from the embedded flex sensor and the measured pressure response, is recorded and synchronised with measurements for the actual bending angle for each actuation.
The input pressure to the tested soft actuators can be effectively varied through high speed valve switching, controlled by a pulse width modulated (PWM) signal at 60 Hz from the Arduino board. A fixed input regulated pressure line can be thus effectively reduced to a desired value according to the duty cycle of the generated PWM signal. This provides a fairly simple and inexpensive method for controlling the pressure supply to the soft actuator. However, it has the drawback of introducing noise to the measured internal pressure response because of the mechanical switching of the valves. Having noisy sensory feedback   will limit the accuracy of any predictive models or controllers that rely on such data. One way of overcoming this problem is the use of a pneumatic tank in the form of fixed volume syringe and a pneumatic resistance in the form of a porous plug [27]. Fig. 5 shows a schematic diagram for the pneumatic circuit including a 4 ml syringe and a 20 mm pneumatic resistor between the valve and the pressure sensor, while Fig. 6 shows how this results in significantly damping the oscillations in the pressure response measured at 50% duty cycle. It can be observed from Fig. 6 that introducing the pneumatic tank and resistor has minimal effect on the measured internal pressure, but in return results in a significant improvement in noise reduction. It is important however to avoid changing the size of the pneumatic tank and resistor after collecting the experimental data required for the data-driven modelling, since this would affect the prediction accuracy of the derived models as the measured pressure changes slightly. Furthermore, a moving average can be applied to further smoothen remaining oscillations in the signal, yet this would come at the expense of an added delay to the response of the system depending on the window size. The final smoothed pressure response shown in Fig. 6 is the combined outcome of adding the pneumatic tank and resistor as well as applying a two-point moving average, which would introduce a delay of around 20 ms.

Bending angle measurement using image processing
A high-speed camera was used to capture the gradual deformation of the tested SPA upon actuation by recording image frames at a rate of 130 Fps. Such a fast frame rate is required to allow capturing sufficient number of images within the actuation durations that could be as short as 500 ms. The camera is fixed to the same frame that holds the actuator, to ensure that it remains in the same location with respect to the actuator. Calibration for the intrinsic and extrinsic camera parameters was conducted to allow measurements in real-world coordinates for the tip trajectory of the tested soft actuators with a mean calibration error of 0.003 mm. The measurements are done automatically for each image frame by an image processing program that was developed using Halcon library 4 without the use of any external markers that could alter the bending response. To achieve this, the program segments the deforming SPA body using automatic thresholding aided by a dark background. Contours defining the circumference of the segmented blob representing the actuator body are then extracted and the position  of the tip is located within each image frame in real-word coordinates. Afterwards, the bending angle 'θ' can be calculated with respect to the axis passing through the base of the soft actuator, as illustrated in the sample output from the program shown in Fig. 7. During a typical actuation test, the camera is externally triggered via the Arduino microcontroller, so that the bending angle value calculated for each captured image frame can be synchronised with the corresponding sensory readings recorded simultaneously.

Embedded flex sensor characterisation
The primary sensory feedback of interest in this work, is the change in resistance of the embedded flex sensor due to the bending motion of the actuator, which is converted to voltage and measured through the analog input port of the Arduino board. This provides a direct measurement that can be correlated to the actual bending angle of the actuator, allowing accurate prediction and closed-loop control of such actuators. In order to evaluate the quality and repeatability of the feedback from the embedded flex sensors a soft actuator sample was repeatedly actuated at different magnitudes and durations of the input pneumatic supply. Fig. 8 plots the internal pressure measured against the resulting flex sensor readings, when supplied with a step pressure input of 12 Psi (82.7 kPa) for different durations. The plotted flex sensor readings are the result of the analog to digital conversion of the voltage received from the flex sensor, in which the 0-5v range is converted to values between 0 to 1023. The plotted cycle shows the readings from the flex sensor decreasing upon actuation as the internal pressure builds up, until the pneumatic supply is stopped and the SPA starts to retract back to its original shape. The response was observed to be fairly repeatable; with longer actuation duration causing a systematic extension to the witnessed response. Thus, it can be assumed that when increasing the actuation duration, the actuator will continue to bend following the same relation between the internal pressure and flex sensor readings as long as the input pressure is constant and the actuator is able to hold that pressure.
Furthermore, the same test was repeated again, yet this time the actuation duration was fixed at 500 ms, while the SPA was actuated at pressure inputs of 10 Psi (68.9 kPa) and 12 Psi (82.7 kPa). Fig. 9 shows that changing the input pressure had a more significant effect on the recorded sensory response, influencing not only the final reading from the flex sensor, but also the rate of change of the response. This shows the need for incorporating the measured internal pressure response, if accurate models are to be derived for the estimation of the bending angle of soft actuators. The pressure term in this case will account for the rate of change of the flex sensory reading, allowing more generic models to be derived that are capable of estimating the bending angle at varying input pressures.
Finally, Fig. 10 shows the relation between the measured internal pressure and the flex sensor readings at three different soft finger initial orientations of 45°, 0°, and −45°. A slight deviation in the response can be observed in each case, even though the input conditions were held constant. The deviation is more evident during the retraction of the soft finger to its initial position, since the pneumatic supply is stopped and gravity becomes the dominant force acting on the finger. This illustrates the significance of taking the initial orientation of soft fingers into consideration when modelling their bending response to be able to compensate for the effect of gravity and generate more accurate models [10]. The orientation here is known for each test since the tested soft finger is fixed using the 3D printed mounts. Yet, in actual grasping applications the orientation can be measured in real-time using an accelerometer sensor mounted at the gripper base. This would be an additional sensory input that can be interfaced to the Arduino board.

Data-driven modelling
In this section, the data acquired from experimental tests is utilised for deriving an empirical model that describes the bending response of the investigated soft actuator. The available feedback from a typical actuation test comprises of the (1) the measured voltage from the change in resistance due to bending of the embedded flex sensor "F", (2) internal pressure "P" measured using on-board pressure sensors, (3) Fig. 7. Image processing program extracting the soft actuator and tracking its trajectory to measure the bending angle. and the initial orientation of the soft finger within its bending plane "ϕ" set using the tilting fixture. A soft actuator sample with an embedded flex sensor was tested twice at the combinations of three different initial orientations of −45°, 0°, and 45°, with step pressure inputs of 8, 10, and 12 Psi (55.2, 68.9, and 82.7 kPa). The resulting sensory feedback and the image frames captured for measuring the actual bending angle were recorded and synchronised as shown in Fig. 11. A data set of 1664 observations in total was generated at a unified sampling rate of 10 ms, with each observation being an array of four elements in the form of [F, P, ϕ, θ]. The first three elements in the array are the input variables, while the fourth element is the target bending angle output for training and testing the derived empirical models. Regression analysis and neural networks are two data-driven modelling techniques that are implemented and compared here, in order to derive empirical models which will be better suited predicting and controlling the bending angle of the tested soft actuators based on real-time sensory feedback.

Regression analysis
Linear regression is a common data-driven technique that can be used to derive an empirical model using the Least Square Method to compute the best fit relation between the target bending angle and the generated sensory feedback. For this analysis, the dataset generated from the experimental tests was split into two sets for training and testing purposes. The training dataset included a total of 1108 observations acquired at the three tested initial orientations, when the actuator is supplied with input pressure of 10 and 12 Psi (68.9 and 82.7 kPa) for a fixed duration of 300 ms. The remaining 556 observations, are the ones acquired at a pressure input of 8 Psi at the three orientation values for testing the derived models at new input conditions. The primary variable of the regression model is the measured change in resistance (converted to voltage) from the embedded flex sensor "F" as the soft actuator bends. Hence, the simplest form of the regression model will be a linear equation that directly relates the target bending angle "θ" to the voltage readings from the flex sensor "F". Eq. 1 below shows the output model from the regression analysis, with an R 2 value of 0.88 and standard error of 2.28°. The R 2 value reflects how much of the variance was successfully represented by the model, while the standard error is a measure of the accuracy of the predictions made by the regression model [28].
206.87 0.422* relative (1) In order to improve the accuracy of the model in predicting the bending angle when actuated at variable input pressure values, the measured internal pressure "P" was added to the model to account for the rate of change in the flex sensory readings. The regression analysis in this case results in Eq. 2 with an improved R 2 value of 0.943 and a reduced standard error of 1.576°. This is expected since the dataset used in deriving the model was acquired at different pressure input levels and hence including the P term in the model should yield an improved fit.
150.39 0.309* 0.91* relative (2) Moreover, the models so far were derived using the relative bending Fig. 9. Flex sensor response against the internal pressure at variable input actuation pressure. angle measured from the initial orientation of the soft actuator. However, the vision system can measure the bending angle as an absolute value from the positive x-axis of a fixed reference frame (Fig. 4). Hence, the initial orientation of the actuator needs to be added to the model to allow more meaningful predictions of the bending angle as an absolute value, regardless of how the actuator was oriented initially. This is achieved by labelling the training dataset with the initial orientation of the actuator, and using this value as an additional variable in the regression model. Thus, the outcome of the regression analysis will now include three variables as shown in Eq. 3, and results in a further imporvement in the model fit as the R 2 value increased to 0.949 and the standard error further decreased to 1.489°. The updated model in this case is not only able to cope with variable input pressure conditions, but also outputs the absolute value of the bending angle given a constant value for the initial orientation of the actuator. The coefficient of the ϕ term (0.973) is essentially adjusting the value of the initial orientation to account for the static bending of the actuator under gravity. This explains the additional improvement in the model fit, since the training dataset was collected at three different orientations that are influenced differently by gravity.
A summary of the regression statistics for the derived models is given in Table 1. It shows how the model accuracy was improved gradually by the inclusion of the P and ϕ variables. It is clear that using the feedback from the flex sensor alone is not sufficient to derive a model that can accurately predict the actual bending angle under different operating conditions. The addition of the P term significantly improves accuracy of fit since the change in the input pressure is reflected in the model, while adding the ϕ term allows the prediction of the absolute bending angle values while accounting for the static bending under gravity.
In order to verify the derived models, the testing dataset was fed to each model and their predicted bending angle was compared to the actual values measured using the vision system. The data set for testing was generated at input conditions that were not covered by the training dataset used in deriving those models. The results of testing the three models are summarised in Table 2, showing the mean squared error (MSE) and standard deviation (SD) of the predicted bending angles.
It becomes evident that the inclusion of the P and ϕ parameters contribute to a more accurate empirical model that is able to accurately reproduce the bending angle values under untrained input conditions, with an MSE of only 1.36 and a SD of 1.15°(Model 3). Fig. 12 shows a sample of the test results comparing the predicted bending angle of each model to the target values measured using the vision system. It can be observed that even though models 1 and 2 result in almost the same final bending angle value, model 2 better follows the actual bending angle response since the P parameter is adjusting the output to the correct the rate of change. As expected, model 3 can be seen to provide the closest predictions compared to the actual target values, yet a small error of 1.54°in the final value still exists. The remaining deviation between the predicted and target values can be accounted to sources of non-linearity in the response that cannot be captured effectively by a linear regression model.

Artificial neural networks
Another data-driven modelling technique investigated here is the use of a feed-forward artificial neural network (ANN) that is known to cope well with handling sources of uncertainty [29], and is hence a Fig. 11. Sample of the synchronised feedback from the flex sensor, pressure sensor, and target bending angles. good candidate for modelling the complex behaviour of continuum soft robots in general [30]. The same training dataset used in the regression analysis was used again here to train and validate a feed-forward neural network with 1 hidden layer and 7 neurons using MATLAB. This network structure was found to reduce the MSE while avoiding overfitting. The inputs to the neural network are the same as model 3, which include the sensory feedback from the pressure and flex sensors, and labelled with initial orientation of the soft finger. The target output is again the measured bending angle of the soft finger recorded by the vision system. Training was conducted using the Levenberg-Marquardt algorithm [31], which would stop when the generalisation accuracy stops improving. The results of the training showed an excellent fit between the inputs and the target output with an R value of almost 1, as shown in Fig. 13. The trained ANN was tested with the same test dataset previously used for testing the regression models, and achieved a much lower MSE of only 0.37 with a SD of 0.6° (Table 3) when compared to the best performing regression model. This means that the trained network is able to better capture the non-linearity in the response of the soft actuator, which the linear regression model was not able to account for. On the other hand, the neural network is more complex in structure compared to a simple linear equation resulting from the regression analysis. Thus, depending on the application needs, the slightly less accurate regression model might still be favoured when deploying the model to a controller with a limited processing power, so that a faster   sampling rate for the required sensory feedback can be maintained. This is essential especially when operating at higher input pressure, during which the actuation would typically last for less than 500 ms.
Finally, Fig. 14 shows a sample of the test results comparing the prediction accuracy of the derived empirical model 3 and the trained neural network. Both techniques successfully reproduced the bending angle response at the tested finger orientation. It can be concluded that both techniques can be used to predict the bending angle response when given new data sets acquired at untrained operating conditions. Yet, the trained neural networks performed better than the derived regression model, at the expense of requiring more computational power when deployed to a controller.

Bending angle control
The next step after successfully deriving models that predict the bending angle of soft actuators based on the combined sensory feedback, is to utilise those models in controlling the bending angle according to a desired target value. A closed-loop PID controller was designed and tuned using Matlab Simulink, which (1) collects the realtime sensory feedback from the Arduino, (2) predicts the current bending angle using the derived regression model according to the sensory data, (3) calculates the duty cycle value of the PWM signal driving the valve switching, based on the difference between the current and target bending angles. (4) adjusts the supplied pressure to the actuator by generating a PWM signal based on the new duty cycle value and sending it to the high speed vales. Fig. 15 shows a schematic diagram summarising the basic operation of the MATLAB control program communicating with the Arduino controller on the pneumatic control board. The PID controller gains were tuned and initiated online following the Ziegler-Nichols method [32], until the settling error and oscillations were minimised. This involved setting the controller's integrator gain (K i ) and derivative gain (K d ) to zero while increasing the proportional gain (K p ) until the system reaches its stability boundary.
The corresponding values of this gain and period of oscillations were recorded and used to calculate the initial values of the PID controller gains. Further tuning of the gain values was manually conducted online based on the monitored bending response when tested with different target values. The final values of the tuned PID gains were found to be: K p = 26 (deg −1 ), K i = 11 (1/deg s), and K d = 0.2 (s/deg). This heuristic tuning approach is well suited for the data-driven modelling approach adopted here, since the physical model of the system is not available for typical model-based tuning and stability analysis tests to be performed. Instead the availability of the real-time response is utilised to tune the PID controller gains and confirm the controller stability within the required operating conditions as further demonstrated in the tests to follow.
In order to test the accuracy and stability of the controller in meeting a target bending angle value, a series of experiments were conducted in which a step as well as sinusoidal reference signals were supplied to the controller and compared to the measured bending angle. Once a switch on the pneumatic controller board is toggled, the valve opens to supply a constant pressure input to the tested soft actuator with an initial duty cycle value of 100%. The sensory feedback from the embedded flex sensor and on-board pressure sensor is continuously fed to the derived regression model to convert it to the current bending angle value of the soft actuator. The difference between the target and current bending angles is fed to the PID controller as the error signal (Fig. 15), which as it decrease causes the PID controller to reduce the duty cycle value of the PWM signal accordingly. Reducing the duty cycle below 100% initiates the high speed valve switching, which in turn reduces the effective internal pressure supplied to the soft actuator as previously explained. Hence, the rate of increase in the bending of the soft actuator attenuates until settling at the target bending angle value, even though a fixed pressure input is being supplied. Fig. 16 shows the measured bending angle response, the measured internal pressure, and the duty cycle output from the controller, when testing an actuator at 8 Psi (55.2 kPa) pressure input and setting the target bending angle to a value of −35°(measured from the positive X-axis). It can be observed how the measured internal pressure response settled to a value of nearly 5.5 Psi (37.9 kPa), as the controller reduced the duty cycle value to values in the range of 60-80%. The fluctuations in the duty cycle value is due to the small residual oscillations in the internal pressure measurement, which is expected when using high speed valve switching to control the pressure. Once the actuation switch is toggled off, the input pressure is stopped causing the soft actuator to retract to its original position as shown in Fig. 16. Since the exhaust of the pneumatic circuit was left at atmospheric pressure, the duty cycle output from the controller settles around the value required to achieve an internal pressure that is just enough for the actuator to maintain the target bending angle. Alternatively, if the exhaust was instead sealed to hold the supply pressure, then the output duty cycle will continue to drop until reaching zero, which closes the valve completely to stop any further pneumatic supply. However, in this case the exhaust has to be manually opened for the soft actuator to retract to its original position, which means that the bending can only be controlled during the forward actuation phase.
Moreover, further tests were conducted in which the target bending angle was supplied to the controller as stepped as well as a sinusoidal reference signal. For the step response experiment the reference signal increases from 30°to 40 0 and falls back with 5°increments, while the sinusoidal reference signal oscillated from 30°with an amplitude of 10°a nd a period of 3 s. The measured bending angle response closely followed that of both the stepped and sinusoidal reference signals with a mean error of only 0.752°and a standard deviation of 2.09°as shown in Fig. 17. The convergence time was around 150 ms on average, yet this largely depends on the input pressure value which for these tests was 8 Psi (55.2 kPa). The results of these tests confirmed that the soft actuator can be accurately controlled to follow a variable reference signal, based on the acquired real-time sensory feedback.
Moreover, a key feature of this controller is the fact that it relies on feedback from both the embedded flex sensor as well as the internal pressure response to estimate the current bending angle. Thus, not only can the controller operate effectively at different pressure inputs, but also it can handle external disturbances in the form of pressure leaks. This was witnessed during the conducted tests, when a leak from the inlet of the supply tubes to the base of the soft actuator caused an unexpected drop in the measured internal pressure. Consequently, the controller automatically increased the output duty cycle value to compensate for the witnessed pressure drop until meeting the target bending angle. The pressure leak in this case is no different than a change in the supply pressure, which the derived model was trained to accommodate. Thus, the inclusion of the filtered internal pressure measurements with the feedback from the embedded flex sensor in the derived models, enhances the robustness of the controller to external disturbances. This also allows accurate predictions of the bending angle during both the actuation and retraction of the actuator, which is important to measure and control the fluctuations around the target bending value in both directions. Finally, including the initial orientation of the soft actuator in the derived models allows the user to set meaningful target bending angle values that are measured as an absolute value from a known fixed reference.

Conclusions and future work
The work presented here demonstrated an alternative approach for predicting and controlling the bending angle of a common soft pneumatic actuator using a purely data-driven approach that relies on generated datasets of sensory feedback, without the need for analytically deriving complex physical and material models. A resistive flex sensor was embedded within the strain limiting layer of the soft actuator, while an on-board pressure sensor measures the internal pressures response during actuation. The soft actuator was tested at different operating conditions using a controlled pneumatic supply. The resulting bending response was recorded using a high-speed camera and processed using an image processing program, to track and measure the change in bending angle during each test. Regression analysis and neural networks were utilised to model the measured bending angle output based on the generated sensory feedback. Both techniques were successful in capturing the bending response of the soft actuator, with neural networks providing more accurate predictions. The trained models were successfully validated using a new dataset generated at untrained operating conditions. Furthermore, the derived regression model was integrated as part of a closed-loop PID controller, in order to control the soft actuator bending based on real-time sensory feedback. The controller was tested using stepped and sinusoidal reference signals, and was able to accurately maintain the desired target angle with a mean error of only 0.752°and a standard deviation of 2.09°.
The result of this work showed how simple empirical models and trained neural networks are able to accurately predict the bending angle of common bending SPAs at different operating conditions, using a relatively small dataset from inexpensive commercial sensors. Additionally, the bending angle was successfully controlled in real-time using the derived empirical model, even when the system suffered from some pressure leak. The main advantage of this approach lies in lifting the need for exact physical models that require prior knowledge about the geometry and material properties of the tested soft actuators. Instead, inexpensive commercial sensors are embedded to generate experimental data required for deriving the empirical models, which implicitly accounts for any variations that could arise during the manual fabrication of such actuators. Thus, the approach can be potentially adopted for other soft actuator morphologies, as long as the required sensory feedback can be generated to derive the models. This is part of ongoing work on developing more controllable soft gripper prototypes (as the one shown in Fig. 3), which are made of interchangeable soft fingers based on bending SPAs with embedded flexible sensors. The first stage of the work presented here, demonstrated how data-driven approaches can be used to model and control the free bending response of individual soft fingers using real-time sensory feedback. By combining those individually calibrated soft fingers to form a complete soft gripper, more controllable manipulations can be achieved. It is envisioned that by further training of the ANN under wider grasping conditions, contact with the grasped objects can be detected, and accurate estimations can be made about the size and position of the grasped object with respect to the gripper base. This will contribute towards expanding the application of soft grippers to include more complex manipulation tasks that require not only the inherited softness and compliance, but also accurate positional and force control.