teemuatlut / TMCStepper

MIT License
515 stars 201 forks source link

Stealthchop voltage across sense resistor - no sinewave? #301

Open iNoob610 opened 7 months ago

iNoob610 commented 7 months ago

hey,

im running a tmc5160 with tmcstepper on my teensy 4.1 with a nema23. I tried to tune my stealthchop frequency and soldered two wires to the R033 sense resistors on the board. I was curious when i first saw my oszi-picture. I have expected it should be a (chopped but still) sinosoidal waveform. Can sb explain why the voltage across the sense resistor looks like that?

scope_0

I tried measuring the other way around, but this was even more confusing. I guess my chopper frequency is around 24khz - which looks fine. Is there any guide how to tune stealthchop for torque and noise as good as possible? For my newbie knowlage the manual is quiet hard to understand.

Kind Regards Yannik

These are my tmcstepper settings

TMC5160Stepper driver1 = TMC5160Stepper(CS_PIN, R_SENSE); driver1.begin(); // Initiate pins and registeries driver1.microsteps(64); driver1.rms_current(2333); driver1.en_pwm_mode(1);
// driver1.en_spreadCycle(true); driver1.intpol(1); driver1.pwm_autoscale(1); // needed for stealthchop driver1.pwm_autograd(1); driver1.pwm_freq(0); driver1.toff(1); driver1.tbl(2); driver1.hstrt(8); driver1.hend(12); // driver1.TPWMTHRS(50);`