Managing quantization errors in digital motor control systems -

Managing quantization errors in digital motor control systems

Digital control systems offer designers several advantages, includingthe implementation of advanced algorithm capabilities and costreductions. A major design consideration when implementing a digitalmotor control system is the choice of a digital processor.

Designers need to look out for quantization errors that resultfrom the fixed-point representation ofnumbers, as these errors impair control-system performance.

Real-world signals are continuous in time. Digital representationsof signals, on the other hand, are finite precision and are sampled intime, which results in quantization. Obvious sources of quantizationare the ADC, the computation engine due to truncations, round off, overflow and the pulse-width modulation (PWM)generator.

ADC quantization errors can beminimized by using longer word-length ADCs; 12bit ADCs in embeddedcontrollers are common. Designers must also watch out for errorsintroduced when sampling multiple currents. A finite error occurs if asingle ADC is used to sample two currents sequentially.

This can be avoided by using an ADC with dual-sample and holdcircuitry. The most critical area where quantization effects are feltis in the numerical representation of the algorithm. A practical way toanalyze quantization errors is to study the actual digital controllerusing both simulation and experimental analysis. The system shown in Figure 1, below , was executed insimulation and in actual implementation.

Figure1: One of the major design considerations when implementing a digitalmotor control system is selecting the digital processor.

The algorithms were implemented in three formats: 16bit and 32bitfixed point, and 32bit IEEE-754 single precisionfloating-point, all using the same 32bit fixed point digitalcontroller—the TMS320F2812—and the IQmathlibrary for 32bit fixed-point programming.

This IQmath library allows designers to easily and quickly convert Ccode written in floating-point format to 32bit fixed-point format.Because implementing floating- point arithmetic on a fixed pointprocessor is inherently inefficient, the implementation of thefloating-point version required a longer sampling time of 4kHz. Thus,for a fair comparison, the experiment results focused only on the 16bitand 32bit fixed point versions.

To compare the quantization impact among three data formats, theestimated speed responses and corresponding d- and q- axis referencecurrents were monitored.

Figure2: A practical way to analyze the quantization errors is to study theactual digital controller using both simulation and experimentalanalysis.

The 16 bit fixed-point system exhibited false transients andringing, while the 32 bit implementation showed none of these effects (Figure 2, above) . The experimentresults also showed similar performance. In a real system, thesetransients would result in audible noise and vibration (Figure 3, below ).

Sampling frequency
A key consideration for any digital system is the choice of samplingfrequency—the Nyquist criterion. The highestfrequency component in the system ( )must be determined.

The common practice is to choose a frequency that is at leastfourtimes for first-ordersystems. To illustrate this effect, a simple one-pole transfer functionis discretized. The transfer function is given by this equation:

G(s)=s + 100/100

Coefficients don't have issues at a properly selected samplinginterval. With oversampling, however,significant resolution problems arise. Examining the coefficientmagnitudes reveals quantization effects. As the sampling rate isincreased, the numerator coefficient decreases.

At a sampling rate of 10 microseconds, the coefficient has gonedownto 0.00099950016. Tthis is represented as 0 x 0020. It meansthere is a 5 bit resolution for the coefficient, a serious issue for 16bit processors. In such cases, using 32 bit arithmetic will lead to farbetter numerical representation.

A 32bit processor, such as the TMS320F2812 digital signalcontroller(DSC), with native 32bit representation for fractional numbers, couldavert these issues.

Generating PWM outputs
Digital PWMs on embedded controllers use a counter and a compareregister to generate PWM outputs. This scheme has shortcomings. Theminimum possible change in the PWM output is equal to the clock periodof the counter clock, creating quantization issues when the PWMfrequency is increased.

This becomes important when controlling power factor correctionstages associated with motor control inverters, where PWM frequenciesover 200kHz are commonly found. In such instances, the PWM resolutionof a 100MHz device leads to a PWM resolution of about 8bits to 9bits,causing limit-cycle issues. A new high resolution PWM architecture,first introduced on TMS320F280x DSCs, solves this issue by offering aresolution of 150ps.

Figure3: This system was executed in simulation and in actual implementation.The algorithms were implemented in 16bit fixed-point, 32bit fixed-pointand IEEE-754 single-precision floating-point formats.
Figure4: The 16bit fixed-point system exhibits false transients and ringing,while the 32bit implementation shows none of the effects.

Figure 4, above showsthehigh resolution PWM in operation, together with the standard PWMtechnique. Referenced to a software ramp, the staircase is generatedwith the high-resolution function turned off.

With this function on, the yellow trace is captured. Thehigh-resolution PWM reduces quantization on the PWM outputs by severalorders of magnitude, significantly reducing limit-cycling introduced bythe lower PWM resolution.

System designers can use 32 bit implementations to advance theperformance of motor control systems. Moreover, 32bit computation freesdesigners from the task of examining their algorithms in detail forquantization issues and allows the use of higher sampling rates thatboost system bandwidths.

To completely understand quantization effects and maximizeperformance, designers must adequately address output quantizationthrough advances in technology such as high-resolution PWMs.

Kedar Godbole is Servo ControlProduct Manager at Texas Instruments Inc.He can be contacted at E-mail:

To read a PDF version of this story, go to Managingquantization errors in digital motor control systems.

Leave a Reply

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