Tame your noisy motor - Dynamic compensation - Embedded.com

# Tame your noisy motor – Dynamic compensation

Part 1 of this two-part series discussed vibration of pulsating loads and offered an introduction to a traditional method to remove the vibration. Here in Part 2, a dynamic method is introduced, showing its performance in a simulation environment as well as running an actual motor performed on a bench using tools that can be purchased by any user.

The following diagram shows an entire Field-Oriented Control (FOC) system using the dynamic vibration compensation block.

click for larger image

Figure 1: Dynamic vibration compensation block (Source: Texas Instruments)

As can be seen in Figure 1, a new block was added, called “dynamic vibration compensation”. This block is used to learn the torque load and provide an output to be used by the feed-forward input of the speed controller. This algorithm requires four main blocks:

1. A speed controller with feed-forward input
2. A table to hold a learning curve
3. A way of extracting a specific member from that table based on an index
4. Calculation of an index to update the learning curve and an advanced index to extract a value from that table

Feed-forward speed controller
The first component to this algorithm is to have a speed controller that can accept a feed-forward term as a third input. Figure 2 is taken from a SciLab simulation, which shows how a speed controller with feed-forward is implemented:

Figure 2: A speed controller with feed-forward implemented (Source: Texas Instruments)

As can be seen, the input Ffwd is taken all the way to the final summation point, providing extra help to the speed controller, independent of the speed reference and the speed feedback.

The algorithm is able to dynamically learn a load profile based on two inputs:

1. Electrical angle information: Even though the mechanical angle is needed internally, it does not have to be aligned with respect to an absolute mechanical position as was the case with the traditional approach outlined in Part 1. The only requirement of the mechanical angle range is that it needs to cover an entire mechanical rotation regardless of its alignment with respect to the mechanical shaft. In this particular implementation of the algorithm, the mechanical angle is calculated within the module, using the electrical angle as the input and taking into account the number of poles in the motor. This is assuming a synchronous motor is present. If an asynchronous motor is being controlled (i.e. induction motor), then the mechanical angle calculation completed inside the module needs to take slip into account. An alternate method for induction motors is to use a mechanical sensor such as an encoder to find the mechanical angle.
2. A measured current value: In the case of FOC, Iq, is responsible for the torque of the motor.

Figure 3 shows the block’s inputs:

Figure 3: Dynamic vibration compensation block inputs (Source: Texas Instruments)

The module needs four parameters in this implementation.

2. Learning Rate. This parameter is a value from 0 to 1 and controls how rapidly the load curve is learned. This will be explained in further detail in the following section.
3. Points. This is the number of points of the compensation table to be used for the learning curve.
4. P. This is the number of poles in the motor. If the electrical frequency is twice compared to the mechanical frequency, then the number of pole pairs would equal 2, and therefore the number of poles (P) = 4.

Figure 4 shows the parameters of the dynamic compensation block:

Figure 4: Dynamic vibration compensation block parameters (Source: Texas Instruments)

Figure 5 shows how the module learns a load dynamically. The table starts with zero (blue line) and then approaches a stable value after some time of learning the curve.

Figure 5: Module dynamically learning a load (Source: Texas Instruments)

If we compare the load table applied to the motor with the final learned table, Figure 6 shows that both curves are very close to each other (green is the load applied to the motor, and blue is the learned load):

Tuning the learning rate
The learning rate can be adjusted depending on two factors: How quickly the user wants to learn the curve, and how much noise is produced by the input to the learning curve. The second consideration is important because the noise is not only coming from the current sensing method itself, but also minor mechanical perturbations that are non-periodic in the system. This information should be filtered out so it does not show in our compensation table.

In order to show the noise, a random load is added to the system, creating a perturbation on top of the torque vs. angle load table.

Figure 8 shows three settings of the learning rate. The blue line shows a very aggressive learning rate of 0.9, green with a learning rate of 0.5 and yellow has a learning rate of 0.1.

Figure 8: Learning rate settings (Source: Texas Instruments)

As can be seen, the yellow line (learning rate of 0.1) is able to filter out the additional random perturbation. However, if the learning rate is too low, the learning time could be too long for a specific application, and a trade-off may need to be made.

Putting it all together
In order to apply the learned load curve, the output “Spd_Ffwd” in Figure 9 is needed for the module. This output is the learned Iq point for the specified mechanical angular position, plus a phase advance. This will be explained in more detail in the next section of this article..

Figure 9: Output of the module (Source: Texas Instruments)

In order to help the speed controller with the load, the output needs to be connected to the feed-forward input of the speed controller.

Figure 10: Output connecting to the feed-forward input of the speed controller (Source: Texas Instruments)

Tuning the phase angle
In a discrete system, there may be several delays when outputting a voltage to the motor, as well as delays related to sensing currents. For example, when implementing an FOC system in a processor, the output voltage goes through a pulse width modulator (PWM), which has delays. The phase advance parameter allows fine tuning of that delay. This is completed by providing the number of table positions from the learned table, so that the appropriate output can be applied to the speed controller’s feed-forward input. The easiest way to tune this parameter is to look at the speed variation after applying dynamic compensation, and change the value so that a minimum amount of speed variation is achieved. For example, phase advance values of 5, 0 and -5 cause the steady state speed variation as shown in Figure 11.

Figure 11: Phase advance values of 5, 0 and -5 cause the steady state speed variation (Source: Texas Instruments)

In this case, a phase advance of zero creates the minimum speed variation.

Simulation results
After tuning our algorithm, the following steady state speed variation is achieved:

Figure 12: Steady state speed variation (Source: Texas Instruments)

The speed variation is about three RPM peak-to-peak, which represents about 1.5 percent peak-to-peak compared to the reference.

By looking at the transient when the algorithm starts learning, users can wait for the learning process to settle before applying the compensation factor to the speed controller. However, speed and vibrations will be immediately improved when the learning process is enabled. Figure 13 shows that the compensation is applied after 0.5 seconds of learning time.

Figure 13: Load learning with dynamic compensation applied (Source: Texas Instruments)

To test the dynamics of this learning process, we learn the load for 0.25 seconds, apply dynamic compensation, and then remove the load completely at 0.5 seconds. This is how the learning process will find that the motor does not have a pulsating load. The learning process lowers the speed variation as time elapses, ending with no speed variations. Directly after the load is removed, the speed distortion is inverted. This explains how the vibration compensation method introduces distortion with the opposite sign, after the load is removed on the first mechanical rotation.

Figure 15 shows how the learning process can begin right away. It also shows when the dynamic vibration compensation algorithm learns the new load, after a step input to the speed controller reference (where we assume the load profile doubles as an example).

Figure 15: Load learning when load changes with speed (Source: Texas Instruments)

In practice, the phase advance angle should be fine-tuned for different speeds in order to get the best vibration compensation. In this example we only used a single phase advance compensation point across the speed range.

It is important to note that since the torque mapping is completed as a function of angle instead of time, the learning process is impervious to speed changes, assuming the load doesn’t change with speed.

Figure 16 shows three curves that represent different speed controller output components when applying a fixed speed command of 200 rad/s. The first curve is the output of the speed controller from the Kp and Ki gains (without the feed-forward term). The second curve shows the output that comes from the feed-forward portion of the speed controller, as it originates from the dynamic vibration compensation module. The third curve is a total speed controller output. The output from the feedback portion of the speed controller diminishes to almost nothing, responding to only small random speed and load variations.

Figure 16: Speed controller output components as the load is being learned and compensated (Source: Texas Instruments)

Experimental results
In this section, we will test the dynamic vibration compensation algorithm on the bench. For the load, we will use a motor with a sensor attached to it. It will run in torque mode, commanding the following torque vs. angle curve:

Figure 17: Torque vs. angle curve for load motor (Source: Texas Instruments)

Using the two-motor dyno kit from Texas Instruments, shown in Figure 18, the load motor (LM) with the above torque profile and a motor under test (MUT) are coupled together.

Figure 18: Two-motor dyno kit (Source: Texas Instruments)

We will run the MUT at 500 RPM and plot the speed of the motor on the scope using a Digital-to-Analog Converter (DAC) output. When the LM does not provide a load, the speed of the motor does not show any perceivable oscillations as shown in Figure 19, where delta Y in mV corresponds to RPM, so 10 mV is 10 RPM.

Figure 19: Peak-to-peak speed variations with no load (Source: Texas Instruments)

When the load motor applies the load vs. mechanical angle profile, we can see the speed oscillations in the MUT as shown in Figure 20:

Figure 20: Speed variations with load at 500 RPM (Source: Texas Instruments)

If we ramp up to 1000 RPM, we see that the oscillations are still present. The speed controller is well tuned, since the average speed is controlled very tightly. However, no matter how stiff the speed controller is, oscillations cannot be completely removed using a traditional PI approach unless a compensation method is used.

Figure 21: Speed variations with load and speed reference step from 500 RPM to 1000 RPM (Source: Texas Instruments)

When we enable dynamic vibration compensation, we can see a transient, where the load is being learned by the algorithm. Here the speed oscillations drop from a peak-to-peak speed variation of 350 RPM to a peak-to-peak value of 45 RPM — almost an order of magnitude improvement!

Figure 22: Enabling dynamic vibration compensation (Source: Texas Instruments)

In order to compare speed reference changes, Figure 23 shows a transient from 500 RPM to 1000 RPM with compensation turned off, and then with compensation turned on.

Figure 23: Transient from 500 RPM to 1000 RPM (Source: Texas Instruments)

Figure 24 shows the learning speed when the load is completely removed. A transient is noticeable, but as soon as the new load is learned, the oscillations are diminished.

Figure 24: Learning speed when the load is removed (Source: Texas Instruments)

Also, Figure 25 shows that the load can reverse signs, effectively creating a completely different load profile that needs to be learned by the algorithm.

Figure 25: Reverse sign of load creates new load profile (Source: Texas Instruments)

The new adaptive method presented in this article can remove undesirable acoustic noise resulting from speed variations in applications with a pulsating torque. This method is available as part of the MotorWare™ libraries. The software and tools used in this article can be obtained from the following web sites:

1. Software with vibration compensation library: ti.com/motorware
2. Simulation software used: scilab.org
3. Development tool used for load motor: http://www.ti.com/tool/drv8301-69m-kit
4. Development tool used for motor under test: http://www.ti.com/tool/drv8312-69m-kit
5. Two motor dyno: http://www.ti.com/tool/2mtr-dyno

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