Open Source Motor Controller Makes Smooth Moves With Anti-Cogging

Almost two years ago, a research team showed that it was possible to get fine motor control from cheap, brushless DC motors. Normally this is not feasible because the motors are built-in such a way that the torque applied is not uniform for every position of the motor, a phenomenon known as “cogging”. This is fine for something that doesn’t need low-speed control like a fan motor, but for robotics it’s a little more important. Since that team published their results, though, we are starting to see others implement their own low-speed brushless motor controllers.

The new method of implementing anti-cogging maps out the holding torque required for any position of the motor’s shaft so this information can be used later on. Of course this requires a fair amount of calibration; [madcowswe] reports that this method requires around 5-10 minutes of calibration. [madcowswe] also did analysis of his motors to show how much harmonic content is contained in these waveforms, which helps to understand how this phenomenon arises and how to help eliminate it.

While [madcowswe] plans to add more features to this motor control algorithm such as reverse-mapping, scaling based on speed, and better memory usage, it’s a good implementation that has visible improvements over the stock motors. The original research is also worth investigating if a cheaper, better motor is something you need.

10 thoughts on “Open Source Motor Controller Makes Smooth Moves With Anti-Cogging

  1. ” Why? Sadly, cheap brushless motors simply aren’t mechanically well-constructed enough to offer precise position control because they exhibit cogging torque, an unexpected motor characteristic that causes slight variations in the output torque that depend rotor position. ”

    Cheapness of one with the precision of stepper.

  2. I guess a lot depends on how you define “cheap.” Does this mean “junk bin” or “less than a commercial servo?”

    I bought 25lb of BLDC motors salvaged from HDDs for $23. Seller must have made $8 after shipping! They’re 7W (~0.58A at 12V) and they seem much higher build quality than fan motors. I’ve ordered some microcontrollers with lots of PWM channels with dead-time, now I have to figure out what a 7W motor is useful for.

    What work is this motor capable of that would lead me to wanting high quality control?

    When I look on the internet it seems like I would need to spend over $100 to get a motor rated with comparable torque to a stepper, and those seem to be high quality that test out with constant torque. Am I wrong on one side or the other of that observation?

    1. Stepper motor and servo motor torque ratings are not comparable. Each unit of continuous servo torque might be worth 2-10x a unit of stepper motor torque because peak servo torque can be applied instantaneously when required, whereas a stepper motor is always consuming the same power (and producing the same amount of heat).

      That being said, the primary advantage of servos over stepper motors are the stiffer position control; not torque.

      Shitty hobby BLDC motors are quite unique because they are completely unenclosed and leave the windings and magnets open to the ambient air. This makes them very light and very good at shedding heat.

      A Nema23 stepper motor feels like a brick, a BLDC of similar power rating might be the size of a golf ball. Being completely unprotected comes with its own set of problems (you wouldn’t want to use a hobby outrunner in a milling machine without substantial protection) but for mobile robotics and many hobby applications its a good trade.

      1. I always prefer to compare torque to torque, if it isn’t comparing I figure there might be something else wrong with the formula.

        Obviously, consuming less power is an advantage. But the power supply is more likely sized to the motor than the motor being limited by that. So it is an advantage, but why would it be involved in torque considerations? Won’t the rated torque of the motor account for any heat-based limitation? For example I see some of the 1/10th scale RC motors (which are enclosed) where they’re only rated to some fraction of “throttle” but still designed to take the same voltage, but that’s already considered in their torque ratings.

        Peak torque can be applied instantly with a BLDC, but a stepper gives you peak torque at each step. As long as you’re full-stepping then why would that be different? Assume you’re trying to turn the same lead screw with both, why would the required torque be different? And if it is, what is the formula for the difference?

        Another part I’m curious about, is “shitty hobby BLDC motor” code for quadcopter motor? Does it also apply to the 1/10th scale auto RC motors, which are enclosed and much higher power? Is there basically anything that gets included in this category that isn’t some type of RC motor?

        Do you have an example of a BLDC that is significantly smaller than NEMA23 so I can see what you mean? The ones I’m seeing, I can get a NEMA17 BLDC with similar torque to a NEMA23 stepper for 5x the price. Is that about what you mean?

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.