RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Moderators: michael_borland, soliday

Post Reply
duanz
Posts: 50
Joined: 30 May 2009, 01:50

RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Post by duanz » 10 Aug 2021, 01:54

Hi Michael,

I'm using elegant 2021.1.0, I'm trying to use I/Q feedback of RFMODE to simulate an active RF cavity.

As I understand, if PRELOAD is set, or initial beam loading voltage/phase is set up, i.e., the tracking starts with a specified initial beam loading \vec{Vb}, then the generator voltage \vec{Vg} will be set up so that \vec{Vg}+\vec{Vb} =\vec{Vc0}, \vec{Vc0} is the desired total RF voltage. However, in the later tracking, the RF feedback would aim at a total voltage \vec{Vc} = \vec{Vc0} + \vec{Vb}, rather than \vec{Vc0}.

In the source file rfmode.cc Line 489&490, VISetpoint & VQSetpoint include the following contribution: rfmode->V0 * cos(rfmode->last_phase0) or rfmode->V0 * sin(rfmode->last_phase0), this seems to double-count the beam loading voltage.

It would be highly appreciated if you could check this issue.Thanks!

Best,

Zhe

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Post by michael_borland » 12 Aug 2021, 09:11

Zhe,

In lines 492 and 493, the generator current is recomputed using VISetpoint-VI and VQSetpoint-VQ, VI and VQ also contain contributions from the beam loading (see lines 410-414), so these are basically subtracted off. Does that address your concern?

--Michael

duanz
Posts: 50
Joined: 30 May 2009, 01:50

Re: RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Post by duanz » 12 Aug 2021, 21:53

Hi Michael,

In the manual for RFMODE, V_SETPOINT & PHASE_SETPOINT are setpoints for total cavity voltage and phase. The amplitude/phase feedback loop is consistent with this statement.

For I/Q feedback loop, in line 489/490, rfmode->voltageSetpoint & rfmode->phaseSetpoint are the total cavity voltage and phase, while VISetpoint & VQsetpoint thus calculated, are the generator voltage and phase. However, in line 492 & 493, VI & VQ are the sampled total cavity voltage and phase, therefore VISetpoint-VI & VOSetpoint-VQ have a beam loading voltage component, in addition to the desired difference between the setpoint of total voltage and the sampled total voltage.

488 phaseg = PI/180*rfmode->phaseSetpoint - 3*PI/2;
489 VISetpoint = (rfmode->voltageSetpoint+rfmode->setpointAdjustment)*cos(phaseg) + rfmode->V0*cos(rfmode->last_phase0);
490 VQSetpoint = (rfmode->voltageSetpoint+rfmode->setpointAdjustment)*sin(phaseg) + rfmode->V0*sin(rfmode->last_phase0);

492 rfmode->Iiq->a[0][0] = rfmode->Ig0->a[0][0] + (dII=applyIIRFilter(rfmode->IFilter, rfmode->nIFilters, rfmode->lambdaA*(VISetpoint-VI)));
493 rfmode->Iiq->a[1][0] = rfmode->Ig0->a[1][0] + (dIQ=applyIIRFilter(rfmode->QFilter, rfmode->nQFilters, rfmode->lambdaA*(VQSetpoint-VQ)));


In the attached example, I launched three simulations, Case 1 (folder name : no_feedback) is for the case w/o RF feedback by tweaking the filter.sdds file, the cavity is preloaded with a bunch charge of 15nC, and the evolution of Vc near 8MV in the tracking is expected; Case 2 (folder name : proportional_feedback) is for the case w/ a proportional feedback, in the tracking, Vc is seen rising to 8.4MV( Vc0 + Vb ) instantly and then being stabilized; Case 32 (folder name : proportional_feedback_modified) is doing the simulation as Case 2, but the source file is modified in the following way, the evolution of Vc is now close to expectation.

488 phaseg = PI/180*rfmode->phaseSetpoint - 3*PI/2;
489 VISetpoint = (rfmode->voltageSetpoint+rfmode->setpointAdjustment)*cos(phaseg) ;
490 VQSetpoint = (rfmode->voltageSetpoint+rfmode->setpointAdjustment)*sin(phaseg) ;

492 rfmode->Iiq->a[0][0] = rfmode->Ig0->a[0][0] + (dII=applyIIRFilter(rfmode->IFilter, rfmode->nIFilters, rfmode->lambdaA*(VISetpoint-VI)));
493 rfmode->Iiq->a[1][0] = rfmode->Ig0->a[1][0] + (dIQ=applyIIRFilter(rfmode->QFilter, rfmode->nQFilters, rfmode->lambdaA*(VQSetpoint-VQ)))


Thanks and best regards,

Zhe
Attachments
elegant_example_IQ_preload.tar.gz
(5.3 MiB) Downloaded 191 times

michael_borland
Posts: 1927
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Post by michael_borland » 20 Aug 2021, 15:43

Zhe,

Thanks for the detailed explanation and examples. I agree with your correction and it will appear in the next version.

By the way, I liked your trick of using echo and csv2sdds to make an SDDS file. You can also use the program sddsmakedataset.

Thanks again.

--Michael

duanz
Posts: 50
Joined: 30 May 2009, 01:50

Re: RFMODE I/Q feedback w/ PRELOAD or initial beam loading voltage/phase

Post by duanz » 20 Aug 2021, 22:59

Hi Michael,

Thanks for checking this out! I'll try using sddsmakedataset next time as you suggested.

Cheers,

Zhe

Post Reply