Duty-Cycle Electronically Tunable Triangular/Square Wave Generator Using LT1228 Commercially Available ICs for Capacitive Sensor Interfacing

This paper proposes a duty-cycle electronically tunable triangular/square wave generator using LT1228 commercially available ICs for capacitive sensor interfacing. The generator comprises two LT1228s, a grounded resistor, and a grounded capacitor. The circuit provides two output signals which are triangular and square waves. Both signals are regulated by adjusting the current bias. Likewise, the amplitude of the triangular signal can be tuned electronically without affecting the frequency. In addition, the square wave can independently control the linear duty cycle via tuning the voltage. Experiment results confirm the performance of the proposed circuit that the amplitude of the triangular wave, frequency, and duty cycle are linearly controllable via current or voltage, which do not affect each other. The duty cycle, the amplitude of the triangular wave, and frequency have maximum errors of ±1.60%, ±3.33%, and ±2.55%, respectively.


Introduction
Many applications use a triangular and square wave generator, such as communication, instrumentation, electrical and control, and electronic systems. In communication systems, a triangular and square wave generator is used to generate carrier signals. Furthermore, a triangular and square shape is applied in generated pulse width modulation (PWM) to control motors, class-D amplifiers, and switching power supplies in electrical, control and electronic systems [1][2][3]. Moreover, it is employed to measure capacitance and capacitive sensor interfacing in instrumentation systems [4][5][6][7][8], as shown in Figure 1.

Introduction
Many applications use a triangular and square wave generator, such as communication, instrumentation, electrical and control, and electronic systems. In communication systems, a triangular and square wave generator is used to generate carrier signals. Furthermore, a triangular and square shape is applied in generated pulse width modulation (PWM) to control motors, class-D amplifiers, and switching power supplies in electrical, control and electronic systems [1][2][3]. Moreover, it is employed to measure capacitance and capacitive sensor interfacing in instrumentation systems [4][5][6][7][8], as shown in Figure 1.  From capacitive sensor interfacing in [8], it is found that a square wave generator was its main component. There are also a fast counter, a multiplexer, and a microcontroller. The sensing element's capacitance values are converted to a period modulated by the square wave generator. The counter counts the number of periods that have passed from the beginning of the counter. The measured capacitance is selected by the multiplexer. The microcontroller controls the external counter and multiplexer, which reads the data and sends it to the PC through a data line interface.
Many triangular and square wave generators have been proposed in the literature. Regarding technique design, these circuits are based on a Schmitt trigger with lossy and lossless integrators [9][10][11][12][13][14][15]. The generator in [9] is a low-power circuit and works in the MHz range. However, it consists of a Schmitt trigger with a lossy integrator that provides only a square wave. In addition, the frequency cannot be tuned by the electronic method, and the duty cycle cannot be adjusted. The construction of circuits in [10][11][12][13][14][15] uses the Schmitt trigger cascade, a lossless integrator where the resulting outputs are a triangular and square signal. A generator for instrumentation applications is proposed in [10]. It is a low power circuit, tuning amplitude and frequency by current biases; however, it cannot control the duty cycle. Additionally, the frequency control is non-linear. Thus, it is not easy to control. In 2011 and 2016, square wave generators using OTAs and VDTA were presented, respectively [11,12]. The advantages of these circuits include linearly controlling amplitude and frequency via voltage. However, the duty cycle of [11,12] lacks of electronic control. A CCI-and OTA-based triangular and square wave generator was presented in 2019 [3]. This generator has features such as linear electronic controllability of the frequency. However, it lacks adjustability amplitude and duty cycle of the output signals. Using a Dual-X current conveyor transconductance amplifier (MO-DXCCTA) to design a triangular/square wave generator, which can be implemented by commercially available ICs (AD844 and LM13700) [13], it uses current bias to linearly control frequency, amplitude, and duty cycle. Notwithstanding, controlling the frequency by current bias affects the duty cycle. Then, the frequency can be adjusted independently by adjusting the capacitor, which is difficult to control and non-linear. A dual-mode triangular/square wave generator is implemented by three current feedback amplifiers (CFOAs) [14]. The CFOAs employ commercial ICs, AD844. This circuit can operate for both current and voltage modes. It also gives sawtooth, triangular, and square waves, which can electronically tune the duty cycle, but the generator cannot adjust the frequency and amplitude. In particular, the adjustable frequency with a resistor is non-linear, which makes it difficult to apply in an automatic system.
In the field of analog signal processing, the use of analog function blocks (ABB) for the synthesis and design of high-performance circuits has received considerable attention [15][16][17][18][19][20]. The topologies of analog circuits synthesized from analog function blocks are simple, with a few active and passive elements. The synthesis procedures of circuits using analog function blocks are also easier and more flexible than using transistor levels. With the high input and low out impedance properties of voltage-mode ABB, as well as the low input and high output impedance features of current-mode ABB, additional buffer devices at input and output nodes of some ABB-based circuits are not required. In-circuit design for specific applications, using the commercially available ABB, is more convenient and cheaper than the CMOS or BJT-based ABBs. Although the CMOS-ABB-based circuits provide high circuit performances with small size, low voltage, and low power, the cost is still high for monolithic integrated circuit implementation. Therefore, the prospect of analog circuits using commercially available ABB is frequently proposed [21][22][23][24][25][26]. LT1228 is a popular commercially available ABB. It is the combination of the operational transconductance amplifier (OTA) and current feedback amplifier (CFA). This IC has several advantageous features such as electronic controllability, wide bandwidth, high voltage input impedance, high current output impedance, low voltage output impedance, and a wide range of applications, etc. With these advantageous features, the LT1228-based analog circuits can be found in the open literature [27][28][29][30][31].
From the previous, this research aims to synthesize a triangular/square signal generator employing LT1228 commercially available ICs, which are linearly tunable in amplitude, frequency, and duty cycle, using an electronic method. The paper is classified into six sections. The first section is the introduction. The ideal concept of synthesizing a duty cycle adjustable triangular/square wave generator is expanded in Section 2. The essential operation and saturation mode of LT1228 are described in Section 3. Section 4 clarifies the notion of Schmitt trigger and triangular/square wave generator. Section 5 concerns the performance of the circuit, which is confirmed by the experimental results. Finally, the conclusion is in Section 6.

Idea of Synthesize of Duty Cycle Adjustable Triangular/Square Wave Generator
Synthesizing the block diagram is shown in Figure 2. It aims to create a triangular/square wave generator that electronically controls the square wave's duty cycle without affecting amplitude and generated frequency. The cycle adjustable triangular/square wave generator consists of a current-mode inverting Schmitt trigger, a lossless integrator, an inverting amplifier, and a comparator. The output frequency can be found to be From the previous, this research aims to synthesize a triangular/square signal generator employing LT1228 commercially available ICs, which are linearly tunable in amplitude, frequency, and duty cycle, using an electronic method. The paper is classified into six sections. The first section is the introduction. The ideal concept of synthesizing a duty cycle adjustable triangular/square wave generator is expanded in section 2. The essential operation and saturation mode of LT1228 are described in section 3. Section 4 clarifies the notion of Schmitt trigger and triangular/square wave generator. Section 5 concerns the performance of the circuit, which is confirmed by the experimental results. Finally, the conclusion is in section 6.

Idea of Synthesize of Duty Cycle Adjustable Triangular/Square Wave Generator
Synthesizing the block diagram is shown in Figure 2. It aims to create a triangular/square wave generator that electronically controls the square wave's duty cycle without affecting amplitude and generated frequency. The cycle adjustable triangular/square wave generator consists of a current-mode inverting Schmitt trigger, a lossless integrator, an inverting amplifier, and a comparator. The output frequency can be found to be The duty cycle of the triangular/square wave generator can be expressed as where ref V is the reference voltage. It can be concluded that the duty cycle can be ad-

Off-the-Shelf IC (LT1228)
The LT1228 is an off-the-shelf IC using BJT technology. It implements the currentgain control with an operational transconductance amplifier (Voltage Differencing to Current), whose gain is a direct variation to an externally bias current. The output current is converted to a voltage by an external resistor. The CFA (Current Feedback Amplifier) amplifies the voltage into an 8 port, as shown in Figure 3. Where k, I S , I TH and τ are gain of the amplifier, the output amplitude of the Schmitt trigger, the current hysteresis of the Schmitt trigger, and the time constant of the lossless integrator. From (1), the frequency control of the system ( f o ) can be tuned by k or I HL . The triangular wave amplitude can be calculated below: The duty cycle of the triangular/square wave generator can be expressed as where V re f is the reference voltage. It can be concluded that the duty cycle can be adjusted by V re f .

Off-the-Shelf IC (LT1228)
The LT1228 is an off-the-shelf IC using BJT technology. It implements the current-gain control with an operational transconductance amplifier (Voltage Differencing to Current), whose gain is a direct variation to an externally bias current. The output current is converted to a voltage by an external resistor. The CFA (Current Feedback Amplifier) amplifies the voltage into an 8 port, as shown in Figure 3.  Testing LT1228, it is found that the OTA's output current ( y I ) is given by, where − V and + V are the voltages of pin 2 and 3, respectively. T V is the thermal voltage. B I is the externally bias current of terminal 5. The Maclaurin series of the hyperbolic tangent is as follows [33]: If 1 x , the tanh x term shown in (5) can be estimated as ≈ tanh x x . From (4), its first-order approximation can be derived to be Therefore, using (6), y I can be rewritten to be ( ) it is seen that y I conforms to the datasheet of the LT1228, where 3.87 From the above, the relationship of voltage and current for each LT1228's pin is where w V , x V , and y V are the voltage of pin 6, 8, and 1, respectively. w I and x I are the current of pins 6 and 8, respectively. Generally, CFA has 4 terminals: y, x, z, and w, as shown in Figure 4. However, the pin z of CFA is inside the LT1228, and this pin is floated. The trans-resistance gain of the pin z is T Z , which is ideally about infinity. From the LT1228 test, it is found that T Z is approximately 190 kΩ. Then, (9) can be rewritten as follows: Testing LT1228, it is found that the OTA's output current (I y ) is given by, where V − and V + are the voltages of pin 2 and 3, respectively. V T is the thermal voltage. I B is the externally bias current of terminal 5. The Maclaurin series of the hyperbolic tangent is as follows [33]: If x 1, the tanhx term shown in (5) can be estimated as tanhx ≈ x. From (4), its first-order approximation can be derived to be Therefore, using (6), I y can be rewritten to be it is seen that I y conforms to the datasheet of the LT1228, where I B 3.87V T is a transconductance amplifier (g m ). V T at a temperature of 27 degrees Celsius is about 26 mV. Finally, I y is approximately obtained: From the above, the relationship of voltage and current for each LT1228's pin is where V w , V x , and V y are the voltage of pin 6, 8, and 1, respectively. I w and I x are the current of pins 6 and 8, respectively. Generally, CFA has 4 terminals: y, x, z, and w, as shown in Figure 4. However, the pin z of CFA is inside the LT1228, and this pin is floated. The trans-resistance gain of the pin z is Z T , which is ideally about infinity. From the LT1228 test, it is found that Z T is approximately 190 kΩ. Then, (9) can be rewritten as follows:

Concept of Schmitt Trigger
Designing the Schmitt trigger uses the LT1228's saturation mode, which is both internal OTA and CFA. The OTA operation condition in the saturation region is the input From Figure 5, the +, −, and y ports are floated. The CFA operates in saturation mode where SAT V and are the positive and negative saturation voltages; CC V and EE V are the positive and negative supply voltages, respectively. Using LT1228's saturation mode, the Schmitt trigger is shown in Figure 6, which consists of two LT1228s and a grounded resistor.

Concept of Schmitt Trigger
Designing the Schmitt trigger uses the LT1228's saturation mode, which is both internal OTA and CFA. The OTA operation condition in the saturation region is the input voltage differencing (V + − V − ) more than 150 mV or less than −150 mV. Thus, the output current I y can be found in OTA's saturation region to be From Figure 5, the +, −, and y ports are floated. The CFA operates in saturation mode where V SAT and −V SAT are the positive and negative saturation voltages; V CC and V EE are the positive and negative supply voltages, respectively. Using LT1228's saturation mode, the Schmitt trigger is shown in Figure 6, which consists of two LT1228s and a grounded resistor.  . From Figure 6, it is found that the Thus, OTAs of LT1228-2 operates in saturation mode; At the initial time, the triangular wave is the input signal of LT1228-1's pin x, which V w1 is about I in (190 k). From Figure 6, it is found that the V w1 equals V − of LT1228-1 (V 1− ) and LT1228-2 (V 2− ). Thus, OTAs of LT1228-2 operates in saturation mode; LT1228-2's I y I y2 is −I B2 . At the same time, V 1− = I in (190 k), while V 1+ = RI y1 . Then, V 1+ − V 1− is much more than |150 mV|, where LT1228-1 is saturation mode operational. OTAs of LT1228-1 and LT1228-2 operate in saturation mode; LT1228-1's I y (I out ) and LT1228-2's I y I y2 are approximated −I B1 and −I B2 , respectively. I out equals −I B1 until I in is lower than −I B2 . I out is changed from −I B1 to I B1 while I y2 is equal to I B2 . I out is returned to be −I B1 again when I in is higher than I B2 , as illustrated in Figure 7.  I  I  I  if  I  I  I  I where HL I and LH I are the high and low hysteresis currents, which can be found to be Using (14), out I can be recalculated to be 1 I  I  I  if  I  I  I  I  From (13) and (14), the DC characteristic of the Schmitt trigger is displayed in Figure 8. It is seen that it is a noninverting Schmitt trigger. Hence, the output current (I out ) can be obtained by, where I HL and I LH are the high and low hysteresis currents, which can be found to be I HL = I B2 and I LH = −I B2 .
Using (14), I out can be recalculated to be where I B1 and I B2 are the external current bias of LT1228-1 and LT1228-2, respectively. The external bias current linearly controls the output and hysteresis currents of the Schmitt trigger, which are I B1 and I B2 . Additionally, they are insensitive to temperature. From (13) and (14), the DC characteristic of the Schmitt trigger is displayed in Figure 8. It is seen that it is a noninverting Schmitt trigger.

Concept of Triangular/Square Wave Generator
The duty cycle tunable triangular/square wave generator using LT1228s is explained in this section. Using the Schmitt trigger in Section 4.1, the capacitor and resistor are replaced by the resistor and the input signal at LT1228-1's y and x terminals, respectively, as shown in Figure 9, which operates as a triangular wave generator. The duty cycle tunable triangular/square wave generator using LT1228s is explained in this section. Using the Schmitt trigger in Section 4.1, the capacitor and resistor are replaced by the resistor and the input signal at LT1228-1's y and x terminals, respectively, as shown in Figure 9, which operates as a triangular wave generator. Using properties of LT1228, 1 1 Using Figure 10, the period of the signal depends on the amplitude of the triangular wave; therefore, it can be expressed as, Independently controlling the frequency can be archived by the current bias of LT1228-1 ( ) As demonstrated in Figure 11  Using properties of LT1228, V y1 = V x1 = V TRI , thus the amplitude of the triangular wave (V TRI ) can be found to be |V TRI | = R|I B2 |.
Using Figure 10, the period of the signal depends on the amplitude of the triangular wave; therefore, it can be expressed as, and  From (18), the frequency can be derived as Independently controlling the frequency can be archived by the current bias of LT1228-1 (I B1 ). In addition, since (19) is without V T term, the frequency is not sensitive to temperature variation. The open-loop voltage gain of LT1228's internal CFA is high, which is about 55 dB [30], so the LT1228-2's CFA is used as a voltage comparator. The inputs of the comparator are the DC voltage reference V re f . and the triangular signal (V TRI ). The resulting output is a square signal. The output amplitude can be As demonstrated in Figure 11, the rise time and fall time depend on V re f , and it can be seen that V SQ equals V SAT until V TRI (t) or RI B2 (t) less than V re f . The amplitude of the square wave is changed V SAT to −V SAT . It becomes V SAT again when V TRI (t) is upward V re f . From the relationship mentioned above, It is the period when V TRI (t) goes up and then equals V re f and where V TRI (t) goes down and is equal to V re f , which is the pulse width (∆t 2 ).  Figure 11. The waveform of the triangular/square wave generator using LT1228s.
It is discovered that 2 t Δ or 1 T is the difference between 2 T and 1 3 t t Δ +Δ ; it can be written as follows: and ( ) ( ) By Substituting (22) in (23) and (24), 1 t Δ and 1 t Δ can be rewritten by 1 3 Figure 11. The waveform of the triangular/square wave generator using LT1228s.
It is discovered that ∆t 2 or T 1 is the difference between T 2 and ∆t 1 + ∆t 3 ; it can be written as follows: where ∆t 1 and ∆t 3 are the duration times of addition V TRI (t) from 0 to V re f , and the decrease V TRI (t) from V re f to 0, respectively. Using the straight-line equation, the positive and negative slopes of the triangular signal are given by Therefore, ∆t 1 and ∆t 3 are obtained: and By Substituting (22) in (23) and (24), ∆t 1 and ∆t 1 can be rewritten by (24) and (25) can be substituted in (21), ∆t 2 can be obtained by Using (18) and (26), the duty cycle (D) is as follows: From (16), (19), (20) and (26), it is established that the triangular/square wave generator is slightly affected by temperature changes. The current biases have the ability to control the amplitude of the triangular wave and the frequency. Additionally, the frequency can be independently tuned without affecting the triangle wave's amplitude by I B1 . V re f can control the duty cycle of the square signal.

Non-Ideal Case of LT1228 on Saturation-Mode
The non-ideal effect of LT1228 in the saturation-mode region on the operation of the proposed triangular/square wave generator is expanded in this part; the current and voltage's relationship of LT1228 on saturation mode in non-ideal is given as follows: and where α, β x , and β are the current error outputs, voltage gain transfer at x pin error, and voltage error output, respectively. Taking into account the non-idealities of LT1228 on the saturation region, so the non-ideal amplitude of the triangular and square wave, frequency, and duty cycle can be recalculated by and where α 1 and α 2 respectively, are the current error outputs of LT1228-1 and LT1228-2; β x1 is the voltage gain transfer at the x pin error of LT1228-1; β 2 is LT1228-2's voltage error output. It is found that the imperfections of LT1228 affect how well the proposed triangular/square wave generator works; applied in the capacitive sensor interface by plugging in the capacitive sensor instead of the capacitor. For example, HCH-1000 has a capacitance value of 310 pF to 350 pF [34]. The capacitance of this sensor can overcome the parasitic capacitance at the Y and + terminals, which are 6 pF and 3 pF, respectively [35]. For the accurate readout value, it can be calibrated via the bias currents I B1 or I B2 . There are two ways to achieve this: manually and automatically. Manually, it is an I B1 or I B2 adjustment through the bias resistors, R B1 or R B2 , as shown in Figure 12. Automatically, the bias currents I B1 or I B2 are tuned via the control voltages V C1 and V C2 , which is a convenient electronic method controlled by the microcontroller unit (MCU), as shown in Figure 13. However, I B1 or I B2 depend on the temperature and negative power supply voltage (V EE ).  1.4 Figure 13. The automatic calibration through 1 C V or 2 C V using a microcontroller.

Experimental Results
This section shows the experimental results to ensure the efficiency of the triangular/square wave generator using LT1228s. RIGOL DS1054Z (RIGOL Technologies Co. Ltd, Beijing, China) is the measuring instrument that was utilized. In the experiment, I B1 = 800 µA, I B2 = 200 µA, R = 1 kΩ, C = 0.1 µF, ±9 V supply voltage was used. Figure 14a shows the experimental setup, consisting of one RIGOL DS1054, a breadboard, two DC power supplies, and two ×10 oscilloscope probes. The first DC power supply is MCP MODEL: M10-TP3005H which is ±9 V supply voltage. V re f uses MCP MODEL: M10-TP3003L for DC supply, which is set to 168 mV at the moment. The actual triangular/square wave generator implementation is displayed in Figure 14b. It is composed of five main parts: R = 1 kΩ, C = 0.1 µF, two LT1228s, R bias1 = 10.62 kΩ, and R bias2 = 42.3 kΩ, where R bias1 and R bias2 are resistors for the current bias of pin 5 of LT1228-1 and LT1228-2, respectively. board, two DC power supplies, and two ×10 oscilloscope probes. The first DC power supply is MCP MODEL: M10-TP3005H which is ±9 V supply voltage. ref V uses MCP MODEL: M10-TP3003L for DC supply, which is set to 168 mV at the moment. The actual triangular/square wave generator implementation is displayed in Figure 14b. It is composed of five main parts: 1 k R = Ω , 0.1 μF C = , two LT1228s,  Designing the frequency and duty cycles of the proposed circuit are 10 kHz, 90%, 50%, and 10%, which V re f is varied −160 mV, 0 mV, and 160 mV; the amplitude of triangular and square waves, respectively, are 200 mV p and 9 V p . Figure 15 displays the triangular and square waves with the frequency of 10.42 kHz when V re f is varied −168 mV, 0 mV, and 168 mV; the duty cycles are 90%, 50%, and 10%; Triangular and square waves have amplitudes of 211 mV p and 7.596 V p , respectively. This error is due to the non-ideal case of LT1228, which was discussed in Section 4.3. The results are plotted, as shown in Figure 16; it is the amplitude of the triangular signal, which is controlled by I B2 .  The test modulates the frequency by adjusting 1 B I , which found that its dynamics change linearly, as demonstrated in Figure 17. Linear controlling the triangular signal's amplitude is varied in the range of 0-1.03 V when I B2 is 0-1 mA. The peak amplitude deviates from the theory analyzed by ±3.33%. The test modulates the frequency by adjusting I B1 , which found that its dynamics change linearly, as demonstrated in Figure 17.  The magnitude of the triangular and square signals is likewise unaffected by frequency modulation. The results obtained have a maximum error of about ±2.55%. The matter of the values of α 1 , α 2 , and β x1 deviating from one, as shown in (32) The plot is illustrated in Figure 18; it is the comparison between the duty cycle and V re f change from −200 mV to 200 mV. It is confirmed that V re f linearly controls the duty cycle by the electronic technique. The maximum error of the square wave's duty cycle is ±1.60%.

Conclusions
Off-the-shelf IC LT1228 designs the proposed triangular/square wave generator for capacitive sensors, which comprises two LT1228s, and a grounded capacitor and resistor. The circuit can be electronically/linearly tuned for the duty cycle, the magnitude triangular wave, and the frequency, which are achieved by

Conclusions
Off-the-shelf IC LT1228 designs the proposed triangular/square wave generator for capacitive sensors, which comprises two LT1228s, and a grounded capacitor and resistor. The circuit can be electronically/linearly tuned for the duty cycle, the magnitude triangular wave, and the frequency, which are achieved by V re f , I B2 , and I B1 , respectively. The amplitude of the triangle signal is not affected by frequency control using I B1 , which is another advantage of this method. The proposed circuit's functional test, when I B1 , I B2 , R and C are assigned equally to 800 µA, 200 µA, 1 k and 0.1 µF, respectively. The experimental results show that the circuit has a frequency of 10.42 kHz, and when V re f is −168 mV, 0 mV, and 168 mV, the duty cycle is equal to 90%, 50%, and 10%, respectively; the duty cycle is varied by V re f , it is changed between −200 mV and 200 mV. The amplitude of the triangular wave can be adjusted from 51 mV to 1.03 V, with I B2 in the range from 50 µA to 1 mA. The available frequencies are in the range of 0-12.4 kHz, which I B1 is about 0-1 mA. The maximum errors of the duty cycle, triangular wave's magnitude, and frequency are ±1.60%, ±3.33%, and ±2.55%.