0
\$\begingroup\$

For inverter closed-loop controlled PMSM motor, if we want to realize a high speed accuracy at steady state, say 0.2%, i.e., +/- 2rpm at 1000rpm, must the PWM accuracy be better that it? Or is it more about PWM resolution?

My understanding is that the PWM resolution must be better, say 12-bit, and then resolution is not a problem. One the other hand, PWM accuracy is affected by MCU clock, which is affected by external crystal/oscillator. If PWM accuracy must be better than motor control's accuracy, then I have to be very careful when selecting the components.

[updated]

Another issue is the motor speed measurement. For such higher accuracy motor speed control, I guess encoder is needed, and since 12-bit and even 15-bit incremental encoders are available, so I guess it is more on the speed detection algorithm to make sure the measured speed accuracy is better than 0.2%. Any suggestion on encoder processing algorithm?

The motor load is a slow changing one and the variation is roughly +/- 5%.

[update-2]

Let's not talk about cases like flywheels where the inertia is huge to help stabilize the speed. I think a proper analogy would be a blender blade driven by a PMSM motor with encoder, blending a small amount of fruits.

\$\endgroup\$
20
  • \$\begingroup\$ You're not looking at a truly linear relation, so for fine speed control you use speed feedback instead of voltage/current feedback. For a constant load, an alternative is to measure actual speed output over the entire drive range and scale the duty cycle in software as necessary. 0.2% is fairly fine, so even with speed feedback you have a significant challenge without an engineering degree. For pure speed measurement Hall sensors are common and for fine position which allows speed measurement you might want to look into rotary encoders. \$\endgroup\$
    – K H
    Commented Mar 10, 2021 at 2:30
  • \$\begingroup\$ I'm not an engineer so I won't write that as an answer unless one of the engineers confirms as there may be options I'm not seeing. In the meantime, you should define your project better to improve your question. What is the load? Is it variable? Do you need high precision or just high accuracy(precision would be tightly controlled speed, accuracy refers to how correct the speed is on average rather than how tight the control is. Google "Precision VS Accuracy" if this is not clear. \$\endgroup\$
    – K H
    Commented Mar 10, 2021 at 2:35
  • \$\begingroup\$ If you need both high precision and high accuracy, you need a high switching frequency and a low delay on your control response and/or predictive feedback. \$\endgroup\$
    – K H
    Commented Mar 10, 2021 at 2:36
  • 2
    \$\begingroup\$ You have a control loop to vary the pwm duty cycle in order to control the motor’s speed. The motor’s speed and the ability to change that speed (inertia) is significantly slower than your pwm signal (say 20kHz). So, 8 bit resolution on the pwm is probably more than enough to satisfy your speed precision requirements. Similarly with encoder resolution - speed is based in time, so there’s some integration happening. Being able to measure the instantaneous speed with sub-degree resolution is useless as the ability for the motor and everything connected to change speed significantly is not likely \$\endgroup\$
    – Kartman
    Commented Mar 10, 2021 at 3:29
  • 1
    \$\begingroup\$ For that precisions you really need a closed loop control. A motor in service would have a somewhat varied load (even only dust on the bearings!) so you just can't estimate from the torque the real speed. Unless of course you are using a synch motor. Even BLDC uses hall sensors to determine rotor position (and speed control is easy then) but sensorless BLDC has big issues at low speeds \$\endgroup\$ Commented Mar 10, 2021 at 7:35

4 Answers 4

2
\$\begingroup\$

Let's not talk about cases like flywheels where the inertia is huge to help stabilize the speed

But we are. With typical modern microcontrollers and their built-in PWM generators, and typical motors, the motor itself is a flywheel -- not to mention the blade you're putting on it. Consider this motor, which is designed to have low inertia (and is absurdly expensive for whacking fruit to bits). It's a coreless motor, which means it has maybe five to twenty times less inertia than a brushless motor.

It has a mechanical time constant, by itself, of 4.87ms. That means that this absurdly quick-responding motor acts like a 1st-order lowpass filter with a 3dB frequency of 32Hz.

To heap absurdity on absurdity, let's say you're driving the motor PWM with a super-cheap microprocessor like an Atmel 8-bit part, and that for some reason you've decided to use the 8-bit timers. So you have an effective PWM resolution of 1 in 128. Even an ATMega will handle updating the PWM at 10kHz -- so assume that.

Now, you've got a resolution of 1:128 -- which is way worse than the 1:500 (0.2%) that you're calling out. If you simply dither the PWM at 625Hz, you can increase your effective resolution by a factor of 16 -- that puts you well above the 1:500 that you need. Better yet, implement a simple 1st-order sigma-delta modulator in your software, then you'll extend the effective resolution of the PWM by approximately 300, or a hair over 15 bits. You could contemplate implementing an even higher-order sigma-delta, but you're already at a ridiculous level of resolution compared to what you need, so why go there?

\$\endgroup\$
1
\$\begingroup\$

The accuracy of a PWM signal may be much better than you think. If you really mean the accuracy of the duty factor then it is independent of small variations in the processor's clock frequency. The duty factor is the ratio of the pulse high time to the pulse period, and both of these are integer multiples of the processor clock frequency. So, the actual clock frequency cancels out.

The only way the accuracy would suffer is if the clock frequency changed significantly during each period of the PWM output. That is certainly possible, but the effect is probably much less than absolute crystal accuracy and temperature variation.

Having said all that, I don't know if this is the best way to control your motor.

\$\endgroup\$
2
  • \$\begingroup\$ The duty factor cancels out the clock inaccuracy makes a lot of sense! In that case, the resolution of PWM seems more important because it decides how fine the duty ratio could be. Of course, the crystal accuracy (+/-0.5% is quite common) and temperature drift will also affect it. I am curious about your last statement. What in your opinion could be a better way to control the motor in the assumed blender scenario if the speed accuracy is required? \$\endgroup\$ Commented Mar 11, 2021 at 2:55
  • \$\begingroup\$ Maybe I should have been more clear. I don't have the right background to recommend techniques for motor speed control, I just wanted to address the PWM accuracy issue. \$\endgroup\$ Commented Mar 11, 2021 at 13:02
1
\$\begingroup\$

The accuracy of an optical encoder is important to factor in. The optical encoder measures discrete changes in angular position, so your position error is at most one encoder count. This encoder error will manifest itself in the speed calculation because you need to differentiate the angular position (\$\theta\$) with respect to the sampling time (\$T\$) to get angular angular velocity (\$\omega\$). Differentiation is done numerically using the current encoder count \$\theta_{i}\$ and the last sampled encoder count \$\theta_{i-1}\$.

\begin{equation} \omega = \frac{\theta_{i}-\theta_{i-1}}{T} \end{equation}

We know that the largest error is 1 encoder step count. This means that the speed error can be computed as the following:

\begin{equation} \omega_{error} = \frac{\theta(1)}{T} \end{equation}

So the time between encoder samples and encoder resolution both effect error of your measurement. Example: A 12 bit encoder has 1024 Periods Per Revolution (PPR). This means that there are 4*1024= 4096 individual steps. This means that each step represents 0.0878 degrees. Now imagine if you sampled this measurement every 0.01 sec.

\begin{equation} \omega_{error} = \frac{\theta(1)}{T} = \frac{0.0878}{0.01} = 8.78 \frac{deg}{s} = 1.46 rpm \end{equation}

So the longer you sample the encoder the better resolution you get. Typically, I use a running average to filter the numerical result (\$\omega\$), which reduces noise and provides a bit more stability for your controller.

Regarding PWM, I can't comment unless you are more specific about what you are doing. It is important to note that for your control algorithm you must use an integrator to reject torque disturbances and hit target speeds.

\$\endgroup\$
1
\$\begingroup\$

PWM (resolution and frequency) does influence the velocity accuracy via the torque production.

velocity ripple is a form of acceleration (and deceleration) and this is influenced by the load inertia and torque. \$T = J \alpha \$

For a stabilized system where the load torque equals the torque production, there is no more acceleration and a steady velocity has been reached. However if there is any torque perturbation this will manifest itself as acceleration -> velocity ripple

Torque is current multiplied by the torque constant \$T = K_t \cdot i\$. So current ripple can produce torque ripple that causes velocity ripple.

When you control a motor via PWM your aim is to control the "average" current. There will always be a ripple as the current rises and falls

enter image description here

Higher the frequency, the lower the current ripple (and thus lower torque and velocity ripple) Selection of PWM switching frequency in BLDC motor

Now what about PWM resolution? This also plays a part since the smallest duty is never small enough for the controller to exactly command the duty that is required to meet the command and thus what occurs is the controller will toggle between the two closes representable duty cycles. If your controller has a resolution of 1% then the controller will do something like this: 4% -> 5% -> 4% if 4.5% was required. This toggling results in smaller, larger, smaller voltage being applied to the motor and thus another source of ripple.

How much of an impact this has on your system depends on the update rate, the delta duty and also the propagation delay through interface chips.

\$\endgroup\$
1
  • \$\begingroup\$ Good point. It is especially true when the motor inductance is small, like the Maxon motors that use coreless stator winding. \$\endgroup\$ Commented Apr 5, 2021 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.