The Turmell-Meter: In Vivo Ankle Kinematics by Using Draw-Wire and Inertial Sensors

— Objective: To implement a prototype specific for human ankle kinematics studies in limited spaces, immobile, or lying down patients. Based on anatomy and anthropometry, using a screw theory model, draw-wire and inertial sensors were employed. Methods: We included ankle injury studies to highlight the importance of measuring the in vivo range of motion; we studied the ankle anatomy, biomechanics, and anthropometry to estimate the size and movements of the device. We simulated the biaxial representation of ankle motion through the product of exponential mapping. Finally, we designed a structure based on trilateration by projecting tetrahedrons, an acquisition circuit with firmware and calibration software. Results: The prototype has two main parts: support and adjustable platform. We proposed a method to find the position by projecting three apexes on the base using draw-wire sensors, an acquisition board, a single-board computer, a display, Bluetooth, Wi-Fi, and two inertial measurement units. The power source had battery backup with boost and buck con-verters. Conclusion: We proposed an ankle model in the screw theory framework, a method for localization, and a novel device for in vivo measurements specific for lying patients on a bed, the ground, outdoors, or remote locations without complex setups. The double-battery management is robust and long lasting. Signif-icance: The device is an alternative for measuring the range of motion in laying down patients. We will use it in modeling, diagnosis, and rehabilitation.


I INTRODUCTION
TURMELL-METER is a hyphenated word from the Valencian language, and its meaning has two components: "ankle" and "measure". In this work, we present a mechatronic application to study the human ankle.
Human ankle modeling and measuring is important in physiology, biomechanics, and robotics for rehabilitation (also in the design of truly humanoid robotic legs). The ankle is a fundamental joint of the human locomotion system and 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 to identify each human. The variations in individual ankle characteristics are based on anthropometric measurements that depend on sex, age, and phenotype. There is little electronic Submitted August 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). equipment specialized for in vivo patient-specific measurement of the ankle in reduced spaces, especially for laying-down patients in remote places.
3D-printed biomedical devices can be personalized, enhanced, scaled, and modified for a specific application. In this work, we designed 3D printed parts for a group of standard sizes.
The screw theory representation of spatial transformations is broadly used in modern robotics. A requirement of the product of the exponential formula is to know the initial pose of a body; it can be referenced to another rigid body by using draw-wire sensors. We employ draw-wire sensors and trilateration to find the initial pose.
Inertial sensors are broadly used for tracking; they give us real-time digital information about the movement, but they have drift. Therefore, we complement the inertial sensor information with draw-wire sensors.
The turmell-meter (TM) should be used for ankle kinematics to compare ankle symmetry or for model validation.
For a rapid visual introduction, we show the device in a typical patient position in Fig. 1.
We employ the knowledge and conventions of ankle anatomy and biomechanics to represent an ankle model in the screw theory framework and as a basis to design a prototype to study human ankle kinematics. We presented in brief the concept in [7].

II RELATED WORK
Ankle modeling is part of the screw theory framework, which was introduced by Ball [8], presented in books [9]- [17], applied to multibody systems, and geometrically represented in [18]- [26]. Modern robotics have used the product of exponential formulas in rigid body motions [27].
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).  Screw theory has been employed in biomechanics for human jaw characterization [28], [29] and characterization of instantaneous screws in a human knee [30]- [32]. Additionally, inertial measurement units have been applied in tracking limbs by referencing multiple sensors in [33]- [39].
There are different 3D ankle models in the literature; in our work, we focus on the two-axis approach, which is included in the International Biomechanics Society recommendations [40], anatomy and biomechanics books [41]- [45], and simulation software [46]. Specific works on ankle biomechanics are in [47]- [52] and more recently in [53]. In vivo studies for articulated boots were performed in [54], subject-specific in [55], and the axes of rotation were calculated in [56]. Dual fluoroscopy for the ankles from markers was performed in [57]. The most complex joint is the subtalar axis, and important contributions are shown in [58]- [65]. Functional representations in the literature are presented in [66]. Although the TM was inspired by the two-axis model, it can be used in the study and characterization of this and other 3D joint mechanisms, as shown in [67], [68]. Draw-wire sensors have been employed in robotics [69]- [71], linear position tracking [72], and easy robot programming [73]. Inertial measurement units were used by post-processing data and complementing other sensors in [74]- [78].

III ANKLE BIOMECHANICS
In this section, we start from the ankle description, which presents a complex movement. First, we study the shank, ankle and foot bones. Then, we analyze the ankle movements based on the anatomic spatial and functional representation.

III.A Ankle Bones
It is a good idea to start by understanding the morphology of the bones when studying ankle movements. Fig. 2 identifies the names of the bones of the left and right feet.
In Fig. 3, we use the right-hand rotation convention and systematically present the movements. Additionally, we organize the movements into two rows, which correspond to pronation and supination. We also show the hindfoot and midfoot as the most involved segments in ankle movements.

III.B Ankle Kinematic Model
As we mentioned, the most accepted approach to model the ankle is biaxial movement. As shown in Fig. 3, the 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 Fig. 4.
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 talus dome "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, calcaneus, navicular, and cuneiform groups. To identify those axes, it is necessary to consider the reference frames from each bone. As we show, there are mechanical parallel chains joined by nontrivial surfaces in the ankle structure. It is difficult to localize the reference frame of human bones. Normally, this process is performed using a goniometer, palpation, markers, medical imaging, inertial sensors, or other indirect methods.

IV ANKLE MODEL SIMULATION
In this section, we extract the data from [79] and scale the model with the proportions from [80], [81] and statistics in [82], [83].

IV.A Reference Points Assignation
Based on [79], we show in Fig. 5 the reference points and values K, L, O and P.   A, B, and C are the vertices of a triangle fixed to the foot. Distances K, L, and O are measured from the most medial and lateral points from the black-filled marker to the white-filled marker. Points M1 and M2 pertain to the TC axis.
In Fig. 6, the transverse top and right lateral views with distances Q, W, and w are identified because points N1 and N2 define the ST axis.
The mean values in Fig. 5 and Fig. 6 are listed in Table I. In Fig. 7, we show the ST and TC axes from several viewpoints. The TC axis is measured from the sagittal plane, and the ST is measured from the transverse plane.

IV.B Anatomical and geometrical frames Assignation
We hypothesize that the ankle can be geometrically represented by a 2-dimensional object bounded by a curve, which defines the range of motion (RoM) limits. First, we define the anatomical and geometrical planes as follows: the sagittal (lateral) plane is the X-Z plane (perpendicular to the yaxis), 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 Fig. 8, left.
With this reference frame, we can define the orientation of the TC axis from a unitary vector in the z-direction. We first rotate -80° around the x-axis and subsequently rotate -6° around the z-axis. Similarly, the ST 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.
We summarize the 3D positions of the fibula, tibia, talus, calcaneus, reference points, TC and ST axes in Fig. 8, right. In this image, A0, B0, and C0 are the vertices from the platform fixed to the foot. S1, S2, and S3 are fixed to the shank relative to the arbitrary origin point PO. M1 and M2 define the TC axis; N1 and N2 correspond to the ST axis. We define r1 and r2 as the sagittal plane intersection with the TC and ST axes.

IV.C Size and Dimensions
After the plane and point assignment, we estimate the device dimensions from anthropometric proportions in [80] and use the segment proportions in Fig. 9.
In our model, 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. The distance from the projection of PL on the sagittal plane and PO is dm.
According to [82], the mean height H of an adult male is 175 cm; by substituting this value into the proportion, we have a knee-ankle distance of 21 cm. The distance between points r1 and r2 about the TC and ST axes on the sagittal plane is: 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 = ( , 0, ) (4) Point M1P is the projection of M1 on the sagittal plane and calculated from the P and O values. M2P is the projection of M2 on the sagittal plane and calculated from the L and K values.
The projection of 2 1 on the sagittal plane is 2 1 ; it has the proportional relation W/w with respect to 2 1 . Then,    > TBME-01349-2021< 4 Solving for r1 gives the following: 1 = 2 − 2 − 1 (8) By knowing the distance Q projected in the sagittal plane and r1 at an angle of 41°, we calculate r2 from 2 = Q(cos(41°) , 0, − sin(41°)) + 1 (9) The distance dp from the ankle to the foot is = 0.039 (10) With reference to a circumscribed equilateral triangle with radius rP projected from r1 to the platform, the initial distance dz from the origin is = +

IV.D Product of Exponential Mapping
In this part, we simulate the ankle kinematics using the product of exponential mapping. 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 R3×3 is the rotation matrix, and pT is the translation vector.
The initial transformations for points A0, B0, and C0 are: The ends of and are the origins of and . The components = − × and = − × compound the 6-dimensional vectors and .
where and are The rotation matrix is obtained by the skew-symmetric matrix With Rodrigues' formula ̂ = 3×3 +̂sin +̂2 (1 − cos ) For each joint, i = 1, 2 Points A, B, and C have invariant relative positions, and there are two rotating joints; the product of the exponential formula for each point is where 1 and 2 are the values of the talocrural and subtalar axes of rotation.

IV.E Code Implementation
We implement the code in Sagemath. The complete code is in [84]. We show the simulation flexibility by initializing the anthropometrical values in listing 1: Additionally, we show the product of exponential implementation in listing 2.  As shown in Fig. 10, the trajectories of A, B, C, and PC generated by biaxial movements are smooth surfaces 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 the distances between the origin and the vertices, we estimate the maximal length of the draw-wire sensors in every module.
= max(‖ ( 1 , 2 ) − ‖ + ) (29) Here, is the maximal possible length from the triangular inequality, ( 1 , 2 ) is the group of positions in , is the module radius, and is the base point.

V GEOMETRICAL DESIGN
The main design requirement is the localization of three points attached to the foot with respect to the shank. We propose to estimate the actual position by using an array of draw-wire sensors in a tetrahedral structure to find the apex location, as shown in Fig. 11. and are the IMU reference positions. The platform has known dimensions, and the number of sensors is 7. First, we calculate from three distances, and and can be calculated after the first with only two sensors.

V.A Finding the TA Apex
To find , we realized that the base points are in the same plane as origin and developed faces Δ 12 ( 1 , 2 , ), Δ 23 ( 2 , 3 , ), and Δ 13 ( 1 , 2 , ) on the plane of the base, as shown in Fig. 12. Fig. 12 shows that triangles 1 , 3 , 132 and 2 , 3 , 231 are two sides of the tetrahedron developed on the base plane.
The respective orthogonal projection of the apex on each adjacent segment of the base triangle can be found by tracing the circle centered on 1 with radius ‖ − 1 ‖ and the circle centered on 3 with radius ‖ − 3 ‖, which results in intersection points 132 and 131 . In addition, the circle centered at 2 with radius ‖ − 2 ‖ intersects the circle centered at 3 at points 231 and 232 .
The line between points 132 and 131 intersects the line defined by points 231 and 232 at point . In the case of tetrahedron , we determined the components and by considering the projection of point = ( , , 0). It is easy to realize that the height of tetrahedron is the distance from the base to point and corresponds to the absolute value of the z coordinate.
If the length of the segments ‖ 1 − 2 ‖, ‖ 1 − 3 ‖ and ‖ 2 − 3 ‖ are the sides of an equilateral triangle, the line defined by points and is perpendicular to the base plane. Then, we can find the distance between points and 3 as the side of a rectangular triangle; the other side is z, and the hypotenuse is the known distance 3 = ‖ − 3 ‖.
V.B Tetrahedrons and In this stage, by knowing point , points and need only two sensors to be found. To determine the result of tetrahedron ( 1 , 3 , , ), we consider the base as a triangle of known dimensions 1 , 2 , A pxy . We calculated the normal vector perpendicular to the containing plane and calculated the projection similarly to that of tetrahedron . Considering Fig. 13, only tetrahedron is analyzed.
Finally, to find the projection of the apex of tetrahedron  Fig. 13. Resolution of on the XY plane, we took as the projection of point on the base. The z-coordinate was found by the Pythagorean formula, as shown in the case. The same algorithm was applied to tetrahedron .

V.C Computer Aided Designs
In this section, we choose draw-wire sensors to measure the lengths of the tetrahedron sides; they are arranged as structural parts. Their maximal length was estimated from the screw simulation. Then, we design the shank attachment and use the shank dimensions, proportions and statistical data to design all other parts.

C.1 Draw-wire Sensor
We used flat springs with no special characteristics. A detailed sensor study deserves complete publication. The springs are not exposed to a high load against gravity; they are in two or three concurrent groups. Fig. 14 depicts the design, which is composed of three 3D=printed parts: the potentiometer, flat spring, bolts and nuts.
A two-coil winch drives the potentiometer; a flat spring retracts a wire attached to the winch. When the wire is extended, the spring retracts it.
The value of each turn was calculated from the nominal value of the potentiometer, 2.2 kΩ , divided into 10 turns, i.e., 220 Ω per turn.
The diameter is = 3.8 cm, and the spring can be compressed in 4 turns. The maximal length is described as follows: max = 4 ⋅ ⋅ (31) This value is approximately 477.5, which is greater than for all groups of movements.

C.2 Mechanical Parts
The support structure consists of an aluminum tube. The point of attachment on the calf has a size according to the simulation. We used the mesh model of a leg to guide the shape of the calf support. The structure was scaled and divided into 7 parts for 3D printing. A band composed of neoprene and Velcro fabric was attached to the part of the calf. Fig. 15 shows the mechanical components in the following order: sensor base, foot platform, aluminum structure, and shank support. The TM has 45 3D-printed mechanical parts.

C.3 Electronics
The two operational amplifiers configure an instrumentation amplifier as shown in Fig. 16.
The voltage gain as follows.
The device was intended to be portable, so a backup 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 12-V boost converter. Fig. 17 shows the schematics. We exported the printed circuit design to Kicad StepUp to fit the case for all components, focusing on a compact configuration.
The two main electronic components are the Arduino Mega 2560 and Orange Pi One. We symmetrically placed components such as the dual pole dual-throw (DPDT) toggle switches on the sides of the box. Fig. 18 shows the main sides and final assembly of the electronic case.  Every side of the box has attached components to optimize the space and compact the system for portability. Each component can be first calibrated and subsequently installed on the support structure.

C.5 Final mechanical design
Finally, we design the assembly of all parts, and the main components are attached by an 8-mm steel threaded rod. The subassemblies use M3 bolts and nuts. Fig. 19 shows the assembled design.

V.D Calibration and Validation Software
Calibration was performed with only the Arduino board connected to the PC, which ran a calibration program in Processing. 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. The lengths were computed from the initial values plus the scaled sensor inputs with = + Here, is the distance in cm from wire of module , is the initial distance, is the measured digital value, and is the scale factor in digital units per cm.

VI RESULTS
In this part, we describe the results of the TM design, which are the assembled device and calibration. The CAD are in [85].
First, we show images of the connected electronics parts. Second, the structure was assembled for calibration. Third, the device calibration results are shown. Finally, we placed a healthy leg and foot to show the adaptable ergonomic design of the prototype. We printed the structural parts with ABS, drawwire sensor with PLA and supports and the electronics case with PETG.

VI.A Printed and Connected electronics
The electronics were assembled in each face of the electronics case. In Fig. 20, the sides were prepared and connected; finally, the assembled case was charged. The revised circuit worked as design simulation and requirements.

VI.B Printed and Assembled Structure
All structural components were assembled carefully, and put together with stainless-steel threaded rods. The draw-wire sensors, acquisition board, connections and final structure were independently made for the initial calibration. The resulting image is shown in the figure below. This system was powered and calibrated with a connected personal computer.

VI.C Calibrated Device
The resulting calibration was easily performed by using the lengths and a program that captures the signal of the sensors, as shown in Fig. 22.

VI.D Attached Foot and Shank
Finally, we show the resulting device attached to a healthy patient. The foot and shank fit in the adjustable platform and support structure, respectively, as is shown in Fig. 23.

VII CONCLUSIONS
The ankle is the most commonly injured joint of the lower limb; it is important to measure the range of motion by in vivo methods for patients laying down in reduced or remote places. We proposed a device based on the ankle anatomy and anthropometry. Additionally, we used a model in the screw theory framework, which can be characterized by the device. The simulations enabled us to design the size of the device and maximal length of the wires.
We presented a trilateration method by using tetrahedrons projected on the base as an efficient alternative to 3D sphere intersections.
The draw-wire sensors are modular and a structural part of the device, which is lightweight and portable. The assembly of the electronics is also modular, and other single-board computers and microcontroller boards can be used.
The TM will also be used for ankle characterization and diagnosis in the design of a rehabilitation robot named Turmellmoure.