Current sampling circuit, current sampling control method, cleaning equipment and medium
By designing a time-sharing multiplexed current sampling circuit in a motor device, using the time-sharing multiplexed phase current sampling unit and bus current sampling unit and operational amplifier, the cost caused by the complex current sampling circuit in the motor device in the prior art is solved. and area increase problem, accurate current measurement and stability improvement are achieved.
Patent Information
- Application Number
- CN202310558013.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2024-11-26
AI Technical Summary
The detection and sampling circuits of phase current and bus current in existing motor equipment are complex, resulting in an increase in circuit board layout area and an increase in equipment costs.
A current sampling circuit is designed to realize the time-sharing sampling and amplification of phase current and bus current through time-sharing multiplexing of phase current sampling unit and bus current sampling unit and operational amplifier, simplifying the circuit structure and reducing costs.
It effectively reduces the cost of equipment and the layout area of circuit boards, and improves the measurement accuracy and stability of motor phase current and bus current.
Smart Images

Figure CN119024035A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of motor control technology, and specifically relates to a current sampling circuit, a current sampling control method, a cleaning device and a medium. Background Art
[0002] A motor is a device that converts electrical energy into mechanical energy. It has good speed regulation performance, simple structure, reliable operation, easy manufacturing and maintenance, and low cost. It is widely used in power tools, household appliances and other general equipment.
[0003] In current devices using motors, the detection and sampling circuits for phase current and bus current are usually complex, which increases the layout area of the circuit board and increases the cost of the application equipment. Summary of the invention
[0004] Therefore, the technical problem to be solved by the present application is that the detection sampling circuit of the phase current and the bus current will increase the layout area and equipment cost of the circuit board.
[0005] In order to solve the above technical problems, the present application provides a current sampling circuit, comprising:
[0006] A phase current sampling unit, used for collecting and outputting phase current;
[0007] A bus current sampling unit, used for collecting and outputting bus current;
[0008] a first channel selection unit, wherein an input end of the first channel selection unit is respectively connected to an output end of the phase current sampling unit and an output end of the bus current sampling unit, and the first channel selection unit is used to select and output one of the phase current and the bus current;
[0009] An operational amplifier, wherein an input end of the operational amplifier is connected to an output end of the first channel selection unit, and the operational amplifier is used to amplify the received phase current or the bus current.
[0010] In one embodiment, it also includes:
[0011] A ground brush current sampling unit, used for collecting and outputting the ground brush current;
[0012] A second channel selection unit, wherein the input end of the second channel selection unit is respectively connected to the output end of the bus current sampling unit and the output end of the ground brush current sampling unit, the output end of the second channel selection unit is connected to the input end of the first channel selection unit, and the second channel selection unit is used to select and output one of the ground brush current and the bus current;
[0013] Wherein, the first channel selection unit is further used for selecting a channel that conducts one of the output end of the phase current sampling unit and the output end of the second channel selection unit to the input end of the operational amplifier;
[0014] The operational amplifier is also used to amplify the received ground brush current.
[0015] In one of the embodiments, the phase current sampling unit includes: a first resistor, a second resistor, a first capacitor and a second capacitor;
[0016] One end of the first resistor is grounded, and the other end of the first resistor serves as an output end of the phase current sampling unit. One end of the second resistor is connected to the phase current sampling node. One end of the first capacitor is grounded, and the other end of the first capacitor is connected to the other end of the second resistor to serve as another output end of the phase current sampling unit. The second capacitor is connected between one end of the first resistor and one end of the second resistor.
[0017] In one of the embodiments, the bus current sampling unit includes: a third resistor, a fourth resistor and a third capacitor;
[0018] One end of the third resistor is grounded, and the other end of the third resistor is connected to one end of the third capacitor to serve as an output end of the bus current sampling unit. One end of the fourth resistor is connected to the bus current sampling node, and the other end of the fourth resistor is connected to the other end of the third capacitor to serve as another output end of the bus current sampling unit.
[0019] In one of the embodiments, the ground brush current sampling unit includes: a fifth resistor, a sixth resistor, a seventh resistor, a fourth capacitor and a fifth capacitor;
[0020] One end of the fifth resistor is connected to one end of the sixth resistor to serve as a ground brush current sampling node, the other end of the fifth resistor is connected to one end of the seventh resistor and connected to the ground, the other end of the seventh resistor serves as an output end of the ground brush current sampling unit, one end of the fourth capacitor is grounded, the other end of the fourth capacitor is connected to the other end of the sixth resistor to serve as another output end of the ground brush current sampling unit, and the fifth capacitor is connected between one end of the sixth resistor and one end of the seventh resistor.
[0021] In one embodiment, it also includes:
[0022] an analog-to-digital conversion unit connected to the output end of the operational amplifier, the analog-to-digital conversion unit being used to perform analog-to-digital conversion on the received target sampling current to output a target current sampling value;
[0023] The target sampling current includes the phase current, the bus current, and the ground brush current.
[0024] In one of the embodiments, the sampling frequency of the phase current is higher than the sampling frequency of the bus current;
[0025] The sampling frequency of the bus current is higher than the sampling frequency of the ground brush current.
[0026] The present application also provides a current sampling control method for controlling the current sampling circuit as described above, the method comprising:
[0027] Controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, and counting the number of sampling times of the phase current;
[0028] If the first count value is greater than the first preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, and to connect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier to collect the bus current, and the number of samplings of the bus current is counted, and the first count value is the number of samplings of the phase current;
[0029] If the second count value is greater than the second preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, and the second count value is the sum of the first count value and the number of sampling times of the bus current.
[0030] In one embodiment, if the second count value is greater than the second preset value, after controlling the first channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, the method further includes:
[0031] The first count value and the second count value are cleared, and the step of controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier is repeatedly performed to collect the phase current.
[0032] In one embodiment, before controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, the method further includes:
[0033] Control the second channel selection unit to conduct the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit, and control the first channel selection unit to conduct the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current, and determine whether the ground brush is working according to the ground brush current;
[0034] The controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current includes:
[0035] If it is determined that the ground brush is working, the first channel selection unit is controlled to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current.
[0036] In one embodiment, if the second count value is greater than the second preset value, controlling the first channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier includes:
[0037] If the second count value is greater than the second preset value, control the second channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the first channel selection unit, and connect the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit;
[0038] The first channel selection unit is controlled to conduct a channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current.
[0039] In one embodiment, it also includes:
[0040] Obtain the phase current sampling value output after analog-to-digital conversion;
[0041] The phase current sampling values are calculated through a motor vector control algorithm to control the running state of the motor.
[0042] The present application provides a cleaning device, comprising the current sampling circuit as described above.
[0043] The present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0044] The present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the steps of the above-mentioned method when executed by a processor.
[0045] The present application provides a computer program product, including a computer program, which implements the steps of the method described above when executed by a processor.
[0046] The technical solution provided by this application has the following advantages:
[0047] The current sampling circuit provided in the present application connects the output end of the phase current sampling unit and the output end of the bus current sampling unit to the input end of the first channel selection unit. The first channel selection unit can sample the phase current and bus current in a time-sharing manner and output them to the operational amplifier for amplification processing, thereby realizing time-sharing multiplexing of a single operational amplifier to measure the phase current and bus current of the motor, greatly reducing the cost of the equipment and the layout area of the circuit board. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 This is one of the structural schematic diagrams of a current sampling circuit provided in an embodiment;
[0050] Figure 2 This is a second structural schematic diagram of a current sampling circuit provided in an embodiment;
[0051] Figure 3 is a structural schematic diagram of a phase current sampling unit provided in an embodiment;
[0052] Figure 4 It is a structural schematic diagram of a bus current sampling unit provided in an embodiment;
[0053] Figure 5 It is a structural schematic diagram of a ground brush current sampling unit provided in an embodiment;
[0054] Figure 6 This is one of the flow charts of a current sampling control method provided in an embodiment;
[0055] Figure 7 This is a second flow chart of a current sampling control method provided in an embodiment.
[0056] Description of reference numerals:
[0057] 100-phase current sampling unit; 200-bus current sampling unit; 300-first channel selection unit; 400-operational amplifier; 500-analog-to-digital conversion unit; 600-ground brush current sampling unit; 700-second channel selection unit. DETAILED DESCRIPTION
[0058] The technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0059] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0060] In the present application, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present application.
[0061] The motor is a device that can realize electromechanical energy conversion or signal transmission and conversion based on the laws of electromagnetic induction and electromagnetic force, consisting of circuits and magnetic circuits. Among them, motors are divided into DC motors and AC motors. DC motors can be divided into brushed DC motors and brushless DC motors. Taking brushed DC motors as an example, brushed DC motors are divided into stator windings and rotor windings. When DC power is applied, the stator windings generate a magnetic field with a fixed polarity. The rotor is forced to rotate in the magnetic field when DC power is applied, so that the motor rotates and drives the load. DC motors are powered by DC power and will not directly generate a rotating magnetic field. It relies on a commutator that rotates with the rotor to change the direction of the current entering the rotor, so that the polarity of the magnetic field between the rotor and the stator is always opposite, thereby causing the rotor to rotate. Furthermore, motors are widely used in cleaning equipment, such as scrubbers, vacuum cleaners, and sweeping robots, due to their advantages such as high efficiency, high speed, and small size. In the application process of motors, sampling of their phase current and bus current is a crucial link in motor control. The common solution currently on the market is to use two independent op amps to collect phase current and bus current respectively, which increases the layout area of the circuit board and increases the cost of the equipment.
[0062] Based on this, the present application collects the phase current and bus current by time-sharing multiplexing a single operational amplifier, thereby achieving accurate sampling of the motor phase current and bus current while simplifying the circuit structure and reducing equipment costs.
[0063] Example 1
[0064] This embodiment provides a current sampling circuit, such as Figure 1As shown, it includes: a phase current sampling unit 100, a bus current sampling unit 200, a first channel selection unit 300 and an operational amplifier 400.
[0065] Among them, the phase current sampling unit 100 is used to collect the phase current and output it to the first channel selection unit 300, and the bus current sampling unit 200 is used to collect the bus current and output it to the first channel selection unit 300. It can be understood that in order to obtain the position of the motor rotor, the motor speed and current and other information as a reaction, it is necessary to collect the phase current of the motor, and perform a series of mathematical transformations on it according to the application requirements, and then control the output current size of the motor drive circuit, so that the actual operation state of the motor can be operated according to the actual application requirements, that is, the motor speed, torque and start and stop operations can be controlled to improve the controllability and safety of the motor. The bus current is also very important in the motor vector control process. On the one hand, the bus current is used to calculate the motor power. Since the current is converted from the bus to the phase line through the controller, the power output to the motor can be calculated through the bus current. On the other hand, the bus current is also used for overcurrent protection. When the bus current exceeds the predetermined value, the rotation of the motor can be cut off in time to avoid overcurrent burning of the motor. Based on this, in the motor control, by processing the bus current and the phase current, a control signal that meets the requirements is output to the motor after various calculations.
[0066] Furthermore, the input end of the first channel selection unit 300 is respectively connected to the output end of the phase current sampling unit 100 and the output end of the bus current sampling unit 200, and the output end of the first channel selection unit 300 is connected to the input end of the operational amplifier 400. The first channel selection unit 300 is used to select one of the output phase current and the bus current, and the operational amplifier 400 is used to amplify the received phase current or bus current.
[0067] Specifically, the first channel selection unit 300 can be a multiplexer, whose input end is connected to the output end of the phase current sampling unit 100 and the output end of the bus current sampling unit 200, and selects one of the two input currents as the output. Since the bus current and phase current actually sampled are relatively small, they need to be amplified by a corresponding multiple through the operational amplifier 400 to achieve accurate measurement in order to achieve the sampling accuracy of the sampling circuit. Therefore, the current output by the first channel selection unit 300 is amplified by connecting the operational amplifier 400 to the output end of the first channel selection unit 300.
[0068] Furthermore, the first channel selection unit 300 selects two inputs according to the first control signal received by the control end. Exemplarily, when the first control signal is 0, the first channel selection unit 300 selects the output bus current, which is actually the differential input signal of the sampled bus current to the operational amplifier 400. When the first control signal is 1, the first channel selection unit 300 selects the output phase current, which is actually the differential input signal of the sampled phase current to the operational amplifier 400.
[0069] In the above example, by connecting the output end of the phase current sampling unit 100 and the output end of the bus current sampling unit 200 to the input end of the first channel selection unit 300, the phase current and bus current can be sampled in a time-sharing manner and output to the operational amplifier 400 through the first channel selection unit 300 for amplification processing, thereby realizing time-sharing multiplexing of a single operational amplifier to measure the phase current and bus current of the motor, greatly reducing the cost of the equipment and the layout area of the circuit board.
[0070] In one embodiment, please refer to Figure 2 The current sampling circuit provided in the present application also includes: a ground brush current sampling unit 600 and a second channel selection unit 700, the input end of the second channel selection unit 700 is respectively connected to the output end of the bus current sampling unit 200 and the output end of the ground brush current sampling unit 600, and the output end of the second channel selection unit 700 is connected to the input end of the first channel selection unit 300.
[0071] The first channel selection unit 300 is further used to select a channel from the output end of the conducting phase current sampling unit 100 and the output end of the second channel selection unit 700 to the input end of the operational amplifier 400, and the operational amplifier 400 is further used to amplify the received ground brush current.
[0072] It is understandable that when the motor is used in cleaning equipment (such as a sweeper and a floor scrubber, etc.), the motor of the cleaning equipment drives the floor brush to clean the floor. Since the cleaning equipment often inhales debris such as hair and dust, it is easy to cause the floor brush motor to stall. If the floor brush motor stalls and the power supply is not cut off in time, the motor is easily burned, causing losses and safety hazards. Therefore, the floor brush current is monitored to monitor the operating status of the motor. When the floor brush current is greater than or equal to the stall current, the motor can be controlled to stop to prevent the motor from burning, thereby ensuring the safe use of the motor. Therefore, a ground brush current sampling unit 600 is provided to collect the ground brush current, and further, since the phase current needs to execute a very high sampling frequency, an independent channel is provided for the phase current sampling unit 100 for sampling, and the bus current sampling unit 200 and the ground brush current sampling unit 600 use a channel multiplexed by the second channel selection unit 700 for switching sampling, that is, the output end of the bus current sampling unit 200 and the output end of the ground brush current sampling unit 600 are connected to the input end of the second channel selection unit 700, and the second channel selection unit 700 is controlled to switch back and forth to sample the bus current and the ground brush current, and at a certain moment, one of the bus current and the ground brush current is selectively output to the first channel selection unit 300, and the first channel selection unit 300 then selectively outputs the phase current and one of the output currents of the second channel selection unit 700 to the operational amplifier 400 for amplification processing according to actual needs. Based on this, it is equivalent to leading out three pairs of ports from an operational amplifier 400, and realizing switching sampling of phase current, bus current and ground brush current by turning on and off the first channel selection unit 300 and the second channel selection unit 700.
[0073] Optionally, the second channel selection unit 700 can be a multiplexer, and the second channel selection unit 700 selects the two inputs according to the second control signal received by the control end. When the second control signal is 0, the second channel selection unit 700 selects to output the bus current, which is actually the differential input signal of the sampled bus current to the first channel selection unit 300. When the second control signal is 1, the second channel selection unit 700 selects to output the ground brush current, which is actually the differential input signal of the sampled ground brush current to the first channel selection unit 300.
[0074] In one embodiment, continue to refer to Figure 2 The current sampling circuit provided in the present application also includes an analog-to-digital conversion unit 500, which is connected to the output end of the operational amplifier 400. The analog-to-digital conversion unit 500 is used to perform analog-to-digital conversion on the received target sampling current to output a target current sampling value. The target sampling current includes phase current, bus current, and ground brush current.
[0075] The analog-to-digital conversion unit 500 includes an analog-to-digital converter chip, and the analog-to-digital conversion unit 500 performs analog-to-digital conversion on the sampled current into a digital signal, that is, a current sampling value, thereby realizing the measurement and application of the output signal of the operational amplifier 400, for example, the phase current sampling value is operated by a field oriented control (Field Oriented Control, FOC) algorithm to further control the motor, so that the motor always obtains the best torque and brings higher work efficiency. In other embodiments, a multiplexer MUX is also provided between the operational amplifier 400 and the analog-to-digital conversion unit 500, because the analog-to-digital conversion unit 500 is also configured with other sampling channels to collect other signals, and the multiplexer MUX can select one of the multiple input signals according to the demand and output it to the analog-to-digital conversion unit 500 for analog-to-digital conversion.
[0076] In one embodiment, the sampling frequency of the phase current is higher than the sampling frequency of the bus current, and the sampling frequency of the bus current is higher than the sampling frequency of the ground brush current.
[0077] It can be understood that since the position of the motor rotor must be obtained in real time, the sampling frequency of the phase current needs to be very high, and in the same sampling, the sampling time of the bus current must be after the phase current sampling, so in the same cycle, the first channel selection unit turns on the path from the output end of the phase current sampling unit to the input end of the operational amplifier to sample the phase current. When the number of sampling times of the phase current reaches the requirement of its sampling frequency, the phase current collection path is disconnected, and then the path from the output end of the first channel selection unit to the input end of the operational amplifier is turned on, and the second channel selection unit turns on the path from the output end of the bus current sampling unit to the input end of the first channel selection unit to collect the bus current. After the number of sampling times of the bus current reaches the requirement of its sampling frequency, the bus current collection path is disconnected, and the second channel selection unit switches to turn on the path from the output end of the ground brush current sampling unit to the input end of the first channel selection unit to collect the ground brush current. At this point, the current sampling in this cycle is completed, and then the cyclic sampling of the next cycle is entered.
[0078] In one embodiment, Figure 3As shown, the phase current sampling unit 100 includes: a first resistor R1, a second resistor R2, a first capacitor C1 and a second capacitor C2, one end of the first resistor R1 is grounded, the other end of the first resistor R1 is used as an output end OPAO_N of the phase current sampling unit 100, one end of the second resistor R2 is connected to the phase current sampling node A1, one end of the first capacitor C1 is grounded, the other end of the first capacitor C1 is connected to the other end of the second resistor R2 as another output end OPAO_P of the phase current sampling unit 100, and the second capacitor C2 is connected between one end of the first resistor R1 and one end of the second resistor R2. The phase current sampling unit 100 outputs the phase current in the form of a differential signal, so that the common mode interference is offset, the interference of external signals on the phase current sampling is reduced, and the stability of the motor phase current is improved.
[0079] In one embodiment, Figure 4 As shown, the bus current sampling unit 200 includes: a third resistor R3, a fourth resistor R4 and a third capacitor C3, one end of the third resistor R3 is grounded, the other end of the third resistor R3 is connected to one end of the third capacitor C3 to serve as an output end OPA1_N of the bus current sampling unit 200, one end of the fourth resistor R4 is connected to the bus current sampling node A2, and the other end of the fourth resistor R4 is connected to the other end of the third capacitor C3 to serve as another output end OPA1_P of the bus current sampling unit 200. Specifically, the bus current is input to the bus current sampling unit 200 through the bus current sampling node A2, and the bus current sampling unit 200 outputs a bus current differential signal in the form of differential routing, and after the bus current differential signal is amplified by the operational amplifier, the sampling accuracy of the bus current sampling can be improved. In addition, since the bus current needs to participate in the calculation of each cycle, if there is a spike interference, it will cause errors in the entire motor control calculation. Therefore, when collecting the bus current, the third capacitor C3 is used to filter out unnecessary interference, thereby improving the stability of the motor bus current.
[0080] In one embodiment, Figure 5 As shown, the ground brush current sampling unit 600 includes: a fifth resistor R5, a sixth resistor R6, a seventh resistor R7, a fourth capacitor C4 and a fifth capacitor C5, one end of the fifth resistor R5 is connected to one end of the sixth resistor R6 to serve as a ground brush current sampling node A3, the other end of the fifth resistor R5 is connected to one end of the seventh resistor R7 and connected to the ground, the other end of the seventh resistor R7 serves as an output end OPA3_N of the ground brush current sampling unit 600, one end of the fourth capacitor C4 is grounded, the other end of the fourth capacitor C4 is connected to the other end of the sixth resistor R6 to serve as another output end OPA3_P of the ground brush current sampling unit 600, and the fifth capacitor C5 is connected between one end of the sixth resistor R6 and one end of the seventh resistor R7.
[0081] Example 2
[0082] This embodiment provides a current sampling control method for controlling the current sampling circuit provided in the above embodiment, such as Figure 6 As shown, the method includes step S100, step S200 and step S300.
[0083] Step S100: controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, and counting the number of sampling times of the phase current.
[0084] Based on the above description of the circuit structure embodiment of the current sampling circuit, after the chip where the current sampling circuit is located is turned on, the operational amplifier multiples of the phase current and the bus current are configured and enabled respectively after the basic functions of the chip are initialized. Specifically, the operational amplifier changes the amplification factor by changing the resistance value of the feedback resistor, so the operational amplifier multiples of the phase current and the bus current can be set and saved in the register respectively to achieve different amplification factors. Further, the chip enters the operational amplifier switching subroutine, that is, after entering the FOC interrupt, the first channel selection unit is controlled to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, which is equivalent to turning on the acquisition port of the phase current to execute the acquisition of the phase current, and the control counter (count, CNT) counts the number of sampling times of the phase current. For example, each time the phase current is sampled once, the count value of CNT is accumulated by 1, and the count value of CNT represents the sampling frequency of the phase current. After the number of sampling times of the phase current reaches the requirement of its sampling frequency, it switches to sampling the bus current.
[0085] Step S200: If the first count value is greater than the first preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, and to connect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier to collect the bus current, and the number of samplings of the bus current is counted, and the first count value is the number of samplings of the phase current.
[0086] It can be understood that when the first count value of CNT is greater than the first preset value, it indicates that the phase current has been collected within the cycle, and then the first channel selection unit is controlled to switch the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, which is equivalent to switching on the bus current collection port to execute the collection of the bus current. At the same time, the count value of CNT continues to accumulate with the increase in the number of bus current sampling times. After the number of bus current sampling times reaches the sampling frequency requirement, the sampling of the bus current is stopped.
[0087] Step S300: If the second count value is greater than the second preset value, the first channel selection unit is controlled to disconnect the channel from the output of the bus current sampling unit to the input of the operational amplifier, and the second count value is the sum of the first count value and the number of bus current sampling times.
[0088] When the second count value of CNT is greater than the second preset value, it indicates that the bus current has been collected within the cycle, and the current sampling work within the cycle is completed. At the same time, the count value of CNT needs to be reset to enter the next cycle of cyclic sampling of phase current and bus current.
[0089] In the above example, the phase current is sampled by turning on the channel from the output end of the phase current sampling unit to the input end of the operational amplifier. When the sampling times of the phase current reaches a first preset value, the channel from the output end of the bus current sampling unit to the input end of the operational amplifier is switched on to sample the bus current. When the sampling times of the bus current reaches a second preset value, the sampling of the bus current is stopped. Based on the above control method, two groups of sampling ports are derived from a single operational amplifier, and the sampled phase current and bus current are amplified by the same operational amplifier. By controlling the switching of the first channel selection unit to turn on the two groups of sampling ports, the single operational amplifier is used to measure the phase current and bus current of the motor in a time-sharing manner, which greatly reduces the cost of the equipment and the layout area of the circuit board, while improving the stability of the motor phase current and bus current.
[0090] In one embodiment, if the second count value is greater than the second preset value, in step S300, after controlling the first channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, the following steps are also included: clearing the first count value and the second count value, and repeatedly controlling the first channel selection unit to connect the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current. That is, the count value of CNT is cleared and reset, and when the count value of CNT is 0, it is switched to sampling the phase current at the same time, that is, steps S100 to S300 are repeated.
[0091] In one embodiment, before step S100 controls the first channel selection unit to turn on the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, the following steps are also included: controlling the second channel selection unit to turn on the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit, and controlling the first channel selection unit to turn on the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current, and judging whether the ground brush is working according to the ground brush current.
[0092] Specifically, after the basic functions of the chip are initialized, it is also necessary to configure and enable the op amp multiples of the ground brush current, and control the channel of the ground brush current sampling unit output-the second channel selection unit-the first channel selection unit to identify the ground brush through the ground brush current. If the ground brush is not identified, restart the chip. If the ground brush is identified, further enter the op amp switching subroutine to switch back and forth and collect the phase current, bus current, and ground brush current.
[0093] And step S100 includes the following steps: if it is determined that the ground brush is working, the first channel selection unit is controlled to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current. When the ground brush is identified, after entering the FOC interrupt, the first channel selection unit is controlled to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, which is equivalent to opening the acquisition port of the phase current to perform the acquisition of the phase current.
[0094] In one embodiment, if the second count value is greater than the second preset value, step S300 controls the first channel selection unit to disconnect the channel from the output of the bus current sampling unit to the input of the operational amplifier, including the following steps: if the second count value is greater than the second preset value, controls the second channel selection unit to disconnect the channel from the output of the bus current sampling unit to the input of the first channel selection unit, and switches on the channel from the output of the ground brush current sampling unit to the input of the first channel selection unit; controls the first channel selection unit to switch on the channel from the output of the second channel selection unit to the input of the operational amplifier to collect the ground brush current.
[0095] Specifically, when the first count value of CNT is greater than the first preset value, the bus current collection starts to be switched, that is, the second channel selection unit is controlled to conduct the channel from the output end of the bus current sampling unit to the input end of the first channel selection unit, and the first channel selection unit is controlled to conduct the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the bus current, that is, the path of the bus current sampling unit output end-the second channel selection unit-the first channel selection unit is conducted;
[0096] When the second count value of CNT is greater than the second preset value, it indicates that the bus current sampling work within the cycle is completed, and the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit is switched on, and the first channel selection unit is controlled to switch on the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current, that is, the path of the output end of the ground brush current sampling unit-the second channel selection unit-the first channel selection unit is turned on. At this point, the phase current, bus current, and ground brush current collection within the cycle are completed, and the first count value and the second count value are cleared to enter the next cycle of repeated collection of phase current, bus current, and ground brush current.
[0097] In one embodiment, the method further includes the following steps: obtaining the phase current sampling value output after analog-to-digital conversion, and operating the phase current sampling value through a motor vector control algorithm to control the running state of the motor. The motor vector control algorithm is a field oriented control (FOC) algorithm, that is, the phase sampling current is converted into a digital signal (phase current sampling value) through an analog-to-digital conversion unit, thereby realizing the measurement and application of the output signal of the operational amplifier, and the phase current sampling value is operated through the FOC algorithm to further control the motor, so that the motor always obtains the best torque and brings higher work efficiency.
[0098] In one embodiment, if Figure 7 As shown, a flow chart of a current sampling control method is provided, wherein the method includes steps S10 to S50.
[0099] Step S10: Control the second channel selection unit to conduct the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit, and control the first channel selection unit to conduct the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current, and determine whether the ground brush is working according to the ground brush current.
[0100] If the ground brush is not recognized, the chip is restarted. If the ground brush is recognized, the op amp switching subroutine is further entered to switch back and forth and collect the phase current, bus current, and ground brush current.
[0101] Step S20: controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, and counting the number of sampling times of the phase current.
[0102] Step S30: If the first count value is greater than the first preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, and the channel from the output end of the second channel selection unit to the input end of the operational amplifier is turned on, and the second channel selection unit is controlled to turn on the channel from the output end of the bus current sampling unit to the input end of the first channel selection unit to collect the bus current, and the number of sampling times of the bus current is counted.
[0103] Step S40: If the second count value is greater than the second preset value, the second channel selection unit is controlled to disconnect the channel from the output end of the bus current sampling unit to the input end of the first channel selection unit, and to connect the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit, and the first channel selection unit is controlled to connect the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current.
[0104] Step S50: clear the first count value and the second count value, and repeat steps S20 to S40.
[0105] Specifically, the steps in this embodiment are consistent with the definitions of the same steps in the previous embodiments, and will not be repeated here.
[0106] Example 3
[0107] This embodiment provides a cleaning device, including the current sampling circuit provided in the above embodiment. Optionally, the cleaning device includes a vacuum cleaner, a floor scrubber, and a sweeping robot.
[0108] In one embodiment, a computer device is provided, which includes a processor, a memory and a communication interface connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a control method for current sampling is implemented.
[0109] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0110] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0111] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A current sampling circuit, It is characterized in that include: A phase current sampling unit, used for collecting and outputting phase current; A bus current sampling unit, used for collecting and outputting bus current; a first channel selection unit, wherein an input end of the first channel selection unit is respectively connected to an output end of the phase current sampling unit and an output end of the bus current sampling unit, and the first channel selection unit is used to select and output one of the phase current and the bus current; An operational amplifier, wherein an input end of the operational amplifier is connected to an output end of the first channel selection unit, and the operational amplifier is used to amplify the received phase current or the bus current.
2. The current sampling circuit according to claim 1, It is characterized in that Also includes: A ground brush current sampling unit, used for collecting and outputting the ground brush current; A second channel selection unit, wherein the input end of the second channel selection unit is respectively connected to the output end of the bus current sampling unit and the output end of the ground brush current sampling unit, the output end of the second channel selection unit is connected to the input end of the first channel selection unit, and the second channel selection unit is used to select and output one of the ground brush current and the bus current; Wherein, the first channel selection unit is further used for selecting a channel that conducts one of the output end of the phase current sampling unit and the output end of the second channel selection unit to the input end of the operational amplifier; The operational amplifier is also used to amplify the received ground brush current.
3. The current sampling circuit according to any one of claims 1 to 2, It is characterized in that The phase current sampling unit comprises: a first resistor, a second resistor, a first capacitor and a second capacitor; One end of the first resistor is grounded, and the other end of the first resistor serves as an output end of the phase current sampling unit. One end of the second resistor is connected to the phase current sampling node. One end of the first capacitor is grounded, and the other end of the first capacitor is connected to the other end of the second resistor to serve as another output end of the phase current sampling unit. The second capacitor is connected between one end of the first resistor and one end of the second resistor.
4. The current sampling circuit according to any one of claims 1 to 2, It is characterized in that The bus current sampling unit includes: a third resistor, a fourth resistor and a third capacitor; One end of the third resistor is grounded, and the other end of the third resistor is connected to one end of the third capacitor to serve as an output end of the bus current sampling unit. One end of the fourth resistor is connected to the bus current sampling node, and the other end of the fourth resistor is connected to the other end of the third capacitor to serve as another output end of the bus current sampling unit.
5. The current sampling circuit according to claim 2, It is characterized in that The ground brush current sampling unit includes: a fifth resistor, a sixth resistor, a seventh resistor, a fourth capacitor and a fifth capacitor; One end of the fifth resistor is connected to one end of the sixth resistor to serve as a ground brush current sampling node, the other end of the fifth resistor is connected to one end of the seventh resistor and connected to the ground, the other end of the seventh resistor serves as an output end of the ground brush current sampling unit, one end of the fourth capacitor is grounded, the other end of the fourth capacitor is connected to the other end of the sixth resistor to serve as another output end of the ground brush current sampling unit, and the fifth capacitor is connected between one end of the sixth resistor and one end of the seventh resistor.
6. The current sampling circuit according to claim 2, It is characterized in that Also includes: an analog-to-digital conversion unit connected to the output end of the operational amplifier, the analog-to-digital conversion unit being used to perform analog-to-digital conversion on the received target sampling current to output a target current sampling value; The target sampling current includes the phase current, the bus current, and the ground brush current.
7. The current sampling circuit according to claim 2, It is characterized in that The sampling frequency of the phase current is higher than the sampling frequency of the bus current; The sampling frequency of the bus current is higher than the sampling frequency of the ground brush current.
8. A current sampling control method, It is characterized in that Used to control the current sampling circuit according to any one of claims 1 to 7, the method comprising: Controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, and counting the number of sampling times of the phase current; If the first count value is greater than the first preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the phase current sampling unit to the input end of the operational amplifier, and to connect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier to collect the bus current, and the number of samplings of the bus current is counted, and the first count value is the number of samplings of the phase current; If the second count value is greater than the second preset value, the first channel selection unit is controlled to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, and the second count value is the sum of the first count value and the number of sampling times of the bus current.
9. The current sampling control method according to claim 8, It is characterized in that If the second count value is greater than the second preset value, after controlling the first channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier, the method further includes: The first count value and the second count value are cleared, and the step of controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier is repeatedly performed to collect the phase current.
10. The current sampling control method according to claim 8, It is characterized in that Before controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current, the method further includes: Control the second channel selection unit to conduct the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit, and control the first channel selection unit to conduct the channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current, and determine whether the ground brush is working according to the ground brush current; The controlling the first channel selection unit to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current includes: If it is determined that the ground brush is working, the first channel selection unit is controlled to conduct the channel from the output end of the phase current sampling unit to the input end of the operational amplifier to collect the phase current.
11. The current sampling control method according to claim 10, It is characterized in that If the second count value is greater than the second preset value, controlling the first channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the operational amplifier includes: If the second count value is greater than the second preset value, control the second channel selection unit to disconnect the channel from the output end of the bus current sampling unit to the input end of the first channel selection unit, and connect the channel from the output end of the ground brush current sampling unit to the input end of the first channel selection unit; The first channel selection unit is controlled to conduct a channel from the output end of the second channel selection unit to the input end of the operational amplifier to collect the ground brush current.
12. The current sampling control method according to claim 8, It is characterized in that Also includes: Obtain the phase current sampling value output after analog-to-digital conversion; The phase current sampling values are calculated through a motor vector control algorithm to control the running state of the motor.
13. A cleaning device, It is characterized in that The method comprises the current sampling circuit as claimed in any one of claims 1 to 7.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 8 to 12 are implemented.
15. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 8 to 12 are implemented.
16. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 8 to 12 are implemented.
