Open FFBoard
Open source force feedback firmware
Loading...
Searching...
No Matches
TMC4671_configs.cpp
Go to the documentation of this file.
1/*
2 * TMC4671_configs.cpp
3 *
4 * Created on: Feb 20, 2024
5 * Author: Yannick
6 */
7
8#include "TMC4671.h"
9#include "constants.h"
10#include "span"
11
12#if !defined(TMC4671_OVERRIDE_HWCONFS) && defined(TMC4671DRIVER)
13// Default configs for officially supported hardware
14
15
17 .name = "v1.0 AD8417 (1.5mOhm)",
18 .hwVersion = (uint8_t)TMC_HW_Ver::v1_0,
19 .adcOffset = 1000,
20 .thermistorSettings = {
21 .thermistor_R2 = 0,
22 .thermistor_R = 0,
23 .thermistor_Beta = 0,
24 .temp_limit = 90,
25 .temperatureEnabled = false,
26 },
27 .currentScaler = 2.5 / (0x7fff * 60.0 * 0.0015), // w. 60x 1.5mOhm sensor
28 .brakeLimLow = 52400,
29 .brakeLimHigh = 52800,
30 .vmScaler = (2.5 / 0x7fff) * ((1.5+71.5)/1.5),
31 .vSenseMult = VOLTAGE_MULT_DEFAULT,
32 .clockfreq = 25e6,
33 .bbm = 20,
34};
36 .name = "v1.2 AD8417 (1.5mOhm)",
37 .hwVersion = (uint8_t)TMC_HW_Ver::v1_2,
38 .adcOffset = 1000,
39 .thermistorSettings = {
40 .thermistor_R2 = 1500,
41 .thermistor_R = 22000,
42 .thermistor_Beta = 4300,
43 .temp_limit = 90,
44 .temperatureEnabled = true,
45 },
46 .currentScaler = 2.5 / (0x7fff * 60.0 * 0.0015), // w. 60x 1.5mOhm sensor
47 .brakeLimLow = 50700,
48 .brakeLimHigh = 50900,
49 .vmScaler = (2.5 / 0x7fff) * ((1.5+71.5)/1.5),
50 .vSenseMult = VOLTAGE_MULT_DEFAULT,
51 .clockfreq = 25e6,
52 .bbm = 20,
53};
55 .name = "v1.2.2 LEM 10 (80mV/A)",
56 .hwVersion = (uint8_t)TMC_HW_Ver::v1_2_2,
57 .adcOffset = 0,
58 .thermistorSettings = {
59 .thermistor_R2 = 1500,
60 .thermistor_R = 10000,
61 .thermistor_Beta = 4300,
62 .temp_limit = 90,
63 .temperatureEnabled = true,
64 },
65 .currentScaler = 2.5 / (0x7fff * 0.08), // w. LEM 10 sensor 80mV/A
66 .brakeLimLow = 50700,
67 .brakeLimHigh = 50900,
68 .vmScaler = (2.5 / 0x7fff) * ((1.5+71.5)/1.5),
69 .vSenseMult = VOLTAGE_MULT_DEFAULT,
70 .clockfreq = 25e6,
71 .bbm = 20,
72};
74 .name = "v1.3 ACS724 (66mV/A)",
75 .hwVersion = (uint8_t)TMC_HW_Ver::v1_3_66mv,
76 .adcOffset = 0,
77 .thermistorSettings = {
78 .thermistor_R2 = 1500,
79 .thermistor_R = 10000,
80 .thermistor_Beta = 4300,
81 .temp_limit = 90,
82 .temperatureEnabled = true,
83 },
84 .currentScaler = 2.5 / (0x7fff * 0.066), // sensor 66mV/A
85 .brakeLimLow = 50700,
86 .brakeLimHigh = 50900,
87 .vmScaler = (2.5 / 0x7fff) * ((1.5+71.5)/1.5),
88 .vSenseMult = VOLTAGE_MULT_DEFAULT,
89 .clockfreq = 25e6,
90 .bbm = 40, // May need longer deadtime
91 .flags{
92 .mot_none = 1,
93 .mot_dc = 1,
94 .mot_bldc = 1,
95 .mot_stepper = 1,
96
97 .enc_none = 1,
98 .enc_abn = 1,
99 .enc_sincos = 1,
100 .enc_uvw = 1,
101 .enc_hall = 1,
102 .enc_ext = 1,
103
104 .allowFluxDissipationDeactivation = 1
105 }
106};
107const auto tmc4671_hw_configs_array = std::to_array<const TMC4671HardwareTypeConf>({conf1_3,conf1_2_2,conf1_2,conf1_0});
108std::span<const TMC4671HardwareTypeConf> TMC4671::tmc4671_hw_configs = tmc4671_hw_configs_array;
109#endif
110
111// Only a single config with default settings. Some defaults can be overridden by defines
112#ifdef TMC4671_CUSTOM_DEFAULT_HWCONF
114const auto tmc4671_hw_configs_array = std::to_array<const TMC4671HardwareTypeConf>({defaultconf});
115std::span<const TMC4671HardwareTypeConf> TMC4671::tmc4671_hw_configs = tmc4671_hw_configs_array;
116
117#endif
@ v1_3_66mv
Definition TMC4671.h:78
const TMC4671HardwareTypeConf conf1_0
const auto tmc4671_hw_configs_array
const TMC4671HardwareTypeConf defaultconf
const TMC4671HardwareTypeConf conf1_2_2
const TMC4671HardwareTypeConf conf1_2
const TMC4671HardwareTypeConf conf1_3
static std::span< const TMC4671HardwareTypeConf > tmc4671_hw_configs
Definition TMC4671.h:629
float vSenseMult