Strategy for authoring a program that implements basic anti cogging?

Ok, so I am desiging, still, a very low noise fan. Things are looking good but the motor driver needs work. The motor is significantly coggy and I can’t get a lower cogging motor.

Fundamentally I’ve been able to ascertain that the cogging torque is mostly a sine wave at 44 cycles per revolution of the motor. It’s an 11 pole pair motor. I tried to count the detents the motor exhibits by hand, I repeatedly counted 43 but assume I made a mistake and it’s 44.

As a quick refresher, the cogging torque is caused by the magnets being attracted to the iron core of the poles. It’s a torque ripple imposed on the rotational torque which I think is probably not changing with rpm and power level, although the saturation of the core might have an impact, I suspect, that would imply poor efficiency or high power level operation.

What I need is to impose a sine wave of the same frequency onto the voltage waveform, preferrably adjustable inthe main loop, to cause a torque ripple that cancels out most of the cogging torque. Then I’ll connect a potentiometers I think (if there is a pin for that handy on the adc) and adjust the amplitude during operation till the noise is iminimal by reading the adc and using that as an adjustment value. Then I can at least do my testing.

My priority is to test the fan to measure the noise the blades are making, but right now all the motor drivers I have make so much noise they drown out the noise from the blades and I cannot get a useful reading.

It can require manual intervention or whatever, I gotta start somewhere.

I am not so good with arduino although I know some I have difficulty.

So my question is can anyone think of a good strategy to atttack this? If I take the position in radians, multiply by 44, make it a global variable that can be accessed, and insert a function in between function that gets the voltage for the waveform (before it gets converted to a PWM value) and imposes that little voltage ripple the way I want, by looking up the sine of the position in radians multiplied by 44, adds it to the previous voltage , then feeds it back where the voltage is supposed to go.

So I jack in in the right point and impose the ripple I want, with the right phase, which should mostly cancel the cogging ripple. Makes sense? The ideal voltage amplitude will probably not stay constant across rpm, but I can do something that works best at the goal rpm (300 rpm) and will still work a bit at other rpms.

Enough I can get a measurement and learn more, basically.

I’m trying to use the QVADRANS but I only have 1 left so if I fry it I may need to pull out my B-g431-ESC1 boards.

Sounds like a plan. I would have guessed 22 detents per revolution, but if you measured 44, try that first. I’m also not sure what the phase should be, so it would be nice to have a second potentiometer to hunt for that too.

As usual, the STM32’s uselessly slow implementation of analogRead will be a problem. You’ll either need to manually set up ADC2 to read the potentiometer(s), or you may be able to use a second InlineCurrentSense with ADC2 pins to do it. Here’s my quick reference image for the ADC pins. PA0-2 are the motor’s current sense on Qvadrans, so maybe use PA4 and PA5.


If that doesn’t work, you could use servo testers which output a pulse that can be read by digital pins using interrupts.

I’m not sure exactly where would be the “proper” place to inject the ripple voltage, but for initial testing I’d just stick it in loopFOC
setPhaseVoltage(voltage.q + cog_amplitude * _sin(electrical_angle * cog_multiplier + cog_phase), voltage.d, electrical_angle);
For 44 detents, cog_multiplier would be 4 since electrical_angle is already multiplied by pole pairs.

1 Like

Is that the best way to go? Add another bunch of sine-math to the already delayed control algo?
If you only want to test your fan blades, why don’t you decouple motor and fan with a remote drive using e.g. a belt or use a switched reluctance motor instead?
Those SR motors are meant to be cogging-free.
They can be found as Capstan motors in video or audio tape machines. Finding a discrete driver for it might be tricky, tho.

nice, putting it in the main loop like that sounds good, if I can get away with that.

BTW I did search for reluctance motors but I couldn’t find any. BAsically a two phase stepper motor with a low number of pole counts would probably work fine for testing at least. With a TMC2209 driver for instance I was able to get silent motion at 200 rpm with a 200 step per revolution motor, which is I think very similar to a switched reluctance motor operating open loop. With even a slightly lower pole count it could be fine. But I couldn’t find any.

1 Like

What was the bottleneck in that setup? MCU loop time or back-EMF?
Using lower step/turn steppers would probably add torque ripple and noise again, but a driver with higher motorvoltage would not.

You could always use a toothed belt drive and play with gear ratio.

PS: I bought a few used Revox Capstan motors on ebay and rebuilt them to BLDC motors.
I’m sure you still find used ones in the bay.

1 Like