## 2 Sample Environment Components
### Motion Control and Sample Alignment  
The alignment of thin film samples for GISANS or NR measurements is crucial and requires high accuracy. Therefore, an inherent alignment system was installed on top of the optical breadboard consisting of a lateral y-translation stage perpendicular to the neutron beam (set as x direction hereafter), a vertical z-translation stage, and an angular translation stage for both rotations around the x- and y-axes. For the y-translation stage, the LS-180 (PI miCos GmbH, Eschbach, Germany) with a 508 mm travel range (as seen in Figure 8a,b) is used. It is equipped with a two-phase bipolar half-coil stepper motor (PK-258-02B, Oriental Motor) and a linear optical encoder with an RS422 quadrature output signal (LIA 20, NUMERIK JENA), and it allows for the positioning of an up-to 100 kg load with an accuracy of 1 \(\upmu\)m. The z-translation is achieved with the 5103.A10-35 z-stage, and the angular translation is achieved with the 5203.10 2-circle-segment (both Huber Diffraktionstechnik GmbH & Co. KG, Rimsting, Germany). They are shown in Figure 8c,d equipped with two-phase hybrid stepper motors (ZSS43.200.1.2, Phytron) and optical absolute rotary encoders (OCD-S101G-1413-S060-PRL, Posital/Fraba) with an accuracy of 0.022\({}^{\circ}\) (multiturn). The z-stage offers a travel range of 35 mm, while the 2-circle segment offers an angular range of \(\pm\)14\({}^{\circ}\), which even covers strong tilts as well as the usual angles of up to around 3\({}^{\circ}\) that are used in GISANS or NR. Initial height adjustments with a 0.1 mm accuracy are possible by the lifting table that is part of the mounting system. The stages are assembled as shown in Figure 8e, with the linear stage screwed to the optical breadboard, the z-stage mounted on top of the linear stage, and the 2-circle segment located at the very top. The pivot point of the 2-circle segment is 110 mm above its top edge, and the position of the sample within the humidity chamber is 74 mm above its bottom edge. As such, a 36 mm spacer with a 10 mm PTFE plate is used between the 2-circle segment and the chamber, which additionally functions as insulation of the alignment components from the temperature changes of the chamber. Figure 7: Film thickness (red) and humidity (black) during a continuous spectral reflectance measurement at 20 \({}^{\circ}\)C and a 20%RH step-wise increase of the humidity from 0% to 96% RH. In order to control the different stages, a custom-made control unit was assembled based on the Ethernet-based fieldbus system EtherCAT [50] (Ethernet for Control Automation Technology) (Beckhoff Automation GmbH & Co. KG, Verl, Germany). The layout of the motion control unit is shown in Figure 9a. The motors (M1-4) and encoders (E1-4) belong to the LS-180 linear stage (M1, E1), the z-stage (M2, E2), and the 2-circle segment (M3, M4, E3, E4). Three power supply units are installed in a 19-inch rack together with an embedded computer and the required EtherCAT terminals. The 48 V supply feeds the 4 motors, while the 24 V power lines feeds the CX5130 embedded PC and thereby also the internal terminal power circuit. The EL9189 is a 0 V potential distribution terminal to which M1 was connected. The two EL1808 24 V are digital input terminals that registered the limit switches of the four motors (two per terminal). The EL2819 is a digital output terminal that connects the 24 V signal of the automation unit to the three encoders of the z-stage and 2-circle segment, and the two EL5002 are the SSI encoder interfaces for these three encoders. Since E1 provides an RS422 signal, EL5101, which is an incremental encoder interface that registers RS422 differential signals, is used. The four EL7041-0052 are stepper motor terminals to which M1-M4 are directly connected. Lastly, the EL9011 is a bus end cover that terminated the bus station and covers the contacts. If not supplied via a terminal, the motors, encoders, and cable shields are grounded via the power supply.