The digital data processed by the PICs is organized into packets that are interchanged between them, and between the ComPic and the USB transceiver. There are three types of data depending on their length: the 8-bit, 16-bit and 32-bit numbers. The first ones are status variables, while the second ones are physical magnitudes (PSDs, piezo voltage). The third ones are used by the MotorPic. Following there is a list of the more relevant variables contained in the structures of data in the PICs.
- mode. It is a 8-bit variable that holds the working mode of the TrapPic. Depending on its value, the TrapPic works in manual mode or performs some type of feedback such as constant position, constant force or autoalign.
- gain and rateDivider. These are two 8-bit variables that are used to perform the feedback algorithms. A feedback is a routine that changes an output controlled variable to produce a desired value (target) to an uncontrolled input variable. For instance, the position of the optical trap (output) can be changed in order to produce a desired force (input variable). All the feedbacks perform the following loop:
is the new value that the output variable will have after the calculation,
is the value that the output variable had before the calculation,
is the desired value for the input magnitude,
is the actual value of the input magnitude and is a tunable parameter called Gain. This algorithm is named proportional, since the correction in the output variable is proportional to the difference between the actual and the target values of the input magnitude. The Gain controls the response to this difference and it has to be tunned. Large gains produce large responses that might lead to oscillations. Low gains might lead to slow responses that never reach the target value. Finally, the rate divider is another control variable that allows to skip the algorithm every once in a while, in order to produce more stable feedbacks. It also has to be tunned.
- psdX, psdY, psdSum, iris, leverX, leverY, leverSum. These are 16-bit variables that hold the data from the photodetectors and there is one set of them for each TrapPic. They can take values between 0-65535 in adu. The variables that represent deflections (psdX, leverY, etc.) can be positive or negative. As a convention, the middle value 32768 is taken as 0, so that positive (negative) values are larger (smaller) that this value. All these variables are sent to the host that has to perform the conversion to physical magnitudes after the calibration procedure.
- piezoX, piezoY. There are two of these 16-bit variables for each TrapPic. They represent the voltage of the piezo crystals of the wiggler. There is a conversion between the 0-65535 adu units and the 0-150 V applied to the piezos.
- positionX, positionY, positionZ. These are three 32-bit variables used by the MotorPic. These variables hold the values of the 24-bit counters and permit to infer the position of the motor. They must be so long in order to cover the whole range of the motors.