TeslasuitDocumentation
Frameworks

Configuration Reference

Configuration options, parameter ranges, and default values for RapidKit.

System Configuration#

Processing Rates#

  • Backend Loop: 100 Hz (10 ms per iteration)
  • GUI Update: 30 Hz (33 ms per iteration)
  • LSL Streaming: 100 Hz (all streams)
  • Shared Memory: 100 Hz (write rate)

Buffer Sizes#

  • Shared Memory Buffer: 1000 frames (~10 seconds at 100 Hz)

Muscle Parameter Ranges#

Amplitude#

  • Range: 0-100%
  • Default: 0%
  • Typical Range: 20-80%
  • Units: Percentage
  • Purpose: Stimulation intensity

Frequency#

  • Range: 0-100 Hz
  • Default: 0 Hz
  • Typical Range: 30-50 Hz
  • Units: Hertz (Hz)
  • Purpose: Stimulation pulse frequency

Pulse Width#

  • Range: 10-140 microseconds
  • Default: 0 μs
  • Typical Range: 10-140 μs
  • Units: Microseconds (μs)
  • Purpose: Individual pulse duration

Timing Parameters#

All timing parameters are normalized (0.0-1.0) relative to phase duration.

Stance Phase Timing#

  • Range: 0.0-1.0 (0-100% of stance phase)
  • Default: Varies by muscle (see below)
  • Units: Normalized time
  • Purpose: When to activate during stance

Swing Phase Timing#

  • Range: 0.0-1.0 (0-100% of swing phase)
  • Default: Varies by muscle (see below)
  • Units: Normalized time
  • Purpose: When to activate during swing

Default Muscle Timings#

Note: These timing windows are the defaults used by the Walking FES example (examples/walking_fes/). The RapidKit package does not enforce any muscle timing — activation windows are entirely determined by your ControlStrategyBase.process() implementation.

Default activation windows as percentages of phase duration:

MuscleStance StartStance EndSwing StartSwing End
Quadriceps0%33%50%100%
Hamstring0%17%50%100%
Tibialis Anterior0%17%0%100%
Gastrocnemius50%83%0%0%
Gluteus0%67%75%100%

Notes:

  • Values are percentages (0-100)
  • Stance timing: Relative to stance phase duration
  • Swing timing: Relative to swing phase duration
  • Gastrocnemius: Only activates during stance (swing = 0-0)
  • All muscles: Independent left/right configuration

Step Detection Configuration#

Teslasuit API Step Detector#

  • Method: Built-in SDK algorithm
  • Configuration: No user-configurable parameters
  • Output: Binary foot contact (left_foot_contact, right_foot_contact in StepDetectorData)
  • Latency: Low (~0.5 ms)

Control Strategy Configuration#

Note: The following sub-sections describe control behaviour implemented in the Walking FES example (examples/walking_fes/walking_control_strategy.py). The RapidKit package provides no built-in control logic — all behaviour is defined in your ControlStrategyBase subclass.

Gait Phase Detection (Walking FES example)#

  • Method: Foot contact state transitions
  • Phases: Stance (foot on ground), Swing (foot off ground)
  • Adaptation: Automatic based on measured phase durations
  • Averaging: Running average of phase durations

Stimulation Timing (Walking FES example)#

  • Adaptation: Adjusts to walking speed automatically
  • Calculation: Relative timing (0.0-1.0) × measured phase duration
  • Update: Recalculated on phase transitions
  • Precision: Millisecond-level timing

Standing Detection (Walking FES example)#

  • Condition: Both feet on ground simultaneously
  • Action: All stimulation deactivated
  • Purpose: Prevent inappropriate stimulation during standing

LSL Streaming Configuration#

Stream Configuration#

All streams configured with:

  • Sample Rate: 100 Hz (nominal)
  • Synchronization: LSL global clock
  • Source ID: Configurable via source_id argument to ClosedLoopEngine or launch()
  • Enabled by default: No — must pass lsl_enabled=True

Stream List#

Stream nameChannelsContent
TS_Biomechanics29Joint angles
TS_StepDetector2Left/right foot contact
TS_EMSParameters80EMS params (20 muscles × 4 fields)
AppData_ControlMessagevariableStrategy runtime parameters
AppData_UtilityMessagevariableSystem state flags
TS_BonePosition140Bone positions/rotations
TS_RawDatavariableRaw IMU sensor readings

Session Configuration#

Session Folder#

  • Location: data/Session_YYYY-MM-DD_HH-MM-SS/
  • Creation: Automatic on application startup
  • Naming: Timestamp-based
  • Contents: Calibration data (if calibration performed)

Calibration#

  • Trigger: Manual (button click)
  • Data Saved: mocap_calibration_data_[timestamp].csv
  • Location: Current session folder
  • Format: CSV with sensor calibration parameters

Hardware Configuration#

TeslaSuit Connection#

  • Interface: WiFi via TeslaSuit Control Center
  • Control Center: Must be installed and running
  • Connection: Automatic on startup via Control Center
  • Network: TeslaSuit and computer must be on same WiFi network
  • Power: External power bank required
  • Reconnection: Automatic retry on failure
  • Timeout: Configurable (default: 20 attempts)

Suit Calibration#

  • Skeleton Calibration: Automatic on backend startup
  • Motion Capture Calibration: Manual via GUI button
  • Frequency: As needed (first use, after repositioning)

Performance Configuration#

Backend Loop#

  • Target Rate: 100 Hz (10 ms per iteration)
  • Timing: Blocking loop (no sleep)
  • Priority: Real-time processing

GUI Update#

  • Update Rate: 30 Hz (33 ms intervals)
  • Method: QTimer-based
  • Optimization: Only active tab updates continuously

Memory Configuration#

  • Shared Buffer: 1000 frames capacity
  • Frame Size: ~1 KB per frame
  • Total Buffer: ~1 MB
  • Overwrite: Circular buffer (oldest overwritten)

Customization Options#

Changing Update Rates#

Backend Rate (not recommended — loop is hardware-paced):

  • The loop rate is governed by DataStreamer.collect_data(), which blocks until the SDK delivers a new frame (~10 ms). Do not add time.sleep() or other delays.

GUI Rate:

  • Pass a different hardware_init_delay to orchestrator.launch() if the GUI needs more time to wait for the backend.
  • Adjust the QTimer interval in your GUI's update method (default 33 ms = 30 Hz).

Buffer Sizes#

Shared Memory Buffer:

  • Pass size=N to SharedRingBuffer(...) in your on_start() hook.
  • Default 1000 frames (~10 s at 100 Hz). Increase for longer plot history.

Parameter Constraints#

Validation Rules#

  1. Amplitude: Must be 0-100
  2. Frequency: Must be 0-100 Hz
  3. Pulse Width: Must be 10-140 μs
  4. Timing: Must be 0.0-1.0, start < end
  5. Phase Duration: Must be positive

Safety Limits#

  • Maximum Amplitude: 100% (hard limit)
  • Maximum Frequency: 100 Hz (hard limit)
  • Maximum Pulse Width: 140 μs (hard limit)
  • Minimum Phase Duration: 0.1 seconds (estimated)

Configuration Files#

Currently, configuration is:

  • Hardcoded: Default values in code
  • Runtime: Set via GUI
  • Session: Saved in session folder (calibration only)

Future Configuration Options#

Potential configuration file support:

  • Default parameter presets
  • User profiles
  • Session templates
  • Export/import settings

See also#