Configurable PWM rate

A project log for moteus brushless controller

Open source, compact, high performance, FOC based BLDC motor control

Josh PieperJosh Pieper 03/28/2022 at 16:350 Comments

moteus is a switch mode motor driver.  That means it alternately switches the phase terminals of the motor between ground and the positive input to either decrease or increase the current through the winding inductance.  Like most switch mode motor drivers, it performs that switching at a fixed frequency.  To date, that has been a fixed 40kHz frequency.

As of firmware release 2022-03-12, this frequency can now be configured to anywhere between 15kHz and 60kHz to give you more flexibility at optimizing various parameters.

There are a few performance measurements that fall out from the switching rate, otherwise know as the PWM rate, short for pulse width modulation.

Efficiency: Lower PWM rates results in higher efficiency for the driver.  That means less power will be used, and the motor driver will generate less heat for a given load.

Peak power: Higher PWM rates result in higher peak power.  moteus is limited in peak power by its bulk capacitance.  Higher PWM rates result in less ripple, so that more instantaneous power can be applied.

Motor speed and control bandwidth: These usually aren't a problem, but the moteus control loop runs at the PWM rate as well.  That means that a lower PWM rate will result in reduced control bandwidth, and a reduced maximum electrical frequency.  The effective control bandwidth and motor speed are not usually limited in this way for most applications though, so it isn't as likely to affect the PWM rate selection.

To get a feel for what you could expect for peak power and efficiency at different control bandwidths, I ran some experiments with an mj5208 motor.

FrequencyPeak Power24V Eff / Idle Thermal36V Eff / Idle Thermal
15kHz190W94% / 0.20W92% / 0.25 W
40kHz500W88% / 0.25W85% / 0.30W
50kHz625W84% / 0.30W84% / 0.35 W