1 / 37

POPCA 2012

POPCA 2012. Current measurement Digital Filtering - Tutorial - . FIR or IIR? . POCPA Conference 20..23 May @ DESY. Michele Martino (TE-EPC-HPM). Current Measurement for Control. Control systems can tolerate some delay in the measurement chain but certainly don’t like it !.

qiana
Télécharger la présentation

POPCA 2012

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. POPCA 2012 Current measurement Digital Filtering - Tutorial - • FIR or IIR? • POCPA Conference • 20..23 May @ DESY • Michele Martino (TE-EPC-HPM)

  2. Current Measurement for Control • Control systems can tolerate some delay in the measurement chain but certainly don’t like it ! • Properly designed digital controllers can “easily” handle delays (RST), so what’s the problem? • Delays increase model order (Z transf) → Model mismatch become rapidly critical for stability! Anti Aliasing / Signal Conditioning ADC Converter Control Power Circuit Fundamental trade-off of the measurement chain: accuracyvsspeed ! Current Transducer voltage/current signal transmission

  3. Sampling Basics • Ideal Sampling Spectrum of a critically sampled strictly band-limited signal: no alias!!! • Signals whose bandwidth exceeds will be corrupted! • Noise is always present so there are no strictly band-limited signals! • Anti-aliasing filtering always needed! • If the controller runs at , what about sampling faster?

  4. WhY OVERSAMPLING? • Standard Nyquist Sampling Analog filter Anti-aliasing can be dealt with only analogically! Small Transition Bandwidth High Order Filter High Order Analog Filters Huge Delay  High Order Analog Filters No re-configurability  Quantization Noise : frequency at which the control algorithm runs • Oversampling Anti-aliasing filtering can be shared between analog and digital! “Quantization” Noise decreases of a factor increases by a factor , by Digital filter Re-configurability now possible Analog filter Quantization Noise

  5. DECIMATION • Ok oversampling works very well, but the control still runs at !!! • Samples are produced at frequency, so what to do with them? • Take one sample out of ? Not really a brilliant idea  SNR not improved due to lack of filtering! Replicas still occur due to decimation! • Take the average of the samples? That’s better: it puts a notch at which can be the switching frequency of the converter! • Convolving many of such filters, notches can be put at pathological frequencies and enough attenuation can be achieved close to

  6. The never-ending dispute: IIR vs FIR (non-causal) Charles M. Rader : The Rise and the Fall of Recursive Digital Filters – IEEE Signal Processing Magazine, Nov 2006

  7. Where there is no match against FIR: • 1-bit ADC: 1-bit only? • Yes, 1-bit only! It is the digital filter that actually determines the ADC “precision”! Spectrum of : order Spectrum of : zoom • “shapes” the white, uniformly distributed (pseudo-quantization) noise ! model • Only 1-bit means that no multiplication are needed for filters!!!! • Fundamental relationship for digital filter design:

  8. How to specify digital filters • A precision of is required “alias-free” bandwidth Spectrum of : order Idle tones can be close to so a w.c. has to be guaranteed by the filter! -“alias-free” bandwidth “alias-free” bandwidthof the converter (no overspecs) : why????

  9. Minimum-PHASE FIR • filters can have a nice linear phase, but is that important? • Minimum-phase filters: the delay in the passband (approx constant) is significantly lower than that of a linear-phase having the same frequency constraints: • A minimum-phase filter has additional advantages; the overall order of the design is less than that of a linear-phase : coefficients which are less sensitive to quantization • Ok it looks promising, but minimum-phase has a lot more overshoot! Is that a problem? • Actually not if the filter is part of the measurement chain of a control loop!!! • Minimum-phase FIR can readily be used in single-stage or multistage decimators… That needs some tricks: , both and are not integers!

  10. Minimum-PHASE FIR decimation • Given the specifications a minimum-order minimum-phase with coefficients is calculated be means of FDATOOL – Generalized Equiripple Algorithm • If then a new filter can be designed with;the output at frequency can then be generated by simply taking one samples out of • If then a new filter has to be designed with ; in order to guarantee the minimum delay filters need to be interleaved • : wordlength, : fraclength Coefficients wordlength has to increase by bits

  11. IIR implementation • Implementation on DSP hints • Hints based on Texas Instruments TMS320C28x with CCS • No multiplication round-off errors if = • The hints clearly work with floating point DSP such as the TMS320F28335 _IQmpy↔ *

  12. IIR implementation • Implementation hints on DSP : Break up Structure and Combine Terms

  13. IIR implementation • Implementation hints on DSP : Inline Two order filters + two -like controllers +… a bunch of other stuff running on a TMS320F28335 • Inline is automatic with –O3 Optimization mode • Source must be visible to calling file • Make data allocation/definitions visible to calling file • Compiler can make use of Direct Addressing Mode “@0..63

  14. “INTERACTIVE” SESSION

  15. MATLAB FDATOOL • Different algorithms are available for minimum-phase design • Generalized Equiripple calculates minimum (even) order filters! • Other algorithms can be successfully used once the filter order is approximately known • What about very long filters? • For filter orders larger than a thousand taps the algorithms fail • But the problem can be decomposed and the FDATOOL let you the “cascade” • You can also quantize coefficients and then create a .coe file

  16. Some SUBTLE PHENOMENA • What can go wrong?

  17. Some SUBTLE PHENOMENA • It looks very nice isn’t it? • It looks very “white” !!!!

  18. Some SUBTLE PHENOMENA • Let’s have a look at the histogram:

  19. Some SUBTLE PHENOMENA • Let’s have a look at the impulse response:

  20. CASE STUDY • The designed filter: , , ,

  21. CASE STUDY • The designed filter: , , ,

  22. CASE STUDY • The designed filter: , , ,

  23. CASE STUDY • The designed filter: , , ,

  24. CASE STUDY • Actual implementation by means of interleaved filters: and last taps equal to

  25. CASE STUDY • Actual implementation by means of interleaved filters: and last taps equal to

  26. CASE STUDY • DC performance

  27. CASE STUDY • AC performance

  28. CASE STUDY • AC performance • Making hardware or perform measurements as flat as the digital filter may turn out to be unfeasible or unworthy!

  29. CASE STUDY • Sine-fit Amplitude Estimation • Clock had to be “corrected” by for the data to make sense!

  30. References • Digital Filters with MATLAB® : Ricardo A. Losada, 2009, The MathWorks, Inc. • http://www.mit.bme.hu/books/quantization • IEEE Std1241-2000 Standard for Terminology and Test Methods for Analog-to-Digital Converters • A. Tessarolo, Getting the Most from Your C Code on the TMS320C28x™ Controller Using Code Composer Studio™ • Delta-Sigma Data Converters Theory, Design, and Simulation. Norworthy, Schreier, Temes, IEEE – Wiley-Interscience 1992 • K. Steiglitz, T. W. Parks, and J. K. Kaiser, ”METEOR: a constrained-based FIR Filter design program,” IEEE Trans. Signal Proc., vol 40, no. 8, pp. 1901-1909, Aug. 1992 • New class of recursive digital filters for decimation: Horacio G. Martinez and Thomas W. Parks, 1978, Rice University Electrical Engineering Dept. Huston • M. Martino, et al. “Low emission, self-tunable DSP based Stepping Motor Drive for use with arbitrarily long cables,” IFAC Large Scale Systems Symposium, Villeneuve d’Ascq, France, 2010

  31. BACkup Slides

  32. Minimum phase FIR filters • Delay is minimized, but there is a lot more overshoot! Is that a problem? 10A 100A

  33. How to specify digital filters? 1 • From Precision to Filter Specs • Full scale is considered as the reference level • part-per-million will always be referred to it; if a precision ofis required an ideal quantizer would then need to have a quantization step such that the maximum quantization error would be • Passbandripple • In order to guarantee a dynamic precision of all over the “useful band” the passband gainshould change less than the precision required for a full scale signal. • Stopbandattenuation • For the stopbandattenuation an estimation of the noise “level” to be rejected is required! • In a relatively “silent” environment assuming noise components (worst case scenario) would turn out in heavy and sometimes meaningless over-specification complexity, computational power, delay!

  34. How to specify digital filters? 2 • From Precision to Filter Specs • Stopbandattenuation w.c. • : quantization noise power of an ideal quantizer with quantization step • Putting it (almost) all together • As anexample if the expected, or measured, noise “level” ( amplitude) is timessmaller than the , then should bespecified smaller than what is reported in the table. So precision can be achieved with only of attenuation in the stopbandand so on. This will save computational power and most important: delay!

  35. How to specify digital filters? 3 • From Precision to Filter Specs • What’s still missing?Oh yes: passband and stopband frequencies!!! • The easiest approach (minimum filter order - largest transition bandwidth): • end of passband “alias-free” band • beginning of stopband“alias-free” band • The iterative approach: • beginning of stopband“alias-free” band  • Replicas occurring around will not affect the desired precision in the “alias-free” band • : ↓ → delay ↑ ; ↑ → ↓→ order ↑ • should be chosen by trading off delay and filter complexity! • Now we are done! Or maybe not? • Let’s see: what about the “alias-free” band? • “alias-free” band results in over specifying • “alias-free” band (full precision might not be needed for the whole closed loop bandwidth especially for very high precision applications)

  36. WhY OVERSAMPLING? 1 • A “bit” of theory • Quantization Process • Quantization is a non linear process - vast and tricky subject • Quantization of a signal Sampling its (Probability Density Function) • Fortunately an approximated model works very well almost every time!  Pseudo Quantization Noise model: Still a bit too complicated Now the model is linear! • Uniform Statistical Distribution • White • Independent of input signal : • Ok but what does that mean? • Power ofdoes not change with sampling frequency • ideally • so increasing i.e. oversampling reduces the Power Spectral Density!!!!

  37. WhY OVERSAMPLING? 2 • Easy analog filter design, reduced delay, re-configurability, Ok! • Is that all? What about PQN power? b) a) • Let’s assume ideal brick-wall lowpass filters at for both a) and b) and consider the Signal-to-Noise Ratio : Sampling Frequency Bandwidth • a) ; b) → improves by a factor ! • It’s easy to see that for equal lowpass filters in a) and b) either analog or digital the still improves by a factor ! • Actual : , ,

More Related