Underground power supply switching circuit

By monitoring current and voltage values ​​through a processor to control downhole power switching, the power instability problem caused by the LTC4417 chip was solved, realizing the monitoring of power parameters and the stability of downhole power supply, ensuring the normal operation of logging instruments and successful construction.

CN121965951APending Publication Date: 2026-05-01CHINA PETROLEUM & CHEMICAL CORP +3
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA PETROLEUM & CHEMICAL CORP
Filing Date
2024-10-29
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In the existing technology, the LTC4417 chip has unstable factors during downhole power switching, which leads to frequent power switching, affects the power supply stability of logging operations, increases labor and material costs, and prolongs the wellhead occupation period.

Method used

Using a processor as the control core, combined with the LTC4417 chip, the power supply is determined by monitoring current and voltage values, and the switching of the switching branch is controlled to avoid frequent switching caused by relying on voltage values, thereby realizing the monitoring of power parameters and stable power supply.

Benefits of technology

It improves the stability of downhole power supply, avoids frequent power switching, ensures the normal operation of logging instruments, reduces labor and material costs, and increases the success rate of logging operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121965951A_ABST
    Figure CN121965951A_ABST
Patent Text Reader

Abstract

The invention provides an underground power supply switching circuit, which adopts a processor as a main control core and an LTC4417 chip to execute a switching action, and the processor determines the electric quantity of a power supply according to a current value and a voltage value, and controls the on-off of a switch branch according to the electric quantity of the power supply, namely, controls a power supply mode, namely, controls the on-off of the switch branch according to the electric quantity of the power supply. The problems of frequent power supply switching caused by the adoption of a voltage value as a judgment basis, and further unstable underground power supply and incapability of normal work are avoided, monitoring of electric energy parameters is realized, and the underground power supply stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of power supply switching devices, and more specifically, relates to an underground power supply switching circuit. Background Technology

[0002] A mature solution for powering the instrument with a low-voltage DC power supply and switching between multiple power supplies is to use the LTC4417 chip, externally expand several sets of MOSFETs and sampling resistors to form an automatic switching control module for three power supplies.

[0003] Existing technology uses the LTC4417 chip to implement simple logic switching for three power supplies according to the manufacturer's standard solution. The LTC4417 chip's power switching mechanism relies on resistor sampling to compare the values ​​of the three supply voltages. Specifically, for example, channel 1 has higher priority, so its voltage decreases during power supply. When the voltage of the sampled signal is lower than a threshold value, the LTC4417 chip determines that channel 1 does not meet the power supply requirements and switches to channel 2. When the voltage of the sampled signal of channel 2 is lower than the threshold value, the LTC4417 chip determines that channel 2 does not meet the power supply requirements and switches to channel 3. By comparing the voltages of the power supplies through voltage sampling and based on priority, the function of automatically switching one of the three input power supplies to power the load is achieved.

[0004] When the power input from the three power sources is relatively stable, and any one of them suddenly interrupts, the resistor sampling method for control circuitry is simple and effective, allowing for timely adjustment of the power supply channel based on the power supply situation. In well logging applications, the power supply methods for instruments are complex, including cable power, generator power, and battery power. When using special power supply methods such as batteries or generators, the power supply may be insufficient for the instruments requiring power due to the specific application scenario of downhole. This can lead to unstable power supply switching states when using voltage comparison methods. For example, if channel 1 is disconnected and there is no load, the supply voltage of channel 1 may recover to above the limit. Since channel 1 has the highest priority, the LTC4417 chip will consider channel 1 capable of supplying power and will switch back to channel 1. After channel 1 is powered on, the supply voltage may decrease due to load influence, leading to a switch back to channel 2. This cycle repeats, causing the downhole instrument to malfunction.

[0005] In well logging applications, using the LTC4417 independent chip to control power switching presents numerous instabilities. Frequent power switching can lead to unstable power supply during deep formation logging operations, making logging services unavailable. In such cases, the instrument must be pulled back from the well for inspection and maintenance, a process that incurs significant labor and material costs and extends the wellhead occupancy period. Summary of the Invention

[0006] In view of this, the purpose of the present invention is to provide a downhole power switching circuit for monitoring power parameters and improving the stability of downhole power supply.

[0007] This application discloses a downhole power switching circuit, comprising: at least one switching system; the switching system comprising: a processing module and a switching module; the switching module comprising: an LTC4417 chip and three switching branches;

[0008] Each of the three switch branches corresponds one-to-one with one of the three power supplies, and the input terminal of each switch branch is connected to its corresponding power supply; the output terminals of each switch branch are connected, and the connection point serves as the output terminal of the downhole power switching circuit; the three output terminals of the LTC4417 chip correspond one-to-one with the three switch branches; each output terminal of the LTC4417 chip is connected to the control terminal of its corresponding switch branch; the three DC pins of the LTC4417 chip correspond one-to-one with the three power supplies; and each DC pin of the LTC4417 chip is connected to its corresponding power supply.

[0009] The processing module includes: a processor and a voltage and current acquisition module;

[0010] The processor acquires the input voltage of each of the switching branches and the output current of the switching module through the voltage and current acquisition module; the LTC4417 chip is controlled by the processor;

[0011] The processor is used to determine the power level of each power supply based on the input voltage of each switch branch and the output current of the switching module, and to control the on / off state of each switch branch through the LTC4417 chip based on the power level of each power supply.

[0012] Optionally, the processing module further includes: an interlock circuit;

[0013] The interlock circuit is located between the LTC4417 chip and the processor.

[0014] Optionally, the processing module further includes: a storage module;

[0015] The storage module is used to store the processing data of the processor.

[0016] Optionally, the number of switching systems is one or two.

[0017] Optionally, when the number of switching systems is at least two, the processing modules synchronize data through a synchronization interface.

[0018] Optionally, when there are two switching systems, the processor in one switching system is an FPGA; the processor in the other switching system is a microcontroller.

[0019] Optionally, the voltage and current acquisition module includes: a current acquisition module and three voltage acquisition modules;

[0020] The three voltage acquisition modules correspond one-to-one with the three switch branches;

[0021] Each of the voltage acquisition modules is located between its corresponding switch branch and the corresponding power supply;

[0022] The current acquisition module is located between the switching module and the downhole instrument.

[0023] Optionally, the voltage acquisition module includes: a first resistor, a second resistor, a first diode, a first operational amplifier, and a first AD converter;

[0024] One end of the first resistor is connected to the power supply corresponding to the voltage acquisition module;

[0025] The other end of the first resistor is grounded through the second resistor;

[0026] The connection point between the second resistor and the first resistor is connected to the input terminal of the first operational amplifier and the cathode of the diode, respectively.

[0027] The anode of the diode is grounded;

[0028] The output terminal of the first operational amplifier is connected to the input terminal of the first AD converter;

[0029] The output terminal of the first AD converter serves as the output terminal of the voltage acquisition module.

[0030] Optionally, the current acquisition module includes: a third resistor, a second diode, a third diode, a second operational amplifier, a third operational amplifier, and a second AD converter;

[0031] One end of the third resistor is connected to the cathode of the second diode and the input terminal of the second operational amplifier, respectively, and the connection point serves as the input terminal of the current acquisition module.

[0032] The other end of the third resistor is connected to the cathode of the third diode and the input terminal of the third operational amplifier, respectively, and the connection point is grounded;

[0033] The output terminals of the second operational amplifier and the third operational amplifier are connected, and the connection point is connected to the input terminal of the second AD converter;

[0034] The output terminal of the second AD converter serves as the output terminal of the current acquisition module;

[0035] The anodes of the second diode and the third diode are grounded.

[0036] Optionally, when there are two switching systems, each system has two current acquisition modules; the third resistors of the two current acquisition modules are connected in series.

[0037] As can be seen from the above technical solution, the downhole power switching circuit provided by the present invention uses a processor as the main control core, and the LTC4417 chip performs the switching action. The processor determines the power supply based on the current value and voltage value, and controls the on / off of the switching branch according to the power supply, that is, controls the power supply mode. In other words, it avoids the frequent power switching caused by using voltage value as the judgment basis, and further avoids the problem of unstable downhole power supply and failure to work normally. It realizes the monitoring of power parameters and improves the stability of downhole power supply. Attached Figure Description

[0038] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a schematic diagram of a downhole power switching circuit provided in an embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of another downhole power switching circuit provided in an embodiment of the present invention;

[0041] Figure 3 This is a schematic diagram of another downhole power switching circuit provided in an embodiment of the present invention;

[0042] Figure 4 This is a schematic diagram of another downhole power switching circuit provided in an embodiment of the present invention;

[0043] Figure 5 This is a schematic diagram of another downhole power switching circuit provided in an embodiment of the present invention;

[0044] Figure 6 This is a schematic diagram of another downhole power switching circuit provided in an embodiment of the present invention;

[0045] Figure 7 This is a schematic diagram of a voltage acquisition circuit included in a downhole power switching circuit provided in an embodiment of the present invention;

[0046] Figure 8 This is a schematic diagram of a current acquisition circuit included in a downhole power switching circuit provided in an embodiment of the present invention;

[0047] Figure 9 This is a schematic diagram of a current acquisition circuit included in a downhole power switching circuit provided in an embodiment of the present invention;

[0048] Figure 10 This is a timing diagram of the turn-on of a downhole power switching circuit provided in an embodiment of the present invention;

[0049] Figure 11 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention;

[0050] Figure 12 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention;

[0051] Figure 13 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention;

[0052] Figure 14 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention;

[0053] Figure 15 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention;

[0054] Figure 16 This is a flowchart of a downhole power switching method provided in an embodiment of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Furthermore, the terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data used can be interchanged where appropriate so that embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein.

[0057] This application provides a downhole power switching circuit to address the numerous instabilities inherent in the independent power switching control of the LTC4417 chip in existing technologies. Frequent power switching can lead to unstable power supply during logging operations deep within formations, making logging services unavailable. In such cases, the instrument must be pulled back to the surface for inspection and maintenance, a process that not only incurs significant labor and material costs but also extends the wellhead occupancy period.

[0058] See Figure 1 The downhole power switching circuit includes: at least one switching system 100; the switching system 100 includes: a processing module 10 and a switching module 20; the switching module 20 includes: an LTC4417 chip 24 and three switching branches.

[0059] It should be noted that the number of system 100 switches can be multiple or one; specifically, as shown below... Figure 2 As shown, when using one switching system 100, the number of processing module 10 and switching module 20 is one each; as Figure 3 As shown, when two switching systems 100 are used, the number of processing modules 10 and switching modules 20 are both two; the same applies when using other numbers of switching systems 100, which will not be elaborated here, and are all within the protection scope of this application.

[0060] Each of the three switch branches corresponds to one of the three power supplies, and the input terminal of each switch branch is connected to its corresponding power supply. The output terminals of each switch branch are connected, and the connection point serves as the output terminal of the downhole power switching circuit. Each of the three output terminals of the LTC4417 chip 24 corresponds to one of the three switch branches. Each output terminal of the LTC4417 chip 24 is connected to the control terminal of its corresponding switch branch. Each of the three DC pins of the LTC4417 chip 24 corresponds to one of the three power supplies. Each of the DC pins of the LTC4417 chip 24 is connected to its corresponding power supply.

[0061] Specifically, the input terminal of the first switch branch 21 is connected to the first power supply; the input terminal of the second switch branch 22 is connected to the second power supply; and the input terminal of the third switch branch 23 is connected to the third power supply. The output terminals of each switch branch are connected to the downhole instrument so that when any switch branch is in the ON state, the power supply connected to that switch branch powers the downhole instrument. The first output terminal of the LTC4417 chip 24 is connected to the control terminal of the first switch branch 21; the second output terminal of the LTC4417 chip 24 is connected to the control terminal of the second switch branch 22; and the third output terminal of the LTC4417 chip 24 is connected to the control terminal of the third switch branch 23. The three output terminals of the LTC4417 chip 24 control the on / off state of their respective corresponding switch branches. The DC1 pin of the LTC4417 chip 24 is connected to the first power supply; the DC2 pin of the LTC4417 chip 24 is connected to the second power supply; and the DC3 pin of the LTC4417 chip 24 is connected to the third power supply.

[0062] It should be noted that the switching branch may include a MOSFET pair, which typically consists of a pair of MOSFETs with complementary conductivity types. They can work together to achieve a switching function. See also... Figure 1 The processing module 10 includes a processor 12 and a voltage and current acquisition module 11.

[0063] The voltage and current acquisition module 11 is used to acquire the input voltage of each switch branch, that is, the output voltage of each power supply; and to acquire the output current of the switching module 20, that is, the output current of the downhole power switching circuit, or the input current of the downhole instrument.

[0064] The processor 12 acquires the input voltage of each switching branch and the output current of the switching module 20 through the voltage and current acquisition module 11; the LTC4417 chip 24 is controlled by the processor 12.

[0065] Specifically, the three input terminals of the LTC4417 chip 24 correspond one-to-one with the three output terminals of the processor 12; the first input terminal of the LTC4417 chip 24 is connected to the first output terminal of the processor 12; the second input terminal of the LTC4417 chip 24 is connected to the second output terminal of the processor 12; and the third input terminal of the LTC4417 chip 24 is connected to the third output terminal of the processor 12.

[0066] More specifically, the input terminals of the LTC4417 chip 24 may include two pins, such as a UV pin and an OV pin; for example, the UV1 pin of the LTC4417 chip 24 is connected to the first pin of the processor 12; the OV1 pin of the LTC4417 chip 24 is connected to the second pin of the processor 12; the UV2 pin of the LTC4417 chip 24 is connected to the third pin of the processor 12; the OV2 pin of the LTC4417 chip 24 is connected to the fourth pin of the processor 12; the UV3 pin of the LTC4417 chip 24 is connected to the fifth pin of the processor 12; and the OV3 pin of the LTC4417 chip 24 is connected to the sixth pin of the processor 12.

[0067] The processor 12 is used to determine the power of each power supply based on the input voltage of each switch branch and the output current of the switching module 20, and to control the on / off of each switch branch through the LTC4417 chip 24 based on the power of each power supply.

[0068] The power supply type can be cable-powered, battery-powered, or generator-powered. Generally, in battery-powered and generator-powered applications, the battery and generator are lowered into the well along with the downhole instruments, while in cable-powered applications, the power is transmitted from the surface to the well. It is worth noting that regardless of whether the power supply is cable-powered, battery-powered, or generator-powered, the power received by the switching module 20 is a low-voltage DC power supply, such as 36V DC power. That is to say, a corresponding converter can be set between the input terminal of the switching module 20 and the cable, generator, or even the battery to ensure that the power supply voltage meets the input requirements of the switching unit.

[0069] The three power supplies mentioned above can use multiple power supply methods of the same type, or a combination of multiple power supply methods, which will not be elaborated here.

[0070] Specifically, the processor 12 can determine the power supply level to select the power source. In other words, it can configure the power supply priority and supply power according to the power supply priority. For example, battery power has a high priority, while cable power and generator power have a low priority. Of course, other methods are also possible, which will not be elaborated here.

[0071] In different applications such as wireline logging, direct-drive logging, and logging while drilling, wireline logging can choose from either surface power supply + downhole battery power supply or a combination of downhole battery 1 + downhole battery 2. Direct-drive logging can choose from downhole battery 1 + downhole battery 2. Logging while drilling can choose from either generator power supply + downhole battery or a combination of downhole battery 1 + downhole battery 2. Batteries and generators need to be deployed downhole along with the downhole instruments. The battery's power output is fixed, while the generator's output is insufficient due to the influence of surface engineers; when the fluid flow rate to the downhole slows down, the generator's output may be insufficient. For the battery, the processor 12 determines the used power, remaining power, and the power required by the downhole instruments at a preset time to switch power supply. The switching priority is as follows: first, generator power and cable power; second, battery power. If cable power is interrupted or generator output is insufficient, switch to battery power. When the entire downhole system is powered by battery banks, the first battery bank is prioritized; if the remaining power is insufficient, switch to the second battery bank. Regardless of whether one or two battery banks are used, the battery's power must be measured immediately after deployment as an evaluation basis for the continued use of the currently used battery in subsequent deployments.

[0072] In addition, the power switching during the cable logging construction process can be done manually. For example, when the downhole instrument adopts a cable power supply + downhole battery power supply mode, the staff can input the corresponding switching information on the ground or downhole, send the command through the cable, and then the processor 12 will switch according to the switching information.

[0073] It is worth noting that the three switch branches correspond to three power supplies. It is possible to connect only two power supplies and switch between them; or it is possible to connect all three power supplies and switch between them.

[0074] When battery power is used, the battery charge level can be determined to execute subsequent switching actions; similarly, when generator or cable power is used, the generator or cable voltage can be determined to execute subsequent switching actions. Specifically, when using a two-battery power supply method (downhole battery 1 + downhole battery 2), the charge level of the currently used battery is determined, and power switching is performed based on the charge level. This avoids the frequent power switching caused by using voltage values ​​as the judgment basis, which further leads to unstable downhole power supply and malfunctions. This achieves monitoring of power parameters and improves the stability of downhole power supply. When using cable power supply (or generator) + downhole battery power supply, the processor 12 determines the switching logic based on the voltage value. When the voltage value of the cable power supply (or generator) is lower than the threshold, it actively switches to downhole battery power supply, records the battery voltage and current values, determines the battery's used charge and remaining charge, and uses battery power until the logging operation is completed.

[0075] The existing solution uses the LTC4417 chip, specifically designed for 2.5V to 36V DC power supply systems, providing a highly efficient power switching control scheme. This controller intelligently selects the highest-priority active power source from three input sources to supply power to the load. The priority order can be: source 1, source 2, source 3. The decision rule depends on the pin configuration; once the voltage of a power source remains within a window defined by undervoltage and overvoltage thresholds with 1.5% accuracy for 256 milliseconds, that power source is considered "active" and assumes the power supply task. The LTC4417 achieves electronic switching functionality by simply expanding the peripheral circuitry and adding six MOSFETs, a design that greatly simplifies the system architecture. In applications such as well logging instruments that require multiple different power supplies, the mature control scheme of the LTC4417 can significantly improve system stability, ensuring that the instrument can cope with various power supply requirements. The LTC4417 is equipped with three key power supply control ports: DC (power reference), UV (undervoltage), and OV (overvoltage). These ports are connected in series between the power supply and ground via sampling resistors to obtain different drive levels. Typically, three sampling resistors are needed for this configuration: the top resistor is connected to the power supply, and the bottom resistor is grounded. Specifically, the top resistor not only sends the power reference signal to the LTC4417's DC port but also serves to introduce power into the system. The middle resistor sends its upper signal as an undervoltage signal to the LTC4417's UV port. The bottom resistor sends its upper signal as an overvoltage signal to the LTC4417's OV port. By carefully configuring the values ​​of these three resistors, the following conditions can be met: when the undervoltage (UV) threshold is greater than 1V and the overvoltage (OV) threshold is less than 1V, the current channel is enabled; when the undervoltage (UV) threshold is less than 1V or the overvoltage (OV) threshold is greater than 1V, the current channel is turned off. This design ensures a stable power supply and can promptly cut off power in case of power failure, protecting the system from damage.

[0076] In this embodiment, the sampling resistor of the LTC4417 chip 24 is removed, and multiple control pins are brought out and connected to the processor 12. That is, the control switching method of processor 12 + LTC4417 chip 24 is adopted to improve the power supply stability of downhole instruments.

[0077] Specifically, remove the three sets of sampling resistors, retain the three power supply reference signals input to the DC1, DC2, and DC3 ports of the LTC4417 chip 24, and bring out the six sets of control signals (UV1, UV2, UV3, OV1, OV2, OV3) of the LTC4417 chip 24 to the output port for subsequent control operations.

[0078] The control pins of processor 12 are connected to these control signals via a driver circuit. It's important to note that due to differences in voltage ranges between different chips, the driver circuit provides two main voltage levels: 3.3V and 5V. Fortunately, both of these levels are higher than the 1V threshold required for power switching by the LTC4417 chip 24.

[0079] In practical operation, control is achieved by inputting high-level (3.3V or 5V) or low-level (0V) signals to these six sets of control signals, conforming to the power switching logic of the LTC4417 chip 24. This control method can precisely drive the MOSFET, thereby realizing the power on and off. Utilizing the characteristics and functions of the LTC4417 chip 24, a stable and reliable three-way power switching unit is realized through simple circuit connections and control logic. The turn-on drive follows the rule of undervoltage (UV) > 1V and overvoltage (OV) < 1V, while the turn-off condition is low level < 1V. The control logic is as follows: Figure 10 HIGH represents a high level, and LOW represents a low level. Additionally, sending a high level (>1V) to both OV ports can also shut down the channel; the implementation process is not detailed here.

[0080] The timing sequence for switching between the three power supplies is as follows: Figure 10 To activate a specific channel, the UV level of the current control line for that channel must be set high, while other buses remain low.

[0081] In other words, compared to the existing scheme of independently controlling the LTC4417 chip 24, the resistor sampling module is removed, and the control pins of the LTC4417 chip 24 are connected to the processor 12. The processor 12 and the LTC4417 chip 24 are connected through 6 control lines. That is to say, the LTC4417 chip 24 after removing the resistor sampling module is added as an independent module to the electrical system with the processor 12, so as to build a programmable control module (processor 12 + LTC4417 chip 24), realize the switching of at least two power supplies, and improve the stability of the power supply of downhole instruments.

[0082] In this embodiment, processor 12 is used as the main control core, and LTC4417 chip 24 performs the switching action. Processor 12 determines the power supply based on the current and voltage values, and controls the on / off of the switch branch according to the power supply, that is, controls the power supply mode. In other words, power supply switching is controlled by power supply, which avoids the problem of frequent power supply switching caused by using voltage value as the judgment basis, which further causes the problem of unstable power supply in the well and failure to work normally. It realizes the monitoring of power parameters and improves the stability of power supply in the well.

[0083] It should be noted that when downhole instruments are powered by multiple batteries, the battery voltage exhibits a non-linear decay trend. When the battery is depleted to a certain extent, even slight changes in load can cause significant voltage fluctuations. The LTC4417 uses resistors to sample the power supplies from three sets, obtaining the levels of three overvoltage (OV) or undervoltage (UV) pins. If the first battery is powered, after a certain level of depletion, the overvoltage (OV) or undervoltage (UV) level will no longer meet the requirements, automatically switching to the second battery. At this time, the first battery has no load, and its output voltage will increase, causing the overvoltage (OV) or undervoltage (UV) pin levels to meet the requirements again. The first battery has higher priority, causing the downhole instrument to switch to its power supply again. This cycle repeats until the first battery is completely depleted, finally switching back to the second battery for normal power supply. During the switching process, the power supply to the downhole instrument becomes unstable, which cannot guarantee the normal operation of logging tests.

[0084] In this embodiment, the downhole instrument can be powered by various combinations such as battery, cable, and downhole generator. The LTC4417 chip 24 has a control port, and the processor 12 configures parameters to command the downhole instrument to switch power supplies. Furthermore, the power supply of the logging instrument not only requires switching functionality but also monitoring of voltage, current, and battery power. Particularly for battery power, it is crucial to obtain remaining battery power parameters and anticipate the battery's load-bearing capacity. Batteries with insufficient power will not be used again, greatly assisting on-site workers in designing the next downhole operation plan. This ensures a 100% success rate during logging operations and guarantees the smooth acquisition of geological data after the instrument is deployed.

[0085] Optional, such as Figure 2 As shown, the processing module 10 also includes an interlock circuit 14.

[0086] Interlock circuit 14 is located between LTC4417 chip 24 and processor 12.

[0087] Interlock circuit 14 is used to ensure that only one switch branch signal is valid among the control signals between processor 12 and LTC4417 chip 24. Specifically, there are three control signals between processor 12 and LTC4417 chip 24. Under normal circumstances, only one of the three switch branches is turned on, that is, only one power supply is needed. However, multiple control signals issued by processor 12 may be valid at the same time. Therefore, interlock circuit 14 is used to ensure that only one signal is valid, that is, only one switch branch is turned on.

[0088] In other words, the processor 12 may experience timing conflicts when directly outputting control signals. A control line might be at a low level when it should be high. After the current time has passed, it returns to the correct logic level, although this time is very short. To increase technical sophistication, this application includes an interlocking module.

[0089] Specifically, such as Figure 10 As shown, it illustrates the control logic for 6 control lines. To enable a specific channel, the UV of the current control line must be set high, while other buses remain low.

[0090] according to Figure 10 The logic is that as long as UV and OV meet the logic of 10, the current channel is activated. For example: First switch branch 21: 100000 (e.g. Figure 10 Channel 1 shown is open.

[0091] Second switch branch 22: 001000 (e.g.) Figure 10 Channel 2 shown is open.

[0092] Third switch branch 23: 000010 (e.g.) Figure 10 (Channel 3 shown is open).

[0093] Interlock circuit 14 manages the six control lines, ensuring they adhere to strict three-way turn-on logic. Specifically, when the first switch branch needs to be turned on, the levels of the six control lines should be precisely set to 100000. However, if a race condition occurs in the circuit, such as an unexpected level combination of 101000, it means the turn-on signal for the second switch branch is also incorrectly triggered, resulting in incorrect timing. The core function of interlock circuit 14 is to ensure that only one switch branch can be turned on at any given time.

[0094] When an input level error occurs, the interlock circuit 14 can automatically adjust and output the correct level combination. These correct level combinations include: 100000 (representing the first switch branch being on), 001000 (representing the second switch branch being on), and 000010 (representing the third switch branch being on). In this way, the interlock circuit 14 ensures the stability and reliability of the circuit.

[0095] In order to prevent processor 12 from malfunctioning or bus timing races during the control implementation process, an interlock circuit 14 is introduced to ensure that only 2 of the 6 control lines are effective (1 group of control) under the same logic rules, so as to ultimately meet all the UV and OV level logic requirements of the current control.

[0096] In this embodiment, in order to ensure signal logic stability, there is also an interlock logic circuit between the processor 12 and the LTC4417 chip 24 to ensure that only one of the three control levels is valid, thereby achieving the stability of the power supply of one power source and preventing level competition at the control port, which could lead to control failure.

[0097] Optional, such as Figure 2 As shown, the processing module 10 also includes a storage module 15.

[0098] The storage module 15 is used to store the processing data of the processor 12.

[0099] The storage module 15 enables the communication and real-time storage of operating status and power parameters, allowing for the transmission and storage of these parameters.

[0100] Specifically, the processor 12 first calculates the power consumption status of each switch branch, and then writes various parameters, including control information and power consumption, into the storage module 15 in real time. This step ensures that even if the system is powered off, the measured parameters can be saved immediately. When the processor 12 restarts, it can read these historical records and perform new power consumption parameter calculations based on them.

[0101] Inside the processor 12, the current actual engineering values ​​can be obtained through calculations. Simultaneously, by accumulating the current and time, the power consumption of the instrument can be further calculated. By programming the processor 12, intelligent acquisition of voltage, current, and power values ​​is achieved, and this data is stored in real-time in the storage module 15.

[0102] In summary, this process not only ensures the real-time nature and accuracy of the data, but also guarantees its persistent storage, providing strong support for subsequent analysis and decision-making in the system.

[0103] Optionally, the number of system 100 switches is 1 (e.g., Figure 2 (as shown) or 2 (such as) Figure 3 (As shown).

[0104] In other words, a single-processor system or a dual-processor system can be used.

[0105] like Figure 2 As shown, this diagram illustrates the structure of a single-processor system. A power switching circuit with power monitoring is constructed using a single processor 12. The processor 12 collects power current parameters through a preset program, calculates these parameters, and saves them in real time. The system has a built-in communication interface (such as RS-485 or CAN) and an interlock circuit 14 to ensure that only one of the three control levels is active, thus guaranteeing the stability of the single power supply. Specifically, as... Figure 5As shown, the downhole instrument is equipped with 2 or 3 power supplies; specifically, the first power supply is connected to the DC1 terminal of the switching module 20, the second power supply is connected to the DC2 terminal of the switching module 20, and the third power supply is connected to the DC3 terminal of the switching module 20.

[0106] like Figure 3 As shown, when the downhole instrument power supply stability requirements are high, the power switching mechanism needs to be upgraded to include two independent switching systems 100 (i.e., a dual-processor system 12), such as... Figure 4 As shown, a master-slave switching system 100 is constructed using two processors 12 with different operating characteristics: an FPGA and a microcontroller. The FPGA, with its strict timing execution capabilities and parallel processing capabilities, serves as the core of the master control; while the microcontroller, with its serial execution mode, acts as the auxiliary control (slave). This design, based on a dual-core control mode, cleverly combines processors 12 with different architectures to ensure that at least one system can operate normally during the power supply process for the logging instrument, thereby enhancing system reliability. Specifically, as... Figure 6 As shown, the downhole instrument is equipped with 2 or 3 power supplies. Specifically, the first power supply is connected to the DC1 terminal of the first switching module 201 and the DC4 terminal of the second switching module 202; the second power supply is connected to the DC2 terminal of the first switching module 201 and the DC5 terminal of the second switching module 202; and the third power supply is connected to the DC3 terminal of the first switching module 201 and the DC6 terminal of the second switching module 202. The advantage of this design is that if one switching module 20 fails, the other module can immediately take over, ensuring that the power switching function is not affected, thereby maintaining the normal power supply to the downhole instrument.

[0107] like Figure 3 As shown, in terms of functional implementation, the operating principles of interlock control, parameter detection, data storage, and communication functions are similar to those of... Figure 2 The proposed solution remains consistent. Regarding the three-way power switching strategy, it adopts... Figure 6 The proposed solution.

[0108] Optional, such as Figure 3 As shown, when the number of switching systems 100 is at least 2, the processing modules 10 synchronize data through the synchronization interface 16.

[0109] Synchronization interface 16 is a communication constraint between two processors 12, which enables the synchronization function of the dual-processor system.

[0110] By adding synchronization interface 16, the two systems can handshake, master-slave logic configuration, exchange data such as running status and measurement parameters, and achieve real-time synchronization between the two systems.

[0111] The electrical system is configured via communication interface 13, and multiple terminals are connected to the same communication network using a general-purpose bus (485, CAN, etc.).

[0112] Communication between two processors 12 can be achieved through various methods, such as serial port, SPI, CAN, parallel bus, etc. Regardless of the method, synchronization is the core of communication between the two processors 12, and the synchronization process is as follows:

[0113] Handshake: When the processor 12 system is powered on and begins execution, the two processors 12 notify each other through a handshake function. This handshake function may be implemented by sending data or changing the state of a signal line; the key is that both sides can perceive the other's startup status. Specifically, one processor 12 sends a handshake signal to the other processor 12, and simultaneously, the processor 12 receiving the signal sends an acknowledgment signal back to the processor 12 that initiated the signal. The transmission of these two signals is bidirectional and simultaneous, with no strict time order requirement, but both must be completed at least once to prove that both systems have successfully started and are running.

[0114] Master-Slave Configuration: Typically, the FPGA system acts as the master system, while the microcontroller acts as the slave system. In this master-slave configuration, the synchronous communication process is similar to a status confirmation mechanism. The master system (FPGA) conveys its dominant position to the slave system (microcontroller), informing it that it is the master and expects its cooperation. The slave system then monitors the master's operating status based on the signals continuously emitted by the master, determining whether the master is functioning correctly. Based on this judgment, the slave system decides whether it should take over and execute the control tasks of the entire system. This configuration ensures orderly cooperation and efficient operation between the systems.

[0115] Operational status exchange: This mainly involves the switching status of the current 3-to-1 channel, meaning each system needs to inform the other which of its channels is currently active or which is currently closed. This two-way information transmission ensures that both parties have real-time knowledge of the channel status.

[0116] Measurement data sharing: Each system needs to measure voltage and current, and calculate electrical parameters and record key information such as the date. This information is stored in its own memory and needs to be sent to the other system periodically to achieve comprehensive data sharing and updates, ensuring that both parties have access to the latest measurement data.

[0117] Optionally, when there are two switching systems 100, the processor 12 in one switching system 100 is an FPGA; the processor 12 in the other switching system 100 is a microcontroller.

[0118] It is worth emphasizing that regardless of the combination of processors 1 and 2, the dual-system solution is feasible. In an emergency, the probability of both systems failing simultaneously is extremely low.

[0119] In this scenario, the choice to combine an FPGA with a microcontroller is primarily based on the processor 12 architecture. The FPGA acts as a parallel processor 12, while the microcontroller is a serial processor 12. This combination is more stable than a system using two microcontrollers, and simpler than using two FPGAs.

[0120] When the number of switching systems 100 is one, i.e., a single-processor system, an electrical system with a single processor 12 as its core is built to fulfill control and power monitoring requirements. Output control signals enable the switching on and off of one power channel in the control module, thus meeting the requirement of selecting one of three power sources when multiple power supplies are available. Voltage and current sampling circuits are built to amplify and convert signals to digital, and the power monitoring parameters are obtained after calculation by the processor 12. Communication and storage circuits are built to transmit and store operating status and power parameters. A signal control logic interlock circuit 14 is built to ensure that only one of the three control levels is valid, ensuring that only one power supply is available during power switching.

[0121] (1) When the number of switching systems 100 is 1, i.e., a single-processor system 12 is used, an electrical system with a single processor 12 as its core is constructed to meet the needs of control and power monitoring. This system can output control signals to turn on or off a power channel (switch branch) in the switching module 20, realizing the three-to-one power supply function in multi-channel power supply. At the same time, voltage and current sampling circuits are designed to amplify signals and perform analog-to-digital conversion, and the processor 12 calculates the power monitoring parameters accordingly. In addition, communication and storage circuits can be established to realize the real-time transmission and storage of operating status and power parameters. To ensure that only one power supply is available during power switching, a signal control logic interlock circuit 14 is specially designed to ensure that only one of the three control levels is effective.

[0122] Specifically, when downhole instruments are powered by two or three different power sources (e.g., cable power, battery power, or downhole generator power), a single-processor system can be used to switch between these multiple power sources, thus supporting arbitrary switching between the three power supplies. The control pins of the LTC4417 chip 24 are operated via level-driven mechanisms, and an interlock circuit 14 is added to the processing module 10 to ensure that only one control level is active at any given time, thereby guaranteeing the stability and reliability of the single power supply. In addition, the system also needs to measure the voltage of the power supply (not exceeding 36VDC) and the operating current of the instrument (typically not exceeding 10A).

[0123] Two or three power supplies first pass through a voltage sampling circuit, converting a high voltage of up to 36V into a low-level signal of approximately 2.5V for acquisition by the analog-to-digital converter (ADC). The ADC then converts the analog voltage signal into a digital voltage value for further system processing.

[0124] Meanwhile, a current sampling method was employed to measure the instrument's current consumption. By connecting a sampling resistor in series in the instrument circuit, the voltage value across the sampling resistor could be obtained, and the instrument's current consumption could then be calculated. The signal conversion and analog-to-digital conversion principles in this process are the same as those used in the power supply voltage measurement scheme.

[0125] exist Figure 5 In the diagram, the three electronic switches K1, K2, and K3 represent the switching module 20 constructed based on the LTC4417 chip 24 and the peripheral MOS switch module (switch branch), respectively. Figure 3 (As shown). These electronic switches are responsible for controlling the on / off state of different power supply channels, thereby enabling intelligent switching of the power supply to downhole instruments.

[0126] Using a single processor 12 as the core of the system, peripheral circuits were constructed that include functions such as signal acquisition, interlock control, communication, and storage. Figure 1 The design scheme shown integrates these elements to form a power switching electrical system with power monitoring capabilities. The specific structure is as follows: Figure 2 As shown.

[0127] The processor 12 of this system can be a high-performance chip with parallel processing capabilities, such as an FPGA or CPLD, or a serially operating ARM processor 12, a 16-bit or 8-bit microcontroller. These processors 12 typically operate at 3.3V or 5V, and the selection of peripheral interface chips matches the operating level of the processor 12 to ensure that control lines can be directly connected to the processor 12. Therefore, the entire system centered around the single processor 12 maintains a consistent voltage level of 3.3V or 5V until the LTC4417 chip 24 boosts the voltage to drive a bus up to 36V.

[0128] The voltage and current acquisition units acquire analog electrical signals using signal conversion technology and convert them into digital signals. The processor 12 reads these digital signals through a bus interface (such as SPI) and performs calculations internally to obtain the actual voltage, current values, and power consumption of the instrument. By programming the processor 12, we have achieved intelligent acquisition and real-time storage of voltage, current, and power consumption. The data is written to the storage module 15 for subsequent use.

[0129] In addition, the system is equipped with a communication module 13, which uses common interfaces such as RS485 and CAN to communicate with external devices, such as interacting with ground software. It can send measurement parameters and the current power supply status to the outside world, and also receive commands from the outside. The processor 12 forces the switching of the power supply channel according to these commands. The microcontroller's output pins are used to enable and control the switching module 20 (e.g., ...). Figure 1 (As shown).

[0130] To prevent malfunctions of the processor 12 or problems caused by bus timing races during control implementation, an interlock circuit 14 was introduced. This circuit ensures that under the same logic rules, only 2 out of the 6 control lines are valid (i.e., one group of control), thus satisfying all UV and OV level logic requirements of the current control. This design not only improves system stability but also ensures the accuracy and reliability of power switching.

[0131] (2) When the number of switching systems 100 is 2, i.e., a dual-processor system 12 is adopted, two independent single-processor systems are established, using a microcontroller and an FPGA as the core processors 12 respectively, forming two independent systems in master mode and slave mode. A synchronization interface 16 is added to the single-processor system 12, enabling the two single-processor systems to exchange parameter status information, measured power information, etc. These two single-processor systems can flexibly choose between master-slave mode or parallel mode for operation. In master-slave mode, the FPGA defaults to master mode. If master mode control fails, it automatically switches to the microcontroller's slave mode until logging is completed and power is cut off.

[0132] Specifically, given the stringent requirements for power supply stability in downhole instruments, a dual-processor system (12-system) is a more reliable choice. This ensures that if one switching system (100) fails, the other switching system (100) can continue to maintain normal power switching functionality. Both systems maintain consistency with the single-processor system in terms of control, parameter monitoring, data storage, and communication functions, ensuring comprehensive and consistent functionality.

[0133] In the dual-processor 12 system, two independent switching systems 100 are connected to different power supplies. Specifically, the first power supply is connected not only to the switching system 100 but also to the switching system 100 itself, forming a redundancy backup; similarly, the second and third power supplies are also connected to these two switching systems 100 respectively. The advantage of this design is that when any one control module fails, the other module can immediately take over its work, ensuring the continuous effectiveness of the power switching function.

[0134] Furthermore, the introduction of the dual-processor 12 system adds redundancy functions such as parallel processing and master-slave control, further enhancing the system's reliability and stability. Through the synchronization interface 16, data can be exchanged between the two processor 12 systems, ensuring the real-time nature and accuracy of information. This design not only meets the high power supply stability requirements of downhole instruments but also provides a strong guarantee for the long-term stable operation of the system.

[0135] As shown in the figure Figure 3 exist Figure 2 Based on this, another switching system 100 with the same function was added. The two switching systems 100 can operate independently or work together in parallel or master-slave mode as needed.

[0136] In parallel mode, both switching systems 100 receive instructions from the ground software through their respective communication modules 13 and independently perform power supply switching according to the instructions. That is to say, the switching system also includes a communication module 13, which interacts with the ground software.

[0137] In master-slave mode, if the current master system malfunctions, it will automatically switch to the slave system, thus achieving system redundancy and ensuring absolute stability of the power supply to the downhole instruments. The first system has three input power supplies: DC1, DC2, and DC3, while the second system is equipped with three input power supplies: DC4, DC5, and DC6. During operation, the downhole instruments can select to connect two or three power supplies depending on the actual situation, and the connection method of the three terminals is flexible and unrestricted. A common connection scheme is: power supply 1 connected to DC1 and DC4, power supply 2 connected to DC2 and DC5, and power supply 3 connected to DC3 and DC6. Voltage and current sampling are performed through resistors to facilitate subsequent parameter acquisition.

[0138] In the first system (main system), such as Figure 5 and Figure 6 The three electronic switches K1, K2, and K3 respectively represent Figure 2 The LTC4417 chip 24 and the peripheral MOS switch module (switch branch) are shown; in the second system (slave system), the three electronic switches K4, K5 and K6 also represent this configuration.

[0139] Based on the dual-processor 12, a peripheral circuit was constructed that includes functions such as signal acquisition, interlock control, communication, and storage. The specific design is as follows: Figure 3 As shown. This design is in Figure 2A synchronization interface 16 was added to the existing interface to enable parameter exchange and workflow handover between the two systems. Specifically, one system utilizes an FPGA processor 12 with parallel processing capabilities; due to its high real-time performance, this system is prioritized as the master system. The other system uses a microcontroller with serial operation capabilities as its processor 12.

[0140] The dual-processor system operates in two modes: master-slave and parallel. In master-slave mode, the master system typically handles normal power switching, while the slave system remains in standby mode. If the master system fails, the system automatically switches to the slave system, continuing until the logging operation is complete and all instruments are powered off. In parallel mode, to meet specific application requirements, both systems switch power simultaneously. In this case, it is crucial to ensure that all three switching paths are powered by the same source power, meaning that the downhole instruments simultaneously receive the same power from the same channel in both systems.

[0141] Both systems can simultaneously acquire voltage, current, and power values, and synchronize power parameters through synchronization interface 16, then write this data to storage module 15 in real time. Furthermore, both systems have independent communication addresses, and during bus communication (such as RS485 or CAN), the communication ports of both systems can be connected to the same network for networking. The ground host can independently control each subsystem by sending relevant commands.

[0142] For a series of instruments with low power supply current, low power consumption, and low heat generation, a single processing system can simplify the electrical system, reduce the complexity of circuit board design, and reduce the task scheduling of power switching and power monitoring systems, thereby ensuring the stability of system operation with the simplest solution.

[0143] For instruments with high power consumption or extremely high requirements for power supply stability, the dual-processing system provides greater power redundancy. Through a safer and more reliable power switching scheme, the dual-processing system ensures stable operation of the instrument during logging, meeting the demands of demanding application scenarios.

[0144] In this embodiment, a multi-channel power switching system 100, built based on processor 12 and LTC4417 chip 24, measures the instrument's power supply voltage and operating current, and monitors electrical parameters. This system integrates key functional modules such as communication, storage, and power switching logic interlocks. To meet the diverse power supply needs of downhole instruments, two system configurations are specifically designed: First, a three-channel power switching and power monitoring system based on a single processor 12. This system is suitable for logging instruments with relatively low power consumption and less stringent power stability requirements. Through its streamlined design, it effectively meets the power supply and monitoring needs of these instruments. Second, a three-channel power switching and power monitoring system based on dual processors 12. This system is designed for logging instruments with high power stability requirements and high power consumption. Through the parallel processing and redundancy design of the dual processors 12, this system provides a more reliable and stable power switching and power monitoring solution, ensuring continuous and stable operation of the instruments during logging. These two system configurations provide flexible and efficient solutions for the power supply needs of logging instruments in different scenarios.

[0145] Optionally, the voltage and current acquisition module 11 includes: a current acquisition module and three voltage acquisition modules.

[0146] The three voltage acquisition modules correspond one-to-one with the three switch branches.

[0147] Each voltage acquisition module is located between its corresponding switch branch and the corresponding power supply.

[0148] Specifically, the first voltage acquisition module is located between the first switch branch 21 and the first power supply; the second voltage acquisition module is located between the second switch branch 22 and the second power supply; and the third voltage acquisition module is located between the third switch branch 23 and the third power supply.

[0149] The current acquisition module is located between the switching module 20 and the downhole instrument.

[0150] Specifically, one end of the current acquisition module is connected to one end of the switching module 20, and the other end of the current acquisition module is connected to the downhole instrument.

[0151] In other words, the switching system 100 has a voltage measurement function; each power supply is equipped with voltage sampling to acquire a low-voltage signal that can be measured by the chip. It also has a current measurement function; the back end of the three-way switching module 20 is connected to an instrument. The instrument's power supply channel uses current sampling to obtain voltage values ​​for measurement, and calculates the operating current value. By using the current parameters and accumulating them over time, the power consumption can be calculated.

[0152] The switching system 100 incorporates voltage measurement functionality, with each power supply equipped with a current acquisition module to capture low-voltage signals that can be directly measured by the chip. Simultaneously, the system also possesses current measurement capabilities. Specifically, a current acquisition unit is installed at the connection point between the switching module 20 and the downhole instrument. By sampling the current in the power supply channel, the system can acquire voltage values ​​and calculate the operating current of the downhole instrument. Using these current parameters, combined with the cumulative effect over time, the system can further calculate the energy consumption, providing users with detailed energy consumption data.

[0153] It should be noted that when using a single-processor 12 system, the power switching circuit includes a current acquisition module and three voltage acquisition modules (such as...). Figure 5 As shown), when using a dual-processor 12 system, the power switching circuit has 2 current acquisition modules and 6 voltage acquisition modules (as shown). Figure 6 (As shown).

[0154] Optional, such as Figure 7 As shown, the voltage acquisition module includes: a first resistor R1, a second resistor R2, a first diode D1, a first operational amplifier U1, and a first AD converter A1.

[0155] One end of the first resistor R1 is connected to the power supply corresponding to the voltage acquisition module; the other end of the first resistor R1 is grounded through the second resistor R2; the connection point between the second resistor R2 and the first resistor R1 is connected to the input terminal of the first operational amplifier U1 and the cathode of the first diode, respectively; the anode of the first diode is grounded; the output terminal of the first operational amplifier U1 is connected to the input terminal of the first AD converter A1; the output terminal of the first AD converter A1 serves as the output terminal of the voltage acquisition module.

[0156] The first AD converter A1 is used to convert analog signals into digital signals.

[0157] Generally, the resistance of the second resistor R2 is less than that of the first resistor R1. Of course, it is not impossible for it to be greater.

[0158] In the voltage sampling stage, the power supply is divided by two resistors (R2 and R1) to obtain a voltage signal suitable for the chip's measurement range. This signal is provided by the second resistor R2, that is, the signal sampling is completed by obtaining the voltage division value of the second resistor R2. The ratio of the two resistors can be a correction factor used to calculate the measured engineering value.

[0159] The voltage acquisition section comprises three key steps: overvoltage protection (first diode), signal amplification, and analog-to-digital conversion (A / D). First, the overvoltage protection mechanism ensures safe operation of the circuit when faced with excessively high voltages, clamping the maximum voltage to approximately 3.3V or 5V to prevent a virtual ground effect from occurring in the second resistor R2. The sampled signal would directly output the current power supply voltage (36V), potentially burning out the first operational amplifier U1 and the analog-to-digital converter (first A / D converter A1). Next, the signal is amplified by the first operational amplifier U1 to enhance its strength, specifically adjusting it to a suitable voltage range (typically -2.5V to +2.5V for A / D conversion) before being sent to the analog-to-digital converter (first A / D converter A1) for digital conversion. Finally, the analog voltage signal is converted to a digital signal by the analog-to-digital converter, and these digital signals are transmitted to the processor 12 via the SPI bus. Inside the processor 12, these digital signals are further processed and calculated to accurately determine the current power supply voltage value. The bus interface (typically SPI) is controlled by the processor 12 to realize the digital measurement of the current sampled signal.

[0160] The power supply voltage acquisition principle is the same for both single-processor 12 systems and dual-processor 12 systems, and will not be elaborated here.

[0161] Optional, such as Figure 8 As shown, the current acquisition module includes: a third resistor R3, a second diode D2, a third diode D3, a second operational amplifier U2, a third operational amplifier U3, and a second AD converter A2.

[0162] One end of the third resistor R3 is connected to the cathode of the second diode D2 and the input terminal of the second operational amplifier U2, respectively. The connection point serves as the input terminal of the current acquisition module and is connected to the output terminal of the switching module 20.

[0163] The other end of the third resistor R3 is connected to the cathode of the third diode D3 and the input terminal of the third operational amplifier U3, respectively, and the connection point is grounded.

[0164] The output terminals of the second operational amplifier U2 and the third operational amplifier U3 are connected, and the connection point is connected to the input terminal of the second AD converter A2.

[0165] The output of the second AD converter A2 serves as the output of the current acquisition module and is connected to the downhole instrument.

[0166] The anodes of the second diode D2 and the third diode D3 are grounded.

[0167] In the current sampling stage, a sampling resistor (such as...) Figure 8R3 shown is connected in series to the power supply network of the downhole instrument, and signal sampling is performed at the ground terminal of the downhole instrument. In this way, we can obtain a voltage value representing the current. At the same time, in order to prevent a sharp rise in input voltage that may be caused by special situations such as the downhole instrument being floating, two diodes are connected in series to prevent the sampling resistor from being in a virtual ground state, so as to realize the overvoltage protection function, thereby protecting the subsequent amplification and analog-to-digital conversion circuits from damage.

[0168] The current acquisition section encompasses two core steps: operational amplifier and analog-to-digital (A / D) conversion. First, the signal is amplified to enhance its strength; that is, the operational amplifier amplifies the signal to a suitable voltage level range (typically -2.5V to +2.5V for A / D converters). Then, the analog signal is converted to a digital signal via the A / D converter. These digital signals are transmitted to processor 12 via the SPI bus, where further calculations are performed to accurately determine the current value used by the instrument. The SPI bus is controlled by processor 12 to achieve the digital measurement of the currently sampled signal.

[0169] Optionally, when the number of switching systems 100 is 2, it has 2 current acquisition modules; the third resistor of the 2 current acquisition modules (such as...) Figure 9 R31 and R32 shown are connected in series.

[0170] Specifically, such as Figure 9 As shown, the dual-processor 12 system has two current acquisition modules; one current acquisition module includes: a third resistor R31, a second diode D21, a third diode D31, a second operational amplifier U21, a third operational amplifier U31, and a second AD converter A21.

[0171] Another current acquisition module includes: a third resistor R32, a second diode D22, a third diode D32, a second operational amplifier U22, a third operational amplifier U32, and a second AD converter A22.

[0172] One end of the third resistor R31 is connected to the cathode of the second diode D21 and the input terminal of the second operational amplifier U21, respectively. The connection point serves as the input terminal of the current acquisition module and is connected to the output terminal of the switching module 20.

[0173] The other end of the third resistor R31 is connected to the cathode of the third diode D31, the input terminal of the third operational amplifier U31, the cathode of the second diode D21, the input terminal of the second operational amplifier U22, and one end of the third resistor R32.

[0174] The other end of the third resistor R32 is connected to the cathode of the third diode D32 and the input terminal of the third operational amplifier U32, respectively, and the connection point is grounded.

[0175] The output of the second operational amplifier U21 is connected to the output of the third operational amplifier U31, and the connection point is connected to the input of the second AD converter A21.

[0176] The output of the second AD converter A21 is used as the output of the first current acquisition module and is connected to the downhole instrument.

[0177] The anodes of the second diode D21, the third diode D31, the second diode D22, and the third diode D32 are all grounded.

[0178] The output terminals of the second operational amplifier U22 and the third operational amplifier U32 are connected, and the connection point is connected to the input terminal of the second AD converter A22.

[0179] The output of the second AD converter A22 is used as the output of the second current acquisition module and is connected to the downhole instrument.

[0180] This application provides a downhole power switching method to address the numerous instabilities inherent in existing logging applications where the LTC4417 independent chip controls power switching. Frequent power switching can lead to unstable power supply during deep formation logging operations, making logging services impossible. In such cases, the instrument must be pulled back from the well for inspection and maintenance, a process that incurs significant labor and material costs and extends the wellhead's occupancy period.

[0181] This downhole power switching method is applied to a downhole power switching circuit, which includes a processing module and a switching module. The LTC4417 chip in the switching module is controlled by the processing module. The N switching branches in the switching module are connected one-to-one with N power supplies; N is an integer greater than 1.

[0182] For details on the specific structure and working principle of the downhole power switching circuit, please refer to the downhole power circuit provided in the subsequent embodiments; it will not be described in detail here.

[0183] See Figure 11 Downhole power switching methods include:

[0184] S101, Collect the input voltage of each switch branch of the switching module.

[0185] Specifically, the input voltage of the switching branch can be acquired using a voltage acquisition module in the power switching circuit; for example, a first voltage acquisition module can be used to acquire the input voltage of the first switching branch; a second voltage acquisition module can be used to acquire the input voltage of the second switching branch; and a third voltage acquisition module can be used to acquire the input voltage of the third switching branch; the input voltage acquired by each voltage acquisition module is transmitted to the processor for processing.

[0186] It should be noted that the input voltage of each switch branch and the output voltage of each power supply can be interchanged; no specific restrictions are imposed here.

[0187] S102, Acquisition of the output current of the switching module.

[0188] Specifically, the input current of the switching branch can be collected using the current acquisition module in the power switching circuit.

[0189] It should be noted that the power switching circuit can use a single-processor system or a dual-processor system. Each system has its own corresponding processor, current acquisition module and voltage acquisition module. In other words, whether it is a single-processor system or a dual-processor system, its internal system is independent. The dual-processor system is mainly for the purpose of achieving redundancy and improving stability.

[0190] S103. Determine the target electrical parameters of the power supply connected to the switching module based on each input voltage and output current.

[0191] The target electrical parameters include voltage or electrical quantity.

[0192] When the power source is a battery, the target electrical parameter is the charge level.

[0193] Specifically, different power supplies have different target electrical parameters; for example, the target electrical parameter for a battery is the amount of electricity, while the target electrical parameter for a generator or cable is the voltage.

[0194] Generally speaking, the capacity of a battery is fixed, meaning the battery power is fixed. Therefore, the battery's power supply capability can be determined based on its power capacity. Since cables and generators provide continuous power, that is, under ideal conditions, they can provide a continuous power supply. Therefore, the power supply capability can be determined based on the voltage.

[0195] Generally, the power supply requirement for downhole devices is a voltage higher than the operating voltage. In general, the power supply voltage of the battery can be adjusted so that its output voltage is within the operating voltage of the downhole device. Therefore, the power level can be used as the basis for switching battery power.

[0196] S104. When the downhole power switching circuit adopts the automatic control mode, the switching module controls the on / off state of the corresponding switch branch according to the target electrical parameters of the power supply.

[0197] It should be noted that the downhole power switching circuit can adopt an automatic control mode or a host computer control mode; the downhole power switching module can switch between these two modes. The specific switching method can be host computer control or pre-configuration; of course, other methods are also possible, which will not be elaborated here, and all are within the protection scope of this application.

[0198] In automatic control mode, the processor controls the system based on the target electrical parameters; in host computer control mode, the processor controls the system based on instructions from the host computer.

[0199] The process of controlling the switching on and off of the switch branch based on the target electrical parameters of the power supply can be as follows: determine whether the conditions are met based on the target electrical parameters. If the conditions are met, continue to supply power from the currently connected power source; if the conditions are not met, disconnect the currently connected power source and use another power source to supply power.

[0200] Specifically, this can be controlled by setting the priority of each power supply. For example, the power supply priority from high to low can be power supply 1, power supply 2, and power supply 3. When switching power supplies in the mine, power supply 1 will be used first. If power supply 1 is insufficient, power supply 2 will be used. If power supply 2 is insufficient, power supply 3 will be used. It should be noted that when any power supply is providing power, if a higher priority power supply regains its power supply capability, the higher priority power supply can be switched back. This is an example of 3 power supply groups; the same applies to 2 power supply groups, and will not be elaborated further here.

[0201] Generally, batteries have the lowest priority, while cables and generators have higher priority. Cables or generators can be used first for power supply. Batteries are only used when the cables or generators cannot meet the power demand. When multiple power sources use batteries, switching between batteries is done by adjusting their charge levels. Since battery charge does not recover, frequent switching between batteries is generally not necessary.

[0202] In this embodiment, the input voltage of each switch branch of the switching module is collected; the output current of the switching module is collected; based on each input voltage and output current, the target electrical parameters of the power supply connected to the switching module are determined. The target electrical parameters include voltage or power quantity; when the power supply is a battery, the target electrical parameter is power quantity; when the downhole power switching circuit adopts automatic control mode, the on / off state of the corresponding switch branch of the switching module is controlled according to the target electrical parameters of the power supply; and the on / off state of the switch branch is controlled according to the target electrical parameters of the power supply, that is, the power supply mode is controlled. In other words, the power switching is controlled by power quantity, which avoids the problem of frequent power switching caused by using voltage value as the judgment basis when the battery is used as the power supply, which further causes the downhole power supply to be unstable and unable to work normally. This realizes the monitoring of electrical parameters and improves the stability of downhole power supply.

[0203] Optionally, the power supply connected to the switching module includes a battery; step S103 above, based on each input voltage and output current, determines the target electrical parameters of the power supply connected to the switching module, including:

[0204] Based on the input voltage and output current of the switch branch corresponding to the currently installed battery, determine the cumulative power consumption of the currently installed battery, and use the cumulative power consumption of the currently installed battery as the target electrical parameter.

[0205] Specifically, electrical power (P) refers to the electrical energy consumed by an appliance during operation, and its calculation formula is P = UI, where U is voltage and I is current. Electricity consumption (W) refers to the electrical energy consumed within a certain time period, and its calculation formula is W = Pt, where P is electrical power and t is time. This formula can be used to calculate the amount of electricity consumed by a battery over a period of time. Of course, other methods can also be used to determine the cumulative electricity consumption of a battery; these will not be elaborated upon here, but can be chosen according to the actual situation, all of which are within the scope of protection of this application.

[0206] After determining the battery level, the battery level is used as the basis for battery switching, i.e., the target electrical parameter. It should be noted that the output voltage of each power source is collected in real time, meaning the processor can also switch based on the output voltage of each power source in real time. For example, since the cable has higher priority than the battery, if the cable experiences a power outage, the system switches to battery power. If, during the battery power supply process, the cable resumes power supply, the system can directly switch back to cable power, disconnecting the battery. Other combinations and priorities are handled similarly, and will not be elaborated upon here; they can be determined according to the actual situation and are all within the scope of protection of this application.

[0207] Optionally, step S104 above, controlling the on / off state of the corresponding switching branch of the switching module according to the target electrical parameters of the power supply, includes:

[0208] If the cumulative power usage of the currently deployed battery reaches the threshold, the switch branch corresponding to the currently deployed battery will be turned off, and another switch branch in the switching module will be closed so that the switching power supply can continue to provide power.

[0209] It should be noted that this threshold can be the minimum battery power required for stable instrument operation. In other words, if the battery charge is below this threshold, the battery may experience voltage instability, requiring the battery to be switched off and another power source provided to ensure stable operation of the downhole instrument. Alternatively, a larger value can be set as the threshold; these options will not be elaborated upon here.

[0210] This threshold can be 80%; or it can be other values, which will not be elaborated here; that is to say, when the battery is less than 20%, the battery will be disconnected.

[0211] Optionally, the power supply connected to the switching module includes a sustainable power supply, which includes at least one of a cable power supply and a generator power supply.

[0212] Based on each input voltage and output current, determine the target electrical parameters of the power supply connected to the switching module, including using the voltage value of the currently available sustainable power supply as the target electrical parameter.

[0213] In other words, when the power source is sustainable, unlike energy storage devices such as batteries which are limited by capacity, it can be controlled based on its output voltage. Therefore, voltage can be used as the basis for switching.

[0214] Optionally, based on the target electrical parameters of the power supply, the switching module's corresponding switching branch is controlled to open or close, including:

[0215] If the voltage of the currently supplied sustainable power supply is less than the threshold voltage, the switch branch corresponding to the currently supplied sustainable power supply is turned off, and another switch branch in the switching module is closed so that the switching power supply can continue to supply power.

[0216] Specifically, when the output voltage of the sustainable power supply meets the working voltage requirements of the downhole instrument, such as when the output voltage of the sustainable power supply is within the working range of the downhole instrument, the sustainable power supply can continue to supply power to the downhole instrument; when the output voltage of the sustainable power supply is not within the working range, such as when it is less than the minimum working voltage or greater than the maximum working voltage, the sustainable power supply is switched off and another power source is switched on. This other power source can be a sustainable power supply or a battery. For example, the cable is switched off and the generator is switched on; or the generator or cable is switched off and the battery is switched on. These will not be elaborated on here.

[0217] In this embodiment, when downhole instruments employ diverse power supply modes, such as cable power supply, downhole self-contained battery power supply, and downhole generator power supply, these power supply methods can complement each other, ensuring a continuous and stable power supply for the instruments after they reach the predetermined formation, enabling smooth logging operations. This effectively avoids the cumbersome process of having to lift the instruments back to the wellhead for maintenance due to a single power supply failure, thus significantly reducing the time the wellhead is occupied. The downhole power switching method proposed in this invention provides a clear planning path and implementation steps for developing downhole power switching implementation schemes, ensuring not only the reliability of power supply to downhole instruments but also enabling real-time monitoring of key parameters such as voltage, current, and power consumption.

[0218] Optional, also includes:

[0219] When the downhole power switching circuit adopts the host computer control mode, it obtains the instructions sent by the host computer; controls the target switch branch in the switching module to execute the target action; the target action is the action indicated in the instruction; the target switch branch is the switch branch indicated in the instruction.

[0220] It should be noted that the instructions sent by the host computer may include the processor's address and the identifier of the target switch branch, thereby enabling the corresponding processor to control the on / off state of the target switch branch.

[0221] For example, in single-processor and dual-processor systems, each system has an address. The ground host sends a command word (instruction) to the target address. In a single-processor system, the processor switches between the three power supplies according to the command word. In a dual-processor system, the master and slave systems also have their own addresses. After receiving the corresponding command, each system checks the command word and switches between the three power supplies.

[0222] Optionally, when the downhole power switching circuit includes two switching systems, each system comprising a processing module and a switching module, it may also include:

[0223] When the synchronization conditions are met, data synchronization is performed between the two switching systems.

[0224] In other words, when the downhole power switching circuit includes two switching systems, these two systems will synchronize data. Specifically, the two switching systems can synchronize data through a synchronization interface; for example, when the timer reaches the preset synchronization time, the two switching systems will synchronize data. Specifically, if switching system A is currently in use, when the synchronization time is reached, switching system A will transmit its data to switching system B; the same applies if switching system B is currently in use, and so on. The specific synchronization data can include exchanged operating status, measurement parameters, and other data, which will not be elaborated further here.

[0225] like Figure 16 The following diagram illustrates the logic control process for dual-processor and single-processor systems:

[0226] In both single-processor and dual-processor electrical systems, each system has the capability to switch up to three power supplies, and each operates independently. Their logic control execution methods also remain consistent.

[0227] By checking the "control logic" flag, the operating mode of the downhole power switching circuit is determined. For example, it is 1 for a single processor, 2 for a microcontroller in a dual-processor system, and 3 for an FPGA. The host sends a command to the target address, for example, to address 1. After receiving the command, processor 1 determines the "control logic" flag parameter in memory. If control logic = 1, the downhole power switching circuit switches according to the switching requirements sent from the surface. If control logic = 2, the downhole power switching circuit switches according to the automatic voltage and power mode. The control logic flag here is just one example and will not be elaborated further.

[0228] The first method involves entering command mode in the ground software. Both single-processor and dual-processor systems are assigned a specific address. The ground host sends command words to this address. A single-processor system will independently switch between the three power supplies based on the received command word. In a dual-processor system, both the master and slave systems have their own addresses. When they receive the corresponding command, they each check the command word and switch between the three power supplies separately.

[0229] The second mode involves the system entering an automatic voltage and power mode. This mode is relatively complex because it employs multiple control strategies for different power supply modes. Downhole instruments have various power supply methods, including cable power, battery power, and downhole generator power. When using battery power, the system needs to comprehensively consider voltage and power parameters; if the battery capacity is insufficient, the system will immediately switch. When the power generated by the generator cannot meet the load demand, the voltage will drop significantly, and the system will control based on the voltage parameters. In automatic mode, the single-processor system detects voltage and power parameters and determines the power supply type, thereby switching between the three power supply groups.

[0230] For a dual-processor system, which consists of two independent systems, information synchronization is first performed to obtain the operating status and real-time power values ​​of the two switching systems. In master-slave mode (serial), the two systems independently measure voltage and power parameters. If the master system is working normally, it will determine the power supply type and switch between the three power supplies. If the master system fails, control will automatically transfer to the slave system, which will then switch between the three power supplies.

[0231] In parallel control mode, the master and slave systems execute in parallel, simultaneously switching between the three power supplies. The master and slave systems monitor voltage and power parameters and each control its own three-way switching module. This allows downhole instruments to utilize the switching channels of both systems simultaneously, ensuring reliable power supply.

[0232] In this embodiment, a corresponding power switching scheme was developed by analyzing the power supply requirements of the downhole instruments. Based on the different electrical systems of single-processor and dual-processor systems, a switching control scheme for command mode and automatic mode was configured, and communication, storage, and data synchronization rules were determined. Specific implementation schemes for synchronous and independent operation of the single-processor and dual-processor systems were also developed. These schemes ensured the switching of multiple power supplies and the monitoring of power parameters, ultimately guaranteeing a stable and reliable power supply for the downhole instruments.

[0233] Optionally, the two switching systems can adopt a master-slave control mode or a parallel control mode.

[0234] In other words, the two switching systems can adopt either a master-slave control mode or a parallel control mode.

[0235] When using master-slave control mode, switching system A is the master system and switching system B is the slave system; or, switching system A is the master system and switching system B is the slave system. When using parallel control, there is no master-slave relationship between switching system A and switching system B, and the host computer can control switching system A or switching system B to perform switching actions.

[0236] Optionally, when the two switching systems adopt a master-slave control mode, the first switching system is initialized as the master system and the second switching system is the slave system, wherein the master system is used to execute the downhole power switching method; when the first switching system fails to work properly, the second switching system is set as the master system and the first switching system is set as the slave system.

[0237] In other words, one of the two switching systems can be selected as the master system and the other as the slave system. The master system is mainly used to execute the downhole power switching method provided in this application to realize the switching of power supply; while the slave system acts as a backup system to replace the master system when it cannot work properly, so as to realize the high stability operation of the downhole power switching circuit.

[0238] This application provides a hardware system design judgment method and a logic execution mode that complement the aforementioned hardware invention, jointly fulfilling the power supply switching and power monitoring requirements of downhole instruments. In the circuit system invention, two control methods are designed: a single-processor-based electrical system and a dual-processor-based electrical system. These respectively address the power supply requirements of low-power instruments and high-current, high-power, and high-reliability downhole instruments, while simultaneously enabling the monitoring of voltage, current, and power.

[0239] Optionally, it may also include: transferring the operating parameters of the storage switching system to the storage module;

[0240] The operating parameters include: the input voltage of each switching branch of the switching module, the output current of the switching module, the target electrical parameters of the power supply, and the operating status of each switching branch.

[0241] Before acquiring the input voltage of each switching branch of the switching module, the following is also included:

[0242] After the system is switched on, the operating parameters stored in the storage module are read.

[0243] It should be noted that, as Figure 15 The process of parameter measurement and storage in single-processor and dual-processor systems is illustrated below:

[0244] The operation of the parameter measurement and storage module is strictly time-controlled. Whenever a time node arrives, the system reads real-time data from the analog-to-digital converter via the SPI port. Depending on the system's measurement requirements, the system typically measures the supply voltage values ​​of three power supply channels and the current values ​​during instrument operation. This raw data is then read into system memory and converted into engineering values.

[0245] During this process, the current parameters are accumulated over time to calculate the cumulative power consumption. After this calculation, the system writes the converted power consumption value into the storage unit. This completes the task of storing the power consumption parameters for one time cycle.

[0246] It is worth noting that this process is followed in both single-processor and dual-processor systems during parameter measurement and storage. In dual-processor systems, data synchronization and interaction between the two systems may also need to be considered to ensure data accuracy and consistency.

[0247] It should be noted that two control methods of electrical systems were designed in the downhole power switching circuit: a single-processor-based electrical system and a dual-processor-based electrical system. These systems respectively address the power supply needs of low-power instruments and the power supply needs of downhole instruments with high current, high power consumption, and high reliability, while simultaneously monitoring voltage, current, and power consumption.

[0248] For two types of circuit systems, this downhole power switching method was designed to determine the configuration scheme of the specific implementation process of power management, decide whether to use a single-processor or dual-processor electrical system, and decide whether to choose software configuration switching or automatic switching control, etc.

[0249] Specific execution modes were developed for single-processor and dual-processor electrical systems. Specific implementation logic was developed for functions such as measurement and storage of parameters such as voltage, current, and power, switching control of multiple power supplies, and communication implementation. Implementation measures for data exchange after adding signal synchronization function to the dual-processor electrical system were also developed.

[0250] For the parameter measurement and storage function in electrical systems, an implementation method for the functional steps is formulated to complete the parameter acquisition function.

[0251] For the control logic functions in the electrical system, the implementation methods of the functional steps are formulated to complete the switching function of multiple power supplies.

[0252] It should be noted that, as Figure 12 As shown, before officially entering parameter acquisition and power switching, the corresponding hardware and software can be configured, specifically:

[0253] First, a thorough analysis of the power consumption requirements of the downhole instruments is necessary to determine the specific configuration of the downhole power switching circuit. This involves deciding whether to use a single-processor or dual-processor electrical system, and whether to implement a software-configured switching or an automatic switching control scheme.

[0254] The purpose of this step is to select the hardware: whether to choose a single-processor or dual-processor system. Secondly, it is crucial to clarify the power supply requirements of the downhole instruments. The operating mode of the power management system will be set according to these requirements, determining whether to use a 2- or 3-group power supply scheme. Simultaneously, the connection methods for different power sources (such as cable power, battery power, or downhole generator) and their specific ports connected to the system must be specified. Furthermore, power switching control will employ either a command input mode or an automatic control mode. The command input mode depends on the configuration of the surface software, while the automatic control mode automatically adjusts based on changes in the supply voltage and power limit requirements.

[0255] The purpose of this step is to determine the processor's operating mode: whether to switch by command word or automatically.

[0256] Next, based on the established operating mode, rules for communication, storage, and data synchronization are formulated. For single-processor electrical systems, since there is no need for parallel processing, synchronization functionality is unnecessary. However, for dual-processor systems, synchronous processing is required to ensure that the two independent processor systems can work in a coordinated manner, achieving redundancy and backup.

[0257] The purpose of this step is to determine the communication rules. Specifically, when the mode is command-word switching, the communication rules need to be determined; when the mode is automatic switching, the two processors need synchronization rules. The purpose of storage is to record battery power. Both processors in a dual-processor system have battery power storage modules, and the two processors need to be synchronized, which requires configuring synchronization rules.

[0258] Finally, the specific implementation plan for whether the single-processor system and the dual-processor system can operate synchronously or independently will be determined. This step will decide whether the single-processor system should execute automatic mode, and whether the dual-processor system should adopt automatic modes such as master-slave or parallel mode.

[0259] The purpose of this step is to establish operating rules: a single processor will certainly run independently. A dual-processor system, equivalent to two independent processing systems, will have a master-slave relationship, requiring information synchronization between the two systems. This involves enabling the two systems to exchange states, ensuring each knows the other's progress and status.

[0260] The following explains the specific working processes of single-processor and dual-processor systems:

[0261] (1) Single-processor system.

[0262] like Figure 2 As shown, this illustrates the hardware configuration of a single-processor system, consisting of specific modules such as voltage acquisition, current acquisition, communication, storage, interlock control, and three-way switching. The processor is programmed to acquire power supply current parameters, stores the calculated power parameters in real time, and is equipped with communication interfaces (such as RS-485 and CAN). An interlock circuit is added to ensure that only one of the three control levels is valid at a time, ultimately enabling only one power supply to operate, thus ensuring the stability of the switching process.

[0263] like Figure 13 As shown, a single-processor electrical system initially reads configuration parameters from the memory unit to initialize the system. The system execution then mainly consists of two steps:

[0264] The system activates a time-cycle mechanism, which begins measuring voltage, current, and electrical quantity once the preset measurement time node is reached. Subsequently, at the storage time node, this voltage, current, and electrical quantity information is recorded in the storage unit. The processor then determines the switching conditions based on the acquired voltage, current, and other parameters. Once the specific conditions are met, the power supply switching operation is executed.

[0265] In addition, the switching system also activates the communication function detection module, which acts as a slave device, responsible for listening for command words (instructions) from the host (master computer). After system initialization, the communication flag is first reset to indicate that no instructions have been received from the host. Once a command word is received from the host and conforms to the communication protocol (i.e., the command is valid), the communication flag is set, and the required data is transmitted back as requested. If the command word is invalid, no data is transmitted back. After this process is completed, the communication flag is reset again, and the system enters the next loop, ready to receive new data.

[0266] (2) Dual-processor system.

[0267] like Figure 4 The diagram illustrates the hardware configuration of the dual-processor system. Two processors with different operating modes—FPGA and microcontroller—are used to construct the main power monitoring and switching system and the slave power monitoring system. The FPGA, a time-sensitive processor with parallel processing capabilities, is used to build the main system. The microcontroller, following a serial execution mode, is used to build the slave system. To prevent execution errors in the control flow, a dual-core control mode is implemented. These two processors have different architectures. This design ensures that at least one system can maintain normal function during power supply to the logging instrument. The interlocking control, parameter monitoring, data storage, and communication functions in the main and slave systems are consistent with the single-processor solution. To enhance system synergy, a synchronization interface is added, enabling the main and slave systems to perform handshakes, logic configuration exchanges, operational status communication, and measurement parameter sharing, thereby ensuring real-time synchronous operation of the two systems.

[0268] The operation of a dual-processor system comprises three core components: communication, storage, and control. The execution rules for these components are consistent with those of a single-processor system. However, dual-processor systems also add a synchronization module to enhance their performance.

[0269] Once the system activates the time-based timing mechanism, it will synchronize the current processor status information, switching status, and power parameters with the other system at preset synchronization timing points. This mechanism ensures that the power parameters of the two systems remain consistent within a specific time period and that they can exchange operating status information between the master and slave electrical systems in real time. In this way, the system can maintain a high degree of coordination and consistency.

[0270] Figure 14 A detailed description based on Figure 4 The diagram illustrates the logical execution mode and specific steps of the hardware. Although FPGA and microcontroller electrical systems differ in their later development languages ​​and frameworks, their execution modes are essentially the same. Since these two processor systems operate independently, a synchronization function is added to the single-processor mode to accommodate the needs of a dual-processor system.

[0271] Once the system activates the timing mechanism, each processor synchronizes its current status, switching status, and power parameters to the other system when a preset synchronization time is reached. This synchronization mechanism ensures that the power parameters of the two systems remain consistent within a specific time period and that the status information of the master and slave electrical systems can be exchanged in a timely manner.

[0272] Taking the main system FPGA as an example, it is equipped with a timer. When the timer reaches a specific time (such as 1 second), the FPGA will send the data in its own memory (including power value, time value, control status, and current parameters, etc.) to another system. Similarly, when the microcontroller system reaches the corresponding time point (although it may not be exactly the same as the FPGA's time, for example, it may also be 1 second), it will also send the parameters in its memory to the FPGA's memory.

[0273] The purpose of this data exchange is to synchronize power parameters and ultimately select the maximum value from both systems as the final value for storage. After the system is powered on, both processors will begin running. When using a lithium battery as the power source, because lithium batteries have a fixed capacity, they need to be replaced when the power is depleted (for disposable batteries).

[0274] The synchronization time node and the storage time node can be the same or different. The synchronization time node is the moment when the memory of the two processors is coordinated; the storage time node is the moment when the parameters are written to the storage chip.

[0275] These two nodes are generally any value between 1 and 10 seconds, for example, a typical value of 1 second, which will not be elaborated on here.

[0276] The features described in the various embodiments of this specification can be substituted for or combined with each other. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for system or system embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The systems and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0277] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0278] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A downhole power switching circuit, characterized in that, include: At least one switching system; The switching system includes a processing module and a switching module; the switching module includes an LTC4417 chip and three switching branches. Each of the three switch branches corresponds one-to-one with one of the three power supplies, and the input terminal of each switch branch is connected to its corresponding power supply; the output terminals of each switch branch are connected, and the connection point serves as the output terminal of the downhole power switching circuit; the three output terminals of the LTC4417 chip correspond one-to-one with the three switch branches; each output terminal of the LTC4417 chip is connected to the control terminal of its corresponding switch branch; the three DC pins of the LTC4417 chip correspond one-to-one with the three power supplies; and each DC pin of the LTC4417 chip is connected to its corresponding power supply. The processing module includes: a processor and a voltage and current acquisition module; The processor acquires the input voltage of each of the switching branches and the output current of the switching module through the voltage and current acquisition module; the LTC4417 chip is controlled by the processor; The processor is used to determine the power level of each power supply based on the input voltage of each switch branch and the output current of the switching module, and to control the on / off state of each switch branch through the LTC4417 chip based on the power level of each power supply.

2. The downhole power switching circuit according to claim 1, characterized in that, The processing module further includes: an interlock circuit; The interlock circuit is located between the LTC4417 chip and the processor.

3. The downhole power switching circuit according to claim 1, characterized in that, The processing module further includes: a storage module; The storage module is used to store the processing data of the processor.

4. The downhole power switching circuit according to claim 1, characterized in that, The number of switching systems is one or two.

5. The downhole power switching circuit according to claim 1, characterized in that, When there are at least two switching systems, the processing modules synchronize data through a synchronization interface.

6. The downhole power switching circuit according to claim 1, characterized in that, When there are two switching systems, the processor in one switching system is an FPGA; the processor in the other switching system is a microcontroller.

7. The downhole power switching circuit according to claim 1, characterized in that, The voltage and current acquisition module includes: a current acquisition module and three voltage acquisition modules; The three voltage acquisition modules correspond one-to-one with the three switch branches; Each of the voltage acquisition modules is located between its corresponding switch branch and the corresponding power supply; The current acquisition module is located between the switching module and the downhole instrument.

8. The downhole power switching circuit according to claim 7, characterized in that, The voltage acquisition module includes: a first resistor, a second resistor, a first diode, a first operational amplifier, and a first AD converter; One end of the first resistor is connected to the power supply corresponding to the voltage acquisition module; The other end of the first resistor is grounded through the second resistor; The connection point between the second resistor and the first resistor is connected to the input terminal of the first operational amplifier and the cathode of the first diode, respectively. The anode of the first diode is grounded; The output terminal of the first operational amplifier is connected to the input terminal of the first AD converter; The output terminal of the first AD converter serves as the output terminal of the voltage acquisition module.

9. The downhole power switching circuit according to claim 7, characterized in that, The current acquisition module includes: a third resistor, a second diode, a third diode, a second operational amplifier, a third operational amplifier, and a second AD converter; One end of the third resistor is connected to the cathode of the second diode and the input terminal of the second operational amplifier, respectively, and the connection point serves as the input terminal of the current acquisition module. The other end of the third resistor is connected to the cathode of the third diode and the input terminal of the third operational amplifier, respectively, and the connection point is grounded; The output terminals of the second operational amplifier and the third operational amplifier are connected, and the connection point is connected to the input terminal of the second AD converter; The output terminal of the second AD converter serves as the output terminal of the current acquisition module; The anodes of the second diode and the third diode are grounded.

10. The downhole power switching circuit according to claim 9, characterized in that, When there are two switching systems, the downhole power switching circuit has two current acquisition modules; the third resistors of the two current acquisition modules are connected in series.