The impact of Kelvin probe force microscopy operation modes and environment on grain boundary band bending in perovskite and Cu(In,Ga)Se2 solar cells

An in-depth understanding of the electronic properties of grain boundaries (GB) in polycrystalline semiconductor absorbers is of high importance since their charge carrier recombination rates may be very high and hence limit the solar cell device performance. Kelvin Probe Force Microscopy (KPFM) is the method of choice to investigate GB band bending on the nanometer scale and thereby helps to develop passivation strategies. Here, it is shown that amplitude modulation AM-KPFM, which is by far the most common KPFM measurement mode, is not suitable to measure workfunction variations at GBs on rough samples, such as Cu(In,Ga)Se2 and CH3NH3PbI3. This is a direct consequence of a change in the cantilever-sample distance that varies on rough samples. Furthermore, we critically discuss the impact of different environments (air versus vacuum) and show that air exposure alters the GB and facet contrast, which leads to erroneous interpretations of the GB physics. Frequency modulation FM-KPFM measurements on non-air-exposed CIGSe and perovskite absorbers show that the amount of band bending measured at the GB is negligible and that the electronic landscape of the semiconductor surface is dominated by facet-related contrast due to the polycrystalline nature of the absorbers.


Introduction
High performance polycrystalline thin film solar cells are very interesting alternatives to the mainstream silicon-based devices due to their low manufacturing costs combined with low energy payback time [1]. Stacks of different materials, that form the solar cell are usually deposited on low cost glass substrates, flexible polyamide or steel foils, which leads to polycrystalline absorbers with typical grain sizes in the micrometer range, separated by grain boundaries (GBs). The optoelectronic impact of these planar lattice defects in thin-film solar cells is still intensively studied [2,3] It is known that the interruption of the crystal periodicity in semiconductor materials and the resulting dangling or strained bonds often lead to energy states in the bandgap, which thereby may lead to the formation of charges at the GBs [4]. According to simulations, charges at the GBs deteriorate the solar cell performance due to losses in open-circuit voltage (V OC ) and fill factor (F F ) [4,5]. Consequently, from a simulation point of view, GBs are not beneficial as they act as recombination centers for charge carriers [6].
In this work, we focus on one particular scanning probe technique, namely Kelvin Probe Force Microscopy [24,25], which has been used frequently to measure the electrostatic properties of thin film solar cell absorbers [3,26,27].
During KPFM, the contact potential difference (CPD) between a sharp conductive probe and the surface of a sample can be acquired with nanometer resolution. The measured CPD is proportional to the workfunction difference between the probe and the sample. In the case of a known probe workfunction, KPFM allows to quantify band bending at grain boundaries in polycrystalline materials [22,[28][29][30][31]. However, as we will show in this manuscript, the correct interpretation of the measured workfunction changes at the GBs is not trivial and many pitfalls need to be considered and eliminated.
In this work, we will show explicitly how different measurement setups and sample properties impact the interpretation of band bending at GBs.
We focus on two very important classes of materials, namely halide perovskites and Cu(In,Ga)Se 2 (CIGSe). Both material systems have demonstrated power conversion efficiencies (PCE) higher than 23% over the last years [32] and are already industrially manufactured or are in the process of entering the market. Due to the abundance of GBs in these materials, recombination losses are often attributed to recombination at the GBs. Quite a few results in literature suggest a strong relation between charge accumulation and variations in power conversion efficiency (PCE). Specifically there, KPFM emerged as a powerful tool to access the local electronic properties at the sample surface [22,26,31,[33][34][35][36][37][38]. In the following, we compare the results for two KPFM detection methods: Amplitude Modulation KPFM (AM-KPFM) under ambient conditions and Frequency Modulation KPFM (FM-KPFM) under ultra-high vacuum (UHV) conditions. Even though the AM-KPFM is known to suffer from several issues [39][40][41], it is still the most widely used method in the solar cell community. We compare the two measurement modes on four types of samples: gold on silicon acting as a reference sample, single-crystalline Cu-rich CISe, polycrystalline Cu-poor CIGSe and polycrystalline CH 3 NH 3 PbI 3 (MAPI). Our measurements are supplemented with electrostatic calculations to reveal how the surface roughness impacts the KPFM results. Finally, we discuss grain boundary band bending measurements that are free of artifacts.

Sample preparation
Perovskite & CIGSe absorbers: Methylammonium lead triiodide perovskites (CH 3 NH 3 PbI 3 ) (MAPI) absorbers were deposited on FTO (fluorinedoped tin oxide) covered glass substrates via co-evaporation carried out in a physical vapour deposition chamber embedded in a nitrogen-filled glovebox. A constant temperature of 330 • C was used to evaporate PbI 2 and the temperature of the MAI was kept at 110 • C. The growth was carried out at room temperature. The samples were then transferred to the UHV KPFM apparatus, using an inert-gas transfer system. Epitaxial Cu-rich CuInSe 2 (CISe) films were grown by metal-organic vapor phase epitaxy (MOVPE) on (100)-oriented semi-insulating GaAs wafers at 530 • C and 50 mbar. Details of the process can be found in [15,42]. The absorbers were approximately 500 nm thick and the samples were transferred with the same suitcase directly into the SPM chamber without air exposure.
A Cu/In=1.15 was measured via energy dispersive X-Ray analysis (EDX) at 10 kV.
Polycrystalline CIGSe absorbers were grown via multi-stage coevaporation carried out in a molecular beam epitaxy system (MBE). Details of the growth process can be found in [43]. The Cu/(In+Ga) and Ga/(Ga+In) ratios measured by EDX were 0.85 and 0.31 respectively. The quasi-Fermi level splitting measured via calibrated photoluminescence was 697 meV under one sun equivalent conditions, which corroborates that the absorbers had an excellent optoelectronic quality. The samples were transferred from the MBE chamber (base pressure low 10 −9 mbar range) to the SPM chamber via a UHV suitcase.

AFM characterization techniques
FM-KPFM measurements were carried out using a UHV VT-AFM system (Omicron) operated in the low 10 −11 mbar pressure range. Topography and potential information were measured simultaneously by using the cantilever resonance frequency as feedback with two independent lock-in amplifiers. The applied AC voltage ranged from 0.2 V to 0.4 V at 1.25 kHz. The used probes were Pt/Ir PPP-EFM (nanosensors) with a resonance frequency between 70 kHz and 90 kHz.
AM-KPFM measurements were carried out with a Nanoscope V (Digital instruments) operated in double-pass mode, with topography being acquired in the first pass at the resonance frequency of the probe. Surface potential was acquired in the second pass with the probe lifted by a few nanometers from the sample surface. The AC voltage used during the KPFM measurements was 5 V. The used probes were identical to the ones for the UHV FM-KPFM measurements.
The differences between AM-and FM-KPFM are discussed in more detail in the Supplementary Information (SI). The experimental implementation and their limitations are explained and illustrated with measurements on reference samples (see Figs. S1 and S2 of SI). From the measurements carried out on the reference sample one can conclude that AM-KPFM is easier to implement and that this method has a better voltage resolution, down to 5 mV, while FM-KPFM can detect CPD values down to 10 mV [26].
On the other hand, FM-KPFM yields to a more precise quantification of the workfunction and better lateral resolution in complete agreement with the literature (see detailed discussion in SI).

Literature Review on band banding and solar cell efficiencies
Before presenting the results, we review the available literature on band bending at grain boundaries measured with KPFM. We limit the discussion to MAPI and CIGSe absorbers and their devices. As discussed in the introduction and in the SI, band bending can be characterized by the difference in workfunction (or CPD) between the GBs and the grains. In order to see if there is a direct correlation between band bending and solar cell efficiency, we plot in Fig. 1 (a), the difference between the reported CPD values at GBs (CP D GB ) and the CPD at the grain surfaces (CP D Grain ) as a function of the reported PCE for devices made from the same absorber [21,31,33,37,[44][45][46][47][48][49][50][51][52][53][54][55][56][57][58][59][60][61].
All displayed values are plotted such that they refer to measurements where the bias is applied to the sample. In the SI (Table S1) more experimental details for each of the references can be found. Negative values for CP D GB -CP D Grain refer to downward band bending due to an excess of positive charges at the GBs whereas positive values for CP D GB -CP D Grain refer to upward band bending accompanied with an excess of negative charges. This is illustrated schematically in Fig. 1 (b,c) where a cantilever and a representation of a surface including a positively charged GB is presented together with the corresponding band diagram. Charged defects that are responsible for band bending impact the vacuum level (VL), the conduction band (CB), and the valence band (VB) compared to the grain interior.
In Fig. 1 (a) the data points are split into different categories namely air- However, there are other reasons that are not directly linked to the absorber and the fabrication process itself, which will be discussed in the following. First of all, many KPFM measurements presented in Fig. 1 (a) were performed under ambient conditions, which might induce "environmental" artifacts such as sample contamination with oxygen and water, modifying the surface dipoles [63][64][65]. Secondly, most of the KPFM data shown in Fig. 1 (a) (check table S1) were collected using AM-KPFM, which is the KPFM variant known in literature to be strongly influenced by the long range electrostatic force contribution of the complete probe to the measured electric force [26,40,41,[66][67][68][69][70]. The direct consequence of this coupling is a poor spatial resolution and a wrong absolute workfunction value (see SI for measurements performed on a reference sample). This problem has been known in the community for quite some time. Here we would like to highlight an additional problem when measuring polycrystalline solar cell absorbers with AM-KPFM, namely the surface roughness.
In Fig. 1 (b) a schematic representation of a probe moving over a GB is depicted. When the probe scans over the surface, the sharp probe apex follows the contour of the topography, thereby also entering into the GB region.
As a consequence, the distance between the cantilever and the sample surface changes by ∆h = h G − h GB , where h G and h GB denote the cantilever-sample distance at the top of the grain and at the GB, respectively. This change has so far never been taken into account when discussing KPFM measurements on polycrystalline absorbers, since typical values for the probe height H are in the order of 12 µm and ∆h values only range up to several hundred nanometers. Consequently, it seems at first glance well justified that these changes can be neglected. As we will show in the following, this assumption is not justified for the case of AM-KPFM whereas it works out well for the FM-KPFM case, which has important consequences for the interpretation of work function changes at the GBs.
In the rest of this manuscript, we therefore investigate the impact of the environment and the impact of the grain boundary depth ∆h on GB band bending in order to better understand the literature data and our own measurements. measurements were first performed under UHV on a non-air-exposed perovskite sample ( Fig. 2 (a,d)), then transferred to the air AM-KPFM setup to measure it under ambient conditions ( Fig. 2 (b,e)). After two days of air exposure the sample was introduced back into the UHV system in order to check if the same topography and workfunction map could be recovered ( Fig. 2 (c,f )). All the images were adjusted for maximum contrast and are reprinted in the SI with the same scale bar contrast (Fig. S4).  To check the reversibility of the observed changes, the sample was moved back to UHV to perform once again FM-KPFM measurements on the same, albeit air-exposed sample ( Fig. 2 (c, f )). The magnitude of the CPD values increased again, but the CPD contrast prior to air exposure could not be recovered. This time, a weak correlation of the CPD contrast at grain boundaries and no facet-dependent contrast was observed.

The impact of the environment and sample history
The results presented in Fig. 2 (a,d) and Consequently, the band bending information extracted from the two measurements are different, which renders a direct correlation with the solar cell performance challenging. However, as we will show in the following, there is a much more fundamental difference between the two measurement modes, which results in an erroneous GB contrast in AM-KPFM.

The impact of KPFM mode on Perovskite GB contrast
In the following, we discuss why the measured contrast at the grain boundaries acquired with AM-KPFM cannot be trusted. This is shown exemplary in Fig. 3, where the topography and CPD images measured on another MAPI absorber are depicted. Again, a clear correlation between grain and grain boundaries is observed, which could be attributed to a small downward band bending. We stress that all other AM-KPFM measurements on other perovskite absorbers could also have been used for the following discussion (see Fig. S8 where the following evaluation is done on the measurement presented in Fig. 2). The total force acting between the cantilever and the sample can be divided into several contributions, namely, the cantilever, the cone, and the probe apex, as illustrated in the sketch of Fig. 1 (b). It has been shown for probe-sample distances that are relevant in most experiments that the cantilever contribution in AM-KPFM dominates [67]. In Fig. S3, the individual contributions (apex, cone, cantilever) are summarized, as it was done previously by Wagner et al. [67]. All measurements presented in this manuscript were carried out with lift-heights of 50 nm. In that case, the dominant contribution to the electrostatic force is given by the cantilever (denoted F lever ), which can be expressed via: The cone height is denoted as H and the distance between the probe apex and the sample as z. The potential difference between the cantilever and the sample is given as U ts , A is the area of the cantilever and 0 the permittivity. Consequently, the force exhibits a quadratic dependence on U ts and the remaining distance dependence can be lumped in the capacitance gradient ∂C ∂r , which is assumed to be constant during AM-KPFM. As sketched in Fig. 1 (b) the measurements of GBs at a constant probe-sample distance z lead to a change in the distance between the cantilever and the sample, reducing from h G when the probe apex is at the grain to h GB when the probe apex enters the GB. We denoted this change as ∆h = h G −h GB , which results in a change in the electrostatic force ∆F lever , which can be calculated via: Equation 2 is written in two different forms. In the first part, a change in force is reflected in a change of the capacitance gradient, which is just the difference between the probe apex inside the GBs and the probe apex on the grain surface. The expression after the equivalent sign arises from the fact that in AM-KPFM the capacitance gradient is usually not compensated and assumed to be constant over the scanned area. Consequently, changes in force due to changes in height are not explicitly taken into account. Therefore, all changes in ∆F lever in AM-KPFM result in an apparent potential variation, denoted as ∆U ts with ∂C ∂r being constant (see equation 2). Solving for ∆U ts therefore allows to estimate the apparent change in CPD, induced by a change of the cantilever-sample distance. In other words, ∆U ts shows the variation in the electrostatic force due to changes in the capacitive coupling when the distance between the cantilever and the sample is changed, keeping the probe apex/sample distance constant.
This leads to an apparent change in the CPD by ∆U ts = 6.4 mV. This value is very close to the contrast variations we observed in Fig. 3 (b).
However, each GB has a slightly different depth. To take this into account, we used the topography acquired during the AM-KPFM ( Fig. 3 (a)) as the input value for changes in the cantilever-sample distance ∆h. Then for each pixel of the topography image, we calculated ∆U ts , which is depicted in Fig. 3 (c). Random noise of 2 mV peak to peak was added to this image in order to be as close as possible to the real KPFM setup. Fig. S10 of SI shows a comparison between the simulated images with and without the random noise.
The results of the calculation highlight impressively that the measured workfunction map via AM-KPFM is almost identical to the simulated im-age that considers only changes in electrostatic forces due to variations in the cantilever-sample distance at the GBs. There is no information included in the calculation that arises from the probe apex or cone. Consequently, the calculation suggests that there is no physical meaning in the AM-KPFM measurement performed on the perovskite sample. The only remaining explanation that would allow us to interpret the AM-KPFM measurements as band bending would be to assume that the number of defects at the GBs would be proportional to the GB depth. To exclude this, measurements on a rough single-crystalline surface without GBs need to be analyzed, which is discussed in the next section.

Facet contrast measured on single-crystalline CISe
In analogy to the measurements carried out on the MAPI absorbers, ambient AM-KPFM and UHV FM-KPFM were acquired on the same epitaxial CISe surface. Fig. 4 (a,c) depict the topography of the layers, where trenches aligned in the [011] direction with height variations in the order of 100 nm between valley and peak were observed. This highly textured growth is well known for epitaxially grown CISe material and it is related to the formation of polar (112) facets [71,72]. Fig. 4 (b,d) depicts the respective surface potential images adjusted for maximum contrast (for the same images with fixed scale bars from 0 to 300 mV, check SI Fig. S11 (b-d)).  In the FM-case (Fig. 4 (d)) some topographic features, namely, the (112) and (312) facets showed higher workfunction values compared to the other facets as reported previously [73]. In AM-KPFM ( Fig. 4 (b)) almost all topographic features exhibit a weak contrast in the potential images, which is not in accordance with the FM-case. To understand the origin of the measured AM-KPFM signal, we used the same approach, as described in the section 4.1 and calculated the changes in CPD arising only from the change in height between the cantilever and the sample. images were taken from the same spot and are presented in Fig. 4 (g). The agreement between the simulated and the measured data is excellent, which allows to conclude that the signal in AM-KPFM arose almost entirely from the capacitive coupling between the cantilever and sample.
The measurements on epitaxial CISe and measurements on polycrystralline MAPI therefore show strong capacitive cross-talk at the trenches.

Surface contamination and polycrystalline absorbers
So far, we have identified two important problems that need to be taken care of to measure accurate workfunction maps. Samples cannot be airexposed for a prolonged time and FM-KPFM measurements instead of AM-KPFM measurements need to be performed in order to reduce the capacitive cross-talk at the GBs. In this section, the aspect of surface contamination will be discussed in more detail and measurements on non-air-exposed polycrystalline CIGSe absorbers will be analyzed. represent the as-grown and non-air-exposed condition. (b), (f) represent the same nonair-exposed sample that was kept in the UHV environment for 20 months. (c) and (g) show topography and KPFM measurements after UHV annealing of the aged sample ((b),(f)).
(d) and (h) depict the topography and workfunction map after UHV annealing of another piece of the same sample that was exposed to ambient conditions for 6 months and then annealed.  [73]. After 20 months in UHV, this sample was measured again (Fig. 5 (b,f )) and despite the fact that the topography did nominally not change, the high workfunction values at some specific facets were no longer present. Instead, only a shallow dark workfunction contrast of approximately 30 meV aligned in the direction of the trenches was visible. The origin of this remaining contrast is not clear at present. The physical processes that govern the disappearance of the facet contrast is most likely linked to adsorbates that physisorbed on the absorber surface and obscured the surface dipole induced workfunction contrast [74]. In order to clean the substrate surface, the sample was annealed for 30 minutes at 200 • C in UHV. The annealing temperature was chosen such that absorber surface deterioration due to loss of selenium could be neglected [18,75]. procedure. Again, the topography image did not change compared to the previous measurements ( Fig. 5 (a,b)), however, the surface potential map We did the same annealing procedure for another piece of the same sample that was stored in air instead of UHV. In Fig. 5 (d,h), the topography and workfunction map of an air-exposed CISe sample after heating are presented. A clear contrast in CPD was observed, which is however not linked to a specific facet but rather to a random distribution of areas with varying workfunction values. We associated it to the formation of an oxide layer on the CIGS surface that cannot be removed with the annealing for 30 minutes at 200 • C in UHV. The average workfunction value of this sample (4.42 ± 0.08 eV ) was lower than the one of the pristine absorber, which corroborated that annealing of air-exposed samples could not be used to recover the initial workfunction values and the facet related contrast.
Unfortunately, the same procedure cannot be used for the case of halide perovskites, which are very temperature sensitive. In a recent work from Gallet et al. [20], this was corroborated for the case of MAPI absorbers where in the best case, the samples could be heated up to approximately 100 • C in nitrogen. In vacuum, this value decreases even further, due to the volatile nature of the MAI [76]. Consequently, for the case of halide perovskites a fast measurement directly after growth without air exposure is mandatory.  The average workfunction is close to the one of the non-air-exposed epitaxial CISe surface, which is very reasonable. From the separate topography and workfunction maps, it is hard to differentiate between workfunction and facet contrast. In Fig. 6 (c) a three-dimensional overlay of the topography and the CPD map is shown. It becomes clear that again most of the contrast is related to different parts of the grains, i.e. facets in analogy to the MAPI samples presented in this study. Therefore, 20 line profiles perpendicular to the grain boundaries are presented in Fig. S12 (retrace scan) and

Conclusions
In contrast of up to 500 meV is in agreement with a reports of CuGaSe 2 grown on ZnSe [22] and some reports carried out on halide perovskites [23,77].
Halide perovskites show either a facet-related contrast (this work), or a weak GB contrast with values smaller than 100 meV. This contrast depends sensitively on the surface state (annealed versus as-grown [20]) or the type of surface passivation [78].
In agreement with the measurements on polycrystralline absorbers, epitaxial non-air-exposed CISe samples also show prominent facet contrast, originating from (112) and (312) surface terminations. Prolonged exposure to the residual gas inside the UHV chamber or air exposure resulted in a com-plete disappearance of this contrast. We showed that a mild UHV annealing at 200 • C is an effective tool to recover the pristine properties of the absorber layer. On the other hand, annealing of air-exposed samples resulted in a different workfunction distribution, which we related to the formation of oxides on the surface of the absorber. These results corroborate that air exposure needs to be circumvented and cannot be compensated by UHV annealing.
Future studies should focus on understanding how these strongly varying surface dipoles, that are responsible for the facet-related contrast can be modified by post deposition treatments to form an interface with low number of defects. Ultimately, the impact of these workfunction variations on device performance needs to be understood.

Conflict of Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper. the oscillating electrostatic force will be null, and the KPFM electronics will record the applied voltage to build a surface potential map of the sample.

Laboratory -LNNano
In AM-KPFM, changes in the amplitude of the oscillating electrostatic force are directly measured via the probe deflection at a determined frequency. The KPFM feedback loop applies a V DC bias in order to nullify the amplitude oscillation. This procedure can be done in a single-pass mode by using phase-sensitive detection of the mechanical oscillation at a frequency f e distinct from the probe fundamental resonance f 0 [24]. Alternatively, it can also be done in double-pass mode, where the topography is measured in a first step, then the probe is retracted and kept a few nanometers away from the sample surface to record the potential information [25]. In double-pass mode, the electrostatic force is decoupled physically from the short-range forces.
Conversely, in FM-KPFM, a resonance frequency shift (∆f ) is induced by the V AC oscillating voltage. In this case, the fundamental mechanical resonance (f 0 ) of the probe is modulated by a frequency f mod (1 -2 kHz), generating sidebands at f 0 ± f mod , which are proportional to the gradient of the electrical forces [66]. The KPFM feedback loop then applies a V DC bias to nullify the frequency shift at f 0 + f mod .
In principle, AM-KPFM and FM-KPFM should give exactly the same surface potential values, however, it has been demonstrated in the literature that this is not the case [68][69][70]. The differences are generally attributed to the higher lateral sensitivity of the FM-KPFM, in which the capacitive coupling between the cantilever and the sample can be avoided. Due to the simpler technical implementation, AM-KPFM is the most frequently used setup under ambient conditions, however, FM-KPFM provides more consistent results [41]. FM-KPFM is also the most convenient technique under UHV conditions because the distance between the probe apex and the sample surface can be better controlled.
To confirm the results from the literature and to make sure that our setups are working properly, we measured a commercially available KPFM reference sample composed of a gold pattern on silicon substrate. Figure S1 shows a KPFM measurement on a gold patterned silicon substrate (Anfatec Instruments AG) measured under ambient conditions in AM mode ( Figure   S1 (a, c)) and under UHV conditions in FM-mode ( Figure S1 (b, d)).
In the topography images ( Figure S1 (a, b)), the bright regions of the images represent the gold patches. The equivalent surface potential maps are depicted in the Figure S1 Figure S1(e) depicts the line profiles of the surface potential extracted from the images under ambient and UHV conditions, red and blue lines, respectively. We observed a shift in the surface potential of around 1200 mV between the two line-profiles that was not expected since we used the same Pt-Ir probe. Additionally, we could see that the contact potential difference between the gold and silicon under ambient conditions was reduced by a factor of three compared to UHV conditions (170 mV compared to 500 mV). We attributed these well-known effects to the presence of a water layer on the sample surface exposed to air that adds a dielectric contribution and stray capacitance field to the value measured by KPFM [63][64][65].
The AM-KPFM under ambient conditions is sensitive to the electrical force, and consequently, the full cantilever contributes to the signal due to a capacitance coupling with the sample. FM-KPFM under UHV is sensitive to the gradient of the electrical force, which is more confined to the probe apex and, therefore, reduces the cross-talk and improves the resolution. From these measurements, we concluded that AM-KPFM under ambient conditions as well as FM-KPFM under UHV conditions could resolve the workfunction difference between the gold/Si pattern, however, as already shown in the literature, FM-KPFM yielded a better lateral resolution and values of the workfunction difference closer to the expected one (≈ 0.5eV) [41,68,69].
To corroborate that FM-KPFM provides better quantitative workfunction measurement than AM-KPFM independently from the environment, we used both methods under UHV and at the same position of the gold pattern sample. These measurements are depicted in Figure S2. Similarly to the previous images, the brighter regions in the topography ( Figure S2 (a, c)) represent the gold patches, which show higher values for the workfunction ( Figure S2 (b, d)). The measured CPD difference between gold and Si in AM-KPFM was around 50% smaller than the one measured by FM-KPFM.
One can also see from the images and line profiles that FM-KPFM provides much more lateral information than AM-KPFM. From Figures S1 and S2, we can state that ambient conditions massively affect the KPFM results and that FM-KPFM offers better lateral resolution combined with a more precise values for the workfunction measurements. The measurements in UHV allowed us to conclude that, independent of the environment, AM-and FM-KPFM measurements did not yield the same result on exactly the same spot of the same sample. We observed a 150 mV difference between both techniques on the Si surface. When comparing the surface potential differences between gold and silicon we do measure a difference of about 200 mV. This value is smaller than shown in Figure S1 where the difference between both techniques was 330 mV presumably due to an additional water layer on top of the sample surface. Blue, orange and green represent the cantilever, the cone and the probe apex, respectively. In each graph, the pink region marks the typical working distance for AM-KPFM (double pass) and FM-KPFM. Calculations were done according to [67] without considering the probe oscillation.
The marked regions in the graphs show the working distance range for each KPFM mode, from that we can conclude that the main contribution to the KPFM signal in AM-KPFM double-pass mode is coming from the cantilever, while in FM-KPFM it comes from the probe apex.   The strong correlation between the measured and the simulated data suggests that the majority of the AM-KPFM measured signal originates from a cross-talk with the topography, in analogy to the one observed in Figure 3. Figure S9: (a) CPD GB -CPD Grain versus the depth of the grain boundaries for the sample MAPI after 1 hour exposed to air. Each dot in the graph represents the depth of the GB extracted from the 30 line profiles and the equivalent CPD differences extracted from (b). The highlighted green area depicts the envelope from the entire data-set. The plot shows a correlation between topography and CPD values, which cannot be physically explained as a charge accumulation.     Figure 6. Black solid lines represent the height and red solid lines represent the workfunction data.