A programmable resistance card and a programmable resistance smoothing control method and device thereof

By using a programmable resistor card and its smooth control method, and by optimizing relay state switching using difference masking and greedy algorithms, the problem of resistance fluctuation during the switching process of traditional programmable resistors is solved, achieving smooth resistance transition and high-precision control, thereby improving the reliability and accuracy of the test system.

CN121355045BActive Publication Date: 2026-04-28SHENZHEN INTELLIWORK TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN INTELLIWORK TECH CO LTD
Filing Date
2025-12-16
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Traditional programmable resistors can experience transient maximum open or short circuit states due to asynchronous mechanical actions during resistance value switching, affecting the accuracy and reliability of test data. Furthermore, existing improvement measures struggle to achieve a balance between switching speed, implementation complexity, and cost.

Method used

By employing a programmable resistor card and its smooth control method, a smooth transition of resistance value is achieved through difference mask positioning, greedy algorithm decision-making, and single-step optimal switching control technology. The XOR algorithm is used to compare the weights of the relay combination and adjust the relay state one by one to achieve the target resistance value.

Benefits of technology

It achieves a smooth transition in the resistance value switching process in high-precision and high-reliability resistor programming control, avoiding current or voltage surges and improving test safety and measurement accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121355045B_ABST
    Figure CN121355045B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of program-controlled resistance card and its program-controlled resistor smooth control method, device, wherein the method includes obtaining the resistance card coding combination corresponding to current resistance value and target resistance value;Difference mask is calculated by exclusive or operation, and the relay set to be changed is identified;Based on the strategy of greedy algorithm, in the form of successive single-step switching, the relay that makes instantaneous resistance value closest to target value is selected from the set identified by difference mask and is operated;Switching and state updating are iteratively executed until difference mask is zero;Finally, switching completion signal is output.The device includes state acquisition, difference analysis, switching decision and driving execution module, and through the orderly single-step relay switching control, smooth transition in the resistance value change process is realized, the extreme state such as open circuit or short circuit is effectively avoided, the switching precision and system reliability are significantly improved, and it is suitable for precision test measurement and automation control field.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of programmable resistor card control technology, and in particular to a programmable resistor card and its smooth control method and device. Background Technology

[0002] In the fields of electronic test and measurement, instrumentation, and automation control, programmable resistors are a fundamental and critical device, widely used in simulating loads, calibrating instruments, and testing systems. Traditional programmable resistors typically use relay arrays to switch between precision resistors of different resistance values ​​to generate a target resistance value. However, during the switching process, the mechanical actions of multiple relays are difficult to synchronize completely, leading to transient open-circuit states with extremely high resistance or extremely low resistance short-circuit states at the moment of transition. This drastic resistance fluctuation can cause current or voltage surges to the connected device under test, affecting not only the accuracy and reliability of test data but also potentially damaging precision components. While existing technologies attempt to improve this by using synchronized control signals or adding buffer circuits, they often struggle to achieve a good balance between switching speed, implementation complexity, and cost, resulting in limited effectiveness and failing to fundamentally solve the problem of transient extreme states. Therefore, there is an urgent need for an intelligent control scheme that can achieve smooth, shock-free resistance transitions while ensuring switching speed. Summary of the Invention

[0003] The main objective of this invention is to provide a smooth control method and device for programmable resistor cards. By using difference mask positioning, greedy algorithm decision-making, and single-step optimal switching control technology, the invention aims to achieve a smooth transition of programmable resistors during resistance value switching, thereby constructing a high-precision and high-reliability resistor programming control system.

[0004] To achieve the above objectives, the present invention provides a programmable resistor card smooth control method and device, wherein the programmable resistor card is connected by a resistor control circuit, wherein the programmable resistor card is composed of a resistor card code combination, wherein the value range of n is a positive integer in the range of [1-6], and the resistor card code combination includes a first relay combination to a sixth relay combination;

[0005] Each relay assembly consists of four resistors connected in parallel, and four switches connected in series with each resistor.

[0006] The last resistor of each relay combination is connected in series with the first resistor of the next relay combination.

[0007] The switch is turned on and off by the resistor control circuit.

[0008] Furthermore, the programmable resistor card includes:

[0009] The four resistors in the first relay assembly have resistance values ​​of 10Ω, 10Ω, 20Ω, and 50Ω;

[0010] The four resistors in the second relay assembly have resistance values ​​of 100Ω, 100Ω, 200Ω, and 500Ω;

[0011] The four resistors in the third relay assembly have resistance values ​​of 1KΩ, 1KΩ, 2KΩ, and 5KΩ;

[0012] The four resistors in the fourth relay assembly have resistance values ​​of 10KΩ, 10KΩ, 20KΩ, and 50KΩ;

[0013] The four resistors in the fifth relay assembly have resistance values ​​of 100KΩ, 100KΩ, 200KΩ, and 500KΩ;

[0014] The four resistors in the sixth relay assembly have resistance values ​​of 1MΩ, 1MΩ, 2MΩ, and 5MΩ.

[0015] Furthermore, a smooth control method for a programmable resistor, wherein the smooth control method for the programmable resistor is executed through the aforementioned programmable resistor card, the method comprising:

[0016] Obtain the current resistance value and the first resistance card code combination under the current resistance value, and at the same time obtain the target resistance value and calculate the second resistance card code combination under the target resistance value;

[0017] The first resistor card code combination and the second resistor card code combination are compared using an XOR algorithm to generate the weights of each relay combination;

[0018] The first resistor card code combination is smoothly adjusted to the second resistor card code combination based on the weight using a greedy strategy.

[0019] Furthermore, the smooth control method for the programmable resistor, which uses an XOR algorithm to compare the first resistor card code combination with the second resistor card code combination to generate the weights of each relay combination, includes the following steps:

[0020] Based on the on / off state of the switch in the first resistor card coding combination, six sets of first binary data from the first relay combination to the sixth relay combination are obtained, and each set of binary data contains four bits of binary code.

[0021] The on / off information of the second resistor card code combination for calculating the target resistance value is used to obtain six sets of second binary data corresponding to the first to sixth relay combinations;

[0022] The XOR algorithm compares the binary codes in the first binary data and the second binary data one by one to obtain six sets of difference bit data;

[0023] The weights of the difference bit data are generated one by one, resulting in six sets of weight information.

[0024] Furthermore, in the process of generating weights for the differential bit data in the programmable resistor smoothing control method, the weights for each group of binary data include:

[0025] The weights of the four-bit binary codes are 1, 1, 2, and 5.

[0026] Furthermore, the programmable resistor smoothing control method, in the step of smoothly adjusting the first resistor card code combination to the second resistor card code combination based on the weight using a greedy strategy, includes:

[0027] Based on the six weight information, the relay state in the first resistor card coding combination is iteratively adjusted in a successive single-step switching manner;

[0028] In each iteration, based on the current six sets of difference bit data, the relay to be operated is determined from all relays whose state needs to be changed;

[0029] Perform a state switch on the relay currently to be operated, and update the current resistor card encoding combination and the corresponding six sets of difference bit data;

[0030] Repeat the iterative adjustment steps until all difference bits are zero, completing the smooth adjustment to the second resistor card encoding combination.

[0031] Furthermore, in the aforementioned programmable resistor smoothing control method, the step of determining the relay to be operated from all relays requiring state changes based on the current six sets of difference bit data in each iteration includes:

[0032] Identify all bits with a value of 1 in the current group of difference bit data, where each bit corresponds to a relay whose on / off state needs to be changed, forming the current candidate set;

[0033] For each relay in the current candidate set, after simulating its state switching, the corresponding simulated resistance value is calculated according to the rule of binary encoding weights of 1, 1, 2, 5 and the resistance base of each relay combination.

[0034] Calculate the absolute difference between each of the simulated resistance values ​​and the target resistance value;

[0035] The relay that minimizes the absolute difference is selected from the current candidate set and is chosen as the relay to be operated.

[0036] Furthermore, in the aforementioned programmable resistor smoothing control method, the step of selecting the relay that minimizes the absolute difference from the current candidate set as the relay to be operated further includes:

[0037] If multiple relays exist that make the absolute difference the same and all of them the minimum, the selection priority is determined according to the relationship between the resistance value before switching and the target resistance value.

[0038] If the resistance value before switching is less than the target resistance value, then the relay with the smaller weight value in the rule of weights 1, 1, 2, 5 is selected first.

[0039] If the resistance value before switching is greater than the target resistance value, then the relay with the larger weight value in the rule of weights 1, 1, 2, 5 is selected first.

[0040] Furthermore, in the aforementioned programmable resistor smoothing control method, the step of calculating the second resistor card code combination under the target resistance value includes:

[0041] The target resistance value is decomposed according to the resistance base of the six relay combinations to obtain the resistance components corresponding to each relay combination.

[0042] For each resistance component, the resistor branch that needs to be turned on to achieve that component is determined according to the resistance ratio of the relay combination in which it belongs.

[0043] Based on the required conducting resistor branch, a four-bit binary code is generated for the corresponding relay combination to characterize the on / off state of each switch in the combination.

[0044] The six groups of four-bit binary codes generated by the first to the sixth relay combinations are combined to form the complete second resistor card code combination.

[0045] Furthermore, a programmable resistor smoothing control device includes:

[0046] The aforementioned programmable resistor card;

[0047] A control unit, which is electrically connected to the programmable resistor card;

[0048] The control unit is configured to execute the above-described programmable resistor smooth control method to drive the relay in the programmable resistor card, thereby achieving a smooth switch from the current resistance value to the target resistance value, including:

[0049] The status acquisition module is used to collect the on / off status of all relays in the programmable resistor card in real time and form the first resistor card code combination corresponding to the current resistance value.

[0050] The target parsing module is used to receive the target resistance value and parse out the corresponding second resistance card code combination;

[0051] The difference analysis module is used to calculate the difference mask between the first and second resistor card code combinations to accurately identify the relays whose states need to be changed.

[0052] The switching decision module is used to perform iterative switching decisions based on a greedy strategy using a difference mask;

[0053] The drive execution module is used to perform the state switching operation of the selected relay and update the system state. Attached Figure Description

[0054] Figure 1 This is a resistor network structure diagram of a programmable resistor card smooth control method in one embodiment of the present invention;

[0055] Figure 2 This is a comparison diagram of switching fluctuations in a programmable resistor card smoothing control method according to an embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram illustrating the execution principle of a programmable resistor card smooth control method in one embodiment of the present invention.

[0057] Figure 4 This is a flowchart illustrating a smooth control method for a programmable resistor card according to an embodiment of the present invention.

[0058] Figure 5 This is a state encoding table diagram of a programmable resistor card smooth control method in one embodiment of the present invention;

[0059] Figure 6 This is a structural block diagram of a programmable resistor card smoothing control device according to an embodiment of the present invention. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0061] Reference Figure 4 This is a flowchart illustrating a smooth control method for a programmable resistor card proposed in this invention, comprising the following steps:

[0062] S100, receives the target resistance value and parses the second resistance card code combination:

[0063] The target resistance value is received through the control interface, and the target resistance value is parsed into the corresponding second resistance card code combination according to the pre-stored resistance value-status code table.

[0064] S200, Obtain the first resistor card code combination corresponding to the current resistor value:

[0065] The first resistance card code combination corresponding to the current resistance value is obtained through the state detection circuit, including reading the current contact state of all relays to form a complete state vector.

[0066] S300, calculate the difference mask between the first and second resistor card code combinations:

[0067] Perform a bitwise XOR operation on the first resistor card code combination and the second resistor card code combination to generate a difference mask. The bits that are 1 in the difference mask identify the relays that need to be flipped from the current state to the target state.

[0068] S400, based on the difference mask, employs a greedy strategy to perform the iterative switching process:

[0069] Based on the difference mask, an iterative switching process is performed by switching only one relay at a time. This process employs a greedy strategy: in each iteration, the relay whose state needs to be changed is selected to minimize the absolute difference between the instantaneous resistance value after the switch and the target resistance value. When multiple relays produce the same absolute difference, the weight priority is determined based on the relationship between the current resistance value and the target resistance value.

[0070] S500 completes the switching and outputs a status signal:

[0071] When the difference mask is zero, the handover is confirmed to be complete, a handover completion status signal is generated, and the system status register is updated.

[0072] As described in step S100 above, the system receives the target resistance value and parses the second resistance card code combination. After receiving the target resistance value, the system queries the pre-stored code table ( Figure 5 This directly maps it to a unique and definite second resistor card code combination, providing a clear target endpoint for the entire switching process. The code table is based on a resistor network structure ( Figure 1 The establishment of this system ensures the accuracy and efficiency of target state analysis.

[0073] As described in step S200 above, refer to Figure 3 In the initialization phase, the system determines the starting point of the switching path. A high-precision ADC is used to acquire the current resistance value, which, combined with the relay status monitoring circuit, forms a complete first resistance card encoding combination. The status monitoring circuit employs an optocoupler-isolated digital input module to collect the contact status of all relays in real time, ensuring the accuracy of the current status data.

[0074] As described in step S300 above, calculate the difference mask between the first and second resistor card code combinations. (Refer to...) Figure 3 In the initial value and target value difference calculation step, the system uses an XOR operation to precisely locate all relays that need to be changed, based on the determined target state and the collected current state. The efficiency of the XOR operation combined with the precision of bit operations ensures the completeness and accuracy of difference identification, and the generated difference mask provides a clear set of operations to be performed in subsequent greedy path planning.

[0075] As described in step S400 above, an iterative switching process is performed using a greedy strategy based on the difference mask. (See reference...) Figure 3 The system calculates the next flip bit and subsequent loop steps based on the target value that is closest after the flip. Dynamic path planning is performed using a greedy algorithm: in each iteration, each candidate relay is simulated for switching, and the instantaneous resistance value after the switch is calculated. The relay whose instantaneous resistance value is closest to the final target value is selected for the next operation. This greedy strategy ensures minimal overall fluctuation in the switching path. When multiple candidate relays produce the same minimum absolute difference, a weighted priority rule is applied based on the relationship between the current resistance value and the target resistance value. If the current value is less than the target value, the relay with the smaller weight is selected first; otherwise, the relay with the larger weight is selected first. This further optimizes the selection, making the resistance value change more stable.

[0076] As described in step S500 above, the switching is completed and a status signal is output. (See reference...) Figure 3 The end judgment step in the process – whether it is the last one – is that when the iterative switching process based on the greedy strategy is completed and the difference mask is zero, the system confirms that the entire smooth switching path has been completed, and then generates a switching completion status signal and updates the system status register, providing a clear operation completion indication to the upper-level system.

[0077] In one embodiment, step S100 of receiving the target resistance value and parsing the second resistance card code combination includes:

[0078] Receive the target resistance value through the communication interface;

[0079] Based on the pre-stored resistance value-status code table, query and parse the corresponding second resistance card code combination;

[0080] The parsed target state is validated and cached.

[0081] In practical implementation, the hardware core of the programmable resistor card upon which this invention is based is a multi-level decimal resistor network, the specific structure of which is as follows: Figure 1As shown. The resistor network consists of six series-connected decimal resistor network units. Each unit comprises four parallel precision resistor branches controlled by relays, with the resistance values ​​of each branch strictly adhering to a weighting ratio of 1:1:2:5. The six basic resistance levels are 10 ohms, 100 ohms, 1 kiloohms, 10 kiloohms, 100 kiloohms, and 1 megaohm. By summing the resistance values ​​of each unit in series, a full range from 10Ω to 9.999999MΩ is achieved. In a precision instrument testing scenario, the system receives the target resistance value of 456kΩ via the SPI interface, and the status parsing module then queries the pre-stored 1-1-2-5 encoding table (see reference). Figure 5 The target resistance value is directly mapped to the corresponding second resistance card code combination. The binary codes stored in the encoding table follow the same mapping rule as the acquisition time: 1 for relay on and 0 for relay off. The encoding table is a unique mapping relationship from resistance value to 24-bit relay state vector, pre-calculated and stored based on the physical structure of the series-parallel resistance network. For example, querying... Figure 5 It can be seen that the state combinations corresponding to 456kΩ are: K44=1 (making the 100kΩ unit exhibit a 400kΩ resistance), K33=1 (making the 10kΩ unit exhibit a 50kΩ resistance), K22=1 and K23=1 (making the 1kΩ unit exhibit a 6kΩ resistance), and the states of other units not involved in the series are 0. The total resistance of these units connected in series is 400kΩ + 50kΩ + 6kΩ = 456kΩ. The generated state data is encapsulated into a 32-bit data frame, cached after verification, and based on the deterministic lookup table parsing mechanism, a unique, accurate, and fixed target endpoint is provided for the subsequent greedy algorithm.

[0082] In one embodiment, step S200 of obtaining the first resistance card code combination corresponding to the current resistance value includes:

[0083] The on / off status of all relays is collected through a status monitoring circuit;

[0084] The collected status information is combined to form the first resistor card code combination;

[0085] The state vector of the first relay is verified and stored.

[0086] In practical implementation, to establish a clear digital mapping relationship, the on state of a relay is represented by a binary digit "1", and the off state of a switch is represented by a binary digit "0". Each bit of this four-bit binary code corresponds in a preset order to the switching state of a specific resistor branch within a relay combination. After the target state is generated, the system initiates the current state acquisition process. The state monitoring circuit uses an optocoupler-isolated digital input module to scan in real time at a sampling frequency of 1MHz. Figure 1The contact states of all 24 relays (K11-K64) in the resistor network shown are monitored by eliminating contact bounce through the hysteresis characteristic of Schmitt triggers, generating stable digital status signals. For example, when the system is currently in a 123kΩ state, this resistance value is obtained by adding the contributions of units of different magnitudes in series. The accurate acquisition of the resistor card code combination by the monitoring circuit needs to be based on... Figure 1 Interpreting the 1:1:2:5 structure shown: In the 100kΩ range (assuming control by relays K41-K44), the decoded state combinations indicate that the resistance contributed by this unit is equivalent to 1×100kΩ (i.e., coefficient 1, corresponding to 100kΩ). In the 10kΩ range (assuming control by relays K31-K34), the state combinations indicate that the resistance contributed by this unit is equivalent to 2×10kΩ (i.e., coefficient 2, corresponding to 20kΩ). In the 1kΩ range (assuming control by relays K21-K24), the state combinations indicate that the resistance contributed by this unit is equivalent to 3×1kΩ (i.e., coefficient 3, corresponding to 3kΩ). After data processing, the collected state information is combined according to a predetermined order (e.g., from the lowest to the highest level) to form a 24-bit first relay state vector. This vector fully represents the current on / off state of all six levels of resistor network units. The state vector is then encapsulated into a 32-bit data frame for subsequent processing.

[0087] In one embodiment, step S300 of calculating the difference mask of the first and second resistor card code combinations includes:

[0088] Perform a bitwise XOR operation on the first resistor card code combination and the second resistor card code combination;

[0089] Parse the XOR operation result and generate a difference mask;

[0090] Verify the validity of the difference mask.

[0091] In practical implementation, after obtaining the complete first relay state vector A and second relay state vector B, the system initiates the difference mask calculation process. The difference analysis module loads these two 24-bit vectors into a parallel XOR operation unit implemented by a hardware description language. This unit synchronously processes the corresponding bits of the two vectors on each rising edge of the clock, completes the full-word XOR operation within one clock cycle, and outputs the difference mask vector C. The '1' bits in C precisely identify the corresponding relay that needs to change state. For example, switching from 10Ω to 20Ω, according to the pre-stored 1-1-2-5 encoding table (… Figure 5 The second relay state vector corresponding to 10Ω (here, it is taken as the first state vector A) is assumed to be 0000-0000-0000-0000-0000-1001, with only the lowest 4 bits (1001) being valid, representing the state of the 10Ω level unit. The specific encoded values ​​are... Figure 5Consistent; the second relay state vector (B) corresponding to 20Ω is assumed to be 0000-0000-0000-0000-0000-1010. The XOR operation module performs a bitwise XOR operation on A and B to obtain the difference mask C: 0000-0000-0000-0000-0000-0011. Among them, the two '1's in the lowest 4 bits 0011 are based on... Figure 1 The relay number and bit sequence mapping shown precisely correspond to the relays whose states need to be changed. If the least significant bit corresponds to K11 and the next least significant bit corresponds to K12, it indicates that relays K11 and K12 need to be activated. The system can further perform a validity check on the difference mask C: for example, confirming that it is not all zeros and that the number of '1's does not exceed a certain threshold, thereby providing a clear and reliable set of relays to be operated for subsequent iterative path planning based on a greedy strategy.

[0092] In one embodiment, step S400 of performing the iterative switching process based on the difference mask includes:

[0093] A candidate relay set is selected based on the difference mask;

[0094] For each relay in the candidate set, simulate the resistance change after its state switching;

[0095] Calculate the absolute difference between the instantaneous resistance value and the target resistance value after each candidate relay switches;

[0096] Select the relay that minimizes the absolute difference as the optimal switching target;

[0097] Perform the state switching operation on the selected relay.

[0098] In specific implementation, refer to Figure 2 In traditional non-smooth switching processes, the resistance jumps directly from 7 units to 15 units, resulting in an 8-unit instantaneous overshoot. This abrupt change can cause instantaneous surge currents in the test circuit, severely impacting the testing safety and measurement accuracy of precision components. In contrast, the smooth switching process of this invention demonstrates a switching path of 7→6→4→12→8. Through a single-step optimal selection strategy, it ensures that the deviation between each intermediate state and the target value is minimized (the maximum deviation is 4 units, occurring in state 12), avoiding dangerous states such as open circuits or short circuits, and achieving a truly smooth transition. The switching decision module first parses all relays that need to change their state from the difference mask, forming a candidate relay set. The core of the greedy strategy is that each iteration simulates switching one candidate relay, and based on the 1-1-2-5 encoding rule, recalculates the contribution coefficient of each unit and the total resistance, selecting the operation that makes the instantaneous total resistance closest to the target resistance value. If the programmable resistor card needs to switch from the current resistance value of 30Ω to the target resistance value of 90Ω, according to the pre-stored 1-1-2-5 encoding table (… Figure 5 Both 30Ω and 90Ω are standard coding values ​​for a 10Ω-level unit. A 10Ω-level unit contains four relays, controlling branches with resistance values ​​of 10Ω (K11), 10Ω (K12), 20Ω (K13), and 50Ω (K14), respectively. The coding rule is that the unit's contribution value = 10Ω. The coefficients are determined by the on / off states of the four relays using a weighted encoding of 1-1-2-5. For example, state [K14=0, K13=1, K12=1, K11=0] indicates that the 20Ω and 10Ω branches are conducting, corresponding to coefficient 2+1=3, with a contribution value of 30Ω. State [K14=1, K13=1, K12=1, K11=1] indicates that all branches are conducting, corresponding to coefficient 5+2+1+1=9, with a contribution value of 90Ω. Assuming that other units of different magnitudes (100Ω, 1kΩ, 10kΩ, 100kΩ, 1MΩ) currently have no contribution, i.e., their contribution coefficient is 0, the total resistance is the contribution value of the 10Ω unit. The initial state (30Ω) corresponds to the relay state [0,1,1,0], and the target state (90Ω) corresponds to the state [1,1,1,1]. The difference mask is obtained by XOR operation as [1,0,0,1]. The relays that need to be changed are identified as K14 and K11, and the candidate relay set is {K14,K11}. In the first iteration of the greedy decision, the system performs simulated switching and computational evaluation for each relay in the candidate set: simulated switching of K11, K11 changes from open (0) to closed (1), and the new state is [0,1,1,1]. According to the encoding rules, the coefficient corresponding to this state is (0,1,1,1). 5+1 2+1 1+1 1) = 4, new contribution value = 10Ω × 4 = 40Ω, total resistance R_sim_K11 = 40Ω; simulate switching K14, K14 changes from open (0) to closed (1), the new state is [1,1,1,0], the coefficient corresponding to this state is (1 5+1 2+1 1+0 1) = 8, new contribution value = 10Ω × 8 = 80Ω, total resistance R_sim_K14 = 80Ω. Calculation and evaluation: Calculate the absolute difference between the two simulated total resistances and the target resistance (90Ω): Δ_K11 = |40Ω - 90Ω| = 50Ω, Δ_K14 = |80Ω - 90Ω| = 10Ω. Comparing Δ_K11 and Δ_K14, Δ_K14 is smaller (10Ω < 50Ω). Therefore, the greedy strategy chooses to switch K14, because this operation makes the instantaneous total resistance (80Ω) closest to the target resistance (90Ω). The drive execution module controls the relay K14 to reliably close, the system updates the current state to [1,1,1,0], corresponding to a total resistance of 80Ω, and then updates the difference mask (at this time only K11 needs to be changed). In the second iteration, the candidate set becomes {K11}. A simulated switch to K11 is performed, resulting in the state [1,1,1,1], corresponding to a coefficient of 9 and a total resistance of 90Ω. Since there is only one candidate, the system selects to switch to K11. The drive execution module controls the relay K11 to close, and the system updates the current state to [1,1,1,1], with a total resistance of 90Ω. The difference mask is then cleared. After two single-step switches from 30Ω to 80Ω to 90Ω, the system smoothly transitions to the target resistance value. During the entire process, the first switch introduces a 10Ω deviation, and the second switch introduces a 0Ω deviation. Each switch utilizes a greedy decision-making process to ensure minimal instantaneous resistance fluctuations, avoiding extreme states such as open circuits or short circuits. Based on the 1-1-2-5 coding rule and the series network model, the greedy decision-making and execution process ensures that the system's instantaneous total resistance changes in the direction of the most stable target value during each relay switching action, thus achieving a smooth transition in resistance value switching and effectively improving the system's test safety and reliability.

[0099] In one embodiment, step S500, which involves completing the switching and outputting a status signal, includes:

[0100] Detect the zero-value state of the difference mask;

[0101] Verify the consistency between the current relay state and the target state;

[0102] Generate a switchover completion status signal;

[0103] Update the system status register.

[0104] In practical implementation, after the iterative switching process is completed, the system enters the final state confirmation stage. The state verification module first checks whether the difference mask has been restored to a zero state; when all difference bits are zero, a mask zero-value confirmation signal is generated, indicating that all relays that need to be changed have been operated. Subsequently, the system initiates full-state comparison verification: the current 24-bit relay state vector and the target state vector are input into a parallel comparator array for bit-by-bit comparison; only when all bits are completely consistent is a final valid matching signal generated. To ensure that the relay mechanical action is in place, the system waits for a preset stabilization delay (usually 10-15ms) after the last switching command is issued, and simultaneously monitors the drive feedback signal to confirm that each relay has reliably operated. After all verification conditions are met, the state signal generation module generates a switching completion signal; this signal is output in an optocoupler-isolated manner, using a pulse-then-hold waveform design to ensure reliable identification by the external system. Finally, the system updates the internal register group in an atomic manner: records the current relay state vector, sets the "switching complete" flag and clears the "switching in progress" flag, writes the completion timestamp, and stores the key process data of this switching into non-volatile memory, completing the closed-loop recording and state synchronization of the entire switching process.

[0105] In one embodiment, refer to Figure 6 Here is a structural block diagram of a programmable resistor smoothing control device according to an embodiment of the present invention, comprising:

[0106] The status acquisition module is used to collect the on / off status of all relays in the programmable resistor card in real time and form the first resistor card code combination corresponding to the current resistance value. The status acquisition module includes a signal acquisition unit and a status conversion unit. The signal acquisition unit reads the status of each relay contact through an optocoupler isolation circuit. The status conversion unit converts the physical status into digital signals and combines them according to a preset bit order to form a status vector.

[0107] The target parsing module is used to receive the target resistance value and parse out the corresponding second resistance card code combination. The target parsing module includes a communication interface unit, a table lookup parsing unit, and a verification cache unit, which respectively correspond to the functions of receiving the target value, querying the pre-stored code table for parsing, and verifying and storing the parsing results.

[0108] The difference analysis module is used to calculate the difference mask between the first and second resistor card code combinations to accurately identify the relays whose states need to be changed. The difference analysis module includes an XOR operation unit and a mask verification unit, which respectively implement the functions of generating difference masks by bitwise XOR operation and verifying the validity of the mask.

[0109] The switching decision module is used to perform iterative switching decisions based on a greedy strategy using a difference mask. The switching decision module includes a candidate set generation unit, a simulation calculation unit, a difference comparison unit, and a priority adjudication unit, which respectively realize the functions of generating a candidate relay set from the difference mask, calculating the instantaneous resistance value after simulating the switching, calculating the absolute difference with the target value, and adjudicating based on weight priority rules in the case of a tie.

[0110] The drive execution module is used to perform the state switching operation of the selected relay and update the system state. The drive execution module includes a drive signal generation unit, a state monitoring unit, and an update feedback unit, which respectively realize the functions of generating accurate relay drive signals, monitoring relay action feedback in real time, and updating the current state vector and difference mask.

[0111] In summary, this invention provides a programmable resistor card and its smooth control method. The aim is to resolve the target resistance value into a unique second resistor card code combination by querying a pre-stored deterministic encoding table, establishing a fixed endpoint, and collecting the current relay status in real time as the path starting point. A difference mask is generated through XOR operation to accurately locate all relays that need to be changed, forming a task list. Based on the difference mask, the system executes an iterative process by switching only one relay at a time, employing a greedy strategy in each iteration: simulating the switching of each candidate relay and selecting the relay whose instantaneous resistance value after switching is closest to the target value. When multiple equally optimal candidates appear, a weighted priority rule is activated based on the relationship between the current value and the target value to further optimize transient changes. This path planning strategy ensures that the fluctuation of the overall switching path is minimized. Figure 2 (As shown in the comparison). Finally, after the difference mask is zeroed and the state verification is consistent, the switchover is confirmed to be complete. This method achieves end-to-end optimization from macro-path planning to micro-operation selection, effectively eliminating resistance surges, significantly improving test accuracy and system reliability, and providing an ideal solution for high-precision measurement and automation control.

[0112] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0113] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for smooth control of a programmable resistor, characterized in that, The method is executed by a programmable resistor card, and the method includes: Obtain the current resistance value and the first resistance card code combination under the current resistance value, and at the same time obtain the target resistance value and calculate the second resistance card code combination under the target resistance value; The first resistor card code combination and the second resistor card code combination are compared using an XOR algorithm to generate the weights of each relay combination; The first resistor card code combination is smoothly adjusted to the second resistor card code combination based on the weight using a greedy strategy. The step of smoothing adjustment using a greedy strategy further includes: Based on the weights, the relay states in the first resistor card coding combination are iteratively adjusted in a successive single-step switching manner; In each iteration, based on the current difference bit data, determine the relay to be operated from all relays whose state needs to be changed; Perform a state switch on the relay currently to be operated, and update the current resistor card encoding combination and the corresponding difference bit data; Repeat the iterative adjustment steps until all difference bits are zero, completing the smooth adjustment to the second resistor card encoding combination; The step of determining the relay to be operated includes: Identify all bits with a value of 1 in the current group of difference bit data, where each bit corresponds to a relay whose on / off state needs to be changed, forming the current candidate set; For each relay in the current candidate set, after simulating its state switching, the corresponding simulated resistance value is calculated according to the binary encoding weighting rules and the resistance base of each relay combination. Calculate the absolute difference between each of the simulated resistance values ​​and the target resistance value; The relay that minimizes the absolute difference is selected from the current candidate set and is chosen as the relay to be operated.

2. The smooth control method for a programmable resistor according to claim 1, characterized in that, The programmable resistor card is connected to a resistor control circuit, wherein the programmable resistor card is... The resistor card encoding combination is composed of a series of resistor card codes, where the value of n is a positive integer in the range of [1-6], and the resistor card encoding combination includes the first relay combination to the sixth relay combination. Each relay assembly consists of four resistors connected in parallel, and four switches connected in series with each resistor. The last resistor of each relay combination is connected in series with the first resistor of the next relay combination.

3. The smooth control method for a programmable resistor according to claim 2, characterized in that, include: The four resistors in the first relay assembly have resistance values ​​of 10Ω, 10Ω, 20Ω, and 50Ω; The resistance values ​​of the four resistors in the second relay assembly are 100Ω, 100Ω, 200Ω, and 500Ω; The resistance values ​​of the four resistors in the third relay assembly are 1KΩ, 1KΩ, 2KΩ, and 5KΩ; The resistance values ​​of the four resistors in the fourth relay assembly are 10KΩ, 10KΩ, 20KΩ, and 50KΩ; The four resistors in the fifth relay assembly have resistance values ​​of 100KΩ, 100KΩ, 200KΩ, and 500KΩ; The four resistors in the sixth relay assembly have resistance values ​​of 1MΩ, 1MΩ, 2MΩ, and 5MΩ.

4. The smooth control method for a programmable resistor according to claim 3, characterized in that, The step of comparing the first resistor card code combination with the second resistor card code combination using an XOR algorithm to generate the weights of each relay combination includes: Based on the on / off state of the switch in the first resistor card coding combination, six sets of first binary data from the first relay combination to the sixth relay combination are obtained, and each set of binary data contains four bits of binary code. The on / off information of the second resistor card code combination for calculating the target resistance value is used to obtain six sets of second binary data corresponding to the first to sixth relay combinations; The XOR algorithm compares the binary codes in the first binary data and the second binary data one by one to obtain six sets of difference bit data; The weights of the difference bit data are generated one by one, resulting in six sets of weight information.

5. The smooth control method for a programmable resistor according to claim 4, characterized in that, In the step of generating the weights of the difference bit data one by one, the weights of each group of binary data include: The weights of the four-bit binary codes are 1, 1, 2, and 5.

6. The smooth control method for a programmable resistor according to claim 1, characterized in that, The step of selecting the relay that minimizes the absolute difference from the current candidate set as the relay to be operated further includes: If multiple relays exist that make the absolute difference the same and all of them the minimum, the selection priority is determined according to the relationship between the resistance value before switching and the target resistance value. If the resistance value before switching is less than the target resistance value, then the relay with the smaller weight value in the rule of weights 1, 1, 2, 5 is selected first. If the resistance value before switching is greater than the target resistance value, then the relay with the larger weight value in the rule of weights 1, 1, 2, 5 is selected first.

7. The smooth control method for a programmable resistor according to claim 1, characterized in that, The step of calculating the second resistance card code combination under the target resistance value includes: The target resistance value is decomposed according to the resistance base of the six relay combinations to obtain the resistance components corresponding to each relay combination. For each resistance component, the resistor branch that needs to be turned on to achieve that component is determined according to the resistance ratio of the relay combination in which it belongs. Based on the required conducting resistor branch, a four-bit binary code is generated for the corresponding relay combination to characterize the on / off state of each switch in the combination. The six groups of four-bit binary codes generated by the first to the sixth relay combinations are combined to form the complete second resistor card code combination.

8. A programmable resistor smoothing control device, characterized in that, The programmable resistor smoothing control method according to any one of claims 1-7, wherein the programmable resistor smoothing control device comprises: Programmable resistor card; A control unit, which is electrically connected to the programmable resistor card; The control unit is configured to execute the programmable resistor smooth control method as described in any one of claims 3 to 7 to drive the relay in the programmable resistor card to achieve a smooth switching from the current resistance value to the target resistance value.

Citation Information

Patent Citations

  • Programmable high-power load card convenient to control

    CN213337759U

  • Programmable high-precision resistance card convenient to control

    CN213602622U

  • KR20240168799A