An Automated System for Analysing Swim-Fins Efficiency

Divers’ underwater performance is directly related to their swim-fi n effi ciency. To determine the effi ciency, a comparison is needed between existing models of swim-fi ns leading to conducting experiments that yield reliable results and promise an optimal model. One method of comparison is to construct an automated system that would be able to mimic human leg movement in a submerged environment during independent experiments. To mimic this human behaviour, the options are to either move the robotic leg in the swimming pool or have water fl ow around it in a water tunnel. The second mechanism is simpler to construct and develop because it includes fewer mechanical parts and can be built as a stationary test bench. Therefore, this paper reports the development of this mechanism. Its controlling system is designed based on movement patterns obtained using computer vision techniques in addition to analyses of diver’s behaviour during initial experiments. The presented solution has the potential for comparing the effi ciency of a range of swim-fi ns in a short time.


INTRODUCTION / Uvod
Swim-fi n development, an assurance of better performance for a diver, is of considerable interest. Consequently, a variety of swim-fi ns, made of diff erent materials and moulded in various shapes, has been constructed [1]- [3], [6]. However, more serious attempts have not been developed to assess swimfi ns effi ciency. A substantial number of patents, concerning shapes, materials and constructions of swim-fi ns has been proposed.
The effi ciency of a swim-fi n also plays an important role in biomimetic underwater vehicles technology [4], [5], [8]- [11]. It results from the fact that an effi cient fi n can increase the range of a vehicle, which may facilitate reducing its weight and size. Consequently, some research, devoted to developing an optimal swim-fi n's shape and fl exibility as well as its weight and size has been carried out. Since it is believed that "fi sh-like" underwater vehicles, equipped with undulating propulsion, could be more effi cient than propeller based ones [4], [12], [14], the development of effi cient fi ns will be an essential task.
Even though the effi ciency of a swim-fi n plays a crucial role in many applications, there has been little attention paid to devise a method that could enable a comparison of diff erent models of swim-fi ns. What is more, some techniques analyse swim-fi n propulsion as a global system, where diver's physiological and biomechanical responses are considered [7]. However, it can lead to erroneous results due to the diver's fatigue during experiments. Therefore, an automated system is needed to carry out reliable tests.
The construction of a robotic system is technically demanding because, in order to consider a large number of determinants, the trial should have regard to the diver's movement. To facilitate it, the test bench, based on moving device in a swimming pool, has been presented in [7]. In this solution, the mechanism reproducing horizontal and vertical motion of the swim-fi n is shifted along the side of a swimming pool. Another approach, mainly devoted to the determination of underwater vehicle hydrodynamic coeffi cients, assumes that the vehicle is immobile, whereas water fl ows around it [13]. Since this solution simplifi es the construction of the test bench as well as facilitates test performance, it was utilized in this study.
The purpose of this paper is to present an automated system for analysing swim-fi ns effi ciency. In the next section, the movement pattern of a diver's leg, established during preliminary research, is described. The structure of the system as well as software architecture are presented. At the end, results and conclusions are discussed.

MOVEMENT PATTERN OF A DIVER'S LEG / Obrazac kretanja noge ronioca
A genuine pattern of movement of a diver's leg is necessary for developing a control system of the robotic leg. Therefore, to gather necessary data, the experiments with a diver were carried out in a swimming pool. The diver's leg movement was traced using yellow marks placed on the leg. The experiments were conducted for various speeds and diff erent types of fi ns, which facilitated obtaining representative data. Ultimately, six from all recordings were taken into consideration. Their analyses were performed utilizing a computer vision algorithm, which was designed and implemented into a GUI (graphical user interface) application using the C+ programming language and the OpenCV library (Fig. 1).
The computer vision algorithm, as proposed in the previous work [10], can be divided into the following parts: -Conversion between the RGB and HSV colour spaces. Preliminary experiments were conducted in a swimming pool to determine the best method for detecting markers in underwater environments. They proved that the HSV space facilitates better colour detection in the underwater environment than other colour spaces. Consequently, the HSV space allows faultless detection of yellow markers even when light conditions in the swimming pool are changing. The location of the markers on the image is performed by double thresholding with previously established parameters Min_{H,S,V}, Max_{H,S,V}, defi ning the lower and upper threshold. However, after this operation, some random pixels, incorrectly classifi ed as a marker area, were presented on the image. To remedy this, morphological operations erosion and dilatation were applied for removing unnecessary pixels from the pictures. After this step, the likelihood of error still existed; therefore, additional processing to compare markers' location in consecutive frames was developed. In this processing, if the position of the marker signifi cantly diff ers from the positions of all the detected blobs in the previous image, the marker is removed, and its position is determined using a linear estimator.
The above approach allowed for tracking of the markers in a video stream. Additionally, since an image acquisition rate and all necessary dimensions of the observed scene were known, the following parameters for recorded movies were accessible to calculate: -Pixel positions of the markers.
-Angles between the arms. -Angular velocities of the arms.
Exemplary results, obtained with the developed algorithm, are presented below.
A more detailed description of the developed algorithm and an extensive results' presentation and analysis can be found in [10].

AUTOMATED SYSTEM FOR ANALYSING SWIM--FINS EFFICIENCY / Automatski sustav za analizu učinkovitosti peraja za plivanje
The designed and developed automated system for analysing swim-fi ns effi ciency is depicted in Figure 5. It is composed of two arms, a calf and a thigh, propelled by two motors, and a foot. The foot's position is controlled by a piston attenuator. The piston attenuator is used to simplify construction and improve the simulation of human animation. The motors are in the upper side of the construction, whereas torque is transmitted through a system of gearboxes to a single articulated joint via V-belt. This construction allows operating motors in the air, while joints are located underwater and lubricated with fl owing water. Consequently, the structure is simplifi ed and more reliable.
In order to operate the leg and carry out necessary measurements, the control and measurement system presented in the Fig. 6 has been developed.
The control and measurement station determines the leg's position and gathers the necessary data. The leg's position is changed using brushless DC motors supervised by the drive controllers mcDSA-E45 (Fig.7a). The drive controllers are connected to the control and measurement station using the miCAN-Stick2 CAN/USB converters (Fig. 7b). This connection facilitates exchanging data between the station and the controller.
A strain gauge meter and a fl ow meter are used in order to collect the data. The strain gauge meter measures thrust generated by the leg, using HBM the PW4C3/300G-1 transducer depicted in the fi gure below. The transducer requires a connection to an amplifi er; in this work, 1-PAD4001A-RS4 amplifi er with RS-485 interface is utilized. As a result, RS-485 to USB converter is needed to facilitate a data transfer between the station and the strain gauge.
In order to measure water fl ow, an ultrasonic liquid fl ow meter NFM300M.H was applied (Fig. 9).
Sensors of the fl ow meter were mounted around the water tunnel, while the transducer was connected to the station via Modbus (serial connection protocol). In this case, the RS-485 to USB converter is also used.

SOFTWARE ARCHITECTURE / Arhitektura softvera
A computer application to control the robotic leg as well as to gather and record necessary data was developed using the C++ programming language and the Qt libraries. Consequently, it is independent of the operating system, and it provides a graphical user interface (GUI) presented in the fi gure below.
The user interface facilitates the following operations: -Manual and automatic control of the leg's position.
-Recording data to a fi le.
-Tarring the thrust value.
-Visualisation of the data on the screen.
The application was divided into three threads; each of them is running on a diff erent core of a processor. The fi rst thread is responsible for communication with a user and control over the other two threads. The second thread enables connection with the motors' controllers, whereas the third one is responsible for data gathering from sensors and writing it to a fi le. This approach ensures fast data transfer and smooth control of the motors.
The communication with controllers was established using text commands based on the CIA specifi cation DS309-3; this means that each text command consists of keywords and numbers that are separated by spaces. For example, if a new  In order to calculate new positions of the arms, the movement pattern of a diver's leg is utilised. However, a direct implementation of the designed pattern was impossible because the driver moved his leg not only in a vertical direction but also in a horizontal one. Additionally, some technical limitations connected with the mechanical construction and the data transmission demanded to develop a new strategy of movement estimation. The mechanical complication results from the fact that belt transmissions of two motors are located on the same shaft. Consequently, the position of the second arm depended on the new position of the fi rst one. The data transmission problem is linked with a delay in data transfer between miCAN-Stick2 CAN/USB and the motors' controllers. It results from the fact that the smooth movement of the arms requires exchanging data every 100 ms, but the motors achieve the new positions after 1 second. On account of this, the prediction of future legs' positions was designed for implementation in the control system. Consequently, the following algorithm, based on 12 parameters, was developed using the movement pattern and visual examination with a comparison between human and robotic behaviour.
Data collection and recording are executed in the third thread. At the beginning, the communication with the sensors is established. Then, the following loop is executed: -Sending inquire commands to the sensors in order to obtain measurement data("0x01,0x03,0x00,0x04,0x00,0x02,0x85,0 xCA" for the fl ow meter and "S31;MSV?;" for the strain gauge). -Receiving and displaying the measurement data.
-Saving obtained data to a fi le.
The thrust force is obtained in the form of an integer number, which is proportional to the measured thrust. Therefore, a calibration process is required. In this process, the reference curve, depicted in Fig. 11, was obtained. However, although the integer number is proportional to the measured thrust, it is not equal to 0 in the case when the thrust amounts to 0. Consequently, each measurement needs to begin with tarring, necessary to obtain proper data.

RESULTS / Rezultati
As mentioned previously, the aim of the work was to construct a test bench which facilitates conducting experiments in moving water. Therefore, the developed diver's artifi cial leg was placed in a water tunnel depicted in Fig. 12.

Figure 12 Water tunnel Slika 12. Vodeni tunel
The water tunnel was designed to allow laminar fl ow of water during experiments. The fl ow was forced using a propeller presented in the fi gure below.

Figure 13 Propeller
Slika 13. Propeler In order to design movement models, the movement patterns, as well as qualitative analyses of robotic leg's behaviour, were employed during the initial test. As a result, several movement models for some types of fi ns were designed. The exemplary movement parameters are presented in Table 1.  The parameters of the fi rst movement were designed for a large fi n and fast motion. Figure 14 illustrates the angular positions of the arms during the experiment.
The movement model for the same fi n but the slower pace is presented in Fig. 15, whereas Figure 16 illustrates the model for a smaller fi n and faster pace.
These results demonstrate that the presented approach facilitates the development of various movement models. However, because of technical diffi culties related to a data transfer lag, the movement of the fi rst arm is not as smooth as the second one. Nevertheless, it will not aff ect future experiments since they will be concentrated on comparative analysis of tested fi ns.

CONCLUSION / Zaključak
Prior work has documented the need for developing a method regarding swim-fi ns effi ciencies' calculation and comparison. Because reproducible swimming technique is diffi cult to obtain due to the diver's fatigue during an experiment, an automated system is desirable to carry out experimentation leading to reliable results. Thus, a test bench that enables carrying out stable experiments in fl owing water has been developed in this work.
The test bench has been equipped with a controlling system which has been developed based on movement patterns obtained using computer vision techniques. This solution can be applied for comparing the effi ciency of a range of swim-fi ns. Additionally, the experiments can be carried out for various movement strategies using movement parameters implemented in the control algorithm.