Power switching circuit, integrated circuit chip and encoder
The power supply circuit and detection circuit formed by the PMOS tube realize seamless power switching of the multi-turn encoder, solving the problem of unstable power switching when the battery voltage is lower than the threshold, extending the battery life and improving the battery energy utilization rate.
Patent Information
- Application Number
- CN202510125779.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-26
- Publication Date
- 2025-05-06
AI Technical Summary
When the existing multi-turn encoder is switched, when the battery voltage is below a certain threshold, the low dropout linear voltage regulator cannot provide a stable voltage, resulting in underutilization of the battery capacity and shortening the battery life.
The power supply circuit and detection circuit composed of PMOS tubes can realize seamless switching by detecting the voltage difference between the main power supply and the battery power supply, ensuring that the voltage at the power supply output terminal is always greater than or equal to the battery voltage, avoiding voltage drop, and improving battery energy utilization.
It extends the battery life, ensures that a stable power supply can be provided when the battery voltage is below the threshold, and improves the utilization of battery energy.
Smart Images

Figure CN119944932A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of encoders, and in particular to a power switching circuit, an integrated circuit chip and an encoder. Background Art
[0002] Multi-turn encoders require a continuous and stable power supply to record and maintain data such as rotational position and number of turns. To prevent data loss due to power outages, multi-turn encoders are usually equipped with a backup battery. When the main power voltage drops below a certain threshold, the backup battery is enabled to ensure that the microcontroller unit (MCU) in the multi-turn encoder obtains a stable voltage. Therefore, in the application of multi-turn encoders, it is crucial to achieve seamless switching between the main power supply and the battery power supply.
[0003] In the related art, the power supply switching circuit includes a first diode and a second diode. The anode of the first diode is used as the first power supply input terminal of the power supply switching circuit and is connected to the main power supply. The anode of the second diode is used as the second power supply input terminal of the power supply switching circuit and is connected to the battery power supply. After the cathode of the first diode and the cathode of the second diode are connected together, they are connected to a low dropout regulator (LDO) as the output terminal of the power supply switching circuit. The LDO is used to provide a stable voltage to the MCU. When the main power voltage is higher than the battery voltage, the power supply is switched to the main power supply; when the main power voltage is lower than the battery voltage, the power supply is switched to the battery power supply.
[0004] However, when powered by a battery, if the battery voltage is lower than a certain threshold, the LDO cannot provide a stable voltage. In order to ensure that the LDO provides a stable voltage, the battery power source needs to be replaced, resulting in insufficient utilization of the battery power, thereby shortening the effective service life of the battery. Summary of the invention
[0005] The power switching circuit, integrated circuit chip and encoder provided in the present application are used to fully utilize the battery power and extend the effective service life of the battery.
[0006] In a first aspect, the present application provides a power switching circuit, comprising: a switching control circuit and a detection circuit and a power supply circuit connected to the switching control circuit; wherein:
[0007] The power supply circuit includes a first PMOS tube and a second PMOS tube, the source of the first PMOS tube serves as a first input end of the power supply circuit, and is used to be connected to a main power supply; the gate of the first PMOS tube serves as a second input end of the power supply circuit, and is used to be connected to an output end of a switching control circuit; the drain of the first PMOS tube serves as a power supply output end of a power switching circuit, and is used to be connected to an encoder; the source of the second PMOS tube serves as a third input end of the power supply circuit, and is used to be connected to a battery power supply; the gate of the second PMOS tube serves as a fourth input end of the power supply circuit, and is used to be connected to a first input end of the switching control circuit; the drain of the second PMOS tube serves as a power supply output end of the power switching circuit, and is used to be connected to an encoder;
[0008] The detection circuit is used to output a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply; and output a low level when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply;
[0009] The switching control circuit is used to control the first PMOS tube in the power supply circuit to be turned on when the input is a high level, so as to power the connected encoder through the main power supply; when the input is a low level, control the second PMOS tube in the power supply circuit to be turned on, so as to power the connected encoder through the main power supply.
[0010] In a possible implementation, the detection circuit includes a comparator, a first voltage-dividing resistor, a second voltage-dividing resistor, a current-limiting resistor, a voltage-stabilizing diode, and a pull-up resistor, wherein:
[0011] The first end of the current limiting resistor is used as the first input end of the detection circuit and is used to be connected to the main power supply. The second end of the current limiting resistor and the negative end of the voltage zener diode are connected together and then connected to the negative input end of the comparator. The positive end of the voltage zener diode is grounded.
[0012] The first end of the first voltage-dividing resistor is used as the second input end of the detection circuit, and is used to be connected to the main power supply. The second end of the first voltage-dividing resistor and the second end of the second voltage-dividing resistor are connected together and then connected to the positive input end of the comparator. The first end of the second voltage-dividing resistor is grounded.
[0013] The output end of the comparator serves as the output end of the detection circuit, the output end of the comparator is also connected to the first end of the pull-up resistor, and the second end of the pull-up resistor serves as the third input end of the detection circuit, which is used to be connected to the main power supply;
[0014] The comparator is used for outputting a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply, and outputting a low level when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply.
[0015] In a possible implementation, the detection circuit includes a first input terminal, a second input terminal, a third input terminal and an output terminal, the first input terminal, the second input terminal and the third input terminal are all used to connect to the main power supply, and the output terminal is respectively connected to the first input terminal of the switching control circuit and the fourth input terminal of the power supply circuit;
[0016] The switching control circuit also includes a second input terminal, which is used to connect to the main power supply.
[0017] In a possible implementation manner, the resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor are both determined according to the voltage at the common terminal of the current-limiting resistor and the voltage-stabilizing diode, and the battery voltage.
[0018] In a possible implementation manner, the resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor satisfy the following formula:
[0019] V b / V1 -1= R1 / R2
[0020] Among them, V b represents the battery voltage of the battery power source, V1 represents the common terminal voltage of the current limiting resistor and the voltage-regulating diode, R1 represents the resistance value of the first voltage-dividing resistor, and R2 represents the resistance value of the second voltage-dividing resistor.
[0021] In a possible implementation, the switching control circuit includes a first switch tube and a second switch tube, wherein:
[0022] The input end of the first switch tube serves as the second input end of the switching control circuit and is used to be connected to the main power supply;
[0023] The input end of the second switch tube is grounded;
[0024] The controlled end of the first switch tube and the controlled end of the second switch tube are commonly connected, and the commonly connected end serves as the first input end of the switching control circuit;
[0025] The output end of the first switch tube is connected to the output end of the second switch tube, and the common end serves as the output end of the switching control circuit;
[0026] The first switch tube is turned on when the input is at a low level, and the second switch tube is turned on when the input is at a high level.
[0027] In a possible implementation manner, the first switch tube is a PMOS tube, and the second switch tube is an NMOS tube.
[0028] In a possible implementation, the power supply circuit further includes a third PMOS transistor, a fourth PMOS transistor, a first resistor, and a second resistor, wherein:
[0029] The gate of the third PMOS tube, the gate of the first PMOS tube and the first end of the first resistor are connected together, and the common end serves as the second input end of the power supply circuit. The drain of the third PMOS tube is connected to the drain of the second PMOS tube. The source of the third PMOS tube serves as the power supply output end of the power switching circuit, which is used to be connected to the encoder. The second end of the first resistor is connected together with the source of the first PMOS tube, and the common end serves as the first input end of the power supply circuit, which is used to be connected to the main power supply.
[0030] The gate of the fourth PMOS tube, the gate of the second PMOS tube and the first end of the second resistor are connected together, and the common end serves as the fourth input end of the power supply circuit. The drain of the fourth PMOS tube is connected to the drain of the second PMOS tube. The source of the fourth PMOS tube serves as the power supply output end of the power switching circuit and is used to be connected to the encoder. The second end of the second resistor and the source of the second PMOS tube are connected together, and the common end serves as the third input end of the power supply circuit and is used to be connected to the battery power supply.
[0031] In a second aspect, the present application provides an integrated circuit chip, comprising a power switching circuit as described in any one of the first aspects.
[0032] In a third aspect, the present application provides an encoder, which includes a power switching circuit as in any one of the first aspect, or, the encoder includes an integrated circuit chip as in the second aspect.
[0033] The power switching circuit, integrated circuit chip and encoder provided by the present application include: a switching control circuit and a detection circuit and a power supply circuit connected to the switching control circuit; wherein the power supply circuit includes a first PMOS tube and a second PMOS tube, the source of the first PMOS tube serves as the first input end of the power supply circuit for connecting to the main power supply, the gate of the first PMOS tube serves as the second input end of the power supply circuit for connecting to the output end of the switching control circuit, and the drain of the first PMOS tube serves as the power supply output end of the power switching circuit for connecting to the encoder; the source of the second PMOS tube serves as the third input end of the power supply circuit for connecting to the battery power supply, and the gate of the second PMOS tube serves as the third input end of the power supply circuit for connecting to the battery power supply, and the gate of the second PMOS tube serves as the third input end of the power supply circuit for connecting to the battery power supply. As the fourth input terminal of the power supply circuit, it is used to be connected to the first input terminal of the switching control circuit. The drain of the second PMOS tube serves as the power supply output terminal of the power switching circuit and is used to be connected to the encoder. The detection circuit is used to output a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply; when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply, it outputs a low level. The switching control circuit is used to control the first PMOS tube in the power supply circuit to be turned on when the input is a high level, so as to power the connected encoder through the main power supply; when the input is a low level, control the second PMOS tube in the power supply circuit to be turned on, so as to power the connected encoder through the main power supply. The detection circuit in the present application outputs a high level when it is detected that the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply, and the switching control circuit controls the first PMOS tube in the power supply circuit to be turned on under the action of the high level, and the main power supply is used as the power supply of the encoder; when it is detected that the power supply voltage of the main power supply is less than the battery voltage of the battery power supply, the switching control circuit outputs a low level, and the switching control circuit controls the second PMOS tube in the power supply circuit to be turned on under the action of the low level, and the battery power is used as the power supply of the encoder, thereby realizing seamless switching between the main power supply and the battery power supply. In addition, when the PMOS tube is turned on, the voltage drop between the source and the drain is very small and can be ignored, so that the voltage output by the power supply switching circuit through the power supply output terminal is always greater than or equal to the battery voltage, ensuring that as long as the battery voltage of the battery power supply is greater than or equal to the stable voltage requirement value, the power switching circuit can provide a stable voltage to the outside, improve the utilization rate of the battery energy, and thus extend the service life of the battery. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] Figure 1 A schematic diagram of the structure of a power supply switching circuit in the related art Figure 1 ;
[0036] Figure 2 A schematic diagram of the structure of a power supply switching circuit in the related art Figure 2 ;
[0037] Figure 3 A schematic diagram of the structure of the power switching circuit provided in the embodiment of the present application Figure 1 ;
[0038] Figure 4 A schematic diagram of the structure of the power switching circuit provided in the embodiment of the present application Figure 2 ;
[0039] Figure 5 As shown in the schematic diagram of the structure of the integrated circuit chip provided in the embodiment of the present application;
[0040] Figure 6 A block diagram of the power seamless switching function provided in an embodiment of the present application.
[0041] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0042] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0043] Figure 1 A schematic diagram of the structure of a power supply switching circuit in the related art Figure 1 , Figure 2 A schematic diagram of the structure of a power supply switching circuit in the related art Figure 2 Currently, the seamless switching between the main power supply and battery power supply of multi-turn encoders is mostly Figure 1 and Figure 2 As shown. Figure 1 and Figure 2 As shown, V m Indicates the main power supply voltage, V b Indicates the battery voltage of the battery power supply, V in Represents the output voltage of the power supply switching circuit, V in As the input voltage of LDO, D1, D2, and D3 are all diodes. The voltage drop of diodes is usually 0.2V~1.5V. Assume that LDO needs to output 3.3V to the outside.
[0044] See also Figure 1When powered by a battery, D2 generates a voltage drop on the battery voltage. Assuming that V b When the voltage drop of the diode is lower than 3.5V, the minimum voltage drop is 0.2V. in Lower than 3.3V, the LDO cannot stably output 3.3V. Therefore, V b The voltage must be greater than 3.5V so that the LDO can output 3.3V stably. b When it is lower than 3.5V, a new battery power supply needs to be replaced to ensure that the LDO provides a stable 3.3V voltage to the outside. At this time, there is still a certain amount of battery power remaining, which causes the battery power to be not fully utilized and shortens the effective service life of the battery.
[0045] See Figure 2, Q1 is a PMOS tube. When the main power supply is used, the PMOS tube Q1 is not conducting, V b Transmitted to V through the parasitic diode of PMOS tube Q1 in Assume that the voltage drop of the diode is 0.2V, V b is 3.6V, then when V m When V is greater than 3.6V, in Equal to V m Subtract 0.2V, which is V in Greater than 3.4V; when V m When it is lower than 3.6V, the battery is used for power supply. It is necessary to further determine whether the PMOS tube Q1 is turned on. The turn-on condition of the PMOS tube Q1 is the voltage value V between the gate and the source. gs Less than the threshold V th , threshold V th Generally less than -0.4V. Here we take -0.4V as an example, including two cases: First, when V m When the V of PMOS tube Q1 is greater than 3V and less than 3.6V, gs Greater than -0.4V, Q1 is not conducting, V in Equal to V b Subtract 0.2V, which is V in =3.4V; In the second case, when V m When the V of PMOS tube Q1 is less than 3V, gs Less than -0.4V, PMOS tube Q1 is turned on, V in Equal to V b , that is, V in is equal to 3.6V. Therefore, at V m When V is greater than 3V and less than 3.6V, in Minimum, if V in When the voltage is lower than 3.3V, the LDO cannot stably output 3.3V. To ensure that the LDO can stably output 3.3V, V b Greater than 3.5V. Similarly, at V bWhen it is lower than 3.5V, a new battery power supply needs to be replaced to ensure that the LDO provides a stable 3.3V voltage to the outside. At this time, there is still a certain amount of battery power remaining, which causes the battery power to be not fully utilized and shortens the effective service life of the battery.
[0046] That is to say, in the related art Figure 1 and Figure 2 The power supply switching circuit will produce a voltage drop (diode voltage drop, or parasitic diode voltage drop) when the output voltage is supplied by a battery power supply, which will cause the battery power to not be fully utilized and shorten the effective service life of the battery.
[0047] In view of the problems existing in the related art, the present application proposes a power switching circuit, including a switching control circuit and a detection circuit and a power supply circuit connected to the switching control circuit. When the detection circuit detects that the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply, the detection circuit outputs a high level. Under the action of the high level, the switching control circuit controls the first PMOS tube in the power supply circuit to be turned on, and the main power supply is used as the power supply of the encoder. When the power supply voltage of the main power supply is detected to be less than the battery voltage of the battery power supply, the switching control circuit outputs a low level. Under the action of the low level, the switching control circuit controls the second PMOS tube in the power supply circuit to be turned on, and the battery power supply is used as the power supply of the encoder, thereby realizing seamless switching between the main power supply and the battery power supply. In addition, when the PMOS tube is turned on, the voltage drop between the source and the drain is very small and can be ignored, so that the voltage output by the power supply switching circuit through the power supply output terminal is always greater than or equal to the battery voltage, ensuring that as long as the battery voltage of the battery power supply is greater than or equal to the stable voltage requirement value, the power switching circuit can provide a stable voltage to the outside, improve the utilization rate of the battery energy, and thus extend the service life of the battery.
[0048] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0049] Figure 3 A schematic diagram of the structure of the power switching circuit provided in the embodiment of the present application Figure 1 ,like Figure 3 As shown, the power switching circuit 30 provided in the embodiment of the present application includes a switching control circuit 31 and a detection circuit 32 and a power supply circuit 33 connected to the switching control circuit 31; wherein,
[0050] The power supply circuit 33 includes a first PMOS tube Q2 and a second PMOS tube Q3. The source of the first PMOS tube Q2 serves as the first input end of the power supply circuit, which is used to be connected to the main power supply. The gate of the first PMOS tube Q2 serves as the second input end of the power supply circuit, which is used to be connected to the output end of the switching control circuit. The drain of the first PMOS tube Q2 serves as the power supply output end of the power switching circuit, which is used to be connected to the encoder. The source of the second PMOS tube Q3 serves as the third input end of the power supply circuit, which is used to be connected to the battery power supply. The gate of the second PMOS tube Q3 serves as the fourth input end of the power supply circuit, which is used to be connected to the first input end of the switching control circuit. The drain of the second PMOS tube Q3 serves as the power supply output end of the power switching circuit 30, which is used to be connected to the encoder.
[0051] The detection circuit 32 is used to output a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply; and to output a low level when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply.
[0052] The switching control circuit 31 is used to control the first PMOS tube Q2 in the power supply circuit 33 to be turned on when the input is a high level, so as to power the connected encoder through the main power supply; when the input is a low level, control the second PMOS tube Q3 in the power supply circuit 33 to be turned on, so as to power the connected encoder through the main power supply.
[0053] For example, the power supply voltage range of the main power supply is 0V~5V, the battery power supply is a lithium battery, and the battery voltage is 3.6V. The power supply voltage of the main power supply may be lower or higher than the battery voltage during fluctuation. When the power supply voltage is greater than or equal to 3.6V, the detection circuit outputs a high level (logic 1, or a specific voltage value). When the power supply voltage is less than 3.6V, the detection circuit outputs a low level (logic 0).
[0054] When the PMOS tube in the power supply circuit is turned on, the voltage drop is very small and can be ignored. When the first PMOS tube Q2 in the power supply circuit is turned on, it can be regarded as taking the power supply voltage of the main power supply as the output voltage of the power supply output end; when the second PMOS tube Q3 in the power supply circuit is turned on, it can be regarded as taking the battery voltage of the battery power supply as the output voltage of the power supply output end. Therefore, no matter whether the power switching circuit selects the main power supply or the battery power supply (no matter how the size of the main power supply changes), the output voltage of the power supply output end is greater than or equal to the battery voltage.
[0055] In one example, the output voltage of the power supply output terminal is used as the input voltage of the LDO, and the LDO is a chip in the encoder, such as an MCU, that provides voltage. It should be noted that the power switching circuit and the LDO are both integrated on the chip in the encoder, so it can be simplified to express that the power supply output terminal is connected to the encoder. That is, the connected encoder is powered by the main power supply or battery power supply.
[0056] Assuming that the LDO needs to provide a 3.3V voltage to the MCU, the voltage output by the power switching circuit through the power supply output terminal must be greater than or equal to 3.3V to satisfy the LDO's ability to provide 3.3V to the outside. Based on the structure of the power switching circuit of the embodiment of the present application, it can be seen that the output voltage of the power supply output terminal is greater than or equal to the battery voltage. Therefore, the battery voltage can be as low as 3.3V. Compared with the related art, if the LDO needs to provide a 3.3V voltage to the outside, the battery voltage must be greater than 3.5V. The power switching circuit provided in the embodiment of the present application has a voltage drop of almost 0 when it is turned on, which can be ignored, allowing the battery to be used at a lower power level, thereby extending the battery life.
[0057] In summary, in the embodiment of the present application, the detection circuit outputs a high level when it detects that the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply, and the switching control circuit controls the first PMOS tube in the power supply circuit to be turned on under the action of the high level, and uses the main power supply as the power supply of the encoder, and outputs a low level when it detects that the power supply voltage of the main power supply is less than the battery voltage of the battery power supply, and the switching control circuit controls the second PMOS tube in the power supply circuit to be turned on under the action of the low level, and uses the battery power supply as the power supply of the encoder, thereby realizing seamless switching between the main power supply and the battery power supply. In addition, when the PMOS tube in the power supply circuit is turned on, the voltage drop between the source and the drain is very small and can be ignored, so that the output voltage of the power supply output end of the power switching circuit is always greater than or equal to the battery voltage, ensuring that as long as the battery voltage of the battery power supply is greater than or equal to the stable voltage requirement value, the power switching circuit can provide a stable voltage to the outside, improve the utilization rate of the battery energy, and thus extend the service life of the battery.
[0058] Optionally, the detection circuit 32 includes a first input terminal, a second input terminal, a third input terminal and an output terminal, the first input terminal, the second input terminal and the third input terminal are all used to connect to the main power supply, and the output terminal is respectively connected to the first input terminal of the switching control circuit 31 and the first input terminal of the power supply circuit 33; the switching control circuit 31 also includes a second input terminal and an output terminal, the second input terminal is used to connect to the main power supply, and the output terminal is connected to the second input terminal of the power supply circuit 33.
[0059] Combine the following Figure 4 The specific structure of the power switching circuit is described in detail.
[0060] Figure 4 A schematic diagram of the structure of the power switching circuit provided in the embodiment of the present application Figure 2 ,like Figure 4 As shown, the detection circuit 32 includes a comparator U1, a first voltage-dividing resistor R1, a second voltage-dividing resistor R2, a current-limiting resistor R3, a voltage-stabilizing diode D4 and a pull-up resistor R4, wherein:
[0061] The first end of the current limiting resistor R3 serves as the first input end of the detection circuit 32, and is used to be connected to the main power supply. The second end of the current limiting resistor R3 and the negative end of the voltage-stabilizing diode D4 are connected together and then connected to the negative input end of the comparator U1, and the positive end of the voltage-stabilizing diode D4 is grounded. The first end of the first voltage-dividing resistor R1 serves as the second input end of the detection circuit 32, and is used to be connected to the main power supply. The second end of the first voltage-dividing resistor R1 and the second end of the second voltage-dividing resistor R2 are connected together and then connected to the positive input end of the comparator U1, and the first end of the second voltage-dividing resistor R2 is grounded. The output end of the comparator U1 serves as the output end of the detection circuit 32, and the output end of the comparator U1 is also connected to the first end of the pull-up resistor R4. The second end of the pull-up resistor R4 serves as the third input end of the detection circuit 32, and is used to be connected to the main power supply. The comparator U1 is used to detect the power supply voltage V m Greater than or equal to the battery voltage V of the battery power supply b When the output is high, the main power supply voltage V m Less than the battery voltage V of the battery power supply b When , the output is low level.
[0062] For example, Figure 4 The main power supply can be simplified as V m , the battery power can be simplified to V b , V cb is the output voltage of the comparator.
[0063] The positive pole of the comparator power supply is connected to the main power supply, and the negative pole of the power supply is grounded, thereby powering the comparator. The pull-up resistor ensures that when the comparator outputs a high level, V cb =V m The current limiting resistor ensures the stability of the negative terminal voltage V1 of the voltage zener diode D4. In the embodiment of the present application, the resistance value of the current limiting resistor and the resistance value of the pull-up resistor are not specifically limited. The current calculated according to the resistance value of the current limiting resistor is smaller than the limiting current of the voltage zener diode D4.
[0064] It can be understood that the voltage value V1 at the negative input terminal of the comparator is a fixed value, and the power supply voltage V m The voltage V2 is obtained by the voltage division of the first voltage-dividing resistor R1 and the second voltage-dividing resistor R2. The voltage V2 at the positive input of the comparator changes dynamically. m The relationship between V2 and V1 affects the output of the comparator. If the judgment of the size of V2 and V1 is converted into the judgment of V m and V b The resistance of the first voltage-dividing resistor R1 and the second voltage-dividing resistor R2 can be bOptionally, the resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor are both determined according to the voltage at the common terminal of the current-limiting resistor and the voltage-stabilizing diode, and the battery voltage.
[0065] For example, in order to m ≥V b When the comparator outputs a high level, V m <V b When the comparator outputs a low level, the critical value method (V m =V b , V2= V1) determines the resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor.
[0066] Optionally, the resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor satisfy the following formula:
[0067] V b / V1 -1= R1 / R2
[0068] Among them, V b represents the battery voltage of the battery power source, V1 represents the common terminal voltage of the current limiting resistor and the voltage-regulating diode, R1 represents the resistance value of the first voltage-dividing resistor, and R2 represents the resistance value of the second voltage-dividing resistor.
[0069] It should be noted that V in this formula b It is the initial battery voltage of the battery power supply. During the discharge process of the battery, the battery voltage gradually decreases.
[0070] V b For example, if V is 3.6V and V1 is 2.5V, R1 / R2=11 / 35, so R1=11Ω, R2=35Ω can be selected. If R1=11Ω, R2=35Ω, then V m ≥3.6, the comparator outputs a high level. m When <3.6, the comparator outputs a low level.
[0071] Optionally, the switching control circuit includes a first switch tube and a second switch tube, wherein: the input end of the first switch tube serves as the second input end of the switching control circuit, and is used to be connected to the main power supply; the input end of the second switch tube is grounded; the controlled end of the first switch tube is connected in common with the controlled end of the second switch tube, and the common end serves as the first input end of the switching control circuit; the output end of the first switch tube is connected in common with the output end of the second switch tube, and the common end serves as the output end of the switching control circuit; the first switch tube is turned on when the input is a low level, and the second switch tube is turned on when the input is a high level.
[0072] For example, the first switch tube and the second switch tube may both be field effect tubes. Optionally, the first switch tube is a PMOS tube, and the second switch tube is an NMOS tube.
[0073] like Figure 4 As shown, the switching control circuit 31 includes a PMOS transistor Q4 and an NMOS transistor Q5. The source of the PMOS transistor Q4 is connected to the main power supply, and the gate of the PMOS transistor Q4 is connected to the gate of the NMOS transistor Q5. The common terminal serves as the first input terminal of the switching control circuit 31 (which can be marked as V cb ), which is used to connect to the output terminal of the comparator U1, the drain of the PMOS tube Q4 and the drain of the NMOS tube Q5 are connected together, and the common terminal serves as the output terminal of the switching control circuit 31 (which can be marked as V cm ), the source of NMOS tube Q5 is grounded.
[0074] When the comparator outputs a low level, that is, Vcb=0, the voltage value V between the gate and source of the PMOS tube Q4 is gs2 =V m , PMOS tube Q4 is turned on, and the voltage value between the gate and source of NMOS tube Q5 is V gs3 =0V, NMOS tube Q5 is not conducting, so V cm =V m ; When the comparator outputs a high level, that is, V cb =V m , V of PMOS tube Q4 gs2 =0, PMOS tube Q4 is not conducting, and NMOS tube Q5’s V gs3 =-Vm, NMOS tube Q5 is turned on, so V cm =0.
[0075] Still Figure 4 As shown, when the battery power is used to power the encoder (V m <V b ), V in =V b , V in is the output voltage of the power supply circuit (the power supply output voltage of the power switching circuit), V in The parasitic diode of the first PMOS tube Q2 will be output to the main power supply. The main power supply (V m ) may have other loads that will drain the battery. Similarly, when the main power supply is powering the encoder, V in It will be output to the battery power supply (V b ), when V in -V db3 >V b When V in Short circuit with battery power will damage the device, V db3 is the voltage drop of the parasitic diode of the second PMOS tube Q3.
[0076] To avoid the above-mentioned in Backflow causes the problem of increased battery power consumption or short circuit, damaging the device; and, considering the stability of the working state of the first PMOS tube Q2 and the second PMOS tube Q3 in the power supply circuit, optionally, the power supply circuit also includes a third PMOS tube, a fourth PMOS tube, a first resistor and a second resistor, the gate of the third PMOS tube, the gate of the first PMOS tube and the first end of the first resistor are connected in common, and the common end serves as the second input end of the power supply circuit, the drain of the third PMOS tube is connected to the drain of the second PMOS tube, and the source of the third PMOS tube serves as the power supply output end of the power switching circuit for connecting to the encoder The first resistor and the second PMOS tube are connected in common, the second end of the first resistor and the source of the first PMOS tube are connected in common, and the common end is used as the first input end of the power supply circuit for connecting to the main power supply; the gate of the fourth PMOS tube, the gate of the second PMOS tube and the first end of the second resistor are connected in common, and the common end is used as the fourth input end of the power supply circuit, the drain of the fourth PMOS tube is connected to the drain of the second PMOS tube, and the source of the fourth PMOS tube is used as the power supply output end of the power switching circuit for connecting to the encoder, and the second end of the second resistor and the source of the second PMOS tube are connected in common, and the common end is used as the third input end of the power supply circuit for connecting to the battery power supply.
[0077] For example, see Figure 4 As shown, the power supply circuit 33 includes a third PMOS transistor Q6, a fourth PMOS transistor Q7, a first resistor R5 and a second resistor R6. The first resistor R5 can be understood as a pull-up resistor to prevent V cm It is in floating state, misleadingly turning on the first PMOS tube Q2 or the third PMOS tube Q6. The second resistor R6 can also be understood as a pull-up resistor to prevent V cb It is in a floating state, which misleads the second PMOS tube Q3 or the fourth PMOS tube Q7.
[0078] based on Figure 4 , the realization principle of the power supply circuit is explained. When V cb =0,V cm =V m When the V of PMOS tube Q3 gs3 =-V b , PMOS tube Q3 is turned on; at this time, the drain of PMOS tube Q7 V d7 =V b , the parasitic diode of PMOS tube Q7 works, and the source V s7 Equal to drain V d7 Subtract the parasitic diode voltage drop V db7 , that is, V of PMOS tube Q7 gs7 =-(V b -V db7), PMOS tube Q7 is turned on; V gs2 =V m -V cm =0, PMOS tube Q2 is not conducting; therefore, when V cb =0,V cm =V m When V in =V b .
[0079] When V cb =V m , V cm =0V, the V gs3 =V m -V b >0, PMOS tube Q3 is not conducting; V gs2 =-V m , PMOS tube Q2 is turned on; at this time, the drain of PMOS tube Q6 is V d6 =V m , the parasitic diode of PMOS tube Q6 works, and the source V s6 Equal to drain V d6 Subtract the parasitic diode voltage drop V db6 , that is, V of PMOS tube Q6 gs6 =-(V m -V db6 ), PMOS tube Q6 is turned on; therefore, when V cb =V m , V cm =0V, V in =V m .
[0080] It should be noted that in the power supply circuit, when the PMOS tube Q3 and the PMOS tube Q7 are turned on to provide voltage to the encoder, except that the two PMOS tubes Q3, Q7 and a second resistor R6 will consume very little current, other devices in the power supply circuit are in a closed or power-off state, and the power supply circuit basically consumes no battery power.
[0081] It can be seen that the power supply circuit in the embodiment of the present application is reasonably designed, saves power consumption, and further extends the service life of the battery.
[0082] The present application also provides an integrated circuit chip, such as Figure 5 As shown in the schematic diagram of the integrated circuit chip structure provided in the embodiment of the present application, the integrated circuit chip 50 includes the power switching circuit 51 provided in the above embodiment.
[0083] For example, the original chip (MPU) of the encoder is optimized and the power switching circuit is integrated into the original chip. Figure 6 As shown in the block diagram of the power seamless switching function provided in the embodiment of the present application, the power switching circuit introduces a voltage-dividing resistor, and the resistance value of the voltage-dividing resistor can be determined according to the specifications of the battery voltage. For details, see the description of the above embodiment, and the power switching circuit can dynamically select the main power supply or the battery power supply to power the back end according to the changes in the power supply voltage of the main power supply and the battery voltage of the battery power supply. The power supply output end of the power switching circuit serves as the input end of the LDO, and the power switching circuit selects the power supply voltage of the main power supply or the battery voltage of the battery power supply as the input of the LDO. The LDO outputs a stable voltage (for example, 3.3V) and provides it to the MPU for powering the original chip function.
[0084] An embodiment of the present application further provides an encoder, which includes the power switching circuit provided in the above embodiment, or the encoder includes the integrated circuit chip provided in the above embodiment.
[0085] Compared with the related art, in which the power switching circuit is arranged outside the encoder main control chip MPU, in the embodiment of the present application, the encoder includes an integrated circuit chip with an integrated power switching circuit (here, the integrated circuit chip can be an encoder main control chip MPU with an integrated power switching circuit), thereby reducing the encoder circuit board area and realizing a miniaturized encoder.
[0086] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A power switching circuit, characterized in that: include: A switching control circuit and a detection circuit and a power supply circuit connected to the switching control circuit; wherein, The power supply circuit includes a first PMOS tube and a second PMOS tube, the source of the first PMOS tube serves as a first input end of the power supply circuit, and is used to connect to a main power supply; the gate of the first PMOS tube serves as a second input end of the power supply circuit, and is used to connect to an output end of the switching control circuit; the drain of the first PMOS tube serves as a power supply output end of the power switching circuit, and is used to connect to an encoder; the source of the second PMOS tube serves as a third input end of the power supply circuit, and is used to connect to a battery power supply; the gate of the second PMOS tube serves as a fourth input end of the power supply circuit, and is used to connect to a first input end of the switching control circuit; the drain of the second PMOS tube serves as a power supply output end of the power switching circuit, and is used to connect to an encoder; The detection circuit is used to output a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply; and output a low level when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply; The switching control circuit is used to control the first PMOS tube in the power supply circuit to be turned on when the input is a high level, so as to power the connected encoder through the main power supply; and to control the second PMOS tube in the power supply circuit to be turned on when the input is a low level, so as to power the connected encoder through the main power supply.
2. The power switching circuit according to claim 1, characterized in that: The power supply circuit further includes a third PMOS transistor, a fourth PMOS transistor, a first resistor and a second resistor, wherein: The gate of the third PMOS tube, the gate of the first PMOS tube and the first end of the first resistor are connected in common, and the common end serves as the second input end of the power supply circuit; the drain of the third PMOS tube is connected to the drain of the second PMOS tube; the source of the third PMOS tube serves as the power supply output end of the power switching circuit, and is used to be connected to the encoder; the second end of the first resistor is connected in common to the source of the first PMOS tube, and the common end serves as the first input end of the power supply circuit, and is used to be connected to the main power supply; The gate of the fourth PMOS tube, the gate of the second PMOS tube and the first end of the second resistor are connected in common, and the common end serves as the fourth input end of the power supply circuit. The drain of the fourth PMOS tube is connected to the drain of the second PMOS tube. The source of the fourth PMOS tube serves as the power supply output end of the power switching circuit and is used to be connected to the encoder. The second end of the second resistor and the source of the second PMOS tube are connected in common, and the common end serves as the third input end of the power supply circuit and is used to be connected to the battery power supply.
3. The power switching circuit according to claim 2, characterized in that: The detection circuit comprises a first input terminal, a second input terminal, a third input terminal and an output terminal, wherein the first input terminal, the second input terminal and the third input terminal are all used to connect to the main power supply, and the output terminal is respectively connected to the first input terminal of the switching control circuit and the fourth input terminal of the power supply circuit; The switching control circuit further includes a second input terminal, and the second input terminal is used to be connected to the main power supply.
4. The power switching circuit according to any one of claims 1 to 3, characterized in that: The detection circuit includes a comparator, a first voltage-dividing resistor, a second voltage-dividing resistor, a current-limiting resistor, a voltage-stabilizing diode and a pull-up resistor, wherein: The first end of the current limiting resistor is used as the first input end of the detection circuit and is used to be connected to the main power supply. The second end of the current limiting resistor and the negative end of the voltage zener diode are connected together and then connected to the negative input end of the comparator. The positive end of the voltage zener diode is grounded. The first end of the first voltage-dividing resistor is used as the second input end of the detection circuit, and is used to be connected to the main power supply. The second end of the first voltage-dividing resistor and the second end of the second voltage-dividing resistor are connected together and then connected to the positive input end of the comparator. The first end of the second voltage-dividing resistor is grounded. The output end of the comparator serves as the output end of the detection circuit, the output end of the comparator is also connected to the first end of the pull-up resistor, and the second end of the pull-up resistor serves as the third input end of the detection circuit, which is used to be connected to the main power supply; The comparator is used to output a high level when the power supply voltage of the main power supply is greater than or equal to the battery voltage of the battery power supply, and output a low level when the power supply voltage of the main power supply is less than the battery voltage of the battery power supply.
5. The power switching circuit according to claim 4, characterized in that: The resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor are both determined according to the voltage at the common terminal of the current-limiting resistor and the voltage-stabilizing diode, and the battery voltage.
6. The power switching circuit according to claim 4, characterized in that: The resistance value of the first voltage-dividing resistor and the resistance value of the second voltage-dividing resistor satisfy the following formula: IN b / V1 -1= R1 / R2 Among them, V b represents the battery voltage of the battery power source, V1 represents the common terminal voltage of the current limiting resistor and the voltage-stabilizing diode, R1 represents the resistance value of the first voltage-dividing resistor, and R2 represents the resistance value of the second voltage-dividing resistor.
7. The power switching circuit according to any one of claims 1 to 3, characterized in that: The switching control circuit includes a first switch tube and a second switch tube, wherein: The input end of the first switch tube serves as the second input end of the switching control circuit, and is used to be connected to the main power supply; The input end of the second switch tube is grounded; The controlled end of the first switch tube and the controlled end of the second switch tube are connected in common, and the common end serves as the first input end of the switching control circuit; The output end of the first switch tube and the output end of the second switch tube are commonly connected, and the commonly connected end serves as the output end of the switching control circuit; The first switch tube is turned on when the input is at a low level, and the second switch tube is turned on when the input is at a high level.
8. The power switching circuit according to claim 7, characterized in that: The first switch tube is a PMOS tube, and the second switch tube is an NMOS tube.
9. An integrated circuit chip, characterized in that: The invention comprises a power switching circuit as claimed in any one of claims 1 to 8.
10. An encoder, characterized in that: The encoder comprises the power switching circuit as claimed in any one of claims 1 to 8, or the encoder comprises the integrated circuit chip as claimed in claim 9.