# Integrated Pedal System for Data Driven Rehabilitation

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Hardware

## 3. Methods

#### 3.1. Definitions and Notation

#### 3.1.1. Crank Angle Definition

#### 3.1.2. Pedal Angle Definition

#### 3.2. Load Sensor Calibration

`scikit-learn`[15] with 10-fold cross-validation and $30\%$ test-fraction, and a 25-elements regularization log-space from ${10}^{-10}$ to ${10}^{2}$.

#### 3.3. Pedalling Kinematics

#### 3.3.1. Pre-Processing

`filtfilt()`function implemented in the

`scipy.signal`[17] Python module.

#### 3.3.2. Kinematic Model

#### 3.3.3. Crank Angle Estimation

#### 3.3.4. Pedal Angle Estimation

#### Rough Estimate—Acceleration Angle

#### Refining the Estimation—Kalman Filter

## 4. Calibration Results

#### 4.1. Load

#### 4.2. Kinematic Parameters

## 5. Applications

#### 5.1. Data Visualization

#### 5.2. Gamification

## 6. Results and Discussion

#### 6.1. Conclusions

#### 6.2. Outlook

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Data Availability Statement

## Conflicts of Interest

## Abbreviations

BDC | Bottom dead center |

fps | Frames per second |

IC | Integrated circuit |

IMU | Intertial measurement unit |

KF | Kalman filter |

LPF | Low-pass filter |

MAE | Mean absolute error |

RMSE | Root mean squared error |

SoC | System on chip |

TDC | Top dead center |

## Appendix A. Derivation of Pedal Kinematics

#### Appendix A.1. Notation

#### Appendix A.2. Pedal Kinematics

#### Appendix A.3. A Note on the Chosen Frames of Reference and the Transformation Matrix R BI

## References

- Industry-ARC. Physiotherapy Services Market—Forecast (2021–2026). 2018. Available online: http://xxx.lanl.gov/abs/https://www.industryarc.com/Report/16089/physiotherapy-services-market.html (accessed on 25 September 2021).
- Frontera, W.R. Epidemiology of Sports Injuries: Implications for Rehabilitation; Wiley: Hoboken, NJ, USA, 2003; pp. 3–9. [Google Scholar] [CrossRef]
- Chiarici, A.; Andrenelli, E.; Serpilli, O.; Andreolini, M.; Tedesco, S.; Pomponio, G.; Gallo, M.M.; Martini, C.; Papa, R.; Coccia, M.; et al. An Early Tailored Approach Is the Key to Effective Rehabilitation in the Intensive Care Unit. Arch. Phys. Med. Rehabil.
**2019**, 100, 1506–1514. [Google Scholar] [CrossRef] [PubMed] - De Rooij, M.; van der Leeden, M.; Cheung, J.; van der Esch, M.; Häkkinen, A.; Haverkamp, D.; Roorda, L.D.; Twisk, J.; Vollebregt, J.; Lems, W.F.; et al. Efficacy of Tailored Exercise Therapy on Physical Functioning in Patients With Knee Osteoarthritis and Comorbidity: A Randomized Controlled Trial. Arthritis Care Res.
**2017**, 69, 807–816. [Google Scholar] [CrossRef] [PubMed] - Bouaziz, W.; Schmitt, E.; Kaltenbach, G.; Geny, B.; Vogel, T. Health benefits of cycle ergometer training for older adults over 70: A review. Eur. Rev. Aging Phys. Act.
**2015**. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Veldema, J.; Jansen, P. Ergometer Training in Stroke Rehabilitation: Systematic Review and Meta-analysis. Arch. Phys. Med. Rehabil.
**2019**, 101, 674–689. [Google Scholar] [CrossRef] [PubMed] - Ofori, E.K.; Frimpong, E.; Ademiluyi, A.; Olawale, O.A. Ergometer cycling improves the ambulatory function and cardiovascular fitness of stroke patients—A randomized controlled trial. J. Phys. Ther. Sci.
**2019**, 31, 211–216. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Mazzocchio, R.; Meunier, S.; Ferrante, S.; Molteni, F.; Cohen, L.G. Cycling, a tool for locomotor recovery after motor lesions? NeuroRehabilitation
**2008**, 23, 67–80. [Google Scholar] [CrossRef] [PubMed] - Alankus, G.; Lazar, A.; May, M.; Kelleher, C. Towards Customizable Games for Stroke Rehabilitation. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, Atlanta, GA, USA, 10–15 April 2010; pp. 2113–2122. [Google Scholar] [CrossRef]
- Podlog, L.; Heil, J.; Schulte, S. Psychosocial Factors in Sports InjuryRehabilitation and Return to Play. Phys. Med. Rehabil. Clin. N. Am.
**2014**, 25, 915–930. [Google Scholar] [CrossRef] [PubMed] - Chana, D.K.C.; Hagger, M.; Spray, C. Treatment motivation for rehabilitation after a sport injury: Application of the trans-contextual model. Psychol. Sport Exerc.
**2011**, 12, 83–92. [Google Scholar] [CrossRef] - FECYT—Spanish Foundation for Science and Technology. Video Games to Improve Mobility After a Stroke. 2018. Available online: https://www.sciencedaily.com/releases/2018/02/180214093914.htm (accessed on 25 September 2021).
- Du, W.Y. Resistive, Capacitive, Inductive, and Magnetic Sensor Technologies; CRC Press: Boca Raton, FL, USA, 2015. [Google Scholar]
- Walsh, P.; Mani, D. Inductive Sensing Design Guide. 2019. Available online: https://www.cypress.com/file/427771/download (accessed on 25 September 2021).
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V.; et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res.
**2011**, 12, 2825–2830. [Google Scholar] - Bianchi, G.; Sorrentino, R. Electronic Filter Simulation & Design; McGraw-Hill: Boston, MA, USA, 2007. [Google Scholar]
- Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods
**2020**, 17, 261–272. [Google Scholar] [CrossRef] [PubMed] [Green Version] - Farjadian, A.B.; Kong, Q.; Gade, V.K.; Deutsch, J.E.; Mavroidis, C. VRACK: Measuring Pedal Kinematics During Stationary Bike Cycling. In Proceedings of the 2013 IEEE 13th International Conference on Rehabilitation Robotics (ICORR), Seattle, WA, USA, 24–26 June 2013. [Google Scholar] [CrossRef]
- Kalman, R.E. A New Approach to Linear Filtering and Prediction Problems. J. Basic Eng.
**1960**, 82, 33–45. [Google Scholar] [CrossRef] [Green Version] - Bini, R.; Hume, P.; Kilding, A. Optimizing Bicycle Configuration and Cyclists’ Body Position to Prevent Overuse Injury Using Biomechanical Approaches. In Biomechanics of Cycling; Springer: Berlin/Heidelberg, Germany, 2014; pp. 92–107. [Google Scholar] [CrossRef]
- Turpin, N.A.; Watier, B. Cycling Biomechanics and Its Relationship to Performance. Appl. Sci.
**2020**, 10, 4112. [Google Scholar] [CrossRef] - Julier, S.J.; Uhlmann, J.K. A New Extension of the Kalman Filter to Nonlinear Systems. In Proceedings of the AeroSense: The 11th International Symposium on Aerospace/Defense Sensing, Simulation and Controls, Orlando, FL, USA, 21–25 April 1997. [Google Scholar]

**Figure 1.**The developed ergometer-upgrade system. (

**a**) 3D rendering of the sensor-equipped pedals; (

**b**) The tablet mounted on an ergometer displaying the developed app’s home view; (

**c**) In-game view of a training session; (

**d**) One of the pedals installed on the ergometer—here, the pedal is upside down.

**Figure 2.**Graphical illustration of the pedal system. Users cycle on the ergometer, applying a force on the pedals. The pedals measure the load applied and transfers it to a tablet device for analysis. Audio or visual feedback is transmitted back to the user to provide feedback.

**Figure 3.**Load sensor working principle. By applying a force F to the target T, the spring S is gets displaced by $\delta x$. This change in target position causes the inductance L of the LC-tank to change, and thus causes a change in resonance frequency $\delta f$. By measuring the resonance frequency f of the LC-tank for various forces F, one can construct a mapping from f to F and thus estimate the forces based on the LC-tank’s resonance frequency.

**Figure 4.**Working principle for 3D load detection using three coils. Here, a forward shear force ${F}_{x}$ will cause a change in ${f}_{0}$, and the opposite change in ${f}_{1}$ and ${f}_{2}$. Torque around the x-axis ${M}_{x}$ would cause a change in ${f}_{1}$ and the opposite change in ${f}_{2}$, with ${f}_{0}$ remaining constant. Finally, a normal force ${F}_{z}$ will cause all frequencies to change equally. With this, all load types can be differentiated.

**Figure 5.**Pedal kinematics modeling. Annotated definition of the world frame I, body frame B, crank angle $\varphi $ and pedal angle $\theta $. Note that the pedal angle $\theta $ is defined with respect to the world-horizontal plane (perpendicualr to the gravity vector $\overrightarrow{g}$) and is independent of the crank-angle $\varphi $. The gyroscope measures the pedal’s angular rate $\dot{\theta}=\omega $, while the accelerometer measures the pedal’s acceleration biased by gravity ${}_{B}\ddot{\overrightarrow{x}}={}_{B}\overrightarrow{a}+{}_{B}\overrightarrow{g}$. Please also note that both frames of reference I and B are 3D orthonormal, right-handed frames, with their y-axis pointing inward and outward respectively. These axes are not depicted in the image to avoid overcrowding. The pedal’s motion is mechanically constrained to the $xz$-plane, and it can thus be assumed, without loss of generality, that the y-position of the pedal is constant at 0.

**Figure 6.**Schematic representation of the force-calibration setup. Depending on the mounting mode of the pedal P, the operator can apply forces F to P and collect, simultaneously, data coming from P and the reference sensor O. Three mounting modes are possible, enabling loading in ${F}_{x}$, ${F}_{z}$, and ${M}_{x}$.

**Figure 7.**Flow chart outlining the process used to derive the pedal angle. After passing the analysis-relevant signals through second order Buttwerworth low-pass filter (LPF), we compute a rough estimate of the pedal angle based on accelerometer measurements ${\widehat{\theta}}_{a}$ and then fuse the gyroscope measurements $\omega $ with ${\widehat{\theta}}_{a}$ using a KF to get a refined version of the estimate $\widehat{\theta}$.

**Figure 8.**Force ${F}_{z}$ model performance on test data set. The histogram represents the error $e={F}_{z}-{\widehat{F}}_{z}$ distribution—the black vertical line is located at $e=0$, the bins have size $6.15\phantom{\rule{0.166667em}{0ex}}\mathrm{N}$.

**Figure 9.**Visualization of the improvements brought by the KF for the pedal angle estimate $\widehat{\theta}$. The plots above show how the pedal angle estimate $\widehat{\theta}$ compares to the reference values $\theta $ extracted from the video. The histograms show the error $e=\theta -\widehat{\theta}$ distributions, the vertical line is located at $e={0}^{\xb0}$, and the bell curves are the Gaussian distributions $\mathcal{N}\left(\mu \right(e),\sigma (e\left)\right)$, with $\mu \left(e\right)$ and $\sigma \left(e\right)$ being the average error and the error standard deviation respectively. ${R}^{2}$ is the coefficient of determination. (

**A**) accelerometer-only estimation ${\widehat{\theta}}_{a}$; ${\mathrm{RMSE}}_{{\theta}_{a}}=24.{65}^{\xb0}$; ${\mathrm{MAE}}_{{\theta}_{a}}=21.{07}^{\xb0}$; ${\mu}_{{\theta}_{a}}=-2.{74}^{\xb0}$; ${\sigma}_{{\theta}_{a}}=24.{50}^{\xb0}$. (

**B**) KF-estimation $\widehat{\theta}$; ${\mathrm{RMSE}}_{\theta}=16.{72}^{\xb0}$; ${\mathrm{MAE}}_{\theta}=13.{20}^{\xb0}$; ${\mu}_{\theta}=-2.{85}^{\xb0}$; ${\sigma}_{\theta}=16.{48}^{\xb0}$.

**Figure 10.**Average magnitude of the force exerted on pedal over time. Here, a section of a large assessment is shown. The averages are computed over $1\phantom{\rule{0.166667em}{0ex}}\mathrm{s}$ bins. The bars’ heights are the average force magnitude over the bin, and the error bars span plus and minus one standard deviation.

**Figure 11.**Pedalling forces breakdown. Post-session analysis showing breakdown of forces for different crank angles.

**Figure 12.**Pedalling force and force symmetry over crank angle. Histogram of the magnitude of force exerted on pedal as a function of the crank angle averaged out throughout the session.

**Figure 13.**Game live-view. Render of the live-view of the game with the kite in the middle following a straight track.

**Figure 14.**Game back-end logic depiction. This flowchart illustrates the signals flow running on the tablet while the patient is ‘playing’.

Estimate $\widehat{\mathit{\xi}}$ | Load | ||
---|---|---|---|

${\mathit{F}}_{\mathit{x}}$ [N] | ${\mathit{F}}_{\mathit{z}}$ [N] | ${\mathit{M}}_{\mathit{x}}$ [Nm] | |

${\mu}_{\xi}$ | $2.596\times {10}^{-11}$ | $5.072\times {10}^{-12}$ | $1.576\times {10}^{-12}$ |

${\sigma}_{\xi}$ | $35.51$ | $38.84$ | $0.260$ |

${\mathrm{MAE}}_{\xi}$ | $18.82$ | $25.31$ | $0.153$ |

${\mathrm{RMSE}}_{\xi}$ | $35.51$ | $38.84$ | $0.260$ |

${R}_{\xi}^{2}$ | 0.772 | 0.929 | 0.937 |

${\alpha}_{\xi}$ | $3.16\times {10}^{-5}$ | $1.00\times {10}^{-5}$ | $3.16\times {10}^{-8}$ |

_{x}∈ [−189.72, 243.81] N, F

_{z}∈ [−244.12, 555.28] N, and M

_{x}∈ [−2.618, 3.329] Nm. R

^{2}and α are the coefficient of determination and the LASSO regularization parameter respectively, and are both unit-less.

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Schaer, A.; Helander, O.; Buffa, F.; Müller, A.; Schneider, K.; Maurenbrecher, H.; Becsek, B.; Chatzipirpiridis, G.; Ergeneman, O.; Pané, S.;
et al. Integrated Pedal System for Data Driven Rehabilitation. *Sensors* **2021**, *21*, 8115.
https://doi.org/10.3390/s21238115

**AMA Style**

Schaer A, Helander O, Buffa F, Müller A, Schneider K, Maurenbrecher H, Becsek B, Chatzipirpiridis G, Ergeneman O, Pané S,
et al. Integrated Pedal System for Data Driven Rehabilitation. *Sensors*. 2021; 21(23):8115.
https://doi.org/10.3390/s21238115

**Chicago/Turabian Style**

Schaer, Alessandro, Oskar Helander, Francesco Buffa, Alexis Müller, Kevin Schneider, Henrik Maurenbrecher, Barna Becsek, George Chatzipirpiridis, Olgac Ergeneman, Salvador Pané,
and et al. 2021. "Integrated Pedal System for Data Driven Rehabilitation" *Sensors* 21, no. 23: 8115.
https://doi.org/10.3390/s21238115