An adaptive sampling method and system for sensor signals based on digital potentiometers
By adjusting the gain and bias of the operational amplifier using dual digital potentiometers, the problems of poor compatibility and low sampling resolution caused by inconsistent sensor signal ranges in UAV control products are solved, enabling adaptive sampling of sensor signals and improving sampling efficiency and control accuracy.
Patent Information
- Application Number
- CN202611171360.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-08-04
AI Technical Summary
The signal sampling systems in existing drone control products suffer from poor hardware compatibility, low sampling resolution, and complex debugging, mainly due to the inconsistent range of sensor signals.
The gain and bias of a cascaded operational amplifier are adjusted using dual digital potentiometers. The sensor input voltage range is automatically adjusted to the target range for signal acquisition through a non-inverting amplifier circuit. The resistance values of digital potentiometers VR1 and VR2 and the reference voltage are controlled by a microcontroller to achieve adaptive sampling.
It achieves automatic adaptation of sensor signal range, improves sampling efficiency and compatibility, reduces quantization error, and enhances control accuracy.
Smart Images

Figure CN122678722B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of electronic circuit technology and signal processing, specifically relating to an adaptive sampling method and system for sensor signals based on a digital potentiometer. Background Technology
[0002] Currently, existing drone control products (e.g., joysticks, throttles, pedals) require signal sampling systems to collect data. These systems primarily consist of sensors, signal conditioning circuits, an ADC (Analog-to-Digital Converter), and a subsequent controller. Specifically, during operation, position sensors convert actions into analog signals, which are then processed by the signal conditioning circuit and output to the ADC for sampling. However, existing signal sampling systems have the following drawbacks: (1) Poor hardware compatibility: In order to adapt to the mechanical stroke requirements and achieve a larger sampling resolution, the selection of sensors cannot be unified, which increases the procurement and management costs; (2) Low sampling resolution: If the sensor output range is much smaller than the ADC reference voltage range (for example, the sensor only outputs 0.5V-1.5V, while the ADC reference voltage is 3.3V), a large number of effective bits will be wasted, resulting in increased quantization error and decreased control accuracy. (3) Complex debugging: Because the range of analog input signals of the sensor is not uniform, the specific signal conditioning circuit needs to be debugged to ensure the range of the output voltage of the sampled signal. Summary of the Invention
[0003] The purpose of this invention is to provide an adaptive sampling method and system for sensor signals based on digital potentiometers, aiming to solve the problems of low sampling efficiency and poor compatibility caused by inconsistent sensor signal ranges in the prior art.
[0004] This invention is mainly achieved through the following technical solutions: An adaptive sampling method for sensor signals based on digital potentiometers is proposed, which involves setting up an operational amplifier U1, a fixed resistor R1, and an operational amplifier U2 connected sequentially from front to back. Operational amplifiers U1 and U2 are connected to digital potentiometers VR1 and VR2 respectively, forming a non-inverting amplifier circuit. The method then converts the sensor's input voltage V... Ⅰ The data is transmitted to a non-inverting amplifier circuit, amplified, and then acquired by an analog-to-digital converter (ADC) controlled by a microcontroller (MCU). The process includes the following steps: Step S1: Initialization settings; Initialize the reference voltage V generated by digital potentiometer VR1. ref =0, initialize the resistance value of digital potentiometer VR2; Step S2: Signal range detection; First, in response to the sensor's travel operation, the output voltage V of the non-inverting amplifier circuit is detected. O The range of intervals [V] Omin V Omax Then, determine the actual input voltage range of the sensor [V]. Ⅰmin V Ⅰmax ]; Where: V Omin V Omax The output voltage V is respectively O The maximum and minimum values; V Ⅰmin V Ⅰmax These are the maximum and minimum values of the actual input voltage of the sensor, respectively. Step S3: Calculate the target resistance value VR'2 of the digital potentiometer VR2; (8) VR'2 = (A'-1) × R1 (9) Where: A' is the target gain; ΔV O The target sampling voltage range; ΔV Ⅰ This represents the actual voltage span of the sensor. Step S4: Calculate the target reference voltage V' generated by digital potentiometer VR1 ref ; (11); Where: V Ⅰcenter This represents the midpoint voltage of the input signal under ideal conditions. V mid The target center voltage; Step S5: Based on the target reference voltage V' ref Digital potentiometers VR1 and VR2 are configured to be used to linearly amplify and offset the sensor output signal to a value of V, respectively, in relation to the target resistance VR'2. mid The optimal sampling interval centered on.
[0005] To better realize the present invention, step S2 further includes the following steps: Step S21: Measure and acquire the output voltage V as the sensor oscillates throughout its full stroke. O The maximum value V Omax and minimum value V Omin ; Step S22: Based on the output voltage V O The maximum value V Omax and minimum value V Omin Calculate the actual input voltage range of the sensor [V] Ⅰmin VⅠmax ]; (5) (6) Step S23: Calculate the actual voltage span ΔV of the sensor. Ⅰ =V Ⅰmax -V Ⅰmin .
[0006] To better realize the present invention, step S4 further includes the following steps: Step S41: Set the target center voltage V mid This achieves control offset, ensuring that the output voltage range is within the amplification region; Step S42: Calculate the midpoint voltage V of the input signal under ideal conditions. Ⅰcenter ; (10) Step S43: Calculate the target reference voltage V' generated by digital potentiometer VR1 ref .
[0007] To better realize the present invention, further, in step S41, the target center voltage V mid =1 / 2 (V) Omax +V Omin ).
[0008] This invention is mainly achieved through the following technical solutions: An adaptive sampling system for sensor signals based on digital potentiometers, based on the aforementioned adaptive sampling method for sensor signals based on digital potentiometers, includes digital potentiometers VR1 and VR2, and operational amplifiers U1, R1, U2, analog-to-digital converters (ADCs), and microcontrollers (MCUs) arranged sequentially from front to back; the microcontrollers (MCUs) are connected via I... 2 The C bus is connected to the input terminals of digital potentiometers VR1 and VR2 respectively; The sliding terminal of the digital potentiometer VR1 is connected to the non-inverting input terminal of the operational amplifier U1, and its low-side is grounded. The inverting input terminal of the operational amplifier U1 is connected to its output terminal, and the output terminal of the operational amplifier U1 is connected to the inverting input terminal of the operational amplifier U2 through a fixed resistor R1. The non-inverting input of the operational amplifier U2 is connected to the sensor, and its output is connected to the sliding terminal of the digital potentiometer VR2 and the analog-to-digital converter ADC, respectively. The low end of the digital potentiometer VR2 is connected to the inverting input of the operational amplifier U2.
[0009] To better realize the present invention, the digital potentiometers VR1 and VR2 are further specified as MCP4661T-103E / ML; and the operational amplifiers U1 and U2 are respectively rail-to-rail operational amplifiers TP5532.
[0010] To better realize the present invention, the microcontroller MCU is further specified as STM32F103.
[0011] The beneficial effects of this invention are as follows: This invention uses dual digital potentiometers to adjust the gain and bias of a cascaded operational amplifier, thereby linearly amplifying and shifting the sensor output signal to a value of V. mid The optimal sampling range centered on the sensor automatically adjusts the input voltage range of unknown sensors to the target range for signal acquisition. This solves the problems of low sampling efficiency and poor compatibility caused by inconsistent sensor signal ranges in existing technologies. This invention can be applied to analog signal conditioning in UAV control systems, enabling adaptive sampling of sensors with different output voltage ranges through software configuration. Attached Figure Description
[0012] Figure 1 This is a circuit diagram of the adaptive sampling system for sensor signals based on a digital potentiometer according to the present invention. Figure 2 This is a flowchart of the adaptive sampling method for sensor signals based on digital potentiometers according to the present invention; Figure 3 The simulated waveforms of the system output voltage, sensor input voltage, and reference voltage in Example 3 are shown. Detailed Implementation
[0013] Example 1: An adaptive sampling system for sensor signals based on a digital potentiometer, such as Figure 1 As shown, it includes digital potentiometer VR1, digital potentiometer VR2, operational amplifier U1, operational amplifier U2, fixed resistor R1, analog-to-digital converter (ADC), and microcontroller MCU. The microcontroller MCU connects to I... 2The C bus is connected to the input terminals of digital potentiometers VR1 and VR2, respectively. The sliding terminal of digital potentiometer VR1 is connected to the non-inverting input terminal of operational amplifier U1, with its low-side grounded and its high-side connected to VDD. The inverting input terminal of operational amplifier U1 is connected to its output terminal, and the output terminal of operational amplifier U1 is connected to the inverting input terminal of operational amplifier U2 through a fixed resistor R1. The non-inverting input terminal of operational amplifier U2 is connected to a sensor, and the output terminal of operational amplifier U2 is connected to the sliding terminal of digital potentiometer VR2 and the analog-to-digital converter (ADC). The low-side of digital potentiometer VR2 is connected to the inverting input terminal of operational amplifier U2.
[0014] During use, the sensor's input voltage V Ⅰ The data is transmitted to a non-inverting amplifier circuit composed of a digital potentiometer and an operational amplifier. After amplification, the data is acquired by an analog-to-digital converter (ADC) controlled by a microcontroller (MCU). The MCU receives the sampled data, calculates the amplifier circuit parameters, and sets the resistance value of the digital potentiometer. The core of this invention lies in adjusting the gain and bias of the operational amplifier using dual digital potentiometers (VR1, VR2). Details are as follows: 1. Establishing the circuit transfer function; like Figure 1 As shown, the sensor's input voltage is V. Ⅰ The reference voltage generated by the digital potentiometer VR1 is V. ref The system's output voltage is V O The digital potentiometer VR2 has a resistance of VR2, and the fixed resistor R1 has a resistance of R1.
[0015] According to the principles of virtual short and virtual open of operational amplifiers, the voltage at the inverting input (-) of operational amplifier U2 is equal to the voltage V at the non-inverting input (+). Ⅰ The current flowing through the fixed resistor R1 and the digital potentiometer VR2 is equal.
[0016] From this, the current equation can be derived: (1) Rearrange the terms in formula (1) to solve for the output voltage V. O : (2) Define gain A: (3) Formula (2) is the core mathematical model of this system, indicating that the output voltage V O From the input voltage V Ⅰ Gain coefficient (VR2 / R1) and reference voltage V ref A joint decision.
[0017] 2. Input span reverse calculation algorithm (initialization phase); During system initialization, the reference voltage V generated by the digital potentiometer VR1 is set. ref =0 (i.e., digital potentiometer VR1 is grounded), formula (1) simplifies to: (4) For the output voltage V O The maximum value V Omax and minimum value V Omin The measurement is performed, and the maximum value V of the actual input voltage is calculated according to formula (4). Ⅰmax and minimum value V Ⅰmin : (5) (6) The true span ΔV of the sensor's input signal is calculated. Ⅰ for: (7) 3. Target gain calculation: Determine the target resistance value VR'2 of digital potentiometer VR2; To maximize sampling resolution, the voltage range output to the analog-to-digital converter (ADC) is set to ΔV. O By calculating the target resistance VR'2 of the digital potentiometer VR2, the span ΔV of the input signal is... Ⅰ Just mapped to ΔV O .
[0018] The target sampling voltage range ΔV O Substitute into formula (7) to calculate the target gain A': (8) Substituting the target gain A' into formula (3), we get: ; The target resistance value VR'2 of the digital potentiometer VR2 is obtained by solving: VR'2 = (A'-1) × R1 (9) 4. Target bias calculation: Determine the target reference voltage V' generated by digital potentiometer VR1. ref ; To control the offset and keep the output voltage range within the amplification region, the target center voltage V needs to be set. mid .
[0019] Ideally, the midpoint voltage V of the input signal Ⅰcenter for: (10) Transform formula (1) to obtain the reference voltage V generated by digital potentiometer VR1. ref : ; When the input is the midpoint voltage V Ⅰcenter When that happens, the output should be the target center voltage V. mid Substituting into the above formula, we get: (11) The MCU outputs the target reference voltage V' by controlling the digital potentiometer VR1. ref This allows for automatic centering of the signal.
[0020] Example 2: An adaptive sampling method for sensor signals based on a digital potentiometer, implemented using the sampling system in Example 1, aims to automatically adjust the range of unknown sensor input analog signals to the target range for signal acquisition. Figure 2 As shown, the specific steps include: Step 1: Initialize configuration; The microcontroller (MCU) controls the digital potentiometer VR1, causing the reference voltage V generated by the digital potentiometer VR1 to... ref =0, eliminating the influence of bias voltage on gain calculation; Under the premise of ensuring that the input signal meets the amplification range of the amplifier circuit, initialize the resistance value of the digital potentiometer VR2.
[0021] Step 2: Signal range detection; in response to the sensor's travel operation, obtain the voltage extreme value of the system output voltage; The microcontroller (MCU) acquires the output signal of the sensor during its full-stroke oscillation and records the system output voltage V at that time. O The maximum value V Omax and minimum value V Omin .
[0022] Step 3: Calculate the target gain and resistance; Based on formulas (4) to (7), the actual input voltage range of the sensor [V] can be deduced. Ⅰmin V Ⅰmax ]; Based on the target sampling voltage range ΔV O The actual voltage span ΔV of the sensor I The target resistance value VR′2 of VR2 is calculated using formulas (8) and (9).
[0023] Among them, the actual voltage span ΔV of the sensor is calculated. Ⅰ =V Ⅰmax -V Ⅰmin ; Set the target sampling voltage range ΔV O (Approximately equal to or equal to the MCU's ADC reference voltage); Calculate the required target gain A'=ΔV O / ΔV Ⅰ ; Calculate the target resistance value of digital potentiometer VR2: VR'2 = (A'-1) × R1, where R1 is a fixed resistor.
[0024] Step 4: Calculate the target bias and voltage; Set target center voltage V mid For example, the target center voltage is typically 1 / 2 (V) Omax +V Omin ); The target reference voltage V' generated by the digital potentiometer VR1 is obtained according to formula (1). ref ; (11); According to V' ref Configure the resistance value of digital potentiometer VR1.
[0025] Step 5: Configure the digital potentiometer; Based on the target resistance value VR'2 and the target reference voltage V' ref By configuring a digital potentiometer via the MCU, the sensor output signal is linearly amplified and shifted to a value of V. mid The optimal sampling interval centered on.
[0026] Example 3: A sensor signal adaptive sampling system based on a digital potentiometer is proposed, which applies the system in Example 1 to the sampling of UAV joystick signals. The specific component models and parameters are as follows: The model numbers of the digital potentiometers VR1 and VR2 are MCP4661T-103E / ML; The operational amplifiers U1 and U2 are rail-to-rail operational amplifiers TP5532, respectively. The microcontroller MCU is model STM32F103, and its peripheral device is an integrated analog-to-digital converter (ADC). Fixed resistor R1 = 750Ω; It uses a single 3.3V power supply.
[0027] After signal conditioning, the sensor signal is expected to be acquired by the analog-to-digital converter (ADC) at the target center voltage V. mid With 1.6V as the center, the target sampling voltage range ΔV O It is 3V.
[0028] Preferably, the specific sampling method of the sampling system includes the following steps: Step 1: Initialize configuration; Configure digital potentiometer VR1 so that the reference voltage V generated by digital potentiometer VR1 is... ref =0; at the same time, set the resistance of digital potentiometer VR2 to VR2=750Ω.
[0029] Step 2: Signal range detection; Push the joystick all the way down and measure the output voltage V. O The maximum value V Omax =2V, output voltage V O Minimum value V Omin =1V.
[0030] Step 3: Calculate the target gain and resistance; (1) Back-calculation of input: Calculate the maximum value V of the actual input voltage of the sensor using formulas (5) and (6). Ⅰmax and minimum value V Ⅰmin : ; ; The true span ΔV of the sensor's input signal is calculated. Ⅰ =V Ⅰmax -V Ⅰmin =0.5V; Actual measurements showed that the actual span of the sensor's input signal was consistent with the calculated results.
[0031] Calculate the gain: target sampling voltage range ΔV O =3V, calculate the target gain A' according to formula (8): .
[0032] (2) Calculate the target resistance VR'2 of the digital potentiometer VR2 according to formula (9): .
[0033] Step 4: Calculate the target bias and determine the target reference voltage V' generated by the digital potentiometer VR1. ref ; Midpoint voltage V of the input signal Ⅰcenter for: ; Substituting into formula (11), we get: .
[0034] Step 5: Configure the digital potentiometer; The MCU controls digital potentiometer VR1 to output 0.58V, and configures the resistance of digital potentiometer VR2 to 3750Ω. This completes the adaptive adjustment.
[0035] like Figure 3 As shown, the simulation results are consistent with the calculation results above. After the configuration is completed, the 0.5V-1.0V signal output by the sensor is linearly converted into a 0.1V-3.1V signal with a center voltage of 1.6V, which perfectly matches the 3V ADC sampling range.
[0036] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. An adaptive sampling method for sensor signals based on a digital potentiometer, characterized in that, Configure an operational amplifier U1, a fixed resistor R1, and an operational amplifier U2 connected sequentially from front to back. Connect operational amplifier U1 and operational amplifier U2 to digital potentiometers VR1 and VR2 respectively to construct a non-inverting amplifier circuit. The sensor's input voltage V... Ⅰ The data is transmitted to a non-inverting amplifier circuit, amplified, and then acquired by an analog-to-digital converter (ADC) controlled by a microcontroller (MCU). The process includes the following steps: Step S1: Initialization settings; Initialize the reference voltage V generated by digital potentiometer VR1. ref =0, initialize the resistance value of digital potentiometer VR2; Step S2: Signal range detection; First, in response to the sensor's travel operation, the output voltage V of the non-inverting amplifier circuit is detected. O The range of intervals [V] Omin V Omax Then, determine the actual input voltage range of the sensor [V]. Ⅰmin V Ⅰmax ]; Where: V Omin V Omax The output voltage V is respectively O The maximum and minimum values; V Ⅰmin V Ⅰmax These are the maximum and minimum values of the actual input voltage of the sensor, respectively. Step S3: Calculate the target resistance value VR'2 of the digital potentiometer VR2; (8) VR'2 = (A'-1) × R1 (9) Where: A' is the target gain; ΔV O The target sampling voltage range; ΔV Ⅰ This represents the actual voltage span of the sensor. Step S4: Calculate the target reference voltage V' generated by digital potentiometer VR1 ref ; (11); Where: V Ⅰcenter This represents the midpoint voltage of the input signal under ideal conditions. V mid The target center voltage; Step S5: Based on the target reference voltage V' ref Digital potentiometers VR1 and VR2 are configured to be used to linearly amplify and offset the sensor output signal to a value of V, respectively, in relation to the target resistance VR'2. mid The optimal sampling interval centered on.
2. The adaptive sampling method for sensor signals based on a digital potentiometer according to claim 1, characterized in that, Step S2 includes the following steps: Step S21: Measure and acquire the output voltage V as the sensor oscillates throughout its full stroke. O The maximum value V Omax and minimum value V Omin ; Step S22: Based on the output voltage V O The maximum value V Omax and minimum value V Omin Calculate the actual input voltage range of the sensor [V] Ⅰmin V Ⅰmax ]; (5) (6) Step S23: Calculate the actual voltage span ΔV of the sensor. Ⅰ =V Ⅰmax -V Ⅰmin .
3. The adaptive sampling method for sensor signals based on a digital potentiometer according to claim 2, characterized in that, Step S4 includes the following steps: Step S41: Set the target center voltage V mid This achieves control offset, ensuring that the output voltage range is within the amplification region; Step S42: Calculate the midpoint voltage V of the input signal under ideal conditions. Ⅰcenter ; (10) Step S43: Calculate the target reference voltage V' generated by digital potentiometer VR1 ref .
4. The adaptive sampling method for sensor signals based on a digital potentiometer according to claim 3, characterized in that, In step S41, the target center voltage V mid =1 / 2 (V) Omax +V Omin ).
5. A sensor signal adaptive sampling system based on a digital potentiometer, comprising the sensor signal adaptive sampling method based on a digital potentiometer as described in any one of claims 1 to 4, characterized in that, It includes digital potentiometers VR1 and VR2, and operational amplifiers U1, R1, U2, analog-to-digital converter (ADC), and microcontroller (MCU) arranged sequentially from front to back; the microcontroller (MCU) is connected via I... 2 The C bus is connected to the input terminals of digital potentiometers VR1 and VR2 respectively; The sliding terminal of the digital potentiometer VR1 is connected to the non-inverting input terminal of the operational amplifier U1, and its low-side is grounded. The inverting input terminal of the operational amplifier U1 is connected to its output terminal, and the output terminal of the operational amplifier U1 is connected to the inverting input terminal of the operational amplifier U2 through a fixed resistor R1. The non-inverting input of the operational amplifier U2 is connected to the sensor, and its output is connected to the sliding terminal of the digital potentiometer VR2 and the analog-to-digital converter ADC, respectively. The low end of the digital potentiometer VR2 is connected to the inverting input of the operational amplifier U2.
6. The adaptive sampling system for sensor signals based on a digital potentiometer according to claim 5, characterized in that, The digital potentiometers VR1 and VR2 are model MCP4661T-103E / ML; the operational amplifiers U1 and U2 are rail-to-rail operational amplifiers TP5532.
7. The adaptive sampling system for sensor signals based on a digital potentiometer according to claim 5, characterized in that, The microcontroller MCU is model STM32F103.
Citation Information
Patent Citations
Hall signal measuring device and method with automatically adjustable detection range
CN109884377A
