teemuatlut / TMC2208Stepper

GNU General Public License v3.0
69 stars 23 forks source link

Motors produce noise & vibration when getting closer to HYBRID_THRESHOLD value. #21

Open Lefuneste83 opened 6 years ago

Lefuneste83 commented 6 years ago

Hello I post my problem here as I believe it is the most knowledgeable place to find a hint of the origin of this issue. I have a custom Prusa i3 made out of 6mm aluminium sheets and high strength 10mm steel bars. All kinematics are correct with very little frictions, and alignments are also proven correct. Power supply is a Meanwell 24V 350W brand new. Voltage does not swing under load. Electronics is a RAMPS 1.4 / Mega setup running Marlin 1.1.x latest bugfix (tried other versions with same behaviour). I use the latest (3 days ago) version of your library.

I have 4 TMC2208 drivers (purchased from blkbox on ebay) with protection diodes (sockets), connected with Y jumper (with 1k resistor on TX) wires to software defined serial ports (standard pinout from pins_RAMPS). M122 gives: Recv: X Y Z E0 Recv: Enabled true true false true Recv: Set current 1000 1000 1000 1000 Recv: RMS current 994 994 994 994 Recv: MAX current 1402 1402 1402 1402 Recv: Run current 17/31 17/31 17/31 17/31 Recv: Hold current 8/31 8/31 8/31 8/31 Recv: CS actual 8/31 8/31 8/31 8/31 Recv: PWM scale 0 0 16 20 Recv: vsense 0=.325 0=.325 0=.325 0=.325 Recv: stealthChop true true true false Recv: msteps 16 16 16 16 Recv: tstep 0 1048575 1048575 1048575 Recv: pwm Recv: threshold 109 76 248 49 Recv: [mm/s] 90.61 130.09 2.01 20.17 Recv: OT prewarn false false false false Recv: OT prewarn has Recv: been triggered false false false false Recv: off time 5 5 5 5 Recv: blank time 24 24 24 24 Recv: hysteresis Recv: -end 2 2 2 2 Recv: -start 3 3 3 3 Recv: Stallguard thrs Recv: DRVSTATUS X Y Z E0 Recv: stst X X X X Recv: olb Recv: ola Recv: s2gb Recv: s2ga Recv: otpw Recv: ot Recv: 157C Recv: 150C Recv: 143C Recv: 120C Recv: s2vsa Recv: s2vsb Recv: Driver registers: X = 0xC0:08:00:00 Recv: Y = 0xC0:08:00:00 Recv: Z = 0xC0:08:00:00 Recv: E0 = 0xC0:08:00:00

My issue is linked to the HYBRID_THRESHOLD triggering.

1/ If HYBRID_THRESHOLD is not set (commented out in firmware) I can run in STEALTHCHOP or SPREADCYCLE to more than 100 mm/s without any issue apart from an increasing heat output from the motors. Drivers are well cooled (forced airflow + dual copper heatsink). It is important to note that in my setup I can print fast in STEALTHCHOP or SPREADCYCLE without any issue (mode set in firmware) up to impressive speeds. The mode is properly set when I specify it in the firmware either to one or the other mode.

2/ If I set the HYBRID_THRESHOLD to any value (tried several times between 60mm/s and 150mm/s) and my movement speed is more than the value set (ie 100mm/s for a 80mm/s threshold), the drivers run in SPREADCYCLE (I can hear the different sound regime), but everything is running fine. If the movement speed is WELL BELLOW the threshold value (ie 80mm/s for a 100mm/s threshold), the movement switches back to STEALTHCHOP. So HYBRID_THRESHOLD seems to work fine.

3/ Now if I set HYBRID_THRESHOLD again to any value (between at least 60mm/s and 150mm/s) but my movement SPEED is SLIGHTLY BELLOW the threshold (ie 95mm/s for a 100mm/s threshold), the motors while moving correctly (no missing steps), produce a terrible ratcheting noise which translates into quite noticeable vibrations in the structure of the printer. Now after rechecking several times lots of parameters, I realised today that this ratcheting noise always happens in this case, no matter what value I set the HYBRID_THRESHOLD level to. For instance it occurs similarly if the move is 65mm/s for a 70mm/s value, 85 against 90, 95 against 100... Behaviour occurs on all 3 axis (with lower values for Z of course). The closer the move speed gets to the threshold value, the stronger the effect, and it seems to be linear (it appears progressively and increases until threshold value is reached). If I try to move with a value above threshold I switch to SPREADCYCLE and it runs smoothly again.

My hypothesis are as follow: -My motors could have a problem (They are original Kysan 42BYGH4806-DC rated up to 1.5A). The problem occurs on all 3 axis, so it would be a wiring issue or design issue from the manufacturer. -There is a parameter in Marlin which I have not seen and which has a link with PWM, switching frequency or another driving parameter. The behaviour I see would then be an indirect effect of this setting. -There is a problem in the way the movement is either coded or interpreted making the speed value jittery (I don't know how the driver detects the speed). -Rsense value, microsteps or other parameters are not properly programmed in the driver by the firmware

The effect is strong and noticeable and now completely reproducible. I have tried various versions of Marlin (1.1.8, 1.1.9 and 3 1.1.x bugfixes).

For the moment I am going to disable hybrid mode completely as STEALTHCHOP is working fine up to 100+mm/s, but I have not been able to find a single post with this issue on the Internet...

For diagnostics purpose I can use an oscilloscope, but I don't have a logic analyser. I'll be glad to provide any settings if needed.

I've included my conf files. Note that in order to disable effectively HYBRID_THRESHOLD I've had to set the value to a very high value, otherwise it would still be active (grinding noise when speed is getting close to axes values, even when commenting the #define HYBRID_THRESHOLD line. Weird... By doing so I print at 100mm+/s in STEALTHCHOP without any problem. conf.zip

Thanks

Lefuneste83 commented 6 years ago

The behaviour was confirmed with TMC2130 as well on Marlin github (link above)