Beruflich Dokumente
Kultur Dokumente
Motivation, issues Example test signals Signal generation: block diagram Implementation in C Programming organization, benefits, rules
DSP BASED REAL TIME TEST SIGNAL GENERATOR 2
MOTIVATION
Example application: 3-phase power electronics - control synchronization Requirement for various test signals:
phase & frequency step modulation amplitude step modulation notching imbalance other distortion & noise types
UNDERLYING ISSUES
Development testing in real time Availability and affordability of real time DSP, ex.: Analog Devices ADSP-21161 200 MHz floating point DSP Programming: block diagram level programming preferred object oriented approach Ex.: MatLab/Simulink, C++ BUT: excessive underlying overhead and code, reduced efficiency and execution speed
DSP BASED REAL TIME TEST SIGNAL GENERATOR 4
PROPOSED APPROACH
Given C language:
popular efficient compilation interfaceable to assembly language code struct-ure based syntax, and function pointers Transportability across different h/w platforms
Can effectively translate block / data flow diagram level design into C code, for most efficient execution, development, and maintainability Important point: insist on rigorous, but simple, programming rules
DSP BASED REAL TIME TEST SIGNAL GENERATOR 5
CDN
Gen_3phase_0
3- GENERATOR
AS
BD
Dist_3phase_0
3- HARMONICS
CDN
Notch_3phase_0
3- NOTCHING 3-phase signals
Input Ko Ko o o
A B C
A B C
A B C H(k)
A B C
Notch specs
A B C
a b c
{ h1 , h2 , h3 }
{ Ni }
// 2. Declare functional blocks, assigning names (optional; required forward // declaration when feedback is involved, ex. PLL): // Type name // // State_3phase Distortn_3ph Notching_3ph user-defined (type names defined in Gen_3phase.h) variable (object) name Gen_3ph_0 ; Dist_3ph_0 ; Notch_3ph_0 ; // 3-phase clean signal generation unit // Harmonic distortion unit // Notching distortion unit
// 5. Define list of signals of interest for DAC output and scope observation:
float Signals_3ph[8] = // 8 DAC outputs available { &Dist_3ph_0.A, &Dist_3ph_0.B, &Dist_3ph_0.C, &Gen_3ph_0.Phase, &Dist_3ph_0.B, &Notch_3ph_0.C } ;
10
From perspective of main application programming: thats all, and the main present focus of interest
11
2.
3.
BENEFITS
Application developed at level of block diagram: clearest and simplest Simple rules to follow, easily copied from example template, minimal C programming skills required Object-oriented approach, without undue underlying overhead; minimal reduction of execution efficiency C code easily transportable (compiled) for any hardware platform
MOST IMPORTANT: strict adherence to programming rules, best captured in example templates
DSP BASED REAL TIME TEST SIGNAL GENERATOR 13
3- GENERATOR
Angle Freq
3- GENERATOR
*p *pF
A B C
A B C
Constant
Constant
Handler function
KO
(void*) &Gen_3ph_0
15
// MUST = Gen_3phase // Current phase angle, rads // Center frequency, rad./sec. // Freq. control sensitivity // Freq. control signal addr. // Phase control signal addr. // 3-phase output signals // Name of new data type
16
// Advance phase // Freq ctrl input // Keep phase: // -pi < Phase < pi // Phase ctrl input // Phase C = -A B
18
CONCLUSIONS
Based on these simple organization and guidelines, and strict adherence to simple rules, other functional units can be easily developed and added to library Simplified programming at top, block diagram equivalent, level, with minimal to no C programming skills required 3 stages of development:
Main application level, simplest translation from block diagram to C code Collection of functional objects, in C, transportable to any platform Hardware level I/O for specific platform
19
THANK YOU
20