DESY MP G.Perosn DSP PROGRAM AND DSP SERER
DSP SYSTEM On figure nd 2 re presened loc digrms of DSP sed LLRF conrol ssem for GUN nd ACC. Mesured signls digiized in ADC cm ino he DSP. The lgorihm relized s DSP progrm crees conrol signls I nd Q for ecor Modulor. This digil signl convered o nlog signl DAC. For conrol DSP ord, DSP progrm nd red/wrie d n les from/o DSP ws wrien DSP server. Klsron I,Q modulor DAC Bord DSP Bord ADC Bord Fig. GUN LLRF
ecor Modulor MO Klsron M M2 M3 M4 8 8 8 8 LO + + + + ADC Bord ADC Bord ADC Bord ADC Bord DAC Bord DSP Bord Fig. 2 ACC LLRF
ALGORITHM The lgorihm in DSP using inpu d crees he vecor sum, filering i nd clcules error signl. Afer mulipling i wih gin he lgorihm crees conrol signl dding his resul nd feed forwrd signl. MO ~ ecor Modulor Klsron.3 GHz D A C D A C FFT ~ GT LO 3250 Hz SPT RT..32.... ADC + - + + - Cvi Fig. 3 Digil low pss filer ecor sum ADC Cvi 32 The sic formul is: [ ] crl, crl, G 0 0 G se, se, fr fr + FF, FF,, respecivel rel nd imginr prs of he signl. G, G se se, nd corresponding individul vlues of gin, sepoin nd feedforwrd signls ime к.,, FF FF,,, These vlues clculed in dsp-server s les. Also i is possile o lod hese les from file or direcl from noher pplicion using DOOCS lirr. nd clculed.:
f f fr fr R R R R corresponding vlue of ripple signl for. The ripple signl ws clculed specil progrm [leri]. The digil low pss filer clculed formul: + f f N N 32 M is vecor sum from 32 cviies. Roion mri for ech cvi defined in he following w:. M + M 0 0 + M 0 0 2 + M 0 0 3 Were cos, off g Φ sin, off g Φ, g Scling fcor for cvi. off, Φ Phse shif for cvi.
DSP PROGRAM There re wo dsp progrms relizing he conrol lgorihm. One for GUN nd second for ACC. Bsic differens eween hese progrms h for GUN we hve I nd Q signls from GUN cvi nd for ACC we hve minimum 8 or mimum up o 32 proe signls from cviies. On ne 4 pges re presened loc digrm nd dsp relizion digrm of hese progrms. The progrms re wrien ssemler. For fser clculion he lgorihm is presened following formul: S G MM c > where FF SP G MM + + f f S S N S S 32 MN / M N MN
In FF G, GL SP F RT I /N /N /N Q F2 RT2 SP2 G GL2 FF2 In2 I-SH I- *I *I *Q *Q IF GL! 0 FFFF+In *I *Q X *Q + *I X2 IF GL2! 0 FF2FF2+In2 F + RT F X + F X X2 + F22 X22 F22 + RT2 F22 SP-X SP2-X22 G*SP-X GL*SP-X G2*SP2-X22 GL2*SP2-X22 C C2 C + FF C2 + FF2 X*-/N X2*-/N C + FF C F F2 F
PULS TIMER 0 INT. LOOP i;2047 INIT sr Timer0 2.05µs S Clc c Clc i sop I,Q i I,Q i2048 B. P. GL INT4 I,Q, S MT,G,R i DAC T T CPU RAM GL I,Q DMA0 DMA2 DMA DMA3 i DRAM S MT,G,R DAC TIMER INT Inerrup o hos Fig. 6
PULS TIMER 0 INT. LOOP i;2047 INIT sr Timer0 2.05µs S Clc c Clc i sop c i c i2048 B. P. GL INT4 32, S MT,G,R i DAC T T CPU RAM GL 32 DRAM DMA0 DMA2 DMA DMA3 i S MT,G,R DAC TIMER INT Inerrup o hos Fig. 7
4. DSP SERER The dsp server is DOOCS server [ ]. DSP server llows conrol dsp ord nd lgorihm. The dsp server uses funcions of DSP ord lirr. These funcions use ssem clls for DSP ord driver [ ] DSP progrm on DSP Bord DSP Driver DB67 C++ Lirr DSP Server Clien ddd, ml, rpc_es. Fig. 8 There re 6 rouines in he dsp server:. Sr nd reconnec rouine 2. DSP progrm sus chec rouine 3. DSP configurion rouine 4. DSP progrm lod nd sr rouine 5. Roion Mri rouine 6. Tles rouine 4. Sr nd reconnec rouine During sr rouine server checs eising ord, fer server checs running DSP progrm in DSP ord using DSP progrm sus chec rouine. If here is running DSP Progrm, server reds ll sved vlues for properies from DSP ord memor nd uses hese vlues o iniilise corresponding properies. If here is no running DSP progrm server reds conf file, iniilises ADC nd DAC ord nd wis rpc clls. 4.2 DSP progrm sus chec
During server upde server srs his rouine nd se resul o DSP_IS_ALIE proper. If here is running progrm DSP_IS_ALIE reurns if no reurns 0. 4.3 DSP configurion rouine There is n ineger DSP_CONFIG proper. Firs 4 is of his ineger define conneced ADC i v. Descripion 0 There is ADC conneced GL There is ADC conneced GL 2 2 There is ADC conneced GL 3 3 There is ADC conneced GL4 Second 4 is define which of inerrup from GLins will e use in XLINX for cree inerrup o CPU. i v. Descripion 4 In. from GL will e use. 5 In. from GL2 will e use. 6 In. from GL3 will e use. 7 In. from GL4 will e use. Ne 4 is define which of Glins will e use for DAC oupu. i v. Descripion 8 GL5 will e use. 9 GL6 will e use. 0 GL7 will e use. GL8 will e use.. This ineger sved in DSP ord memor. DSP progrm during sr red his word nd configure XLINX. 4.4 DSP progrm lod nd sr rouine There re 3 properies for his rouine: DSP_PROGRAM_FILE ph nd nme of DSP progrm. DSP_PROGRAM_LOAD lod progrm o DSP. DSP_PROGRAM_START sr progrm. 4.5 Roion mri rouine In figure sowed C++ clsses nd corresponding properies for roion mri.
Properies. CAi.AMPL i-32. CAi.PHASE i-32. LOOP_PHASE.AMPL LOOP_PHASE.PHASE FILTER_PARAM_N. Clculion. CAi.A CAi.AMPL * coscai.phase CAi.B CAi.AMPL * sincai.phase L.A LOOP_PHASE.AMPL * cos LOOP_PHASE.PHASE L.B LOOP_PHASE.AMPL * sin LOOP_PHASE.PHASE CAi.A_PARAM CAi.A * L.A - CAi.B * L.B/ FILTER_PARAM_N CAi.B_PARAM CAi.A * L.B + CAi.B * L.A/ FILTER_PARAM_N 4.6 Tles rouine In figures 9, 0, re sowed C++ clsses nd corresponding properies for cree, red nd wrie les. SETPOINT TABLE Properies. SP_FILL_TIME SP_DELAY_TIME SP_FLAT_TOP_DURATION SP_TIME_CONSTANT SP_OLTAGE_M SP_AMPL_CAL_M_H SP_AMPL_CAL_H_BIT SP_PHASE_REL_BEAM SP_PHASE_OFFSET Clculion. Sepoin reference le: ssp_ref 0 for 0 < < del. During cvi filling d τ SP ref e e f τ d
SP_ref [-ep--sp_delay_time/sp_time_constant] / [-ep-sp_fill_time- SP_DELAY_TIME/SP_TIME_CONSTANT] ssp_ref for during fl op durion Sepoin cul SP_ro_mpl SP_AMPL_CAL_M_H * SP_AMPL_CAL_H_BIT * SP_OLTAGE_M SP_ro_phse SP_PHASE_REL_BEAM + SP_PHASE_OFFSET SP_ro_mpl * cossp_ro_phse SP_ro_mpl sinsp_ro_phse SP_Ac * SPREF Properies for red/wrie les REF_SP_TABLE.USR REF_SP_TABLE.FILE REF_SP_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses REF_SP_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses REF_SP_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. REF_SP_TABLE.AMPL REF_SP_TABLE.PHASE REF_SP_TABLE.IPARAM red le wih 2048 vlue of I. REF_SP_TABLE.QPARAM red le wih 2048 vlue of Q. SP_TABLE.USR SP_TABLE.FILE SP_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses SP_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses SP_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. SP_TABLE.AMPL SP_TABLE.PHASE SP_TABLE.IPARAM red le wih 2048 vlue of I. SP_TABLE.QPARAM red le wih 2048 vlue of Q. FEEDFORWARD TABLE Properies. FF_RATIO
SP_FF_DELAY_TIME FF_AMPL_CAL_M_H FF_AMPL_CAL_H_BIT FF_SP_PHASE_OFFSET FF_I_OFFSET FF_Q_OFFSET BEAM_START BEAM_DURATION BEAM_CURRENT_MA BEAM_CAL_MA_M BEAM_COMP_PHASE Clculion. Feedforwrd reference wihou em FF_ref_n Mgniude of reference feedforwrd le no em sff_ref_n for 0 < < fill ime sff_ref_n FF_RATIO for fl op sr < < fl op end sff_ref_n 0 for > fl op end offse will e dded in DSP Phse of reference feedforwrd le no em FFphse SP_PHASE_REL_BEAM * FF_SP_PHASE_OFFSET % for clculion purpose of resuling vecor FF + em_ ump. Feedforwrd cul wih em FF_c_w Ampliude of cul le no em is sff_c_n sff_ref_n / FF_RATIO* SP_OLTAGE_M*FF_AMPL_CAL_M_H*FF_AMPL_CAL_H_BIT Mgniude of cul feedforwrd le wih em sff_c_wsff_ref_n + dd em vecor NOTE: onl for ime em_sr < < em_end wih em mgniude BEAM_CURRENT_MA * BEAM_CAL_MA_M * FF_AMPL_CAL_M_H * FF_AMPL_CAL_H_BIT nd wih em phse relive o feedforwrd inciden wve - 80 deg. BEAM_COMP_PHASE -80 Feedforwrd reference wih em FF_ref_w
Scle he porion of he FF_c_w during he em on ime s sff_ref_w sff_c_w / FF_AMPL_CAL_M_H / FF_AMPL_CAL_H_BIT / SP_OLTAGE_M * FF_RATIO during em compension em_sr < < em_end FF_ref_phse 0 + ddiionl clculed em ump phse compension FF_ro_mpl / FF_RATIO * SP_OLTAGE_M * FF_AMPL_CAL_M_H * FF_AMPL_CAL_H_BIT FF_ro_phse FF_SP_PHASE_OFFSET + SP_PHASE_REL_BEAM FF_ro_mpl * cossp_ro_phse FF_ro_mpl * sinsp_ro_phse FF_Ac * FFREF Properies for red/wrie les REF_FF_TABLE.USR REF_FF_TABLE.FILE REF_FF_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses REF_FF_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses REF_FF_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. REF_FF_TABLE.AMPL REF_FF_TABLE.PHASE REF_FF_TABLE.IPARAM red le wih 2048 vlue of I. REF_FF_TABLE.QPARAM red le wih 2048 vlue of Q. FF_TABLE.USR FF_TABLE.FILE FF_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses FF_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses FF_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. FF_TABLE.AMPL FF_TABLE.PHASE FF_TABLE.IPARAM red le wih 2048 vlue of I. FF_TABLE.QPARAM red le wih 2048 vlue of Q. GAIN TABLE
Properies. GT_LOOP_GAIN GT_SYS_GAIN Clculion. Reference gin le is mgniude under 45 deg. i.e. IQ GT_ro_mpl GT_LOOP_GAIN / GT_SYS_GAIN GT_ro_phse 0 GT_Ac GT_Ref * GT_ro_mpl Properies for red/wrie les REF_GT_TABLE.USR REF_GT_TABLE.FILE REF_GT_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses REF_GT_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses REF_GT_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. REF_GT_TABLE.AMPL REF_GT_TABLE.PHASE REF_GT_TABLE.IPARAM red le wih 2048 vlue of I. REF_GT_TABLE.QPARAM red le wih 2048 vlue of Q. GT_TABLE.USR GT_TABLE.FILE GT_TABLE.MIX Enle/disle clculion from dsp server. Ph nd file nme from which d will e wrie o le. Afer se his proper he server uomicll red he d from his file nd ses GT_TABLE.USR proper o. In his file d mus e I nd Q nd will e 2048 pirs. Red nd wrie le where re 2048 pirs of I nd Q. Afer se his proper he server uomicll ses GT_TABLE.USR proper o red le wih 2048 vlue of mpliude. red le wih 2048 vlue of phse. GT_TABLE.AMPL GT_TABLE.PHASE GT_TABLE.IPARAM red le wih 2048 vlue of I. GT_TABLE.QPARAM red le wih 2048 vlue of Q. MIX TABLE MX SP + RT*G + FF This le is creed dsp server. The le hve no proper for red/wrie.
D_Red_Server_Tle #.AMPL ge D_Red_Server_Tle #.PHASE ge Lod_Red_Server_Tle SP_TABLE FF_TABLE GT_TABLE INT_GT_TABLE REF_SP_TABLE REF_FF_TABLR REF_GT_TABLE D_Red_Server_Tle #.IPARAM D_Red_Server_Tle #.QPARAM ge ge #.MIX. Tle in Server memor D_Red_Server_Tle #.MIX ge se D_Lod_Server_Tle #.USR Tle Clc. rouine Fig D_Lod_Server_Tle #.FILE red from file se Fig. 9
D_SP_FF_REF_flo SP_FIL_TIME SP_DELAY_TIME SP_FLAT_TOP_DUR SP_TIME_CONSTANT BEAM_CURRENT_MA BEAM_CAL_MA_M BEAM_COMP_PHASE BEAM_START BEAM_DURATION se D_SP_FF_ACT_flo SP_OLTAGE_M SP_AMPL_CAL_M_H SP_AMPL_CAL_H_BIT SP_PHASE_REL_BEAM SP_PHASE_OFFSET FF_AMPL_CAL_M_H FF_AMPL_CAL_H_BIT GT_LOOP_GAIN GT_SYS_GAIN GT_GAIN_PHASE INT_LOOP_GAIN INT_SYS_GAIN INT_GAIN_PHASE INT_GAIN_START INT_GAIN_END SP_FILTER_ON_OFF FF_SP_PHASE_OFFSET se Tle Clc. rouine Fig BEAM_COMP_ON_OFF REF_FF_MODE FF_MODE OPEN_CLOSE_LOOP INTEGRATOR_MODE FF_I_OFFSET FF_Q_OFFSET se Fig. 0
CALC REF. TABLE CALC ACT. TABLE REFSPTABLE.USR IF SP_TABLE.USR IF Clc SP.REF Tle Clc SP Tle REF_FF_TABLE.USR IF REF GT TABLE.USR Clc FF.REF Tle IF FF_TABLE.USR IF Clc FF Tle Me MIX TAB nd lod ino DSP memor. Clc GT.REF Tle GT_TABLE.USR IF REF_INT_TABLE.USR IF Clc GT Tle Clc INT_GT.REF Tle Fig.