Expand description
Utility functions for TMC2209 calculations.
This module provides helper functions for common calculations like RMS current, velocity conversions, etc.
Constants§
- DEFAULT_
FCLK - Default TMC2209 internal clock frequency (12 MHz).
- DEFAULT_
RSENSE - Default sense resistor value in ohms (common value).
- VREF
- Internal voltage reference for current sensing (in volts).
Functions§
- calculate_
current_ settings - Calculate CS and VSENSE for a target RMS current.
- cs_
to_ current - Calculate the RMS current for a given CS value.
- current_
to_ cs - Calculate the CS (current scale) value for a given RMS current.
- optimal_
vsense - Determine optimal VSENSE setting for a given RMS current.
- tstep_
to_ velocity - Convert TSTEP register value to velocity in steps/second.
- velocity_
to_ tpwmthrs - Calculate TPWMTHRS for a given velocity threshold.
- velocity_
to_ vactual - Convert velocity in steps/second to VACTUAL register value.