Optical Beam Deflection Based AFM with Integrated Hardware and Software Platform for an Undergraduate Engineering Laboratory

Atomic force microscopy (AFM) has been used extensively in nanoscience research since its invention. Recently, many teaching laboratories in colleges, undergraduate institutions, and even high schools incorporate AFM as an effective teaching tool for nanoscience education. This paper presents an optical beam deflection (OBD) based atomic force microscope, designed specifically for the undergraduate engineering laboratory as a teaching instrument. An electronic module for signal conditioning was built with components that are commonly available in an undergraduate electronic laboratory. In addition to off-the-shelf mechanical parts and optics, the design of custom-built mechanical parts waskept as simple as possible. Hence, the overall cost for the setup is greatly reduced. The AFM controller was developed using National Instruments Educational Laboratory Virtual Instrumentation Suite (NI ELVIS), an integrated hardware and software platform which can be programmed in LabVIEW. A simple yet effective control algorithm for scanning and feedback control was developed. Despite the use of an educational platform and low-cost components from the undergraduate laboratory, the developed AFM is capable of performing imaging in constant-force mode with submicron resolution and at reasonable scanning speed (approximately 18 min per image). Therefore, the AFM is suitable to be used as an educational tool for nanoscience. Moreover, the construction of the system can be a valuable educational experience for electronic and mechanical engineering students.


Introduction
As nanoscale science, technology, and engineering have grown phenomenally over the past few decades, awareness of nanotechnology and nanoscience concepts and implications is increasingly important in education.Scanning Probe Microscopy (SPM), proclaimed to be the key to enabling discovery for nanotechnology, has evolved into a series of profound techniques for interdisciplinary research at the nanoscale.Atomic Force Microscopy (AFM) [1], a family member ofSPM, is one of the most versatile techniques for surface analysis.Over the past three decades, it has evolved into a powerful tool used to image and measure interatomic or intermolecular forces, for a wide range of surfaces including those encountered in the semiconductor and biomaterial industries.Recent advances have paved the way for atomic level insight into various surfaces such as semiconductors [2][3][4], insulators [5,6], and metal oxides [7,8], which has strongly contributed to the understanding of surface structure and chemical composition.Moreover, the ability of AFM to operate under a liquid environment makes it an indispensable tool for studies of solid-liquid interface [9,10].It is perceivable that AFM offers an effective educational tool in nanoscience and nanotechnology.For educational purposes, students and beginners oftenfind it hard to comprehend some of the original literature.It would therefore be helpful to begin with some introductory topics onfundamental principles and basic instrumental aspects [11][12][13].
In recent years, institutions have taken initiatives to incorporate AFM into teaching laboratories.For instance, a macroscopic model of AFMs wasdemonstrated to explain operating principles on a macroscopic scale [14,15].An AFM model without electronic detection and utilized modified phonograph stylus was created [16].Hsieh et al. presented a conceptual AFM model built with the LEGO MINDSTORMS which was able to produce three-dimensional surface graphs [17].Using specialized interdigitated cantilever, Shusteff et al. designed a low-cost system that was able to perform imaging in constant-height mode withmeasurement of Boltzmann's constant [18].Another low-cost AFM setup was developed by Bergmann et al. [19].This system used the Fabry-Perot interferometer as a detecting device and also operated in constant-height mode.However, the system suffered from signal ambiguity problem for features of height exceeding 158 nm.An optical beam deflection (OBD) based AFM was presented by Jones and Gonçalves [20].Many parts used for the AFM were off the shelf and the system was capable of measuring features on the submicron scale.
In this paper, an OBD based AFM designed for the undergraduate engineering laboratory is presented.The purpose of this work is to utilize existing resources that are available from the undergraduate laboratory and build a cost-effective AFM as a teaching instrument.Even though an educational platform and low-cost components are used, the test results show that the developed system is capable of performing imaging in constant-force mode with reasonable resolution and scanning speed.While the performance does not approach that of a commercial AFM, it is adequate to serve as a teaching instrument for undergraduates.
The rest of this paper is organized as follows.In Section 2 the detection method and system setup design are presented along with details of the electronics and software for the controller.Cost considerations are also briefly discussed here.Section 3 details the results of imaging in constant force mode under feedback control along with discussions.Section 4 concludes thepaper.

Optical Beam Deflection (OBD) Detection
In AFM, the surface of interest is scanned by a sharp tip mounted at the end of a cantilever.The force between the tip and sample can be determined by measuring the deflection of the cantilever.Due to simple design and easy alignment, OBD [21] is the most common setup in commercially available AFM systems.In an OBD system, the key components that act as deflection sensors are the laser beam, the cantilever, and the photodiode as shown in Figure 1.Typically, the deflection is measured using alaserspot reflected from the back of the cantilever into a segmented photodiode.The laser beam that is deflected from the backside of the cantilever provides measurements of the difference in light intensities between the upper and lower segments of a four-quadrant photodiode.The photo-induced currents from the photodiode are fed into a signal conditioning module which produces a voltage signal proportional to the differences in the light intensities between the upper and lower segments of the photodiode.This voltage signal is known as the deflection signal.Through data acquisition and a control system, the height of the sample stage is controlled to maintain a constant force between the AFM tip and the sample.A topographic image of the sample is obtained by plotting the height versus its x-y position on the sample.

AFM Setup
Figure 2a shows the experimental setup of the AFM system for this study.The system incorporates a replaceable microscope objective lens (Achrovid: 5× infinity objective) which can be used to focus the laser beam to the back of a cantilever and to enable an optical view with high magnification.A standard 635 nm, 4.5 mW laser diode module (Thorlabs: CPS196) is used.The collimated laser beam is directed through a polarizing beam splitter (PBS) to the objective lens.The PBS and objective lens are attached to an XYZ translation stage (Thorlabs: MT3/M) so that the laser spot can be adjusted precisely to the back of the cantilever, prior to imaging the experiment.Another smaller XYZ translation stage (Thorlabs: MS3/M) is required for fine-tuning of the reflected laser beam onto the photodiode module.A flexure-stage based piezo positioning system (Thorlabs: MDT630B/M) is used in the AFM setup.This bundle includes a piezo controller and differential micrometers for coarse adjustment.
Several custom-built mechanical parts are necessary to incorporate off-the-shelf components as mentioned above.However, the design of these parts iskept as simple as possible.As can be seen in Figure 2b, almost all parts are in the shape of a square or rectangular, which can easily be designed by undergraduate engineering students.The detailed drawings of the custom-built mechanical parts are presented in the Supplementary Materials (Figures S1-S24).

AFM Setup
Figure 2a shows the experimental setup of the AFM system for this study.The system incorporates a replaceable microscope objective lens (Achrovid: 5× infinity objective) which can be used to focus the laser beam to the back of a cantilever and to enable an optical view with high magnification.A standard 635 nm, 4.5 mW laser diode module (Thorlabs: CPS196) is used.The collimated laser beam is directed through a polarizing beam splitter (PBS) to the objective lens.The PBS and objective lens are attached to an XYZ translation stage (Thorlabs: MT3/M) so that the laser spot can be adjusted precisely to the back of the cantilever, prior to imaging the experiment.Another smaller XYZ translation stage (Thorlabs: MS3/M) is required for fine-tuning of the reflected laser beam onto the photodiode module.A flexure-stage based piezo positioning system (Thorlabs: MDT630B/M) is used in the AFM setup.This bundle includes a piezo controller and differential micrometers for coarse adjustment.

AFM Setup
Figure 2a shows the experimental setup of the AFM system for this study.The system incorporates a replaceable microscope objective lens (Achrovid: 5× infinity objective) which can be used to focus the laser beam to the back of a cantilever and to enable an optical view with high magnification.A standard 635 nm, 4.5 mW laser diode module (Thorlabs: CPS196) is used.The collimated laser beam is directed through a polarizing beam splitter (PBS) to the objective lens.The PBS and objective lens are attached to an XYZ translation stage (Thorlabs: MT3/M) so that the laser spot can be adjusted precisely to the back of the cantilever, prior to imaging the experiment.Another smaller XYZ translation stage (Thorlabs: MS3/M) is required for fine-tuning of the reflected laser beam onto the photodiode module.A flexure-stage based piezo positioning system (Thorlabs: MDT630B/M) is used in the AFM setup.This bundle includes a piezo controller and differential micrometers for coarse adjustment.
Several custom-built mechanical parts are necessary to incorporate off-the-shelf components as mentioned above.However, the design of these parts iskept as simple as possible.As can be seen in Figure 2b, almost all parts are in the shape of a square or rectangular, which can easily be designed by undergraduate engineering students.The detailed drawings of the custom-built mechanical parts are presented in the Supplementary Materials (Figures S1-S24).Several custom-built mechanical parts are necessary to incorporate off-the-shelf components as mentioned above.However, the design of these parts iskept as simple as possible.As can be seen in Figure 2b, almost all parts are in the shape of a square or rectangular, which can easily be designed by undergraduate engineering students.The detailed drawings of the custom-built mechanical parts are presented in the Supplementary Materials (Figures S1-S24).

Electronics
Most of the educational AFM systems [18][19][20] use a commercially available photodiode detector for measurement of cantilever deflection.For educational purposes and further cost reduction, the electronic module for signal conditioning is custom-built for our AFM setup.The function of the signal conditioning module is to convert the photo-induced currents from the photodiode into voltage signals, followed by producing a voltage signal that is proportional to the differences in the light intensities between the upper and lower segments of the photodiode.These functions can easily be implemented using common components such as operational amplifiers (op-amp), resistors, and capacitors from the undergraduate electronic laboratory.The 741 op-amp, one of the most commonly used electronic components in laboratory classes, is used extensively in our signal conditioning module.
A four-quadrant photodiode (Hamamatsu: s5980) with an active area of 5 mm × 5 mm is used in our design.A thin package of 1.26 mm makes it an ideal choice to be used in the OBD setup in the developed AFM.For the signal conditioning module, different configurations are used with the op-amps to achieve different operating modes.These include a current-to-voltage converter, a voltage follower, an inverting summer and differential amplifier.The full circuit diagram of the signal conditioning module is illustrated in Figure 3.In general, the circuit can be divided into four stages.At the first stage of the circuit, four current-to-voltage converters are required to convert the currents from the segments of the four-quadrant photodiode.The converted voltage signals are then fed into the voltage followers, which make up the second stage of the circuit, acting as isolation buffers.At the third stage of the circuit, the op-amps are used as inverting summers.Four op-amps are used here to add up signals originating from the photodiode.For example, voltage signals from the top-right segment and the top-left segment of the photodiode are summed together.Voltage signals from the bottom-right segment and the bottom-left segment of the photodiode are added up.The last stage of the circuit is comprised of two differential amplifiers and an inverting summer.The first differential amplifier is responsible for computingthe deflection signal by taking the difference between the top and bottom segments.The second differential amplifier calculates the lateral signal from the difference between the left and right segments.The inverting summer calculates the summed signals from all segments (top-left, top-right, bottom-left, and bottom right).The test results of this module have been presented and discussed previously [22].Figure 4 shows the printed circuit board of the signal conditioning module.

Controller
The controller for our AFM setup was developed using National Instruments Educational Laboratory Virtual Instrumentation Suite (NI ELVIS), which can be programmed in LabVIEW.NI ELVIS is a modular educational platform usedby educators around the world.This system has built-in instruments such asan oscilloscope, a digital multimeter, and a function generator.In combination with the integrated instruments, prototyping board, and the flexibility of the LabVIEW environment, this integrated hardware and software platform is the perfect candidate for controllerdesign.
Figure 5 shows the block diagram of the AFM and its control system.As an AFM controller, the major tasks of the NI ELVIS are data acquisition, scanning control, and feedback control.In the data acquisition process, the deflection signal (voltage output from the signal conditioning module) is fed into the analog input of NI ELVIS board, AI0.This signal can be used to regulate the force between the AFM tip and the sample of interest, subsequently producing a topographic image of the sample.For scanning control, two analog outputs, namely AO0 and AO1, are used to control the piezo's motion in the X and Y directions.Since the output range of the analog output is −10 V to 10 V, it is not sufficient to drive the piezo stage directly.Therefore, signals from AO0 and AO1 are fed into an open-loop piezoelectric controller which can amplify the voltages up to maximum value of 75 V.Based on the specifications provided by the manufacturer, this corresponds to a scanning range of 20 µm.For feedback control, the height of the sample stage is controlled to maintain a constant force between the AFM tip and the sample.Since a NI ELVIS has only two analog output channels, a positive variable power supply channel with output range of 0-12 V is used to accomplish this task.

Controller
The controller for our AFM setup was developed using National Instruments Educational Laboratory Virtual Instrumentation Suite (NI ELVIS), which can be programmed in LabVIEW.NI ELVIS is a modular educational platform usedby educators around the world.This system has built-in instruments such asan oscilloscope, a digital multimeter, and a function generator.In combination with the integrated instruments, prototyping board, and the flexibility of the LabVIEW environment, this integrated hardware and software platform is the perfect candidate for controllerdesign.
Figure 5 shows the block diagram of the AFM and its control system.As an AFM controller, the major tasks of the NI ELVIS are data acquisition, scanning control, and feedback control.In the data acquisition process, the deflection signal (voltage output from the signal conditioning module) is fed into the analog input of NI ELVIS board, AI0.This signal can be used to regulate the force between the AFM tip and the sample of interest, subsequently producing a topographic image of the sample.For scanning control, two analog outputs, namely AO0 and AO1, are used to control the piezo's motion in the X and Y directions.Since the output range of the analog output is −10 V to 10 V, it is not sufficient to drive the piezo stage directly.Therefore, signals from AO0 and AO1 are fed into an open-loop piezoelectric controller which can amplify the voltages up to maximum value of 75 V.Based on the specifications provided by the manufacturer, this corresponds to a scanning range of 20 μm.For feedback control, the height of the sample stage is controlled to maintain a constant force between the AFM tip and the sample.Since a NI ELVIS has only two analog output channels, a positive variable power supply channel with output range of 0-12 V is used to accomplish this task.

Software
LabVIEW, short for Laboratory Virtual Instrument Engineering Workbench, is a graphical programming environment developed by National Instruments.It is widely used for diverse applications in industry and academia.For the developed AFM system, the entire software is programmed in LabVIEW.This includes the graphical user interface (GUI), subroutines for calculation of piezo voltages, plotting of scanned images, and control of the feedback loop.
A flowchart in Figure 6 illustrates the scanning process of the AFM.The system is first initialized by configuring new channels for input and output.In the software, analog input, AI0 is configured to accept the deflection signal from the signal conditioning module.The three analog outputs, namely AO0, AO1, and the positive variable power supply are set to control the piezo's motion in the X, Y, and Z directions, respectively.The simplest way to configure channels in

Software
LabVIEW, short for Laboratory Virtual Instrument Engineering Workbench, is a graphical programming environment developed by National Instruments.It is widely used for diverse applications in industry and academia.For the developed AFM system, the entire software is programmed in LabVIEW.This includes the graphical user interface (GUI), subroutines for calculation of piezo voltages, plotting of scanned images, and control of the feedback loop.
A flowchart in Figure 6 illustrates the scanning process of the AFM.The system is first initialized by configuring new channels for input and output.In the software, analog input, AI0 is configured to accept the deflection signal from the signal conditioning module.The three analog outputs, namely AO0, AO1, and the positive variable power supply are set to control the piezo's motion in the X, Y, and Z directions, respectively.The simplest way to configure channels in LabVIEW is to invoke NI-DAQmx, a programming interface to communicate with data acquisitiondevices.
Generally, the value of each pixel in an AFM image corresponds to a measured height value which is associated witha pair of surface coordinates, (x, y).Each height value is directly proportional to the instantaneous output voltage that is fed into the Z-piezo.As mentioned previously, the output voltage is used to control the height of the sample stage in order to maintain a constant force between the AFM tip and the sample.When each scan line has beencarried out (all iterations of the inner loop are completed), the 2D plot is updated once.In LabVIEW, the "Intensity Graph" is used to present 3D data on a 2D plot by using color to display the values of the third dimension.The entire scanning process comes to an end when all the lines are completely scanned.As a result, an AFM image is created.Next, the sequence of scanning voltages for X (fast axis) and Y (slow axis) directions are calculated.These scanning voltages are calculated based on parameters specified by the user.The parameters include size of scanned image, scan points (number of data points along fast axis), scan lines (number of data points along slow axis), and scanning coefficient (voltage value required per unit distance).Figure 7 shows a simplified schematic of the scanning sequence in the LabVIEW block diagram.By using nested "For Loops", the scanning sequence can be implemented efficiently.The inner loop handles positions in the fast axis and the outer loop controls the voltage steps along the slow axis.The "Scan lines" and "Scan points" that are connected to the "N" terminal of their respective loops determine the number of iterations for each loop to execute.At the same time, these two parameters control the number of pixels to represent an AFM image.A "Replace Array Subset" function is responsible to update the values of the pixels in real-time during the scanning process.Generally, the value of each pixel in an AFM image corresponds to a measured height value which is associated witha pair of surface coordinates, (x, y).Each height value is directly proportional to the instantaneous output voltage that is fed into the Z-piezo.As mentioned previously, the output voltage is used to control the height of the sample stage in order to maintain a constant force between the AFM tip and the sample.When each scan line has beencarried out (all iterations of the inner loop are completed), the 2D plot is updated once.In LabVIEW, the "Intensity Graph" is used to present 3D data on a 2D plot by using color to display the values of the third dimension.The entire scanning process comes to an end when all the lines are completely scanned.As a result, an AFM image is created.
In order to perform imaging in constant-force mode, a feedback controller is required in the AFM system.In our AFM setup, the control of the feedback loop is implemented in the LabVIEW environment without any extra hardware.This approach is flexible and allows us to configure the system settings easily and quickly.Figure 8 illustrates a schematic of the feedback controller in the LabVIEW block diagram.The main unit used in this subroutine is the PID (proportional, integral, derivative) controller.Here, the process variable is the deflection signal from the signal conditioning module.This signal isthen compared to a set-point value (set by the user) internally.The output of the PID controller is then used to drive the Z-piezo through the positive variable power supply channel in our setup.By choosing appropriate values for the P, I, and D terms, the tip of the cantilever "tracks" the surface during scanning and the deflection of the cantilever can be held constant.This program loop runs in parallel with the scanning process.The nested "For Loops" plays an important role in performing the scanning sequence efficiently.The inner loop controls positions in the X axis and the outer loop controls voltage steps along the Y axis.The "Replace Array Subset" is used here to update the values of pixels in real-time during the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.
In order to perform imaging in constant-force mode, a feedback controller is required in the AFM system.In our AFM setup, the control of the feedback loop is implemented in the LabVIEW environment without any extra hardware.This approach is flexible and allows us to configure the system settings easily and quickly.Figure 8 illustrates a schematic of the feedback controller in the LabVIEW block diagram.The main unit used in this subroutine is the PID (proportional, integral, derivative) controller.Here, the process variable is the deflection signal from the signal conditioning module.This signal isthen compared to a set-point value (set by the user) internally.The output of the PID controller is then used to drive the Z-piezo through the positive variable power supply channel in our setup.By choosing appropriate values for the P, I, and D terms, the tip of the cantilever "tracks" the surface during scanning and the deflection of the cantilever can be held constant.This program loop runs in parallel with the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.The "Replace Array Subset" is used here to update the values of pixels in real-time during the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.
In order to perform imaging in constant-force mode, a feedback controller is required in the AFM system.In our AFM setup, the control of the feedback loop is implemented in the LabVIEW environment without any extra hardware.This approach is flexible and allows us to configure the system settings easily and quickly.Figure 8 illustrates a schematic of the feedback controller in the LabVIEW block diagram.The main unit used in this subroutine is the PID (proportional, integral, derivative) controller.Here, the process variable is the deflection signal from the signal conditioning module.This signal isthen compared to a set-point value (set by the user) internally.The output of the PID controller is then used to drive the Z-piezo through the positive variable power supply channel in our setup.By choosing appropriate values for the P, I, and D terms, the tip of the cantilever "tracks" the surface during scanning and the deflection of the cantilever can be held constant.This program loop runs in parallel with the scanning process.The interface consists of settings that can be configured by the user.These include size of scanned image (scan size), image resolution (scan points and scan lines), and scanning coefficient (voltage value required per unit distance).During scanning, the parameters for the PID controller can be adjusted for an optimized imaging result.Two intensity graphs are used to display the trace and retrace images.Below these intensity graphs are the real-time line scans for trace and retrace along the X (fast axis) Figure 9 shows an example of GUI with controls and indicators for AFM image acquisition.The interface consists of settings that can be configured by the user.These include size of scanned image (scan size), image resolution (scan points and scan lines), and scanning coefficient (voltage value required per unit distance).During scanning, the parameters for the PID controller can be adjusted for an optimized imaging result.Two intensity graphs are used to display the trace and retrace images.Below these intensity graphs are the real-time line scans for trace and retrace along the X (fast axis) direction.For monitoring purpose, real-time indicators of the applied voltages to piezo's motion in the X, Y and Z directions are also displayed in the GUI.

Approximate Cost of the System
The total cost of the AFM setup is approximately $12,300 USD and the major components are listed in Table 1.Our AFM is designed with the purpose of makingthe most of the existing resources from the undergraduate laboratory and build a cost-effective system.As can be seen in Table 1, the NI ELVIS is the most expensive item in the list.However, this educational platform is very common in the undergraduate engineering laboratory.Further cost reduction might be possible if one of the available units in the laboratory can be incorporated into the AFM system and purchase of the additional unit is then not required.

Laser Alignment and Tip Engagement
For an OBD based AFM system, laser alignment is a critical step prior to imaging.In our AFM setup, the laser spot can be adjusted precisely to the back of a cantilever using an XYZ translation stage which is attached with the objective lens.Next, a smaller XYZ translation stage (attached with

Approximate Cost of the System
The total cost of the AFM setup is approximately $12,300 USD and the major components are listed in Table 1.Our AFM is designed with the purpose of makingthe most of the existing resources from the undergraduate laboratory and build a cost-effective system.As can be seen in Table 1, the NI ELVIS is the most expensive item in the list.However, this educational platform is very common in the undergraduate engineering laboratory.Further cost reduction might be possible if one of the available units in the laboratory can be incorporated into the AFM system and purchase of the additional unit is then not required.

Laser Alignment and Tip Engagement
For an OBD based AFM system, laser alignment is a critical step prior to imaging.In our AFM setup, the laser spot can be adjusted precisely to the back of a cantilever using an XYZ translation stage which is attached with the objective lens.Next, a smaller XYZ translation stage (attached with the photodiode module) is fine-tuned so that the reflected laser beam is on the center of the photodiode module.Using NI ELVISmx (National Instruments Corp, version 4.4, Austin, TX, USA), this task can be achieved effectively.NI ELVISmx is the LabVIEW-based software that is used to support NI ELVIS hardware.It provides functionality of common laboratory instruments such as the oscilloscope, the function generator, and the multimeter.As shown in Figure 10, the soft front panel oscilloscope of NI ELVISmx is configured to display the deflection signal from the signal conditioning module.When the reflected laser beam is exactly on the center of the photodiode, the measured voltage will be 0 V. conditioning module.When the reflected laser beam is exactly on the center of the photodiode, the measured voltage will be 0 V.
After laser alignment, a tip engagement process is required to bring the sample into contact with the AFM cantilever.The software is first started with zero scan size (no motion in the X and Y directions).The subroutine of the feedback controller is activated at the same time.Since there is no contact between the tip and the sample initially, the Z-piezo is fully extended in anticipation of engagement due to the feedback mechanism.The micrometer screw of the XYZ translation stage is slowly adjusted to move the piezo positioning stage towards the tip.When the sample first comes into gentle contact with the cantilever, the value of the deflection signal changes quickly and is equal to the user defined set point.The Z-piezo is retracted slightly in order to maintain the set point value.At this point, the system is ready for the actual scanning process.

Imaging Results
The developed AFM is able to operate in constant-force mode.Unlike constant-height mode imaging in which the deflection signal is used directly to generate the topographic data; in constant-force mode, the image is generated from the motion of the Z-piezo with the cantilever deflection held constant.However, our AFM setup is limited to contact mode imaging currently and not able to perform imaging in more advanced modes such as non-contact imaging and tapping mode imaging.Figure 11 illustrates AFM images of the author's hair acquired in constant-force mode.All images presented here are raw data.Further data processing procedures such as plane leveling, flattening, and filtering were not applied to the obtained images.Each image was recorded at 150 × 150 pixels with a scanning time of approximately 18 min.Trace and retrace images were After laser alignment, a tip engagement process is required to bring the sample into contact with the AFM cantilever.The software is first started with zero scan size (no motion in the X and Y directions).The subroutine of the feedback controller is activated at the same time.Since there is no contact between the tip and the sample initially, the Z-piezo is fully extended in anticipation of engagement due to the feedback mechanism.The micrometer screw of the XYZ translation stage is slowly adjusted to move the piezo positioning stage towards the tip.When the sample first comes into gentle contact with the cantilever, the value of the deflection signal changes quickly and is equal to the user defined set point.The Z-piezo is retracted slightly in order to maintain the set point value.At this point, the system is ready for the actual scanning process.

Imaging Results
The developed AFM is able to operate in constant-force mode.Unlike constant-height mode imaging in which the deflection signal is used directly to generate the topographic data; in constant-force mode, the image is generated from the motion of the Z-piezo with the cantilever deflection held constant.However, our AFM setup is limited to contact mode imaging currently and not able to perform imaging in more advanced modes such as non-contact imaging and tapping mode imaging.Figure 11 illustrates AFM images of the author's hair acquired in constant-force mode.All images presented here are raw data.Further data processing procedures such as plane leveling, flattening, and filtering were not applied to the obtained images.Each image was recorded at 150 × 150 pixels with a scanning time of approximately 18 min.Trace and retrace images were taken simultaneously.Three sets of images with scan size of 20 µm × 20 µm (Figure 11a,b), 15 µm × 15 µm (Figure 11c,d) and 10 µm × 10 µm (Figure 11e,f) were obtained consecutively with the same AFM cantilever.The cantilever used has a force constant of 0.2 N/m with a resonant frequency of 13 kHz (BudgetSensors: Contact-G). Figure 11g depicts the 3D surface plot of Figure 11a.As can be seen in these images, the hair cuticle which is the outermost part of thehair shaft and the overlapping layers are clearly visible.This demonstrates that our developed AFM is capable of measuring features on the submicron scale.During scanning, the feedback controller constantly adjuststhe Z-piezo in order to maintain a fixed set point.However, the tip of the cantilever will not track the surface properly if the feedback mechanism reacts slowly.Two main causes are high scanning speed and low feedback gains.The real-time line scans for trace and retrace can be compared during image scanning.If the tracking is good, the shapes of the trace and retrace are almost identical.Most of the time the quality of the image can be improved by reducing the scanning speed or increasing the feedback gains.Figure 12 shows several line scans for trace and retrace which are extracted from AFM images in Figure 11.Note that the data points have been shifted horizontally to enablea better comparison in each pair of trace and retrace lines.As can be seen in these plots, the trace and retrace lines coincide closely.This shows that the developed feedback mechanism is responsive enough during imaging at a reasonable scanning speed.During scanning, the feedback controller constantly adjuststhe Z-piezo in order to maintain a fixed set point.However, the tip of the cantilever will not track the surface properly if the feedback mechanism reacts slowly.Two main causes are high scanning speed and low feedback gains.The real-time line scans for trace and retrace can be compared during image scanning.If the tracking is good, the shapes of the trace and retrace are almost identical.Most of the time the quality of the image can be improved by reducing the scanning speed or increasing the feedback gains.Figure 12 shows several line scans for trace and retrace which are extracted from AFM images in Figure 11.Note that the data points have been shifted horizontally to enablea better comparison in each pair of trace and retrace lines.As can be seen in these plots, the trace and retrace lines coincide closely.This shows that the developed feedback mechanism is responsive enough during imaging at a reasonable scanning speed.

Limitations and Further Improvements
As the developed AFM is the first prototype constructed from the preliminary design, it has several limitations.One of the main limitations is the resolution limit of imaging.The piezo stage used in our setup adopts open-loop design and does not contain an internal strain gauge sensor, limiting the resolution to 20 nm in all directions (X, Y, and Z axes).In addition, the maximum travel range of the piezo stage is 20 μm.Therefore, an AFM image that is acquired with the system is limited to a maximum scan size of 20 μm × 20 μm.The resolution limit and the scan range of our AFM setup can be improved by using piezo stage with better specifications.However, a complete redesign on some of the custom-built mechanical parts might be necessary to incorporate the new piezo stage with different mechanical dimensions.
Calibration on the scanner was attempted using a silicon calibration grating with 4 μm period and 25 nm step height.Unfortunately, the features on the calibration grids cannot be resolved in the AFM images obtained with our AFM.This is mainly due to the resolution limit of the piezo stage.Therefore, calibration on the scanner was not carried out successfully in our setup.The scan size of the AFM images wascalculated based on the piezo stage specifications (provided by the manufacturer).A maximum travel range of 20 μm requires 75 V of output voltage (or 10 V of input voltage to the piezo's controller).Therefore, 7.5 V of output voltage (or 1 V of input voltage) corresponds to 2 μm of travel range.
On the whole, there are several pros and cons of our developed AFM as compared to a commercially available system.Using resources commonly available from the undergraduate laboratory, our AFM costs considerably less than a typical commercial AFM, where the price may start from $26k USD.A high-end machine may cost more than $100k USD per unit.In terms of imaging performance, our AFM is capable of performing imaging at the microscopic scale, while a commercial AFM would be able to resolve features at two or three orders of magnitude smaller (nanometer scale).The fundamental limitation of the existing system is the imaging mode which is restricted to contact mode imaging only.

Limitations and Further Improvements
As the developed AFM is the first prototype constructed from the preliminary design, it has several limitations.One of the main limitations is the resolution limit of imaging.The piezo stage used in our setup adopts open-loop design and does not contain an internal strain gauge sensor, limiting the resolution to 20 nm in all directions (X, Y, and Z axes).In addition, the maximum travel range of the piezo stage is 20 µm.Therefore, an AFM image that is acquired with the system is limited to a maximum scan size of 20 µm × 20 µm.The resolution limit and the scan range of our AFM setup can be improved by using piezo stage with better specifications.However, a complete redesign on some of the custom-built mechanical parts might be necessary to incorporate the new piezo stage with different mechanical dimensions.
Calibration on the scanner was attempted using a silicon calibration grating with 4 µm period and 25 nm step height.Unfortunately, the features on the calibration grids cannot be resolved in the AFM images obtained with our AFM.This is mainly due to the resolution limit of the piezo stage.Therefore, calibration on the scanner was not carried out successfully in our setup.The scan size of the AFM images wascalculated based on the piezo stage specifications (provided by the manufacturer).A maximum travel range of 20 µm requires 75 V of output voltage (or 10 V of input voltage to the piezo's controller).Therefore, 7.5 V of output voltage (or 1 V of input voltage) corresponds to 2 µm of travel range.
On the whole, there are several pros and cons of our developed AFM as compared to a commercially available system.Using resources commonly available from the undergraduate laboratory, our AFM costs considerably less than a typical commercial AFM, where the price may start from $26k USD.A high-end machine may cost more than $100k USD per unit.In terms of imaging performance, our AFM is capable of performing imaging at the microscopic scale, while a commercial

Figure 2 .
Figure 2. Atomic force microscopy (AFM) system: (a) Experimental setup.The system consists of several major sections.A laser diode module, a polarizing beam splitter (PBS) and an objective lens are attached together with custom parts and fixed to an XYZ translation stage.This section is responsible to align the laser spot onto the back of a cantilever.A smaller XYZ translation stage is required to hold the photodiode module.Signals from the photodiode module are fed into the signal conditioning module.A piezo positioning stage sits on top of a custom part which is attached to another XYZ translation stage so that the height can be adjusted; (b) Custom-built mechanical parts.Detailed drawings are presented in the Supplementary Materials (Figures S1-S24).

Figure 2 .
Figure 2. Atomic force microscopy (AFM) system: (a) Experimental setup.The system consists of several major sections.A laser diode module, a polarizing beam splitter (PBS) and an objective lens are attached together with custom parts and fixed to an XYZ translation stage.This section is responsible to align the laser spot onto the back of a cantilever.A smaller XYZ translation stage is required to hold the photodiode module.Signals from the photodiode module are fed into the signal conditioning module.A piezo positioning stage sits on top of a custom part which is attached to another XYZ translation stage so that the height can be adjusted; (b) Custom-built mechanical parts.Detailed drawings are presented in the Supplementary Materials (Figures S1-S24).

Figure 2 .
Figure 2. Atomic force microscopy (AFM) system: (a) Experimental setup.The system consists of several major sections.A laser diode module, a polarizing beam splitter (PBS) and an objective lens are attached together with custom parts and fixed to an XYZ translation stage.This section is responsible to align the laser spot onto the back of a cantilever.A smaller XYZ translation stage is required to hold the photodiode module.Signals from the photodiode module are fed into the signal conditioning module.A piezo positioning stage sits on top of a custom part which is attached to another XYZ translation stage so that the height can be adjusted; (b) Custom-built mechanical parts.Detailed drawings are presented in the Supplementary Materials (Figures S1-S24).
Figure 2. Atomic force microscopy (AFM) system: (a) Experimental setup.The system consists of several major sections.A laser diode module, a polarizing beam splitter (PBS) and an objective lens are attached together with custom parts and fixed to an XYZ translation stage.This section is responsible to align the laser spot onto the back of a cantilever.A smaller XYZ translation stage is required to hold the photodiode module.Signals from the photodiode module are fed into the signal conditioning module.A piezo positioning stage sits on top of a custom part which is attached to another XYZ translation stage so that the height can be adjusted; (b) Custom-built mechanical parts.Detailed drawings are presented in the Supplementary Materials (Figures S1-S24).

Figure 3 .
Figure 3. Full circuit diagram of the signal conditioning module.The circuit consists of four stages: current-to-voltage converters, voltage followers, inverting summers, and differential amplifiers.The outputs of the circuits are the deflection signal, summation signal, and lateral signal.

Figure 4 .
Figure 4. Printed circuit board of the signal conditioning module.

Figure 3 .
Figure 3. Full circuit diagram of the signal conditioning module.The circuit consists of four stages: current-to-voltage converters, voltage followers, inverting summers, and differential amplifiers.The outputs of the circuits are the deflection signal, summation signal, and lateral signal.

Figure 3 .
Figure 3. Full circuit diagram of the signal conditioning module.The circuit consists of four stages: current-to-voltage converters, voltage followers, inverting summers, and differential amplifiers.The outputs of the circuits are the deflection signal, summation signal, and lateral signal.

Figure 4 .
Figure 4. Printed circuit board of the signal conditioning module.Figure 4. Printed circuit board of the signal conditioning module.

Figure 4 .
Figure 4. Printed circuit board of the signal conditioning module.Figure 4. Printed circuit board of the signal conditioning module.

Figure 5 .
Figure 5. Block diagram of AFM and control system.

Figure 5 .
Figure 5. Block diagram of AFM and control system.

Figure 6 .
Figure 6.Flowchart of scanning process.There are three major sections in the software.First, the input and output channels are configured for measurement.Second, the sequence of scanning voltages is generated.Finally, the actual scanning process begins and the 2D plot is updated after every line scan.

Figure 6 .
Figure 6.Flowchart of scanning process.There are three major sections in the software.First, the input and output channels are configured for measurement.Second, the sequence of scanning voltages is generated.Finally, the actual scanning process begins and the 2D plot is updated after every line scan.

Figure 7 .
Figure 7.A simplified schematic of the scanning sequence in the LabVIEW block diagram.The nested "For Loops" plays an important role in performing the scanning sequence efficiently.The inner loop controls positions in the X axis and the outer loop controls voltage steps along the Y axis.The "Replace Array Subset" is used here to update the values of pixels in real-time during the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.

Figure 8 .
Figure 8. Schematic of feedback controller in LabVIEW block diagram.The PID (proportional, integral, derivative) function is the main control element in the feedback controller section.The deflection signal is the process variable which is continuously compared to the set-point value.PID gains can be configured through the graphical user interface (GUI) and the output of the PID function is used to drive the Z-piezo.

Figure 7 .
Figure 7.A simplified schematic of the scanning sequence in the LabVIEW block diagram.The nested "For Loops" plays an important role in performing the scanning sequence efficiently.The inner loop controls positions in the X axis and the outer loop controls voltage steps along the Y axis.The "Replace Array Subset" is used here to update the values of pixels in real-time during the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.

Figure 7 .
Figure 7.A simplified schematic of the scanning sequence in the LabVIEW block diagram.The nested "For Loops" plays an important role in performing the scanning sequence efficiently.The inner loop controls positions in the X axis and the outer loop controls voltage steps along the Y axis.The "Replace Array Subset" is used here to update the values of pixels in real-time during the scanning process.The "Intensity Graph" is in the outer loop so that the 2D plot is updated after one line scan.If it is in the inner loop instead, the 2D plot will be updated pixel by pixel.

Figure 8 .
Figure 8. Schematic of feedback controller in LabVIEW block diagram.The PID (proportional, integral, derivative) function is the main control element in the feedback controller section.The deflection signal is the process variable which is continuously compared to the set-point value.PID gains can be configured through the graphical user interface (GUI) and the output of the PID function is used to drive the Z-piezo.

Figure 8 .
Figure 8. Schematic of feedback controller in LabVIEW block diagram.The PID (proportional, integral, derivative) function is the main control element in the feedback controller section.The deflection signal is the process variable which is continuously compared to the set-point value.PID gains can be configured through the graphical user interface (GUI) and the output of the PID function is used to drive the Z-piezo.

Figure 9
Figure 9 shows an example of GUI with controls and indicators for AFM image acquisition.The interface consists of settings that can be configured by the user.These include size of scanned image (scan size), image resolution (scan points and scan lines), and scanning coefficient (voltage value required per unit distance).During scanning, the parameters for the PID controller can be adjusted for an optimized imaging result.Two intensity graphs are used to display the trace and retrace images.Below these intensity graphs are the real-time line scans for trace and retrace along the X (fast axis)

Figure 9 .
Figure 9. GUI with controls and indicators for AFM image acquisition.

Figure 9 .
Figure 9. GUI with controls and indicators for AFM image acquisition.
Appl.Sci.2017, 7, 226 11 of 14 taken simultaneously.Three sets of images with scan size of 20 μm × 20 μm (Figure 11a,b), 15 μm × 15 μm (Figure 11c,d) and 10 μm × 10 μm (Figure 11e,f) were obtained consecutively with the same AFM cantilever.The cantilever used has a force constant of 0.2 N/m with a resonant frequency of 13 kHz (BudgetSensors: Contact-G).Figure11gdepicts the 3D surface plot of Figure11a.As can be seen in these images, the hair cuticle which is the outermost part of thehair shaft and the overlapping layers are clearly visible.This demonstrates that our developed AFM is capable of measuring features on the submicron scale.

Figure 12 .
Figure 12.Line scans for trace and retrace extracted from AFM images in Figure 10: (a) Trace and retrace of line 75 extracted from Figure 11a,b, respectively; (b) Trace and retrace of line 75 extracted from Figure 11c,d, respectively; (c) Trace and retrace of line 75 extracted from Figure 11e,f, respectively.

Figure 12 .
Figure 12.Line scans for trace and retrace extracted from AFM images in Figure 10: (a) Trace and retrace of line 75 extracted from Figure 11a,b, respectively; (b) Trace and retrace of line 75 extracted from Figure 11c,d, respectively; (c) Trace and retrace of line 75 extracted from Figure 11e,f, respectively.

Table 1 .
Approximate cost of major components.

Table 1 .
Approximate cost of major components.