Home / Projects / GATTII

Project 001 // Medical Device // Deployed

GATTII

A patented wearable gait analysis system bringing clinical-grade spatiotemporal measurement from $100,000+ motion-capture laboratories to community physiotherapy clinics in Mumbai — through custom PCB design, real-time embedded firmware, and validated sensor fusion algorithms.

Timeline 2017 – Present
Patent #377581
Funding $120,000
Deployments 100+ Patients
Iterations 7 Prototypes
GATTII wearable system deployed on patient — Mumbai clinic
GATTII custom PCB Rev 7 — Texas Instruments ESP32-S3 module
GATTII worn system — 7th iteration deployed at Mumbai physiotherapy clinic
Custom PCB Rev 7 — ESP32-S3 + TI module in 3D-printed enclosure mounted to shoe

// 01 — Problem Statement

The $100,000 Diagnostic Gap

Quantitative gait analysis is the clinical gold standard for diagnosing and monitoring a wide range of neurological and orthopedic conditions — Parkinson's disease, post-stroke rehabilitation, osteoarthritis, and pediatric gait disorders. By measuring 24 spatiotemporal parameters during walking (stride length, cadence, step symmetry, ground reaction forces, joint angle profiles), clinicians can detect subtle deterioration months before symptoms become clinically apparent and objectively track recovery trajectories.

The problem is cost and infrastructure. Laboratory-grade motion capture systems — Vicon, BTS SMART, AMTI force plates — require dedicated rooms, multi-camera arrays, and force-embedded flooring. Capital costs range from $80,000 to $250,000, with annual maintenance contracts in the $15,000–$30,000 range. These systems exist in major hospital research centers. They do not exist in the physiotherapy clinics and elder-care facilities where the patient population that most needs routine monitoring actually receives care.

In Mumbai — a city of 20 million with one of the world's highest concentrations of neurological patients per capita — the standard of care in community clinics is visual gait observation: a physiotherapist watching a patient walk and making subjective notes. This is inconsistent between practitioners, unquantifiable, and incapable of detecting subtle changes between visits.

The Core Question

Can we deliver the same 24 clinical parameters as laboratory systems using wearable sensors that cost 100× less, require no dedicated room, and produce a report a physiotherapist can act on in five minutes?

Clinical Need Context

Lab system cost $80K – $250K
GATTII system cost <$500
Setup time (lab) 45–90 min
Setup time (GATTII) <5 min

// 02 — System Architecture

Full-Stack Medical Device Design

GATTII is a three-module wearable system: two instrumented shoe insoles (left and right) and a waist-mounted processing unit. Each insole houses an IMU array and FSR pressure sensor grid. The waist unit handles Bluetooth aggregation, local computation, and TCP/UDP streaming to a FastAPI backend that generates the clinical report.

Hardware Layer

  • ESP32-S3 microcontroller (dual-core 240MHz)
  • Texas Instruments CC2652 wireless module
  • 6-axis IMU arrays (MPU-6050, I2C bus)
  • FSR pressure sensor grid (8×8 matrix)
  • Custom 4-layer PCB — Rev 7
  • 3.7V LiPo with BMS protection circuit
  • 3D-printed TPU enclosures (flex-mounted)

Firmware Layer

  • FreeRTOS — priority task scheduling
  • I2C multiplexed sensor polling at 100Hz
  • Dual-channel: UDP (time-critical) + TCP (reliable)
  • Circular buffer with DMA transfers
  • On-device Madgwick filter (quaternion output)
  • Hardware interrupt-driven FSR sampling
  • Watchdog + auto-reconnect on dropout

Processing Layer

  • Quaternion smoothing (SLERP interpolation)
  • EKF-based drift correction
  • Gait event detection (heel strike, toe-off)
  • Pressure map reconstruction (Voronoi tessellation)
  • Center-of-pressure trajectory computation
  • 24 spatiotemporal parameter extraction
  • Bilateral symmetry index computation

Backend + Reporting

  • FastAPI — async data ingestion endpoint
  • PostgreSQL — session and patient storage
  • NumPy / SciPy signal processing pipeline
  • Matplotlib spatial heat map generation
  • ReportLab clinical PDF generation
  • Normative database comparison
  • Session-over-session trend visualization

Design Principle

Every architectural choice traces back to a clinical constraint. UDP over TCP for sensor streaming: latency matters more than reliability for real-time feedback — a dropped packet is better than a 400ms lag. Voronoi over linear interpolation for pressure maps: clinical validity requires matching force-plate CoP trajectories, not just visually plausible interpolation.

// 03 — Hardware Iteration History

Seven Prototypes to Clinical Deployment

Each iteration addressed a specific failure mode discovered in field testing. Lab bench performance was never the problem — the failures always emerged in clinical conditions that couldn't be simulated at a desk.

Rev 1–2
Proof of Concept — Arduino Nano + MPU-6050
Validated that IMU-based gait event detection was feasible. Immediate failure: no wireless sync, massive form factor, 3-second latency. Demonstrated the measurement concept but nothing deployable.
Failure: Form Factor + Latency
Rev 3
ESP32 + Bluetooth LE — First Wireless Attempt
Moved to ESP32, achieved wireless streaming. New failure: BLE's connection interval architecture introduced 160–200ms jitter, making bilateral synchronization across two insoles unreliable. Sync errors of ±3 gait events per session.
Failure: BLE Jitter / Sync Loss
Rev 4
WiFi UDP — Synchronization Solved, Drift Exposed
Switched to WiFi UDP. Synchronization problem solved (<5ms jitter). New failure: IMU drift became apparent over 30-second walks — cumulative orientation error of ~8° by end of session, making joint angle measurements clinically useless.
Failure: Inertial Drift
Rev 5
FSR Integration + Gait-Event Drift Correction
Added FSR pressure sensor grid. Key insight: pressure data provides natural zero-reference events (heel strike, foot flat, toe-off) at regular intervals — used these to reset IMU quaternion frame every step cycle, reducing cumulative drift by 73%. First version that produced clinically valid joint angle profiles.
Drift Resolved ✓
Rev 6
Custom PCB — First Purpose-Built Hardware
Replaced breadboard-and-module construction with custom 4-layer PCB. Reduced package size by 60%, eliminated connection failures that had been causing mid-session dropouts. Added dedicated LiPo management IC. First version used in patient trials — 18 patients, validation against physiotherapist visual assessment.
Patient Trials Begin ✓
Rev 7
TI Wireless Module + Production Enclosure
Replaced custom RF circuit with Texas Instruments CC2652 for regulatory compliance and transmission reliability. Redesigned enclosure in TPU (flexible) for patient comfort under load. Added hardware watchdog and auto-recovery. Current deployed version — 100+ patient assessments across 5 clinical sites.
Clinical Deployment ✓

// 04 — Technical Challenges

The Hard Problems

Three problems dominated development time and drove the most critical architectural decisions. Each required understanding the physics of the failure before designing a solution.

C1
Inertial Drift in Continuous Motion +

Problem

MEMS IMU sensors accumulate orientation error through two mechanisms: gyroscope integration error (noise integrates over time, growing as √t) and accelerometer inclination error (linear acceleration contaminates the gravity vector estimate during dynamic motion). Standard EKF correction assumes periods of near-zero acceleration for gravity vector realignment — but gait is continuous dynamic motion. Over a 30-second walk, uncorrected drift reached 8–12° in roll/pitch, making ankle and knee angle measurements clinically useless.

Solution

The key insight was that FSR pressure data provides natural zero-reference states within every gait cycle. During foot-flat stance phase (both heel and forefoot sensors at peak load), the foot is nominally horizontal and stationary for ~100–150ms — a valid window for EKF correction using the accelerometer gravity estimate. By triggering drift correction at each detected foot-flat event rather than on a time basis, we anchor orientation to a biomechanically defined reference that occurs ~60–80 times per minute during normal walking. Cumulative drift reduced from 8–12° to <1.5° over a 30-second session.

C2
Real-Time Bilateral Synchronization +

Problem

Computing bilateral symmetry indices — the clinical metric most useful for detecting post-stroke gait asymmetry — requires that left and right insole measurements be temporally aligned to within <10ms. The initial BLE implementation produced sync jitter of 160–200ms due to BLE's connection interval architecture (connections share 7.5ms slots, and retransmission creates unbounded jitter under interference). WiFi solved jitter but the naive TCP stack added 380–420ms end-to-end pipeline latency, making real-time visual feedback to the physiotherapist impossible.

Solution

Dual-protocol architecture: UDP for time-critical sensor frames (accept packet loss — a dropped frame is interpolatable; a 400ms lag is not), TCP for session metadata and report data (where reliability matters). FreeRTOS task prioritization assigns the UDP transmission task the highest priority, preempting all other tasks at the 100Hz sampling interrupt. Hardware timestamps from the ESP32's internal RTC synchronize left/right streams via NTP-style offset calculation at session start. End-to-end pipeline latency reduced from 420ms to 260ms. Bilateral sync error: <4ms.

C3
Pressure Map Reconstruction from Discrete Sensors +

Problem

FSR sensors measure pressure at discrete points. Clinicians need continuous center-of-pressure (CoP) trajectory — the path of the net ground reaction force vector through the stance phase — which is a continuous spatial function, not a point measurement. Naive bilinear interpolation between sensor locations produced CoP trajectories that diverged significantly from force-plate ground truth, particularly at the medial arch where sensor density was insufficient to capture the anatomical pressure gradient.

Solution

Weighted Voronoi tessellation assigns each spatial location to its nearest sensor, weighted by a radial basis function fit to the sensor geometry. Temporal smoothing with a Savitzky-Golay filter removes frame-to-frame noise without introducing phase lag. The CoP trajectory is computed as the load-weighted centroid of active Voronoi cells at each timestep. Validation against a Kistler force plate across 47 healthy subjects: R² = 0.91 for CoP path length, mean lateral deviation <4mm. The one failure mode: CoP estimation at terminal stance (toe-off) degrades as load redistributes to a small forefoot area with low sensor density — flagged in the clinical report with a confidence indicator.

// 05 — Output Data & Clinical Reports

What the System Measures

GATTII computes 24 spatiotemporal gait parameters per session, organized into four clinical categories: temporal parameters (timing of gait events), spatial parameters (distances and angles), kinetic parameters (force distribution), and derived indices (symmetry, variability). The output is a structured PDF report designed to fit a physiotherapist's existing workflow — not a raw data dump.

Plantar Pressure Distribution Maps — System Output

Reconstructed pressure heatmaps from FSR array — 3 stance phases × 2 feet. Warmer colors = higher normalized pressure. Generated automatically per session.

Left foot dorsiflexion phase pressure map
Left — Dorsiflexion
Left foot inversion phase pressure map
Left — Inversion
Left foot progression phase pressure map
Left — Progression
Right foot dorsiflexion phase pressure map
Right — Dorsiflexion
Right foot inversion phase pressure map
Right — Inversion
Right foot progression phase pressure map
Right — Progression

Temporal Parameters

Stride time ±2.1% lab deviation
Cadence (steps/min) ±1.8% lab deviation
Stance / swing ratio ±3.4% lab deviation
Double support time ±4.1% lab deviation
Gait cycle variability ±3.9% lab deviation

Kinetic Parameters

CoP path length R² = 0.91
Peak plantar pressure ±5.2% lab deviation
Pressure symmetry index ±3.7% lab deviation
Mediolateral CoP range ±4.8% lab deviation
Loading rate ±6.1% lab deviation

// 06 — Validation Results

System Performance

Validated against laboratory-grade force plates and motion capture systems across 47 healthy subjects and 53 patients with neurological and orthopedic conditions.

100Hz Sampling Rate
260ms Pipeline Latency
R²=.91 CoP Correlation
<5% Lab Deviation (avg)
<4ms Bilateral Sync Error
24 Gait Parameters

Clinical Validation Note

Validation was conducted in collaboration with Dr. Charmi (physiotherapist, Mumbai) and reviewed by 4 orthopedists and 6 physiotherapists. The criterion for clinical acceptance was <10% mean deviation from laboratory reference on each parameter — GATTII achieved <5% mean deviation across temporal parameters and <7% on kinetic parameters. The one parameter below threshold — loading rate at terminal stance — is noted in the clinical report with reduced confidence.

// 07 — Deployment & Impact

From Lab Bench to Clinical Reality

After seven hardware iterations and 18 months of clinical validation, GATTII is deployed across physiotherapy clinics and elder-care facilities in Mumbai. The system is used for baseline gait assessment at patient intake, and for longitudinal monitoring at follow-up visits to track recovery or deterioration.

Scale

100+ patient assessments across 3 physiotherapy clinics and 2 elder-care facilities in Mumbai. Conditions covered: post-stroke rehabilitation, Parkinson's monitoring, osteoarthritis, pediatric gait disorders.

IP & Funding

Patent granted: No. 377581 (Application No. 201821005734). $120,000 in angel funding secured to scale manufacturing. Provisional manufacturing partnership under evaluation.

Clinical Partners

Developed in direct collaboration with Dr. Charmi (physiotherapist). Validated with 4 orthopedists and 6 physiotherapists. Clinical report format co-designed with practitioners to fit existing documentation workflows.

Economics

System cost per unit <$500 at current component pricing. Target market: community physiotherapy clinics that cannot justify $100K+ laboratory systems. At <$500, GATTII becomes a routine clinical tool rather than a specialized referral resource.

"Seven iterations wasn't perfectionism — it was learning to design within constraints. Battery life. Sensor noise. Human movement variability. Clinical workflow integration. Each iteration addressed one failure mode that couldn't be discovered in simulation."

// 08 — Key Learnings

What GATTII Taught Me

01
Real-world deployment is 90% constraint management. The first three prototypes worked perfectly on a lab bench. Field testing in physiotherapy clinics revealed failures that were invisible in controlled conditions — ambient WiFi interference, patient variability in shoe fit, clinician workflow mismatches. Constraints are not obstacles to route around; they are the design problem.
02
Medical validation requires changing workflows, not just matching numbers. It's not sufficient to show R² = 0.91 against a force plate. Clinicians must trust the system enough to act on its output, integrate it into a 20-minute appointment, and explain it to patients. The report format, setup time, and failure communication matter as much as measurement accuracy.
03
Multi-modal sensing is architecturally harder than it looks. Fusing IMU and FSR data isn't just combining two streams — the failure modes of each modality interact. IMU drift correction depends on FSR event detection quality; FSR event detection depends on sensor placement that changes with shoe fit. The coupling between subsystems becomes the hardest engineering problem.
04
FreeRTOS task design determines system behavior more than algorithm quality. A perfect sensor fusion algorithm running in a poorly prioritized task produces worse real-world results than a simpler algorithm with correct scheduling. Getting the task priority, stack sizes, and inter-task communication right was more impactful than algorithmic improvements.
05
Communicate failure states explicitly. The system knows when its estimates are less reliable — at terminal stance for CoP, or when a sensor has intermittent contact. Hiding this from clinicians produces dangerous overconfidence. Flagging uncertainty in the report with a confidence indicator is not a weakness; it is the mark of a trustworthy clinical tool.

Interested in Medical Device Development?

I'm seeking full-time roles in robotics, embedded systems, or ML engineering — with a focus on medical technology and wearable devices. Graduating May 2026.

Get in Touch ← All Projects