diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-06-27 16:01:22 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-06-27 16:01:22 +0300 |
commit | 989e99119e68e1b413c0babbea1c5ded5e6cfbfe (patch) | |
tree | 2487b1986cedc9a5a1c2dcff26d8c241e62b794f /src/DuetM | |
parent | 0b5f070973004c7008c41a165b1c3d8a557d5622 (diff) |
Improvements to TMX22xx driver
Max current and sense resistor values are now set in the Pins files
Use 32-bit DMA transfers on 5LC
Add PWM_AUTO register to the list of monitored registers
Diffstat (limited to 'src/DuetM')
-rw-r--r-- | src/DuetM/Pins_DuetM.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/DuetM/Pins_DuetM.h b/src/DuetM/Pins_DuetM.h index b7d2141d..73a5d8a9 100644 --- a/src/DuetM/Pins_DuetM.h +++ b/src/DuetM/Pins_DuetM.h @@ -125,11 +125,18 @@ constexpr uint8_t TMC22xx_UART_PINS = APINS_UART0; // So at 500kbaud it takes about 128us to write a register, and 192us+ to read a register. // In testing I found that 500kbaud was not reliable, so now using 250kbaud. constexpr uint32_t DriversBaudRate = 250000; -constexpr uint32_t TransferTimeout = 2; // any transfer should complete within 2 ticks @ 1ms/tick +constexpr uint32_t TransferTimeout = 2; // any transfer should complete within 2 ticks @ 1ms/tick constexpr uint32_t DefaultStandstillCurrentPercent = 75; constexpr Pin TMC22xxMuxPins[3] = { PortCPin(14), PortCPin(16), PortCPin(17) }; // Pins that control the UART multiplexer, LSB first +constexpr float DriverSenseResistor = 0.083 + 0.03; // in ohms +constexpr float DriverVRef = 180.0; // in mV +constexpr float DriverFullScaleCurrent = DriverVRef/DriverSenseResistor; // in mA +constexpr float DriverCsMultiplier = 32.0/DriverFullScaleCurrent; +constexpr float MaximumMotorCurrent = 1600.0; // we can't go any higher without switching to the low sensitivity range +constexpr float MaximumStandstillCurrent = 1400.0; + // Thermistors constexpr Pin TEMP_SENSE_PINS[NumThermistorInputs] = { PortAPin(20), PortBPin(0), PortCPin(30), PortBPin(1) }; // Thermistor pin numbers constexpr Pin VssaSensePin = PortAPin(19); |