POPCA 2012 CURRENT MEASUREMENT DIGITAL FILTERING TUTORIAL FIR

  • Slides: 37
Download presentation
POPCA 2012 CURRENT MEASUREMENT DIGITAL FILTERING - TUTORIAL - FIR or IIR? POCPA Conference

POPCA 2012 CURRENT MEASUREMENT DIGITAL FILTERING - TUTORIAL - FIR or IIR? POCPA Conference 20. . 23 May @ DESY Michele Martino (TE-EPC-HPM) 1

CURRENT MEASUREMENT FOR CONTROL Ø Control systems can tolerate some delay in the measurement

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! Fundamental trade-off of the measurement chain: accuracy vs speed ! Anti Aliasing / Signal Conditioning ADC voltage/current signal transmission Converter Control Power Circuit Current Transducer 2

SAMPLING BASICS Ø Ideal Sampling Time Domain Frequency Domain Spectrum of a critically sampled

SAMPLING BASICS Ø Ideal Sampling Time Domain Frequency Domain Spectrum of a critically sampled strictly band-limited signal: no alias!!! Ø Noise is always present so there are no strictly band-limited signals! Ø Anti-aliasing filtering always needed! 3

WHY OVERSAMPLING? Ø Standard Nyquist Sampling Analog filter Ø Oversampling Digital filter Anti-aliasing can

WHY OVERSAMPLING? Ø Standard Nyquist Sampling Analog filter Ø Oversampling Digital filter Anti-aliasing can be dealt with only analogically! Anti-aliasing filtering can be shared between analog and digital! Re-configurability now possible Analog filter 4

DECIMATION Replicas still occur due to decimation! SNR not improved due to lack of

DECIMATION Replicas still occur due to decimation! SNR not improved due to lack of filtering! 5

THE NEVER-ENDING DISPUTE: IIR VS FIR (non-causal) Charles M. Rader : The Rise and

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 6

Ø Yes, 1 -bit only! It is the digital filter that actually determines the

Ø Yes, 1 -bit only! It is the digital filter that actually determines the ADC “precision”! 7

HOW TO SPECIFY DIGITAL FILTERS “alias-free” bandwidth 8

HOW TO SPECIFY DIGITAL FILTERS “alias-free” bandwidth 8

MINIMUM-PHASE FIR Ø Actually not if the filter is part of the measurement chain

MINIMUM-PHASE FIR Ø Actually not if the filter is part of the measurement chain of a control loop!!!

MINIMUM-PHASE FIR DECIMATION

MINIMUM-PHASE FIR DECIMATION

IIR IMPLEMENTATION Ø Implementation on DSP hints Ø Hints based on Texas Instruments TMS

IIR IMPLEMENTATION Ø Implementation on DSP hints Ø Hints based on Texas Instruments TMS 320 C 28 x with CCS Ø The hints clearly work with floating point DSP such as the TMS 320 F 28335 _IQmpy ↔ * 11

IIR IMPLEMENTATION Ø Implementation hints on DSP : Break up Structure and Combine Terms

IIR IMPLEMENTATION Ø Implementation hints on DSP : Break up Structure and Combine Terms 12

IIR IMPLEMENTATION Ø Implementation hints on DSP : Inline Ø Inline is automatic with

IIR IMPLEMENTATION Ø Implementation hints on DSP : Inline Ø Inline is automatic with –O 3 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 13

“INTERACTIVE” SESSION 14

“INTERACTIVE” SESSION 14

MATLAB FDATOOL Ø Different algorithms are available for minimum-phase design Ø Generalized Equiripple calculates

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 15

SOME SUBTLE PHENOMENA Ø What can go wrong? 16

SOME SUBTLE PHENOMENA Ø What can go wrong? 16

SOME SUBTLE PHENOMENA Ø It looks very nice isn’t it? Ø It looks very

SOME SUBTLE PHENOMENA Ø It looks very nice isn’t it? Ø It looks very “white” !!!! 17

SOME SUBTLE PHENOMENA Ø Let’s have a look at the histogram: 18

SOME SUBTLE PHENOMENA Ø Let’s have a look at the histogram: 18

SOME SUBTLE PHENOMENA Ø Let’s have a look at the impulse response: 19

SOME SUBTLE PHENOMENA Ø Let’s have a look at the impulse response: 19

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY

CASE STUDY Ø DC performance

CASE STUDY Ø DC performance

CASE STUDY Ø AC performance

CASE STUDY Ø AC performance

CASE STUDY Ø AC performance Ø Making hardware or perform measurements as flat as

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

CASE STUDY Ø Sine-fit Amplitude Estimation

CASE STUDY Ø Sine-fit Amplitude Estimation

REFERENCES Ø Digital Filters with MATLAB® : Ricardo A. Losada, 2009, The Math. Works,

REFERENCES Ø Digital Filters with MATLAB® : Ricardo A. Losada, 2009, The Math. Works, Inc. Ø http: //www. mit. bme. hu/books/quantization Ø IEEE Std 1241 -2000 Standard for Terminology and Test Methods for Analog-to-Digital Converters Ø A. Tessarolo, Getting the Most from Your C Code on the TMS 320 C 28 x™ 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 30

BACKUP SLIDES 31

BACKUP SLIDES 31

MINIMUM PHASE FIR FILTERS Ø Delay is minimized, but there is a lot more

MINIMUM PHASE FIR FILTERS Ø Delay is minimized, but there is a lot more overshoot! Is that a problem? 10 A 100 A 32

HOW TO SPECIFY DIGITAL FILTERS? 1 33

HOW TO SPECIFY DIGITAL FILTERS? 1 33

HOW TO SPECIFY DIGITAL FILTERS? 2 Ø From Precision to Filter Specs 1. 74

HOW TO SPECIFY DIGITAL FILTERS? 2 Ø From Precision to Filter Specs 1. 74 x 10 -5 1. 74 x 10 -4 1. 74 x 10 -3 34

HOW TO SPECIFY DIGITAL FILTERS? 3 Ø From Precision to Filter Specs Ø Now

HOW TO SPECIFY DIGITAL FILTERS? 3 Ø From Precision to Filter Specs Ø Now we are done! Or maybe not? 35

WHY OVERSAMPLING? 1 Ø A “bit” of theory Ø Quantization Process Ø Quantization is

WHY OVERSAMPLING? 1 Ø A “bit” of theory Ø Quantization Process Ø Quantization is a non linear process - vast and tricky subject Ø Fortunately an approximated model works very well almost every time! Ø Ok but what does that mean? 36

WHY OVERSAMPLING? 2 Ø Easy analog filter design, reduced delay, re-configurability, Ok! Ø Is

WHY OVERSAMPLING? 2 Ø Easy analog filter design, reduced delay, re-configurability, Ok! Ø Is that all? What about PQN power? a) b) Sampling Frequency Bandwidth 37