| 1 |
1 |
'''[wiki:GraspSwControllerCmd readcal]''' |
| 2 |
2 |
[[TracNav(GraspContents)]] |
| 3 |
3 |
||Command:||'''readcal'''|| |
| 4 |
4 |
||Contexts:||Network socket, serial console, stage2 only|| |
| 5 |
5 |
||Function:||Calibrate signal chain to bring in range of the ADCs.|| |
| 6 |
6 |
||Required Parameters:||None.|| |
| 7 |
7 |
||Optional Parameters:||If '''adulevel''' omitted, readcal just measures pedestal.|| |
| 8 |
8 |
||'''adulevel='''||A number of counts, like '''5000'''|| |
| 9 |
9 |
||'''channel='''||[r] Select between '''r'''ed '''g'''reen and '''b'''lue ADC channel|| |
| 10 |
10 |
||'''cellrow='''||(Use [wiki:GraspSwControllerCmdOtacal otacal] command instead of readcal for OTAs)|| |
| 11 |
11 |
||'''dev='''||[current] Select dev '''0''' or '''1''' (>= r5696 stage2 ONLY)|| |
| 12 |
12 |
[[Image(Offsetting_CAL_STARGRASP_CCD_case.png)]] |
| |
13 |
|
| |
14 |
== What Does "readcal" Do? == |
| |
15 |
|
| |
16 |
Each pixel value generated by the STARGRASP controller is the |
| |
17 |
result of multiple individual digital samples of the channel's |
| |
18 |
internal Analog to Digital Converter (ADC) 0 to 4V range, shown above. The process used |
| |
19 |
is known as Digital Correlated Double Sampling (DCDS). Although |
| |
20 |
multi-sampling readout parameters are configurable at runtime with the '''cestlavie''' program and the '''[wiki:GraspSwControllerCmdClvset clvset]''' command, most STARGRASP CCD |
| |
21 |
readouts sample the reference pedestal level (ped) for each pixel |
| |
22 |
four times, and the video signal level (sig) four times. All eight of these |
| |
23 |
samples must be within the 0-4V limits of the 16-bit ADC (0..65535). |
| |
24 |
The difference between the average (arithmetic mean) of the |
| |
25 |
four reference pedestal values is subtracted from the average |
| |
26 |
of the video to produce the pixel value. |
| |
27 |
|
| |
28 |
All four of the reference pedestal samples must always be above |
| |
29 |
the floor that the A/D can measure, and an internal offset voltage |
| |
30 |
(per channel) must be used to "steer" the value to something |
| |
31 |
above zero, but not too high. (The side effect of being too |
| |
32 |
high would be reduced dynamic range.) |
| |
33 |
|
| |
34 |
In order to converge more quickly, the starting point for the readcal algorithm is the last known |
| |
35 |
calibration value. If it fails to converge, that offset voltage |
| |
36 |
(and next starting point) is set to 0 uV. For this reason, |
| |
37 |
sometimes readcal must be run twice to succeed, especially if |
| |
38 |
incorrect values (from a different boardset or preamp, for example) |
| |
39 |
were used as the starting point. |
| |
40 |
|
| |
41 |
If readcal is taking a long time to complete, or of it is failing to converge, it is often because a new |
| |
42 |
starting point should be recorded. The other common cause of failure can be super-saturation of the CCD. |
| |
43 |
The CCD should always be dark (shutter closed, no major light leaks) and be cleaned multiple times |
| |
44 |
before attempting readcal. |