Multi-channel signal acquisition system and method based on adaptive channel switching
By employing adaptive channel switching and charge release technology, the problems of voltage spikes, backlash, and crosstalk during channel switching in multiplexers are solved, achieving high-precision and high-efficiency multi-channel signal acquisition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- KUNMING SHIP EQUIPMENT RESEARCH & TESTING CENTER (CHINA SHIPBUILDING CORP 750 TEST SITE)
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-28
AI Technical Summary
In traditional multi-channel signal acquisition methods, voltage spikes, backlash, switching delays, and signal crosstalk occur when multiplexers switch channels, and improper waiting time settings affect sampling accuracy and efficiency.
An adaptive channel switching method is adopted, which dynamically adjusts the waiting time by calculating the signal change rate of the previous sampled value and releases residual charge before channel switching to reduce crosstalk. The method utilizes the collaboration of a microcontroller and a multiplexer.
It improved the accuracy of signal sampling to 98%, increased sampling efficiency by 34%, and reduced component costs and power consumption.
Smart Images

Figure CN121934448A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of multi-channel signal acquisition, specifically to a multi-channel signal acquisition system and method based on adaptive channel switching, and more particularly to a high-efficiency, high-precision multi-channel acquisition system and method based on an analog multiplexer and a microcontroller. Background Technology
[0002] Traditional multi-channel signal acquisition methods typically employ an ADC device or complex analog front-end for each channel, resulting in higher costs and power consumption due to the increased number of components required. An improved approach is to use an analog multiplexer to switch sampling channels, which significantly reduces the number of ADC devices needed.
[0003] However, when the multiplexer switches channels, voltage spikes or backlashes may occur at its input, and there are issues such as switching delay and insufficient signal settling time. Therefore, it is necessary to wait for the signal to stabilize before sampling begins. In addition, crosstalk exists between multiplexer channels, and this crosstalk problem needs to be addressed.
[0004] In existing technologies, a fixed time is typically waited after the multiplexer switches channels before sampling. However, if the waiting time is too short, sampling before the signal stabilizes will affect the sampling accuracy; while if the waiting time is too long, it will obviously reduce the sampling efficiency. Summary of the Invention
[0005] To address the problems and shortcomings of existing technologies, this invention provides a multi-channel signal acquisition system and method based on adaptive channel switching. The system calculates the signal change rate based on the previous sampled value to determine the waiting time and dynamically adjusts it.
[0006] The present invention specifically adopts the following technical solution:
[0007] A multi-channel signal acquisition system based on adaptive channel switching comprises a multiplexer, a microcontroller, a power supply, and a host computer. The system connection is as follows: the input ports of the multiplexer are connected to each sampled signal, and the common output port is connected to the microcontroller's AD analog input I / O port. The microcontroller's address control I / O port is connected to the multiplexer's address lines, and its enable control I / O port is connected to the multiplexer's enable pin. The microcontroller's serial port is connected to the host computer. The power supply provides power to the multiplexer and the microcontroller. The hardware connection is as follows: the microcontroller's GPIO controls the multiplexer's address lines and enable pin. The multiplexer's n input channels are connected to n signals, and the output is connected to the microcontroller's ADC input pin.
[0008] A multi-channel signal acquisition method using the adaptive channel switching-based multi-channel signal acquisition system of the present invention includes the following steps:
[0009] Step S1: Initialize the microcontroller system and set the initial switching wait time T. w , the rate of change threshold ε, and the smoothing coefficient α.
[0010] Step S2: Enable any internal grounding channel and briefly ground the common terminal of the multiplexer to release residual charge and resolve channel crosstalk.
[0011] Step S3: The microcontroller selects multiplexer channel n, changes the address lines, and switches to the target channel.
[0012] Step S4: Waiting time T w Then, start sampling N times consecutively, and record the number of samples V. i (i=1,2,…N).
[0013] Step S5: Calculate the maximum rate of change of the signal using the following formula:
[0014]
[0015] If ΔV is less than or equal to the threshold ε, the signal is considered stable. The settling time T is then changed. a :
[0016]
[0017] Among them, T s For one ADC clock cycle, m is the number of cycles. Then, update the predicted latency for that channel. :
[0018]
[0019] Predict the waiting time for the channel sampled last time. Then, use the average of N samples as the result of this sampling.
[0020] If ΔV is greater than ε, the signal is considered unstable, and the prediction wait time for the current channel is increased.
[0021]
[0022] Where β is a coefficient greater than 1. Maximum not exceeding T max ;
[0023] Use the last sampled value as the result of this sampling.
[0024] Step S6: Return to step 2 and begin sampling for the next channel.
[0025] The beneficial effects of this invention compared to the prior art are:
[0026] This invention utilizes a multiplexer in conjunction with a microcontroller for multi-channel signal acquisition. By adaptively adjusting the waiting time after each channel switch in the multiplexer, it ensures signal stability after channel switching, improving sampling accuracy, while simultaneously reducing waiting time and increasing sampling efficiency. Furthermore, before switching sampling channels, residual charge is released by briefly grounding the common terminal, reducing channel crosstalk. Testing shows that this invention achieves a signal sampling accuracy of 98% and improves sampling efficiency by 34%. Attached Figure Description
[0027] Figure 1 This is a schematic diagram of the multi-channel signal acquisition system based on adaptive channel switching according to the present invention. In the figure: 1-multiplexer, 2-microcontroller, 3-power supply, 4-host computer.
[0028] Figure 2 This is a flowchart of a multi-channel signal acquisition method based on adaptive channel switching. Detailed Implementation
[0029] To facilitate understanding of the technical content of this invention by those skilled in the art, the following description, in conjunction with specific embodiments and accompanying drawings, further illustrates the content of this invention.
[0030] Example 1
[0031] like Figure 1 As shown, the multi-channel signal acquisition system based on adaptive channel switching consists of a multiplexer, a microcontroller, a power supply, and a host computer.
[0032] The microcontroller's GPIO controls the address lines and enable pins of the multiplexer. The multiplexer's n input channels are connected to n analog signals, and its common output is connected to the microcontroller's ADC analog input pin. The microcontroller controls the multiplexer's enable and channel switching, samples the signals, and packages the sampled data for transmission to the host computer. The power supply module provides 3.3V DC power to the microcontroller and multiplexer.
[0033] Example 2
[0034] The multi-channel signal acquisition method based on adaptive channel switching has the following specific steps:
[0035] Step S1: Microcontroller system initialization, including initial variable assignment, system clock configuration, address line port configuration, interrupt configuration, etc., followed by enabling the multiplexer. Set the initial switching wait time T. w The ADC clock cycles are 10, the rate of change threshold ε is the voltage value corresponding to 2 LSBs of the ADC, the smoothing coefficient α is set to 0.7, and the maximum latency T is... maxThe maximum time required for the multiplexer to stabilize is 1 for the ADC clock cycle number m.
[0036] Step S2: Briefly ground the common terminal of the multiplexer to release residual charge and resolve channel crosstalk.
[0037] Step S3: The microcontroller selects multiplexer channel n and changes the address lines of the multiplexer to switch it to the target channel.
[0038] Step S4: Waiting time T w Then, three consecutive samples were taken, and the three sample data V were recorded. i (i=1,2,3).
[0039] Step S5: Calculate the maximum rate of change of the signal using the following formula:
[0040]
[0041] If ΔV is less than or equal to the threshold ε, the signal is considered stable. The settling time T is then changed. a :
[0042]
[0043] Among them, T s This is for one ADC clock cycle. Then, the predicted latency for that channel is updated:
[0044]
[0045] This time will be used as the waiting time for the next sample of this channel. The average of the three samples will be used as the result of this sampling.
[0046] If ΔV is greater than ε, the signal is considered unstable, and the prediction wait time for the current channel is increased.
[0047]
[0048] But the predicted waiting time The maximum waiting time T shall not exceed the maximum waiting time. max ;
[0049] Then, the last sampled value is used as the result of this sampling.
[0050] Step S6: Return to step 2 and begin sampling for the next channel.
[0051] This method adaptively adjusts the channel switching waiting time, ensuring that the signal stabilizes after switching, thus guaranteeing the accuracy of sampling, while also reducing the waiting time to a certain extent.
[0052] Tests showed that the signal sampling accuracy using this method reached 98%, and the sampling efficiency was improved by 34%.
Claims
1. A multi-channel signal acquisition system based on adaptive channel switching, characterized in that, The system includes a multiplexer (1), a microcontroller (2), a power supply (3), and a host computer (4). The input ports of the multiplexer (1) are connected to the sampling signals, and the common output port is connected to the AD analog input I / O port of the microcontroller (2). The address control I / O port of the microcontroller (2) is connected to the address lines of the multiplexer (1), and the enable control I / O port is connected to the enable terminal of the multiplexer (1). The serial port of the microcontroller (2) is connected to the host computer (4). The power supply (4) supplies power to the multiplexer (1) and the microcontroller (2). The GPIO of the microcontroller (2) controls the address lines and enable terminal of the multiplexer (1). The n input channels of the multiplexer (1) are connected to n signals, and the output is connected to the ADC input pin of the microcontroller (2). By adaptively adjusting the waiting time of each channel of the multiplexer after switching, the signal is stabilized after channel switching, the sampling accuracy is improved, and the waiting time is reduced to improve sampling efficiency.
2. The system according to claim 1, characterized in that, Before switching sampling channels, residual charge is released by briefly grounding the common terminal to reduce channel crosstalk.
3. The system according to claim 1, characterized in that, Calculate the maximum rate of change of the signal Then, the stability of the signal is determined by ΔV: (a) If ΔV is less than or equal to the threshold ε, the signal is considered stable. In this case, the settling time T is changed. a : ; Update the predicted waiting time for this channel. : ; Use the average of N samples as the result of this sampling; Among them, T w T is the initial handover wait time set. s One ADC clock cycle is represented by m, where m is the number of cycles. N represents the predicted waiting time for the channel sampled last time, where N is a natural number greater than 1. (b) If ΔV is greater than ε, the signal is considered unstable, and the prediction waiting time of the current channel is adjusted. Increase: ; Where β is a coefficient greater than 1. Maximum not exceeding T max ; Use the last sampled value as the result of this sampling; Wherein, the maximum waiting time T max The maximum time required for the multiplexer to stabilize.
4. A multi-channel signal acquisition method utilizing the multi-channel signal acquisition system based on adaptive channel switching as described in claim 1, characterized in that, Includes the following steps: Step S1: Initialize the microcontroller system and set the initial switching wait time T. w The rate of change threshold ε and the smoothing coefficient α; Step S2: The microcontroller selects multiplexer channel n, changes the address lines, and switches to the target channel; Step S3: Waiting time T w Then, start sampling N times consecutively, and record the number of samples V. i where i = 1, 2, ..., N; Step S4: Calculate the maximum rate of change of the signal. Then, the stability of the signal is determined by ΔV: (a) If ΔV is less than or equal to the threshold ε, the signal is considered stable. In this case, the settling time T is changed. a : ; Update the predicted waiting time for this channel. : ; Use the average of N samples as the result of this sampling; Among them, T w T is the initial handover wait time set. s One ADC clock cycle is represented by m, where m is the number of cycles. N represents the predicted waiting time for the channel sampled last time, where N is a natural number greater than 1. (b) If ΔV is greater than ε, the signal is considered unstable, and the prediction waiting time of the current channel is adjusted. Increase: ; Where β is a coefficient greater than 1. Maximum not exceeding T max ; Use the last sampled value as the result of this sampling; Wherein, the maximum waiting time T max The maximum time required for the multiplexer to stabilize; Step S5: Return to step 2 and begin sampling for the next channel.
5. The method according to claim 4, characterized in that, Step 2 also includes: Enable any internal grounding channel to briefly ground the common terminal of the multiplexer to release residual charge and resolve channel crosstalk.
6. The method according to claim 4, characterized in that, In step 1, the initial handover waiting time T is set. w It takes 10 ADC clock cycles.
7. The method according to claim 4, characterized in that, In step 1, the rate of change threshold ε is set to the voltage value corresponding to two LSBs of the ADC.
8. The method according to claim 4, characterized in that, In step 1, the smoothing coefficient α is set to 0.
7.
9. The method according to claim 4, characterized in that, In step 3, N ≥ 3.
10. The method according to claim 4, characterized in that, In step 4, β = 1.2.