Closed dzid26 closed 1 year ago
I think you did a very good job, we will test it, but I need to confirm a few points
@mks-viva
I am having trouble understand intention of the #20. He just pasted the code from misfitTech that is not doing anything and isn't compatible with your implementation even (and it wasn't a dead code anyway). He probably just had a placebo effect of seeing any difference. I don't understand what was the issue there in the first place. The original code controls position fine.
The muting affects high frequencies only > 15kHz, so some people may not even hear it at all. It wasn't that loud originally. To be honest I am not sure why this small hissing noise is there in the first place as the PWM runs at much higher frequency 140kHz. I am guessing it's harmonics. Setting VREF_SCALER to 7, 8 or 9 reduces the hissing without noticable effect of lower current resolution. Looking at volume levels I crudely measured with my phone, it seem it is quieter by 20dB at 19kHz peak.
This shows the higher frequency can reduce hissing and is adjustable via VREF_SCALER.
@mks-viva @dzid26 about 1. that's where I made an assumption about how this code should look. https://github.com/makerbase-mks/MKS-SERVO42B/pull/20
+Improved resolution of sine_table values - superseeds "intentions" of this PR https://github.com/makerbase-mks/MKS-SERVO42B/pull/20 +ability to adjust final Vref PWM resolution and frequency using VREF_SCALER (greater value = less resolution but higher PWM freq and less hissing noise). VREF_SCALER=6 is equivalent to original code (32767>>6=511). +Added Extended write/read feature to A1333 driver (ability to set on-chip hysteresis/filtering, etc). +Improved A1333 sequential angle read implementation.