Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMC2130 support #101

Closed
Richardgriff opened this issue Jan 5, 2018 · 166 comments
Closed

TMC2130 support #101

Richardgriff opened this issue Jan 5, 2018 · 166 comments

Comments

@Richardgriff
Copy link

Hi,

With the release of the prusa mk3 which now has new controlboard which has the option of an on board raspberry pi.

I think it would be nice if slipper could support the mk3

@dragonnn
Copy link

dragonnn commented Jan 5, 2018

It is mostly compatible, since the board is on a AVR and is RAMPS like. I think only we are missing TMC2130 support.

@hg42
Copy link

hg42 commented Jan 5, 2018

cruwaller already has a branch with tmc2130 (and a smoothie compatible, or both), I already compiled it and will probably test it at the weekend

@Richardgriff
Copy link
Author

Would like to try. Please let me know if you get this working

@Diederikvanderpant
Copy link

Hi, i am also interested in testing this somewhere in the next month. Just installed tmc2130 on my megatronics 2 board. Where could i find this cruwaller branch?

@simonlee
Copy link

Would be amazing if this worked with prusa mk3 + octoprint. The prusa firmware has a bunch of features which I assume would not have equivalences in klipper such as the auto leveling stuff and filament detection/crash detection...

@simonlee
Copy link

simonlee commented Jan 26, 2018

actually cruwaller does not have a tmc2130 branch anymore. I think he deleted it.

whats the level of effort for getting klipper to utilize stallguard2 via spi

@hg42
Copy link

hg42 commented Jan 26, 2018

on 2017-12-26 he merged tmc2130 branch into lpc176x, where he is testing it now, see for example klippy/drivers/tmc2130.py

Also, his latest commit in lpc176x branch has the comment
"TMC2130 debugging continues. Works with AVR now, Due to go..."

@hg42
Copy link

hg42 commented Jan 26, 2018

unfortunately he did not answer my questions on his github mail address or in any of my issue comments (explicitly asking @cruwaller).

He has a bunch of changes that would be useful, e.g. things like allowing any order of ^! for pin definitions or suppressing some compiler warnings.

@cruwaller
Copy link
Contributor

@hg42 sorry :(
I missed your email.... I will send you a response soon.

@cruwaller
Copy link
Contributor

Others, TMC2130 branch is merges to lpc176x (all my mods are there now). It still supports same MCU as original...
TMC2130 drivers are working great now incl sensorless homing (i running my corexy setup on RADDS)...

@NeelD87
Copy link

NeelD87 commented Jan 31, 2018

@cruwaller so TMC2130 should now work in ramps config?

@simonlee
Copy link

@cruwaller I see there is an ss_pin for CS/SS but what about for the diag pin?

@hg42
Copy link

hg42 commented Jan 31, 2018

from what I know about TMC2130 the diag pin is not needed, because you can write/read values via SPI.
The diag pin could be used to signal some condition (e.g. stall detection) to the outside world. This could allow to use a diag pin as endstop.

Which usage do you mean/want/think of?

@simonlee
Copy link

my printer is the prusa mk3 which i believe uses the diag pin for the endstop. ive tried setting the endstop pin to use the diag pin but no detection. there are many other issues im having and i doubt i can get this to work correctly without expert aid.

@hg42
Copy link

hg42 commented Jan 31, 2018

@cruwaller how did you connect the TMC2130?

I once had a plan to program the diag pin to signal stalls and simple connect it to an endstop input.
This way you could program the TMC at start and then forget it.
But may be there are benefits form reading values (force etc.) while printing. Also the stall detection may differ depending on speeds (e.g. homing speed). So there are definitely more usages.

@hg42
Copy link

hg42 commented Jan 31, 2018

@simonlee not that I currently use the TMC2130, but did you look at the example config files?

[driver tmc2130_x]
type:               TMC2130
#steps_per_mm:       400
steps_per_mm:       100
# SPI
ss_pin:             driverxy:ar7
spi_mode:           3
spi_speed:          2000000
# config
current:            1500.0
microsteps:         8
#microsteps:         32
mode :              spreadCycle
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        0
sensor_less_homing: 1
stealth_max_speed:  40
stall_threshold:    19

so you select a function for the diag pins 0 and 1.
You said that one diag pin is connected to the endstop input (you don't need to configure this, it's a cable!).
You need to make sure that the diag pin that is connected to the end stop has the stall function.
If it is not diag1, you have to swap the diag0 and diag1 names in the section.

For example, if you have diag0 connected to the end stop input, then it has to be

diag0_out:          stall
diag0_active_high:  1

and either you omit diag1 or you set it like this

diag1_out:          temp_prewarn
diag1_active_high:  1

if you want to assign the temperature warning to it.

@simonlee
Copy link

I gathered from this file that the max endstop pin is the diag pin:
https://github.com/prusa3d/Prusa-Firmware/blob/MK3/Firmware/pins_Einy_0_4.h

#define X_TMC2130_CS           41
#define X_TMC2130_DIAG         64 // !!! changed from 40 (EINY03)
#define X_STEP_PIN             37
#define X_DIR_PIN              49
#define X_MIN_PIN            12
//#define X_MAX_PIN            30
//#define X_MIN_PIN              X_TMC2130_DIAG
#define X_MAX_PIN              X_TMC2130_DIAG
#define X_ENABLE_PIN           29

so my config looks like:

[driver tmc2130_x]
type:               TMC2130
steps_per_mm:       400
# SPI
ss_pin:             ^PG0
spi_mode:           3
spi_speed:          2000000
# config
current:            1000.0
microsteps:         32
mode :              spreadCycle
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        1
sensor_less_homing: 1
stealth_max_speed:  40
stall_threshold:    19

...

[stepper_x]
driver: tmc2130_x
step_pin: PC0
dir_pin: !PL0
enable_pin: !PA7
step_distance: .01
endstop_pin: ^PK2

position_min:       0
position_max:       200
position_endstop:   0
homing_offset:      0
homing_speed:       40
homing_direction:   min
homing_retract_dist:5

PK2 is the x diag pin. Not sure if it needs ^ or ! though. I will try swapping the diag0 and diag1 functions.

@hg42
Copy link

hg42 commented Feb 1, 2018

I would try to find out which diag pin is used, there are 3 pins.
Eventually you can follow the copper traces.
With diagX_active_high you can change the polarity.
You can get your endstops and note them.
Then you changexxxx_active high and then send RESTART and see if an endstop changed.
Otherwise you programm another diag pin.
I think I would only configure the one you try. Remove the other.
I think it's not a pullup (no ˆ) and adding a pullup could harm.

@ghost
Copy link

ghost commented Feb 12, 2018

Any progress @simonlee ? I'm stuck in the same position with TMC2130 and RAMPS.
So far I think the SS is for clock select? Either way I was able to move the axis by flashing Marlin, while maintaining power then flashing klipper. Cold start wouldn't initialize which I guess it means SPI is not working on AVR?
It would be wonderful of @cruwaller adds avr example section for one axis as an example.
Back to repetier, cant print loud anymore. Might aswell set my tmc2130 to standalone with an external switch for klipper. Current can be set sensed by stalling/skipping the motor by hand to get the ~800ma default current via the pot. I will miss the sensorless homing though.

@KevinOConnor
Copy link
Collaborator

@TunaLatte , I'm not sure where @cruwaller is with his development, but if someone can forward me a schematic of an AVR board with the TMC2130 then I'll take a look at adding basic support for it. (I need a link to the schematics - a simple document describing which pins on the mcu connect to which pins on the TMC2130.) We already support the TMC2100 on the Replicape, so I don't think it's a big deal to add in basic TMC2130 support.

@herrwusel
Copy link

@KevinOConnor : Check page 10 in the datasheet. Is that what you need?

@simonlee
Copy link

@TunaLatte
I've taken a break from this. I tried the above suggestions but no luck. The steppers do move, but I am not able to figure out how to get it to detect the endstops via the diag pins.

@ghost
Copy link

ghost commented Feb 12, 2018 via email

@simonlee
Copy link

[driver tmc2130_x]
type:               TMC2130
steps_per_mm:       400
# SPI
ss_pin:             ^PG0
spi_mode:           3
spi_speed:          2000000
# config
current:            1000.0
microsteps:         32
mode :              spreadCycle
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        1
sensor_less_homing: 1
stealth_max_speed:  40
stall_threshold:    19

[driver tmc2130_y]
type:               TMC2130
steps_per_mm:       400
# SPI
ss_pin:             ^PG2
spi_mode:           3
spi_speed:          2000000
# config
current:            1000.0
microsteps:         32
mode :              spreadCycle
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        1
sensor_less_homing: 1
stealth_max_speed:  40
stall_threshold:    19

[stepper_x]
driver: tmc2130_x
step_pin: PC0
dir_pin: !PL0
enable_pin: !PA7
step_distance: .01
endstop_pin: ^PK2

position_min:       0
position_max:       200
position_endstop:   0
homing_offset:      0
homing_speed:       40
homing_direction:   min
homing_retract_dist:5

[stepper_y]
driver: tmc2130_y
step_pin: PC1
dir_pin: !PL1
enable_pin: !PA6
step_distance: .01
endstop_pin: ^PK7

position_min:       0
position_max:       200
position_endstop:   0
homing_offset:      0
homing_speed:       40
homing_direction:   min
homing_retract_dist:5

[stepper_z]
step_pin: PC2
dir_pin: !PL2
enable_pin: !PA5
step_distance: 0.0025
endstop_pin: ^PB4

position_min:       0
position_max:       210
position_endstop:   0.15
homing_pos_x:       100
homing_pos_y:       100
homing_offset:      1.5
homing_speed:       3
homing_direction:   min
homing_retract_dist:5
homing_retract_after: true

[extruder]
step_pin: PC3
dir_pin: PL6
enable_pin: !PA4
step_distance: .003571
nozzle_diameter: 0.400
filament_diameter: 1.750
heater: heater_nozzle

[heater_nozzle]
heater_pin: PE5
min_temp: 0
max_temp: 270
control: pid
pid_Kp: 21.70
pid_Ki: 1.60
pid_Kd: 73.76
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF0

[heater_bed]
heater_pin: PG5
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PF2
control: watermark
min_temp: 0
max_temp: 130

[heater_fan extruder_cooling_fan]
heater_temp: 50.0
pin: PH5
heater: heater_nozzle


[heater_fan nozzle_cooling_fan]
heater_temp: 100.0
pin: PH3
heater: heater_nozzle

[mcu]
serial: /dev/ttyACM0

[printer]
kinematics: cartesian
max_velocity: 500
max_accel: 1250
max_z_velocity: 12
max_z_accel: 200

I did not try to swap the diag0 diag1 as @hg42 suggested though.

@ghost
Copy link

ghost commented Feb 12, 2018

Thanks Ill mess around and report asap

@ghost
Copy link

ghost commented Feb 12, 2018

@KevinOConnor In a basic scheme this is how mine is exactly wired now + diag1 (upper pin from the triangular pin order in the following picture orientation.) to the S (signal) endstop pin accordingly per each axis for sensorless endstop :
image
Source:hackaday

@ghost
Copy link

ghost commented Feb 12, 2018

Success!
Well using your config with pin modification worked well except sensorless homing like you said, but after changing stall_threshold from 19 to 4 (0 also works well) its worked perfectly!
I think the value is too high since if you look at cruwaller's example, his current is also too high, which works well with a value like 19. I had the same issue when converting from 12v to 35v.
Time to test stealthchop skipping! Apparently, the reason why it isn't used in marlin, duet (reprapfirmware double step at 100mm/s travel moves afaik) and most firmware is that it doesn't like double or quadstepping, at least thats what Trinamic said. Klipper can save this with 8 bit mcu :) No more noise or spreadCycle.

I'll be dry running a 15 hour print now (with nozzle removed so the extruder motor/calculations are still done) and report back.

Here is my config for RAMPS1.4 with the same wiring as above including the extra (not visible) enstop pins like this from toms3d:
image
(the handwritten stuff are crap, its diag1 if u cant read it)

Config:

# This file contains common pin mappings for RAMPS (v1.3 and later)
# boards. RAMPS boards typically use a firmware compiled for the AVR
# atmega2560 (though other AVR chips are also possible).

# See the example.cfg file for a description of available parameters.

[driver tmc2130_x]
type:               TMC2130
steps_per_mm:       40
# SPI
ss_pin:             ^PB0
spi_mode:           3
spi_speed:          2000000
# config
current:            500.0 #800 minimum under 18v
microsteps:         8 #with interpolation enabled there is less tiny pauses leading to higher accuracy than 16+ MS. Will also offload MCU load. Who needs non repeatable <50micron accurate gt2 20t setup for molten plastic? 16 is useful for non interpolated drivers, to reduce vibrations and noise only on common 3d printers.
mode :              stealthChop
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        1
sensor_less_homing: 1
stealth_max_speed:  300
stall_threshold:    2

[driver tmc2130_y]
type:               TMC2130
steps_per_mm:       40
# SPI
ss_pin:             ^PL0
spi_mode:           3
spi_speed:          2000000
# config
current:            500.0 #800 minimum under 18v
microsteps:         8 #with interpolation enabled there is less tiny pauses leading to higher accuracy than 16+ MS. Will also offload MCU load. Who needs non repeatable <50micron accurate gt2 20t setup for molten plastic? 16 is useful for non interpolated drivers, to reduce vibrations and noise only on common 3d printers.
mode :              stealthChop
diag0_out:          temp_prewarn
diag1_out:          stall
diag0_active_high:  1
diag1_active_high:  1
interpolate:        1
sensor_less_homing: 1
stealth_max_speed:  300
stall_threshold:    2


[stepper_x]
driver: tmc2130_x
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .025
endstop_pin: ar3
#endstop_pin: ^ar2
position_max: 284
homing_speed: 50
position_endstop:   0
homing_speed:       40
homing_direction:   min
homing_retract_dist:1 #important! else you will have endstop timeout error

[stepper_y]
driver: tmc2130_y
step_pin: ar60
dir_pin: ar61
enable_pin: !ar56
step_distance: .025
endstop_pin: ^ar14
#endstop_pin: ^ar15
position_endstop: 0
position_max: 292
homing_speed: 50
homing_retract_dist:1 #important! else you will have endstop timeout error
homing_offset: 34 #adjust when you remove your endstop, I gained around 3-5cmm area on each axis, good for nozzle cleaning pad space :D

[stepper_z]
step_pin: ar46
dir_pin: ar48
enable_pin: !ar62
step_distance: 0.04
endstop_pin: ^!ar18
position_endstop: 0.0
position_max: 310
homing_speed: 10.0

[extruder]
step_pin: ar26
dir_pin: ar28
enable_pin: !ar24
step_distance: 0.00249314385
nozzle_diameter: 0.500
filament_diameter: 1.750
pressure_advance_lookahead_time: 0.010
pressure_advance: 0.05
max_extrude_only_distance: 150
pwm_cycle_time: 0.010
heater: heater_nozzle

[heater_nozzle]
heater_pin: ar10
sensor_type: ATC Semitec 104GT-2
sensor_pin: analog13
control: pid
pid_Kp: 28.853476
pid_Ki: 1.282377
pid_Kd: 162.300802
min_temp: 0
min_extrude_temp: 160
max_temp: 257
pwm_cycle_time: 0.010 #for sensitive power supply, less voltage ripple (e.g no 5V load on ATX PSU)
#*** Thermal protection
protect_period_heat:        20
protect_hysteresis_heat:    4
protect_period:             10
protect_hysteresis_runaway: 10

[heater_bed]
heater_pin: ar8
sensor_type: EPCOS 100K B57560G104F
sensor_pin: analog14
control = pid
pid_kp = 22.2
pid_ki = 1.08
pid_kd = 114
min_temp: 0
max_temp: 170
#max_power: 0.6
pwm_cycle_time: 0.010 #for sensitive power supply, less voltage ripple (e.g no 5V load on ATX PSU)
pid_deriv_time: 10
#*** Thermal protection
protect_period_heat:        20
protect_hysteresis_heat:    4
protect_period:             10
protect_hysteresis_runaway: 10

[fan0]
pin: ar9
cycle_time: 0.1 #for non pwm friendly blowers

[mcu]
serial: /dev/ttyACM0
pin_map: arduino

[printer]
#buffer_time_high: 30 #when running on Rpi Zero or single core SBCs with Octoprint
kinematics: cartesian
max_velocity: 500
max_accel: 1500
max_z_velocity:  10
max_z_accel: 30
junction_deviation: 0.005 #large moving beds, acceleration is not enough

Edit: config was the wrong one, updated.
I highly recommend rewriting the entire config, things like fan0 instead of fan or heater: can be confusing.
Edit2: ~18 hour print worked well, I slept near the printer (same room), stealthChop + vslot is very silent, had to keep looking at the printer to make sure its printing even in close proximity :)
Edit3: After several tests, spreadCycle is completely unnecessary, stealth_max_speed is not needed with klipper. Setting a value like 300mm/s is appropriate where skipping is likely to happen (although it still didn't with a moving bed at 3000mm/s accel!!).

@NeelD87
Copy link

NeelD87 commented Feb 13, 2018

@TunaLatte what printer are you running and what speeds did you manage? with Marlin I have everything running including sensorless homing but the problem is skipped steps and have to run it at slow speeds.

@NeelD87
Copy link

NeelD87 commented Feb 13, 2018

In Marlin you can override the SPI pins , will it be possible in klipper

  • Default pins for TMC software SPI
    */
    #if ENABLED(TMC_USE_SW_SPI)
    #ifndef TMC_SW_MOSI
    #define TMC_SW_MOSI 66
    #endif
    #ifndef TMC_SW_MISO
    #define TMC_SW_MISO 44
    #endif
    #ifndef TMC_SW_SCK
    #define TMC_SW_SCK 64
    #endif
    #endif

/**

  • Use software SPI for TMC2130.
  • The default SW SPI pins are defined the respective pins files,
  • but you can override or define them here.
    */
    //#define TMC_USE_SW_SPI
    //#define TMC_SW_MOSI -1
    //#define TMC_SW_MISO -1
    //#define TMC_SW_SCK -1

@wizhippo
Copy link
Contributor

For corexy does it take into account that both X/Y endstops are involved? Just playing with it and it seems pretty touchy and not sure if that may be part of the issue.

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 23, 2018 via email

@wizhippo
Copy link
Contributor

I'll keep trying. With that change and using the same drive_SGT of 2 I know get Failed to home y: Timeout during endstop homing I'll try some other values later tonight.

@wizhippo
Copy link
Contributor

No success with other settings. The changes cause timeouts.

klippy.log

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 23, 2018 via email

@wizhippo
Copy link
Contributor

I have reverted to your most recent changes and all is working.

I have enabled stealthchop and tried different thresholds 60 100 200 400. I may not have the best tuned parameters for it. I do hear a different, not quite sure it is kicking in at the correct speed though. I'll have to create a test gcode to do so. Will let you know.

@wizhippo
Copy link
Contributor

Ok I took the values from marin and added a few more settings to match the marlin such as setting autoscale. It is working well now. Not sure if you are interested in those changes https://gist.github.com/wizhippo/ba9a5ea341c5785c9638bea99312326c. Can say the autoscaling made any huge difference.

@Alexdad76
Copy link

When stealthchop_threshold (> 0) is enabled:

  1. There were crunches when moving diagonally (at any speed).
  2. The beginning and the end of the movement became very sharp, like a blow.

When stealthchop_threshold (#) is off:

  1. Any movement is almost noiseless.
  2. Start and end movement is soft.
    CoreXY.

@wizhippo
Copy link
Contributor

wizhippo commented May 24, 2018

@Alexdad76 Not sure if it helps but here are the settings I used and have great success with now. I do have active cooling.

[tmc2130 stepper_x]
cs_pin: ar53
microsteps: 16
run_current: 1.000
diag1_pin: !ar3
driver_SGT: 4
stealthchop_threshold: 100
driver_IHOLDDELAY: 8
driver_TPOWERDOWN: 128
driver_BLANK_TIME_SELECT: 1
driver_TOFF: 5
driver_HEND: 2
driver_HSTRT: 3

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 24, 2018 via email

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 24, 2018 via email

@wizhippo
Copy link
Contributor

AllowIng the user to modify pwmconf is best route. I did not measure forces but I did notice that my sensorless homing seemed not as abrupt and I had to increase the SGT from my first tuning. Great addition again thanks for the project.

@Alexdad76
Copy link

Alexdad76 commented May 24, 2018

I chose the parameters by ear, and by
https://www.trinamic.com/fileadmin/assets/Products/ICs_Documents/TMC2130_datasheet.pdf

[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .01
endstop_pin: ^ar3
position_endstop: 0
position_max: 190
homing_speed: 50

[tmc2130 stepper_x]
cs_pin: ar63
microsteps: 8
run_current: .6
hold_current: .1

interpolate: True
#stealthchop_threshold: 50 

driver_IHOLDDELAY: 8 
driver_TPOWERDOWN: 128 
driver_BLANK_TIME_SELECT: 1 
driver_TOFF: 4 
driver_HEND: 0 
driver_HSTRT: 7

@wizhippo
Copy link
Contributor

Your current looks pretty low. Especially the hold current. Usually it’s about %70. I had skipping until after .8

@Alexdad76
Copy link

Alexdad76 commented May 24, 2018

Is hold_current used during movements? I expected that only for holding in a state without movement.
Or during braking, too?

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 24, 2018 via email

@Alexdad76
Copy link

Alexdad76 commented May 24, 2018

I do not know why but when I set


run_current = .8
hold_current = .3

tmc2130 on the Y axis burned out ...
I do have active cooling too.

But I have a couple more :-)

@wizhippo
Copy link
Contributor

I got the odd clicking, this happens when the movement is on the boarder of the threshold. For example with a threshold of 100 and a movement of 90mms I hear the clicks. The movement is ok, just the audible clicks are heard. The latest tmcbranch is working.

@Alexdad76 They burned out? They have over temperature protection.

@Alexdad76
Copy link

Yes, I also read this, but the fact is a fact. Looks like melted micro-contacts around the chip. Presumably, low-temperature solder is used (purchased at the FYSETC Official Store)

@hg42
Copy link

hg42 commented May 25, 2018

the chip protects itself, but this doesn't help outside the chip.

@KevinOConnor
Copy link
Collaborator

KevinOConnor commented May 25, 2018 via email

@KevinOConnor
Copy link
Collaborator

I'm going to close this issue, as it seems basic tmc2130 support is now merged and working.

@nicozorza
Copy link

nicozorza commented Jun 18, 2018

Good afternoon. I've trying to use sensorless homing with the TMC2130 but it seems like the driver is not detecting it has reached the endstop.
If while homing I connect the diag1 pin to power manually, the printer stops, so the interrupt detection is working.
The .cfg file is this:
```[stepper_x]`
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: 0.00625
endstop_pin: tmc2130_stepper_x:virtual_endstop
position_endstop: 0
position_max: 200
homing_retract_dist: 1

[tmc2130 stepper_x]
cs_pin: ar40
run_current: 0.5
microsteps: 8
diag1_pin: ar3
interpolate: 1
driver_SGT: 2

[stepper_y]
step_pin: ar60
dir_pin: !ar61
enable_pin: !ar56
step_distance: 0.00625
position_endstop: 0
position_max: 200
homing_retract_dist: 1
endstop_pin: tmc2130_stepper_y:virtual_endstop

[tmc2130 stepper_y]
cs_pin: ar42
run_current: 0.5
microsteps: 8
diag1_pin: ar14
interpolate: 1
driver_SGT: 2```
Is there something wrong with this configuration?

@fbitto
Copy link

fbitto commented Jun 19, 2018

@nicozorza

This is what I used:

[tmc2130 stepper_x]
cs_pin: ar40
microsteps: 32
run_current: 0.800
hold_current: 0.500
stealthchop_threshold: 200
driver_SGT: 10
diag1_pin: ^!ar3

[stepper_x]
step_pin: ar54
dir_pin: ar55
enable_pin: !ar38
step_distance: .00625
endstop_pin: tmc2130_stepper_x:virtual_endstop
#endstop_pin: ^ar2
position_endstop: 0
position_max: 200
homing_speed: 40
homing_retract_dist: 0

^!ar3 means there is a pull up resistor and the signal is inverted..

I have an arduino 2560 with ramps 1.4.

I had to remap the CS pins (in Marlin) because I have a display with SD card reader. The display is not needed for Klipper but I'm continiously switching between Klipper and Marlin 2.0

@Ofr3d
Copy link

Ofr3d commented May 1, 2019

hi guys, I'm new to Klipper so I went through Alex's guide,
I went on and pasted Kevin's TMC2130 config (https://github.com/KevinOConnor/klipper/blob/master/klippy/extras/tmc2130.py) but I'm getting this error when I try G28 - why is it saying all of this is missing?

Send: G28
Recv: // File contains parsing errors: /home/pi/printer.cfg
Recv: // [line 96]: 'import math, logging, collections\n'
Recv: // [line 97]: 'import bus\n'
Recv: // [line 108]: '}\n'
Recv: // [line 113]: ']\n'
Recv: // [line 124]: '}\n'
Recv: // [line 129]: '}\n'
Recv: // [line 132]: '}\n'
Recv: // [line 145]: '}\n'
Recv: // [line 149]: '}\n'
Recv: // [line 154]: '}\n'
Recv: // [line 158]: '}\n'
Recv: // [line 178]: '}\n'

@jakep82
Copy link

jakep82 commented May 1, 2019

@Ofr3d Please open a new issue and attach your log file. The file you've linked is the python module that enables support for the TMC2130. It is not a config file, and you shouldn't be copying anything from there. All config files are in the config directory, and the TMC2130 example is in example-extras.cfg.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests