|
HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
|
Power stage parameters structure. More...
#include <tmc51x0_types.hpp>
Public Member Functions | |
| PowerStageParameters ()=default | |
| Default constructor. | |
Public Attributes | |
| float | mosfet_miller_charge_nc {10.0F} |
| MOSFET Miller charge in nanocoulombs (used to calculate DRVSTRENGTH) | |
| uint32_t | bbm_time_ns {100} |
| Break Before Make time in nanoseconds. | |
| SenseFilterTime | sense_filter {SenseFilterTime::T100ns} |
| Sense amplifier filter time constant. | |
| OverTempProtection | over_temp_protection {OverTempProtection::Temp150C} |
| Over-temperature protection level for bridge disable. | |
| uint16_t | s2vs_voltage_mv {0} |
| Short to VS detector voltage threshold in millivolts. | |
| uint16_t | s2g_voltage_mv {0} |
| Short to GND detector voltage threshold in millivolts. | |
| uint8_t | shortfilter {1} |
| Spike filtering bandwidth for short detection (0-3) | |
| uint8_t | short_detection_delay_us_x10 {0} |
| Short detection delay in microseconds (0.1µs resolution) | |
Power stage parameters structure.
Configuration parameters for the power stage of the TMC51x0 driver. Uses user-friendly physical parameters that are automatically converted to register values during initialization.
|
default |
Default constructor.
Initializes with recommended default values:
| uint32_t tmc51x0::PowerStageParameters::bbm_time_ns {100} |
Break Before Make time in nanoseconds.
0 = auto-calculate from MOSFET Miller charge (100ns for small MOSFETs, lowest setting). Minimum: 75-100ns (BBMTIME=0, shortest, reset default).
BBMTIME register (bits 4..0, range 0-24):
BBMCLKS register (bits 11..8, range 0-15):
Datasheet hint: Choose the lowest setting safely covering the switching event. Add roughly 30% headroom to cover production stray of MOSFETs and driver.
Typical values:
| float tmc51x0::PowerStageParameters::mosfet_miller_charge_nc {10.0F} |
MOSFET Miller charge in nanocoulombs (used to calculate DRVSTRENGTH)
0 = auto-calculate from default (10nC for small MOSFETs). Based on datasheet table 3.3:
Typical values:
| OverTempProtection tmc51x0::PowerStageParameters::over_temp_protection {OverTempProtection::Temp150C} |
Over-temperature protection level for bridge disable.
0 = 150°C (default) 1 = 143°C 2 = 136°C 3 = 120°C
| uint16_t tmc51x0::PowerStageParameters::s2g_voltage_mv {0} |
Short to GND detector voltage threshold in millivolts.
0 = auto-calculate to recommended default (625mV for VS<50V, equivalent to S2G_LEVEL=6). Detects voltage drop on high-side MOSFET (VS - VBM).
Datasheet voltage thresholds (typical values, depends on supply voltage):
Recommended: 460-800mV for normal operation (VS<50V). Minimum 1200mV if bridge supply voltage can exceed 52V (prevents false triggers at 55V).
| uint16_t tmc51x0::PowerStageParameters::s2vs_voltage_mv {0} |
Short to VS detector voltage threshold in millivolts.
0 = auto-calculate to recommended default (625mV, equivalent to S2VS_LEVEL=6). Detects voltage drop in LS MOSFET and sense resistor (VBM).
Datasheet voltage thresholds (typical values):
Can be set sensitively to detect overcurrent (150-200% of nominal peak current). Recommended: 550-700mV for normal operation, down to 400mV at low current scale.
| SenseFilterTime tmc51x0::PowerStageParameters::sense_filter {SenseFilterTime::T100ns} |
Sense amplifier filter time constant.
0 = 100ns (default) 1 = 200ns 2 = 300ns 3 = 400ns
| uint8_t tmc51x0::PowerStageParameters::short_detection_delay_us_x10 {0} |
Short detection delay in microseconds (0.1µs resolution)
0 = auto-calculate to recommended default (0.85µs, equivalent to shortdelay=0). Total detection delay including 100ns filtering time. Should cover bridge switching time.
Datasheet timing (typical values):
Recommended: 5-11 (0.5-1.1µs) for most applications. Stored as 0.1µs units (e.g., 8 = 0.8µs, 16 = 1.6µs).
| uint8_t tmc51x0::PowerStageParameters::shortfilter {1} |
Spike filtering bandwidth for short detection (0-3)
0 = lowest (100ns), 1 = 1µs (reset default), 2 = 2µs, 3 = 3µs. Good PCB layout allows setting 0, increase if erroneous detection occurs. Helps prevent spurious triggering from PCB layout or long motor cables.