New VXI board for GMPS. IRQ2 : Regular interrupt which runs the nominal 20KHz code IRQ1 : 15Hz MCO...

download New VXI board for GMPS. IRQ2 : Regular interrupt which runs the nominal 20KHz code IRQ1 : 15Hz MCO interrupt TMZ0: Timer interrupt indicating missing.

If you can't read please download the document

description

{IMINSETLL, IMINSETUL, IMINSETDFLT, 0}, {IMAXSETLL, IMAXSETUL, IMAXSETDFLT, 0}, {ACMINPGNLL, ACMINPGNUL, ACMINPGNDFLT, 0}, {ACMINIGNLL, ACMINIGNUL, ACMINIGNDFLT, 0}, {ACMAXPGNLL, ACMAXPGNUL, ACMAXPGNDFLT, 0}, {ACMAXIGNLL, ACMAXIGNUL, ACMAXIGNDFLT, 0}, {DCPGNLL, DCPGNUL, DCPGNDFLT,0}, {DCIGNLL, DCIGNUL, DCIGNDFLT,0}, {BDOTPHASESETLL, BDOTPHASESETUL, BDOTPHASESETDFLT, 0}, {BDOTIMINDTSETLL, BDOTIMINDTSETUL, BDOTIMINDTSETDFLT, 0}, {PHASEREGTCSETLL, PHASEREGTCSETUL, PHASEREGTCSETDFLT, 0}, {IMINXDTRGAINLL, IMINXDTRGAINUL, IMINXDTRGAINDFLT, 0}, {IMINXDTROFFSETLL, IMINXDTROFFSETUL, IMINXDTROFFSETDFLT, 0}, {IMAXXDTRGAINLL, IMAXXDTRGAINUL, IMAXXDTRGAINDFLT, 0}, {IMAXXDTROFFSETLL, IMAXXDTROFFSETUL, IMAXXDTROFFSETDFLT, 0} Parameters on ACNET

Transcript of New VXI board for GMPS. IRQ2 : Regular interrupt which runs the nominal 20KHz code IRQ1 : 15Hz MCO...

New VXI board for GMPS IRQ2 : Regular interrupt which runs the nominal 20KHz code IRQ1 : 15Hz MCO interrupt TMZ0: Timer interrupt indicating missing MCO interrupt ADC0: BDOT input ADC1: VMIN input ADC2: VMAX input (USER0: FITMIN) (USER1: FITMAX) DAC0: Voltage program output to the power supplies DSP I/O Signals on present XVI card {IMINSETLL, IMINSETUL, IMINSETDFLT, 0}, {IMAXSETLL, IMAXSETUL, IMAXSETDFLT, 0}, {ACMINPGNLL, ACMINPGNUL, ACMINPGNDFLT, 0}, {ACMINIGNLL, ACMINIGNUL, ACMINIGNDFLT, 0}, {ACMAXPGNLL, ACMAXPGNUL, ACMAXPGNDFLT, 0}, {ACMAXIGNLL, ACMAXIGNUL, ACMAXIGNDFLT, 0}, {DCPGNLL, DCPGNUL, DCPGNDFLT,0}, {DCIGNLL, DCIGNUL, DCIGNDFLT,0}, {BDOTPHASESETLL, BDOTPHASESETUL, BDOTPHASESETDFLT, 0}, {BDOTIMINDTSETLL, BDOTIMINDTSETUL, BDOTIMINDTSETDFLT, 0}, {PHASEREGTCSETLL, PHASEREGTCSETUL, PHASEREGTCSETDFLT, 0}, {IMINXDTRGAINLL, IMINXDTRGAINUL, IMINXDTRGAINDFLT, 0}, {IMINXDTROFFSETLL, IMINXDTROFFSETUL, IMINXDTROFFSETDFLT, 0}, {IMAXXDTRGAINLL, IMAXXDTRGAINUL, IMAXXDTRGAINDFLT, 0}, {IMAXXDTROFFSETLL, IMAXXDTROFFSETUL, IMAXXDTROFFSETDFLT, 0} Parameters on ACNET VXI CARD main() { // Required function call to initialize global pointers // setup and initialize Program Information array // Initialize Front Panel Altera Pointer // Initialize BMIN gate control pointer in User_IP_Altera // Initialize program pointers // Set flag states in Front Panel Altera //Initialize BMIN gate control to "Gate Off" state *bmincntrl = BMINOFF; // Associate runtime adjustable parameters with variables assignparams(); // Restore non-volatile parameters restoreparams(); // Initialize protected settings controls // Compute and initialize necessary values //Read number of power supplies in circuit nps = 1 + ~(*fpadigin | 0xfffffffc); // two lsb's of fpa digital input (active low) indicate # supplies //Clear forced slow start request timer_set(TMRRESET, TMRRESET); timer_on(); // set up interrupts interrupt(FITMIN, fitmindata); interrupt(FITMAX, fitmaxdata); interruptf(SIG_IRQ2, regularintrpt); // nominal 20 Khz interrupt interruptf(SIG_IRQ1, mcointrpt); // nominal 15 Hz (heartbeat) interrupt interruptf(SIG_TMZ0, noheartbeat); // timer interrupt caused by missing (heartbeat) interrupt exit(); } DSP code main() RIRQ(20kHz) MCO (~15 Hz) DSP CLK(25MHz) VMAX BDOT VMIN Interrupt and CLK signals on DSP // Compute this mco period, filtered (averaged) mco period, compare to nominal and set mco_ok flag and beginnewssflg accordingly !mco_ok beginnewssflg = 1 mco_ok = 1 (avemcoperiod PERIOD15) < period toreance !mco_ok //Check regular interrupt count and set beginnewssflg accordingly RIRQ count >= MINIMUM RIRQ CNT rirq_ok=1 RIRQ count < MINIMUM RIRQ CNT !rirq_ok beginnewssflg = 1 RIRQCNT =0 // Check gmpson state gmpson = 0 && gmpsonin =1 xdtrflt = 0 beginnewcnctrdly = 1 // Check ac/dc state If change AC and DC status acflg != acflgin beginnewssflg = 1 // Check for XDTRFLT reset sm -> xdtrfltrst = 1 xdtrflt = 0 beginnewssflg = 1 // Check for a contactor closing and set cbc and beginnewcnctrdly accordingly cbc = 0 && cbcin = 1 && gmpson = 1 xdtrflt =0 beginnewcnctrdly = 1 // Check for a forced slow start request and set cbc and beginnewcnctrdly accordingly sm->ssreq && gmpson beginnewcnctrdly = 1 Check 7 statuses void mcointrpt(int dummy) // IRQ1 Slow Start (beginnewssflg = 1) sscoef = sscoef + (1. -sscoef)*runuprate; // runs up program with 1 sec timeconstant ssrampcnt--; 10sec Contactor Delay request (beginnewcnctrdly =1) cnctrok = 0 for 60 x 15Hz cycles cnctrok = 1 0 beginnewssflg = 1 MSB LSB XDTRFLTCBCACUPACDCSLWSTRTBEGINSSGMPSONRIRQOKMCOOKMCO GMPS VXI CURRENT REGULATOR STATE DIAGRAM 10 status bits #define MCOMSK0x1// Mask for MCO state bit #define MCOOKMSK0x2// Mask for MCOOK state bit #define RIRQOKMSK0x4// Mask for RIRQOC state bit #define GMPSONMSK0x8// Mask for GMPSON state bit #define CNCTROKMSK0x10// Mask for CNCTROK state bit #define BEGINSSMSK0x20// Mask for BEGINSS state bit #define SLWSTRTMSK0x40// Mask for SLWSTRT state bit #define ACFLGMSK0x80// Mask for ACFLG state bit #define ZEROOUTPUTMSK0x100// Mask for ZEROOUTPUTMSK state bit #define XDTRFLTMSK0x200// Mask for XDTRFLT state bit #define BDOTFLTMSK0x400// Mask for BDOTFLTMSK state bit if ( !mco_ok || !cnctrok || !gmpson || !rirq_ok || xdtrflt) zerooutput = 1 interruptf(SIG_TMZ0, noheartbeat); mco_ok = 0 VMIN & BDOT 22 samples VMAX 22 samples FITMIN FITMAX Update Frequency and Phase BDOT PERIOD vout = sscoef * pscoef * (vave + vpeak * cos(outputphase)) Update VIMIN Update VIMAX (Slow Start) (Number of PS) Average MCO period thisdeltaperiod = (float) (thismcoperiod-avemcoperiod); avemcoperiod = avemcoperiod + (int)(thisdeltaperiod * invnmco); ticslastbdotzero = ticsthisbdotzero; ticsthisbdotzero = ticsminbdotzero; sm->ticsthisbdotzero_sm = ticsthisbdotzero; *bdotphase_readptr = (TWOPI*((float)ticsthisbdotzero)/((float)avemcoperiod)); Average delta phase thisphaseerror = *bdotphase_readptr - bdotphaseset; deltaphase = deltaphase + thisphaseerror/(NOMGMPSFREQ * phaseregtc_set); thisbdotperiod = ticsthisbdotzero + ( ( TMRRESET-tmrthismco ) - ticslastbdotzero ); Average BDOT period thisdeltabdotperiod = (float) (thisbdotperiod-avebdotperiod); avebdotperiod = avebdotperiod + (int)(thisdeltabdotperiod * 0.5*invnmco); delT(n)=T(n)-Tave(n-1) Tave(n)= Tave(n-1) + delT(n)/ Averaging MCO period, BDOT period and delta phase between MCO and BDOT using filters Zero crossing from Linear fit IMIN_SET Measured_IMIN NEW_IMIN IMAX_SET Measured_IMAX NEW_IMAX Parabola fitting 22 turns Average NEW IMIN and IMAX (vave, vpeak ) // Calculate intermediate values exx2 = sumx2-(sumx*sumx)*invcountf; why1 = sumxy-(sumx*sumy)*invcountf; if (order) // do these only for parabola fit { why2 = sumx2y-(sumx2*sumy)*invcountf; exx3 = sumx3-(sumx2*sumx)*invcountf; exx4 = sumx4-(sumx2*sumx2)*invcountf; a=(why2*exx2-exx3*why1)/(exx4*exx2-exx3*exx3); b=(why2*exx3-exx4*why1)/(exx3*exx3-exx4*exx2); c=(sumy-a*sumx2-b*sumx)*invcountf; t0 = -b / (2.0 * a); minmax = c -(b*b)/(4*a); // Finish up linear fit { slope = why1/exx2; yintercept = (sumy - slope*sumx)*invcountf; xintercept =-yintercept/slope; } VIMIN with Least-Squares Parabola fitting (22 data points ~ 880 nsec) Possible improvements Average periods instead of filter the number Smooth all data points, reduce 720Hz noise and then FITMIN /FITMAX Feed back on a VXI board (FFGMP) GMPS TRUNSDUCTOR OUT With offset and gain DAC OUT TCLK B:FFGMP GO TO EG & WG Make table with 2^20 ~ 1M points Change number of skip turns and take a data on the table every 20kHz 1point = 2pi(1+0.2/15)/2^20 15/20*10^3 * 1/(2pi(1+0.2/15)/2^20) ~756 points / 20kHz Frequency resolution ~ 0.019Hz How to calculate COS(t) on FPGA DSP or FPGA? VXI DAC OUTPUT (+/- 5V ?) MCO VIMAX TCLK DAC OUT 1 4 digital inputs 1 DAC output 3 ADC inputs SLOT 0 BDOT VIMIN Plan Learn about hardware around VXI card Measure gain and offset on the signals from transductor Measure signal to noise ratio and estimate required resolution for the ADC Start writing code using new Cogging board if we are going to use FPGA