I’ve done some more investigation of the current sense noise on GooserCS, and it seems the 100nF filtering capacitor does more harm than good. It smooths everything above ~30KHz, but the amplitude of the remaining noise is about the same as it is unfiltered. Here are the data plots for unfiltered, 100nF, and 1uF. Somewhere around 360 microseconds worth of data.
The driver I soldered the good mosfets on has 15A current sensors, so that’s what I’m testing now. 90mV/A sensitivity, and 11mV noise from the datasheet, but I’m measuring around 24 ADC units (19mV, 211mA) typical variation, with occasional spikes reaching up to 72 ADC units peak to peak (58mV, 644mA).
The 1uF smooths everything above ~12KHz, and reduces the amplitude by about half, but oversampling works better. With no capacitor, I can get it down to 10 ADC units (8mV, 90mA) if I average the samples over a 10 microsecond period, and 5 ADC units over 30 microseconds. Diminishing returns beyond that.
The 100nF capacitor doubles the time it takes to get similar results by averaging, and 1uF was even worse, so for now I’ll go with 30us sampling period, unfiltered. Still probably too noisy for foc_current mode on my smallest motors that can only handle around 1.5A continuous, but probably ok for the 10A largest ones. And certainly usable for overcurrent protection in voltage-based current mode on any motor, once I figure out how to go about enforcing it.
Up next: Spinning my old friend, the smallest motor. I machined a stator mount for it with linear halls back then, but never got around to testing it until now. They give good sinusoidal waveforms, and remarkably clean output. Only 3 ADC units of variation when sitting still.