|
TMC5160 Driver
API reference
|
Motor current calculation functions for TMC51x0 (TMC5130 & TMC5160) More...
Go to the source code of this file.
Namespaces | |
| namespace | tmc51x0 |
| namespace | tmc51x0::MotorCalcConstants |
Functions | |
| bool | tmc51x0::CalculateMotorCurrent (const MotorSpec &motor_spec, uint32_t sense_resistor_mohm, uint32_t supply_voltage_mv, uint16_t run_current_ma, uint16_t hold_current_ma, uint8_t &irun, uint8_t &ihold, uint16_t &global_scaler, uint8_t chip_version=ChipVersion::TMC5160) noexcept |
| Calculate motor current settings from physical parameters. | |
| uint16_t | tmc51x0::CalculateStealthChopLowerLimit (const MotorSpec &motor_spec, uint32_t supply_voltage_mv, uint8_t tbl, uint8_t pwm_freq, uint32_t f_clk=12000000U) noexcept |
| Calculate StealthChop lower current limit. | |
| uint16_t | tmc51x0::CalculateMaxCurrentForSenseResistor (uint32_t sense_resistor_mohm) noexcept |
| Calculate maximum RMS current for a given sense resistor. | |
| uint8_t | tmc51x0::CalculateS2VSLevel (uint16_t voltage_mv) noexcept |
| Calculate S2VS_LEVEL register value from voltage threshold. | |
| uint8_t | tmc51x0::CalculateS2GLevel (uint16_t voltage_mv, uint32_t supply_voltage_mv=0) noexcept |
| Calculate S2G_LEVEL register value from voltage threshold. | |
| uint8_t | tmc51x0::CalculateShortDelay (uint8_t delay_us_x10) noexcept |
| Calculate shortdelay register bit from detection delay time. | |
Variables | |
| constexpr float | tmc51x0::MotorCalcConstants::VFS_MV = 325.0F |
| constexpr float | tmc51x0::MotorCalcConstants::SQRT2 = 1.41421356237F |
| constexpr float | tmc51x0::MotorCalcConstants::TMC5130_VFS_MV = 320.0F |
| TMC5130 full-scale sense voltage with CHOPCONF.vsense = 0 (TMC5130A datasheet, "Selecting sense resistors"). | |
| constexpr float | tmc51x0::MotorCalcConstants::TMC5130_RSENSE_OFFSET_MOHM = 20.0F |
| TMC5130 internal resistance added to RSENSE in its current formula (TMC5130A datasheet, same section). | |
Motor current calculation functions for TMC51x0 (TMC5130 & TMC5160)