Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9.41k stars 5.3k forks source link

TB6600 support (or stepper timing differences) #1090

Closed Coolaswa closed 5 years ago

Coolaswa commented 5 years ago

I have some TB6600 drivers, which clunk sometimes, shifting an axis thus ruining a print. I need because I have a relatively large printer thus a large torque. These TB6600 are relatively slow chips, and Marlin compensates for this see here. I would like to request similar options in klipper. Or if someone could point me to how to do it would also be appreciated.

Regards

KevinOConnor commented 5 years ago

This has come up a few times before. I updated the configuration process so that one can configure the step pulse delay during "make menuconfig" (commit 2ea7c97b). You'll need to pull down the latest code (see the FAQ for details), rerun "make menuconfig", enable the "low level config options menu", and then customize the step pulse duration (looks like you need 3us).

-Kevin

KevinOConnor commented 5 years ago

Also, you'll need to reflash your board (make flash) after you have completed the above. Note that if you are using an 8-bit atmega chip, then the total number of steps per second that you can achieve will be significantly less once you customize the step pulse duration.

-Kevin

Coolaswa commented 5 years ago

Is the decreased steps the cause of the 'Timer too close' errors I am getting? I decreased velocity by 3x, and I keep getting these errors.

KevinOConnor commented 5 years ago

You'll need to attach the klipper log file containing the event in order for us to assist. See: https://github.com/KevinOConnor/klipper/blob/master/docs/Contact.md

-Kevin

Coolaswa commented 5 years ago

Off course, sorry. This is the result after an xy home, and some 10 cm move in x direction. Speeds have already been tuned down, but even if I go down to 10 mm/s the error remains. klippy.log

KevinOConnor commented 5 years ago

Alas, there was a bug in the stepper code when using a non-zero step delay on AVR chips. It should be fixed now (commit 8a6125c8). You'll need to pull the code again, recompile the micro-controller code and reflash to get the fix.

I suspect that 100mm/s is going to be too fast for your setup - setting a custom step delay on the AVR disables the AVR stepper optimizations.

Separately, if using a multi-mcu setup, I highly recommend you follow the steps at: https://github.com/KevinOConnor/klipper/blob/master/docs/FAQ.md#wheres-my-serial-port

-Kevin

Coolaswa commented 5 years ago

Alright, thanks for your help. The steppers definitely perform better. Speed is now limited to 40mm/s, or 25600 steps/s in a linear motion, beyond that presumably the microcontroller gets overloaded. I will have to look into a new solution for that. Thanks Kevin, closing.

KevinOConnor commented 5 years ago

FWIW, if you just need to go to 3us you could try setting the step delay back to zero and comment out the line if (s->flags & SF_HAVE_ADD) in src/stepper.c. Then recompile and reflash.

-Kevin