Remove all stall detection logic, add 100ms current logging

- Removed all STALL_* configuration parameters from config.h
- Simplified motor.h: removed stall-related methods and member variables
- Simplified motor.cpp: deleted checkStall(), resetStallDetection()
- Added frequent current logging (100ms) for data collection
- Removed stall callback system from main.cpp
- Simplified pingpong mode: time-based only, removed stall-return option
- Updated webserver: removed stall warning UI, removed stallReturn checkbox
- Updated status JSON: removed stalled and ppStallReturn fields

This version is for testing with new beefy PSU to collect current data
before designing new stall detection algorithm.
This commit is contained in:
devdesk
2026-02-05 20:59:38 +02:00
parent 241d1ae457
commit fcfee5fa66
5 changed files with 32 additions and 300 deletions

View File

@@ -37,22 +37,8 @@
#define ADC_VREF 3.3f // ADC reference voltage
#define CURRENT_CALIBRATION 1.0f // Calibration factor (measured current / reported current)
// Stall Detection Configuration (delta-based)
// Detects sudden current spikes above the rolling average
#define STALL_DELTA_THRESHOLD 1.2f // Current spike above average that indicates stall (amps)
#define STALL_EMA_ALPHA 0.1f // EMA smoothing factor (0.1 = slow, 0.5 = fast response)
#define STALL_EMA_BASELINE 2.0f // Expected running current baseline for EMA seeding (amps)
#define STALL_STABILIZE_MS 300 // Ignore stalls for this long after motor starts/changes
#define STALL_CONFIRM_MS 50 // Current must exceed threshold for this long to confirm stall
#define DISABLE_STALL_DETECT false // Set to true to disable stall detection
// Under-current stall detection: motor commanded but drawing no current
#define STALL_UNDERCURRENT_THRESHOLD 0.5f // If current below this for too long = stall (amps)
#define STALL_UNDERCURRENT_MS 1000 // Under-current must persist this long to confirm stall
// Repeated spike stall detection: catches oscillating stall (driver protection cycling)
#define STALL_CANDIDATE_COUNT 5 // Number of stall candidates in window to confirm stall
#define STALL_CANDIDATE_WINDOW_MS 2000 // Time window for counting stall candidates
// Current logging interval for data collection
#define CURRENT_LOG_INTERVAL_MS 100 // Log current readings every 100ms
// Web Server
#define HTTP_PORT 80