teemuatlut / TMCStepper

MIT License
514 stars 202 forks source link

TMC 5160 / GRBL_ESP32 cannot increase current over .500 #144

Open pcdonovan opened 4 years ago

pcdonovan commented 4 years ago

Hello all, I am running Bart Drings 4Axis Daisy_SPI CNC controller https://www.tindie.com/products/33366583/4-axis-trinamic-cnc-controller-for-grbl_esp32/ with BigTreeTech TMC 5160 V1.2 Drivers The set up is an XYYZ machine with NEMA 17 Steppers that are rated to 2.4a This is the firmware Grbl_Esp32-master (4).zip I'm running a 24v 16.4a power supply.

I can run the machine at $X/Current/Run=.500 $Y/Current/Run= .500 but on some cuts it begins missing steps. I have tried to increase the */Current/Run= values, but any change to the default value of .500, one or more of the steppers shuts off while homing the machine with no load.

Bart has assisted me in compiling the firmware, the GRBL_ESP32 uses the TMC Stepper library created here.

Has anyone had issues, trying to increase the current to these drivers? and do you guys have any ideas what steps to take next.

teemuatlut commented 4 years ago

@bdring would likely know more about how the firmware interfaces with the library. I'd need to be more familiar with the code base to be able to say much.

On a generic level, the motor shouldn't stay disabled due to the driver overheating. This is what the datasheet says:

After triggering the overtemperature sensor (ot flag), the driver remains switched off until the system temperature falls below the pre-warning level (otpw) to avoid continuous heating to the shutdown level.

However, a short detection will disable the driver until it is disabled and re-enabled.

Once a short condition is safely detected, the corresponding driver bridge (A or B) becomes switched off, and the s2ga or s2gb flag, respectively s2vsa or s2vsb becomes set. To restart the motor, disable and re-enable the driver.

The diagnostic features of the TMC5160 are described in chapter 11 and can potentially help you debugging.

pcdonovan commented 4 years ago

OK thank you, I guess I need to find out if bdring has programmed in TMC Debugging in the firmware.

pcdonovan commented 4 years ago

@teemuatlut bdring did some testing with with his 5160's v1.1, he confirmed the ability to change the current without issue. My drivers are v1.2. I believe on the newer V1.2 the clk pin is pulled to ground, do you think that could make a difference? I have another set of 5160's on their way tomorrow, Im hoping it will fix the issue but I am doubting it. I may try the 5161's if not I'm going to ditch the step sticks and go external drivers.

bdring commented 4 years ago

My Trinamic controllers have that pin pulled to ground. You could check it.

I don't think the 5160 would work at all without it.

pcdonovan commented 4 years ago

Bart, FYI I bent the clk pin outward and rinstalled the driver, and tested. They operate exactly the same. Good thing is I have the new 5160's waiting for me when I get home from work. I'll update you when I pop them in.

pcdonovan commented 4 years ago

@teemuatlut Upon further testing @bdring could not duplicate the problem. I sent him a sent of drivers I was having issues with and he could not replicate the problem. I was reading the TMC5160 Datasheet and noticed there are some registers for Short_Conf, I had an issue with noise in the limit switch lines I'm wondering if its detecting a false short. Can these registers be changed in the tmcstepper library on my local machine when I compile the software. What directory would I be looking in. Short_conf

pcdonovan commented 4 years ago

I also found this and was thinking could it be the TOFF HEND and HSTRT setting?https://github.com/KevinOConnor/klipper/issues/2516

pcdonovan commented 4 years ago

Any help would be appreciated

teemuatlut commented 4 years ago

The library does support those registers, but I don't know how the ESP GRBL would conveniently configure the values. In Marlin you'd use the TMC_ADV macro. Unfortunately I don't think your unique issues can be solved with software so my suggestion is to simplify your setup down to the very minimal. Use just the board and the drivers. Try with a different motor.

pcdonovan commented 4 years ago

How can I set this to 0 to disable bool diss2vs : 1; // TMC5160 only whenever I set to 0 It fails to compile

teemuatlut commented 4 years ago

diss2vs : 1 is part of a bitfield where the variable diss2vs takes 1 bit. It's not an assignment.

bdring commented 4 years ago

This post has some interesting similarities to the problem.

https://github.com/KevinOConnor/klipper/issues/2516

We will try some chopper changes to see if it helps.

roberthuitema commented 4 years ago

I have exactly the same issues with TMC5161 v1.2 drivers from Bigtreetech. I have 8 drivers and all of them cut out when you set the current over 0.5A as described above. I also bought a single v1.5 TMC5160 from Watterott, this driver also has the same issue.

I also tried with Bart Drings 4Axis Daisy_SPI CNC controller, and later with a Arduino Mega and the TMC stepper library with some of the example code. I tried many settings but no luck.

So is there any progress on this issue?