Automatic StallGuard2 Tuning Tool with Current Reduction.
This tool automatically tunes the StallGuard2 Threshold (SGT) for a specific motor and velocity configuration using the comprehensive AutoTuneStallGuard function. It implements the tuning algorithm following Trinamic application note AN-002 guidelines:
- Saves current motor settings (current, CoolStep, etc.)
- Applies current reduction for safer tuning and improved sensitivity
- Disables interfering features (CoolStep, filter, stop-on-stall)
- Moves the motor at a constant velocity
- Monitors the SG_RESULT (StallGuard value) across SGT range
- Adjusts SGT until a stable non-zero SG_RESULT in ideal range (100-500) is obtained
- Validates at min/max velocities
- Restores all saved settings (except optimal SGT)
USAGE:
- Ensure the motor is free to move (no load or minimal load).
- Run this tool.
- The tool will output the found optimal SGT value and velocity range analysis.
- Use this SGT value in your application.
- Author
- Nebiyu Tadesse
- Date
- 2025