From: Usher, Nathan
Sent: Thursday, July 19, 2012
10:04 AM
To: Davis, Mark
Subject: Re: PhCtlr and LLRF2
waveform data formats
Mark,
The
easiest way to scale the value in those waveforms would be to take each value
and do the following:
<scaled
amplitude> = 65536.0 * cavMagCalib * cavAmplGain * (float) <unscaled
amplitude>
That
will produce the same scaling the operators see when they look at all of the
other cavity amplitude registers.
You
could also use the maxCavAmpl register to set the upper limit of the plot's
y-axis, since that is the maximum safe value for the amplitude.
Nathan
On
Jul 19, 2012, at 7:05 AM, Davis, Mark wrote:
Nathan,
Regarding the
“unscaled” values for the amplitude values in waveforms 0 and 1: Does
that mean you have control of the reference voltage so you can change the
effective range of the values? If so, is there any value that can be read
to determine what the scaling should be at any given time? Or perhaps a
setting that controls it? Or is this set by some resistor or something
that might be different for different modules?
Another educated
guess: That it doesn’t much matter, so long as the values going in to the
FFT calculation are scaled the same and use a reasonable percentage of the
ADC’s range (without exceeding it) ?
But even so, it would
probably make the operators and experimenters happy if we COULD scale it to
some meaningful value. Perhaps add a status bit that warns if the value
reaches or exceeds the ADC’s range? Even the Rabbit could do that,
although it would slow down the read process a bit.
Mark
From: Usher, Nathan
Sent: Wednesday, July 18,
2012 8:53 AM
To: Davis, Mark
Subject: Re: PhCtlr and
LLRF2 waveform data formats
Hi
Mark,
I
filled in what I know down below. I'm not sure about the byte order since
I'm using the hardware serializer. It would take me 10-15 minutes to
figure out the configuration if you really need to know.
Nathan
By waveform #:
0: Ampl & Phase leading/rising edge:
Each 32-bit value contains (2) 16-bit int values
1st 16-bits = 16-bit Ampl value (int mult of some value?) (least significant byte 1st)
These are unscaled
amplitudes. I left them unscaled so I could easily see how close we are
to saturating the ADC.
2nd 16-bits
= 16-bit Phase value (int mult of 360/2^16?) (least significant
byte 1st)
correct, the scaling is
260/2^16
1: Same as waveform #0 except
for the trailing/falling edge
correct
2: FFT: Each
value is a 32-bit IEEE float (network byte order/most significant byte 1st)
(no scaling needed?)
correct, the unit is dBc
3: CTF Phase:
(expressed as a 32-bit int multiple of 360/2^32? In network byte order?)
This is not currently used,
but that scaling would be correct.
4: CTF Amplitude:
(expressed as a 32-bit float or a 32-bit int mult of some value? In
network byte order?)
This is not currently used
Are all int values unsigned?
All int values representing
amplitude are unsigned. Phase values can be treated as unsigned if you
want a range of 0-360 degrees or as signed if you want a range of -180 to +180
degrees.
For the new LLRF2 module, will it
(does it) provide the same waveforms? And what formats will it use for
each data stream?
The new module provides all
but the CTF waveforms.