Phase offset between field maps  [SOLVED]

https://www.dacm-logiciels.fr/tracewin
United States of Americawtam
Skilled
Skilled
Posts: 111
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Phase offset between field maps

Post by United States of Americawtam »

Dear Didier,

Please see attached project. It is ready to run. If we view the two field maps as two cavities controlled by the same clock, what is the phase offset between them? Where can I find it?

Best regards,
Wai-Ming
Attachments
A2_78_134.edz
(2.63 KiB) Downloaded 217 times
A1_72_128.edz
(2.5 KiB) Downloaded 195 times
phase_offset.ini
(43.77 KiB) Downloaded 235 times
phase_offset.dat
(282 Bytes) Downloaded 224 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 978
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Phase offset between field maps

Post by FranceDidier »

Dear Wai-Ming,

All the phase data you need can be found in the tab on the "Data" page.
Firstly, you can delete the SET_SYNC_PHASE command and replace -30° with "∅ input (deg)", just to check that the input phase shift is correct.
Secondly, the last column of data is the aboslute phase along the structure, so the phase between the elements is present, but you have to correct them with the phase shift in the 8th column.

Regards,

Didier
United States of Americawtam
Skilled
Skilled
Posts: 111
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: Phase offset between field maps

Post by United States of Americawtam »

Dear Didier,

I am aware of the "absolute phase" column in the data tab. It gives the absolute phase when the reference ion is at the beginning and at the end of an element. My problem is that with a field map, I can make it arbitrarily long. Please see fieldmap.PNG. The two models have identical physics. But the absolute phase I can read from the Data tab are different. I want to know that from a control system point of view, what is the phase offset between the two "cavities".

Best regards,
Wai-Ming
Attachments
fieldmap.PNG
fieldmap.PNG (21.24 KiB) Viewed 12801 times
phase_offset2.ini
(43.77 KiB) Downloaded 232 times
phase_offset2.dat
(281 Bytes) Downloaded 204 times
phase_offset.ini
(43.77 KiB) Downloaded 232 times
phase_offset.dat
(284 Bytes) Downloaded 191 times
A2_78_194.edz
(3.32 KiB) Downloaded 187 times
A2_78_134.edz
(2.63 KiB) Downloaded 210 times
A1_72_188.edz
(3.19 KiB) Downloaded 209 times
A1_72_128.edz
(2.5 KiB) Downloaded 186 times
User avatar
FranceDidier
Administrator
Administrator
Posts: 978
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Phase offset between field maps

Post by FranceDidier »

Dear Wai-Ming,

I agree that despite the different lengths the physics is the same and therefore the RF phase shift betwwen cavities must be the same. As you have indicated in the FIELD_MAP statement working in absolute phase and not relative, the offset to be imposed on the RF of the control command is directly the input phase (-3.137° and 157.86°). So the RF phase shift to apply between the cavities is the difference between these two values.

This is my first impression, now having worked extensively on the tuning of the cavities of SPIRAL2 for example, I know that all this is finally quite complex and I may be making a mistake in reasoning.

Regards,

Didier
United States of Americawtam
Skilled
Skilled
Posts: 111
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: Phase offset between field maps

Post by United States of Americawtam »

Dear Didier,

The two models give the same input phases (-3.137° and 157.86°) if the FIELD_MAP statement is set to absolute phase, which is good.
If the FIELD_MAP statement is set to relative phase, the input phases itself and the differences between these two values are different for the two models.

I dug into a post from a long time ago in which I asked about absolute vs relative phase. I guess I still don't understand the difference. When FIELD_MAP is set to absolute phase, how is the input phase being calculated? How could it be independent of the length of a specific field map being used?

Best regards,
Wai-Ming
User avatar
FranceDidier
Administrator
Administrator
Posts: 978
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Phase offset between field maps  [SOLVED]

Post by FranceDidier »

Dear Wai-Ming,

In absolute phase, all phases are calculated from the input phase of the machine, i.e. any change in input phase or fields amplitude or phase in a cavity will have an impact on everything that follows. This is typically the notion of RF phase.

Regards,

Didier
United States of Americawtam
Skilled
Skilled
Posts: 111
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: Phase offset between field maps

Post by United States of Americawtam »

Dear Didier,

A follow up question on sign convention.
In this example, the phase offset is 157.87-(-3.14)=161.01. Is A1 or A2 leading? Could you also point me to the manual where it discusses the sign convention?

Best regards,
Wai-Ming
Attachments
Capture.PNG
Capture.PNG (22.43 KiB) Viewed 12772 times
User avatar
Francenpichoff
Global moderators
Global moderators
Posts: 31
Joined: Wed 26 Aug 2020 17:40
Country:
France (fr)
France

Re: Phase offset between field maps

Post by Francenpichoff »

Dear Wai-Ming,

Didier asked me to try to explain the principle of TraceWIN RF phase management.
In traceWIN, the linac is generated with the help of a synchronous particle.
At the start of the simulation, a global clock, oscillating at the Bunch Frequency f_bunch (given on "Main" page) starts at 0°.
At that moment, the synchronous particle starts at s = 0 with :
E = Kinetic energy given in the "Main" page,
x = y = 0 mm; x' = y' = 0 mm.
Its phase phis with respect to the global clock is given by: phis = 360°*f_bunch*t.

In the "Data" page, Abs. phi gives phis when the synchronous particle exits the element.

When one uses an RF element, one needs to define the phase of its RF field.
E = E0 cos(phi) = E0 cos(360°*f_rf*t+phi0)
3 ways are possible:
1- With "set_sync_phase" command, one gives at input phase (parameter 3) the synchronous phase of the synchronous particle in the RF element ("a beam dynamics vision"), --> The code is then calculating the corresponding RF phase in the RF element.
2- Without "set_sync_phase" command, and with parameter10 = 1, one gives at input phase (parameter 3) the RF phase at the start of the RF element simulation (when the synchronous particle enters into the cavity) ("a RF engineer vision"). In that case, the input phase depends on the length of the RF element.
3- Without "set_sync_phase" command, and with parameter10 = 0,one gives at input phase (parameter 3) the RF phase in the cavity at the start of the linac simulation (when the synchronous particle is at s=0) ("a linac engineer vision"). In that case, the input phase does not depend on the length of the RF element.

The main advantage of the 1-, is that the relative phase difference between beam and cavity does not change even if the linac changes (but its absolute phase changes). It is very convenient when you are in the design phase where each element is always changing. Ones considers that the linac tuning will be set after all the changes.

The main advantage of the 3-, is that the absolute phase of each RF element is not changing whatever the beam transport, simulating the linac as it has been tuned (whatever, for example, the errors in the linac). Ones considers that the linac tuning has been done before all the changes.

It is natural to starts with the 1- during design of a linac and then go to 3- during simulation of an existing and alreday tuned linac.

Didier will propose some changes in the naming of the data column to try to make it clearer.

I hope it is clear ?
Don't hesitate to ask me more if not.

Regards.

Nicolas.
United States of Americawtam
Skilled
Skilled
Posts: 111
Joined: Mon 7 Dec 2020 06:17
Location: Boston
Country:
United States of America (us)
United States of America

Re: Phase offset between field maps

Post by United States of Americawtam »

Dear Nicolas,

Thank you very much! It is absolutely very helpful.

Question 1:
E = E0 cos(phi) = E0 cos(360°*f_rf*t+phi0)
In the definition above, it is a "+" sign in front of phi0. So is it correct that in my example, A1 is leading A2 by 157.87-(-3.14)=161.01?

Question 2:
I might have misunderstood but in the 3 possible ways, should it be that parameter10=0 for 2- (i.e. relative phase), and parameter10=1 for 3- (i.e. absolute phase)? I have tried it in the example project that I sent in the post. Great if you could confirm.

Comment:
I really like the various visions you used when explaining the topic. But I cannot appreciate calling 2- "a RF engineer vision". My perspective is that the relative phase option is confusing (at least to me). In the limiting case where the field map has zero length, i.e. GAP, the input phase is simply the synchronous phase. In the other limiting case where one can make afield map arbitrarily long by zero padding, the required input phase to get the same synchronous phase would just change depending on the size of the zero padding. It is confusing to a RF engineer, and everyone. You have not suggested a use case for 2-. I speculate that 2- was originally designed for the use case in which one can set the synchronous phase for the GAP element without the SET_SYNC_PHASE command. What is your comment?

Best regards,
Wai-Ming
User avatar
Francenpichoff
Global moderators
Global moderators
Posts: 31
Joined: Wed 26 Aug 2020 17:40
Country:
France (fr)
France

Re: Phase offset between field maps

Post by Francenpichoff »

Dear Wai-Ming,

Q1 : Correct.

Q2 : Correct, my mistake !

Q3 : Again my mistake.
2- (the RF cavity vision) corresponds to Parameter10=0 (not 1); In this case, for a same acceleration in the cavity, the phase doesn't depend on the length of the drifts between the cavities.
3- (the linac vision) corresponds to Parameter10=1 (not 0); In this case, for a same acceleration in the cavity, the phase does depend on the length of the drifts between the cavities (due to longer transit time).

The RF engineer (who knows the field map of the cavity) can tell at which RF phase the synchronous particle has to enter into the cavity.
But only the linac designer will be able to tell at which absolute phase the cavity has to be with respect to the other cavities. If he decides to change the length of a drift, all cavity absolute phase (given by Parameter10=1) will have to be changed but not if one uses Parameter10=0.

Best regards.

Nicolas.
Post Reply