The Turmell-Metre: Using Draw Wire and Inertial Sensors for an In Vivo Ankle Kinematics Study

This work presents a device for the ankle kinematics study. It is portable, aﬀordable and some parts can be 3D printed. It is based on the ankle anatomy and biomechanics, also, it can be applied for the characterization of the ankle axis or another models of the ankle.

The Turmell-Metre: Using Draw Wire and Inertial Sensors for an In Vivo Ankle Kinematics Study Ángel Valera, Óscar Agudelo, and Julio H. Vargas-Riaño, Member, IEEE Abstract-In this work, we present an analysis of ankle morphology based on the most accepted ankle models.By employing in vitro anthropometric measurements, we reconstructed a model for spatial simulation of ankle movement through screw theory concepts.We revisited the biaxial ankle model in terms of the product of exponential mapping to establish the geometrical design of the device.Based on observations and simulations, we developed the Turmell-metre, a mostly 3D printed, portable and affordable device to estimate the position and orientation of the foot relative to the leg by means of trilateration, which involves projection of the apex of a tetrahedron onto the base plane.The coordinates of the points were determined from the lengths of the conforming faces of the drawwire sensors, which were developed on the plane base, and calculating the intersection of the line segments.The device also consists of two IMU sensors, one fixed to the shank reference frame and the other attached to the foot's platform reference frame.The localization information obtained from the IMU sensors is compared with that obtained from the draw-wire sensors.Data can be used in realtime applications and stored, visualized for analysis and identification purposes, or used as a complementary and accessible alternative to optical, medical imaging, or other similar systems.

I. INTRODUCTION.
Turmell-metre is a hyphenated word from the Valencian language, and its meaning has two components: "ankle" and "measure".Human ankle modeling is an important issue in physiology, biomechanics, and robotics for rehabilitation (even in the design of truly humanoid robotic legs); the ankle is a fundamental joint of the human locomotion system and is the most commonly reported lower limb injury in schools, sports, and military activities [1]- [6].Similar to other human characteristics, the human ankle model has a footprint for the identification of each individual.It results from a nearly variable-unlimited and massively parallel process for Submitted july 2021 This work is supported by Colfuturo-Colciencias Ángel Valera is on Ai2 at the Universitat Politècnica de València (email: giuprog@isa.upv.es).
Julio H. Vargas-Riaño is a PhD student at the Universitat Politècnica de València (e-mail: julio_h_vargas_r@ieee.org).the natural evolution of biped locomotion.The variations in individual ankle characteristics are based on anthropometric measurements that depend on gender, age, and phenotype.The equipment needed to capture the kinematics of an ankle is expensive, and it is not specialized for the diagnosis and measurement of ankle mobility.Additive manufacturing is changing numerous fields, and such technology is becoming affordable and simple to maintain.Moreover, 3D-printed sensors can be personalized, enhanced, scaled, and even modified for a specific application.Because of the advances in information and computer sciences applied to spatial transformations in robotics, the basic concepts of geometry are generalized to geometric algebra and bonding mathematical abstractions used in physics, as well as mechanics and robotics.Consider space to be an elastic tissue and a rigid body to be a reticle with an invariant distance between its particles bound by internal molecular and atomic forces at a stable energy state.Interactions with other physical entities such as fluids, tension, torques, friction, force fields, and any other energy change the whole body state and can be considered a combination of possible translation and rotation motion, similar to an infinitesimal screw.The pose of a body is relative to its initial state.It can be visually referenced to another rigid body frame and therefore is analyzed through transformations derived from the affine and projective geometry.With the help of sensors and signal processing, the initial position and orientation can be captured and tracked.The rigid body state can be recorded, analyzed, processed, and simplified for the modeling of complex human joints, in our case, the ankle.We developed the Turmell-metre as an example of exploiting all the above mentioned abstractions.For the sake of a rapid visual introduction, we show the Turmell-metre in figure 1.
We employed the knowledge and conventions of ankle anatomy and biomechanics by applying all relevant theories to represent an ankle model as the basis of the design of an affordable prototype to track the kinematics of the human ankle.In the biomechanics literature, common terms used for ankle measurement are in vivo (living people) and in vitro (cadavers); our device is intended for in vivo measurements.
In this work, we use screw theory, which was introduced by Ball [7]; this theory is used in multi-body systems [8] and serial and parallel robotics [9]- [25].In [19], a complete history review and an excellent contribution to the kinematics of parallel manipulators is discussed.This theory is related to spinors of universal geometric algebra [26]- [30].In biomechanics, screw theory has been employed for characterization of the human jaw [31], [32], as well as characterization of instantaneous screws in a human knee [33], [34].Inertial measurement units have been applied in biomechanics and wearable technologies [35]- [41].

II. ANKLE ANATOMY
In this section, we start from the anatomic ankle description, which presents a complex movement, depending on its anatomy.First, qualitative analysis of ankle movements was based on the spatial and functional representation of the anatomy.It is a good idea to start by understanding the morphology of the bones when studying ankle movements.Figure 2 was designed by taking into account the positive axis direction and considering all the movements systematically.The frontal plane is perpendicular to the x-axis, the sagittal plane is perpendicular to the y-axis, and the transverse or coronal plane is perpendicular to the z-axis.Figure 2 is divided into two rows corresponding to pronation and supination movements relative to the positive direction of the axis.In addition, it details the hindfoot and the midfoot as the most involved segments in ankle movements.

III. ANKLE MODEL
The most accepted approach for modeling the ankle is the biaxial movement model [42]- [63].In this model, the ankle is considered as two rotational joints in series.Figure 3 identifies the names of the bones of the left and right feet.As shown in figure 3 on the left, ankle movement is the result of the interaction of several bones, such as the fibula, tibia, talus, calcaneus, navicular, cuboid, and three cuneiform bones.However, the mathematical model of the ankle is reduced to a representation of two hinge joints in series, as presented in the right side of the figure 3. The first axis is related to the tibiofemoral and talus joint and is known as the talocrural (TC) axis; some sources name the joint of the tibiofemoral group and the talus dome as "mortise" and "tenon" because of the similarity with the architectonic and carpentry structure.The second axis is the subtalar (ST) joint.The bones involved in this rotation are the talus, the calcaneus, the navicular, and the cuneiform group.To identify those axes, it is necessary to consider the reference frames from each of the axes.As we can see, there are mechanical parallel chains joined by nontrivial surfaces in the ankle structure.It is difficult to directly localize the reference frame of human bones.Normally, this process is carried out by using a goniometer, palpation, markers, medical imaging, inertial sensors, or other indirect methods.

IV. REFERENCE POINTS IDENTIFICATION
We used the data from [42]; figure 4, left, shows the main reference points.The points A, B, and C are the vertices of a triangle fixed to the foot.The distances, K, L, and O are measured from the most medial and lateral points from the black-filled marker to the white-filled marker.The M 1 and M 2 points define the talocrural axis.In figure 4, right, the transverse top and right lateral views with distances Q, W, and w, as the points N 1 and N 2 that define the subtalar axis, were identified.In addition, the axes and platform points M 1 , M 2 , A, B, and C were referenced.The mean values in figure 4 are shown in table I. Based on the data in table I, the axes are estimated in figure 5.The talocrural axis is measured from the sagittal plane, and the subtalar axis is referred to as the transverse plane.

V. ANATOMICAL AND GEOMETRICAL FRAMES
We hypothesize that the ankle can be represented geometrically by a two-dimensional object in the limits of the range of motion (RoM).The anatomical and geometrical planes were defined as follows: the sagittal (lateral) plane is the X-Z plane (perpendicular to the y-axis), the coronal (frontal) plane is the Y-Z plane (perpendicular to the x-axis), and the transverse (axial) plane is the X-Y plane (perpendicular to the z-axis).This correspondence is shown in figure 6, left.With this reference frame, we can define the orientation of the talocrural axis from a unitary vector in the z-direction.We first rotate -80°around the x-axis and then rotate -6°around the z-axis.Similarly, the subtalar axis can be defined from a unitary vector in the direction of the x-axis by rotating 41°about the yaxis, followed by a rotation of 23°around the z-axis.Once the talocrural and subtalar axes were defined regarding the hindfoot bones (tibia, fibula, talus, and calcaneus), they were represented as depicted in figure 6, right.
The points A 0 , B 0 , and B 0 are the vertices from the platform fixed to the foot reference frame.S 1 , S 2 , and S 3 are the points of a triangle fixed to the shank reference frame relative to the arbitrary origin point P O .Points M 1 and M 2 define the talocrural axis; N 1 and N 2 correspond to the subtalar axis.Points r 1 and r 2 define the projection on the sagittal plane of the lower distance between the talocrural axis and the subtalar axis.
For the simulation, we used point P O coinciding with the X-Z sagittal plane and the reference points r 1 and r 2 projected on the plane y=0.Points M 1 and M 2 were estimated from the most medial point P M and the most lateral point P L .
To size the device, we employed anthropometric propor- Fig. 7. Human body proportions [64] tions, which is used in many fields, from artistic expressions to ergonomic design, as well as medicine, biomechanics, and robotics.We took the standard measure of the proportions of an adult from [64] as in figure 7.
The origin is located at the center of the distance between the knee and the ankle.This distance is proportional to 0.246H of the body height [64], [65].The distance from the projection of P L on the sagittal plane and According to the statistical data in [66], [67], the mean height H of an adult male is approximately 175 cm; by substituting this value into the approximated proportion, we have a knee-ankle distance of 21 cm.The distance between points r 1 and r 2 about the TC and ST axes on the sagittal plane is as follows.
The projection of the most medial point on the sagittal plane is and the projection of the most lateral point on the sagittal plane is The point M 1P is the projection of M 1 over the sagittal plane.It is calculated from the P and O values.M 2P is the projection of M 2 over the sagittal plane.It is calculated from the L and K values.
The projection of the M 1 M 2 segment on the sagittal plane is theM 1P M 2P segment; it has the proportional relation W/w with respect to the M 2P r 1 segment.Then, Solving for r 1 gives the following: By knowing the distance Q projected in the sagittal plane and r 1 , the angle 41°is extracted from the figure 4, right.
The angle 41°is determined from the anthropometric statistical data.If we take the value of the proportions from the ankle to the foot width as 0.039H, we have With reference to a circumscribed equilateral triangle with a radius of r P projected from r 1 to the platform, the initial distance d z from the origin is The initial points of the platform A 0 , B 0 , and C 0 are The distance between line segments M 1 M 2 and N 1 N 2 is minimal.Each line is parametrized by L M and L N coordinates. where If we define the difference function as the quadratic difference then the minimal value occurs when By using two equations, solving for t 1 and t 2 and substituting these values into the original parametric lines, the near distance points r n = (n 1x , n 1y , n 1z ) and r m = (m 1x , m 1y , m 1z ) were found.

VI. PRODUCT OF EXPONENTIAL MAPPING
In this part, we simulated ankle kinematics using the product of exponential mapping.It is useful, for example, if we take the model of the left ankle, and by performing a simple mirroring operation, we can obtain an approximate model of the right ankle.Following the intuitive concept that the bone surfaces constrain the movement of the ankle, it can be represented as a special Euclidean group of rigid movements SE(3) of the foot in matrix form where R 3×3 is the rotation matrix and p T is the translation vector. with and sθ = sin θ (28) The initial transformation for the points A 0 , B 0 , and B 0 is given by Here, I 3×3 is the identity matrix.The positions of r 1 and r 2 are the origins of the screws with unitary vectors ω 1 and ω 2 .The components ν 1 = −ω 1 × r 1 and ν 2 = −ω 2 ×r 2 complete the values of the six-dimensional vectors ξ 1 and ξ 2 where ω 1 and ω 2 are The rotation matrix is obtained by the skew-symmetric matrix with the Rodrigues' formula The twist is for each joint, i = 1, 2 Points A, B, and C have invariant relative positions, and there are two rotating joints; the product of exponential formulas are g B = e ξ1θ1 e ξ2θ2 g B (0) (42) The variables θ 1 and θ 2 are the values of the talocrural and subtalar axes of rotation.

VII. CODE IMPLEMENTATION
We implemented the code in Sagemath [68] kernel running on a Jupyter notebook.
For the transformation of the vectors, we implemented the vector-axis transformation, as shown in the Sagemath code in figure 8.
The construction of the initial position matrices was implemented with the code shown in figure 9.
Finally, to create the group of movements in Sagemath, the code shown in figure 10 was used.
The graphical result of the simulation is shown in figure 11.
As we can see in the figure, the trajectories of points A, B, C, and PC generated by biaxial movements are smooth isosurfaces or manifolds.They are mapped by two degrees of freedom, with a limited domain due to the range of movement of the axes.
By considering sections in different planes, perpendicular to the platform plane, we realized that this reconstruction of the movements is not precise and that some positions are not reachable in a real patient.In the next section, we design the Turmell-metre, based on the simulated reconstruction of the anthropometric measurements.

VIII. THE TURMELL-METRE DESIGN
The design requirements are the localization of three points attached to the foot, with respect to the shank reference frame.There are two affordable sensor technologies for tracking movements: draw-wire sensors [69]- [72] and inertial measurement units with complementary sensors and postprocessing [36], [73]- [79].We designed a mostly printable simple drawwire sensor based on a potentiometer, complemented with two IMU sensors because alone, the IMUs have disadvantages such as drift, and they measure inertial changes on the rotational and positional variables.IMU sensors are well suited for the direct calculation of the twist at a specific spatial point.To overcome such disadvantages, we proposed the calculation of the actual position by using an array of draw-wire sensors in a tetrahedral structure to calculate the apex location via a geometrical method.The figure 12, left, shows the initial design of three tetrahedrons: A 1 , A 2 , A 3 , A P near the hindfoot B 1 , B 2 , B 3 , B P and C 1 , C 2 , C 3 , C P close to the medial and lateral forefoot.For this initial design, the number of sensors was nine.Theoretically, the points P O and P c are the positions of the two IMUs.The device has a platform with a known size, and it is possible to reduce the number of sensors to seven as in figure 12, right.First, by calculating the A p point from three distances, the B p and C p edges of the platform can be calculated after the first with only two sensors.In our work, we try to balance the processing time and sensor redundancy.
In figure 12, right, the tetrahedron A 1 , A 2 , A 3 , A p was initially solved with the lengths of the sides l A1 = distance(A p , A 1 ), l A2 = distance(A p , A 2 ), and l A3 = distance(A p , A 3 ).First, we realized that the base points are in the same plane as the origin P O .started by mapping the apex on the z=0 plane, and we developed the sides enclosed by A 1 , A, A P , A 2 , A 3 , A P , and A 1 , A 2 , A P on the plane of the base, as shown in figure 13.
In figure 13, we can see that the sides A 1 , A 3 , A p and In addition, the circle Cr A2 centered on A 2 with radius A 2 − A P intersects Cr A3 at points Ap 231 and A p232 .The line l 13 between points A p132 and A p131 intersects the line l 23 defined by points A p231 and A p232 at point A pxy .In the case of tetrahedron T A , we determined the components A px and A py by considering the projection of point A pxy = (A px , A py , 0).It is easy to realize that the height of tetrahedron T A is the distance from the base to point A p and corresponds to the absolute value of the z coordinate.If we define as d the length of the segments A 1 − A 2 , A 1 − A 3 and A 2 − A 3 are the sides of an equilateral triangle.As we know, the line defined by points A p and A pxy is perpendicular to the base plane.We can find the distance between the points A pxy and A 3 as the side of a rectangular triangle; the other side is z, and the hypotenuse is the known distance

IX. TETRAHEDRONS T B AND T C
In this section, by knowing the point A p , points C p and B p need only two sensors at the same time.To determine the result of the tetrahedron B 1 , B 3 , A pxy , B P , we consider the base as a triangle of known dimensions B 1 , B 2 A pxy .We calculated the normal vector perpendicular to the containing plane and then calculated the projection similarly to that of tetrahedron T A .Considering figure 14, only tetrahedron T B is analyzed.
Finally, to find the projection of the apex of the tetrahedron T B on the XY plane, we took B pxy as the projection of point B P on the base.The z-coordinate was found by the Pythagorean formula, as in the T A case.The same algorithm was applied to the T C tetrahedron.

X. CONSTRUCTION OF THE TURMELL-METRE
We describe the process of CAD designs and the construction of the Turmell-metre.We designed a draw-wire sensor to measure the length of each side of the tetrahedrons.The objective of such a sensor is to rewind a wire with constant tension.They have advantages over other sensors, and they can measure in several directions.The recoil mechanism was attached to a rotary transducer, such as a passive sensor based on resistance, inductance or capacitance.We chose the simplest and most commonly available transducer as the resistor.We designed a pulley that transmits the rotating movement of the transducer as a double winch mechanism.Pulling the measurement wire caused the pulling of the wire of the retraction system.It was necessary to set the initial position of the variable resistor at 100 ohms.The structure of the sensor is shown in figure 15.
The pulley was designed to avoid the slipperiness of the wire and worked as a double winch.A fishing line was attached to the pulley for use.It used a two-coil system: when one was rolled, the other was extended.The pulley was attached to the variable resistor.In addition, the figure 15 shows the rest of the sensor, including a retractile element with a multiturn variable resistor.As one of the objectives is to build an affordable sensor, we selected WXD3-13 as a ten-turn variable resistor, with a flat spring retractile element with four turns of compression used in retractable ID badge holders.The value of each turn was calculated from the nominal value of the potentiometer, 2.2kΩ, divided between ten turns, that is 220Ω per turn.
The diameter of the pulley was D = 3.8cm, and the spring could be compressed in four turns.The maximal measurement of the sensor is described as follows: The two operational amplifiers configure an instrumentation amplifier with voltage gain as follows.
for 34 mV we obtain: A. Electronics circuit.
We designed the printed board circuit as an Arduino Mega™ 2560 Shield.It is a commonly available version of Arduino boards.All the components were incorporated by throw-hole installation, and the welding was simple.
The device was intended to be portable, so a double power backup system was designed with two packs containing two 18650 Li-Ion batteries in series, They have a battery management system, a 5 V buck converter module, and a 12V boost converter.Finally, connectors for the MPUs, OLED and Bluetooth module were added.The schematic is shown in figure 16.
The output of the batteries can be switched if the voltage level is low.The double backup is shown in figure 17

B. Electronics case
We designed the case for all the components, focusing on a compact configuration.The two main electronic components are the Arduino Mega 2560 and the Orange Pi One.We placed the components such as the Dual Pole Dual Throw (DPDT) toggle switches symmetrically on the sides of the box.The figure 18 shows the main sides and the final assembly of the electronics case.
Every side of the box has attached components to optimize the space and compact the system for portability.Each component can be calibrated first and then installed on the support structure.

C. Structure
The support structure consists of an aluminum tube and standard elbows bent at 120 and 90 degrees.The point of attachment on the calf has a standard size according to the statistical data.We used the mesh model of a leg to guide the shape of the calf support.The structure was scaled to standard size and then divided into seven parts for printing on a 3D printer of 20×20×15 cm.A band composed of neoprene and Velcro fabric was attached to the 3D-printed part of the calf.Figure 19 shows the structure components in the following order: the foot platform, the calf support, the modules support plate, and the aluminum tube structure.
In figure 19, an adjustable platform attached to the foot can fit the standard sizes of human adult feet.The length and width can be adjusted by slicing three mobile parts and then secured with steel nuts and bolts.Finally, lace shoes can be used to adjust the foot to the desired tension.All the subassemblies were prepared before the final assembly.The wires were calibrated and attached to the foot platform.The CAD assembled device is shown in figure 20.

D. Assembly and Calibration
The assembly of all parts was prepared with standard M3 steel bolts and nuts.The main components were attached to an 8 mm steel threaded rod. Figure 21 shows the assembled device.
The calibration process was easily performed by using the lengths and a program that captures the signal of the sensors, as shown in figure 21.Calibration was performed with only the Arduino board connected to the PC running a calibration program in Processing.The aspect of the calibration program is shown in figure 22.
The basic program requests the IMU readings from the accelerometer and gyroscope data and captures the values from the ADC inputs.The raw data are treated as signed integer values 2 bytes wide.The two 1-byte registers were converted to 2-byte integers.An exponentially weighted moving average (EWMA) filter was applied to the raw signals and sent via a serial port to the PC.Table II shows the calibration data.
The lengths were computed from the initial values plus the Here, l iM j is the distance in cm from the i wire of the j module, d iM j is the initial distance, m iM j is the measured digital value, and s iM j is the scale factor in digital units per cm.
Finally, a test was performed on a patient, and the foot position was tracked.The most lateral and medial points were visually identified and marked.The heel sensor can be unattached, and the reference points can be recorded.Figure 23 shows the process of placing the device and taking the reference points.
The communication between the Arduino and the Orange PI is sent and processed by the basic software visualization, and the position is refreshed.The Orange Pi uses Armbian software for visualization and is connected to the OLED display and the Bluetooth module.All the Data capture is performed through the visual application on the screen.

XI. CONCLUSIONS AND RECOMMENDATIONS
It is important to start from the ankle anatomy, and the bone configuration serves as a basis for modeling and capturing an ankle model.In this work, we started from simulations of in vitro measurements to appoximate the model, and the specific model can be adjusted with respect to this initial model.
The screw theory model has been used in biomechanics and is useful for diagnosis, prosthesis and assistive robotics.It has a strong mathematical foundation.
It is possible to develop an affordable device to capture ankle movement with 3D printed components, as plastics are resistant enough to human muscular forces.
Electronics to support ankle-sensor devices with inexpensive and commonly available components that are affordable for students and researchers.
The use of open-source hardware and software helps with reproducibility of the results obtained here.
The device can exist in a compacted version with completely 3D printed sensors by using rigid, conductive, and flexible multimaterial 3D printers.All the systems can be integrated into a system-on-chip (SoC) device.
The collected models can be used for statistical studies, diagnosis, training neural networks, telemedicine, physical therapy, prosthetic and ankle rehabilitation devices.

Fig. 6 .
Fig. 6.Planes and axes referenced to the foot position

TABLE I MEAN
VALUES OF THE ANTRHROPOMETRIC MEASUREMENTS