Method for calibrating position offset of Hall sensor in inductive motor
By ORing the PWM signals of the Hall sensor and the observer to detect the duration and duty cycle in the signal, it solves the calibration problem in the existing technology that requires an additional digital-to-analog converter and multiple pins, and realizes the Hall Accurate calibration of sensor position offsets and resource savings.
Patent Information
- Application Number
- CN202410725312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-11
AI Technical Summary
The existing technology requires additional digital-to-analog converters and multiple pin resources to calibrate the position offset of the Hall sensor in motor control, which increases design cost and complexity, and especially fails when pin resources are insufficient.
By ORing the PWM signals of the Hall sensor and the observer, using a single pin to output the processed PWM signal, detecting the specific duration and duty cycle in the signal, and calculating the position offset of the Hall sensor, no need for digital analog Calibration of the converter.
It achieves accurate calibration of the Hall sensor position offset, saves digital-to-analog converter module and pin resources, simplifies the circuit structure, and can still work effectively when there are insufficient pins.
Smart Images

Figure CN118763949A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control, and in particular to a method for calibrating position offset of a Hall sensor in an inductive motor. Background Art
[0002] In motor control, the real-time position of the rotor needs to be known, and this information can come from the Hall sensor. When the rotor is in different positions, the voltage difference between the upper and lower plates of the Hall sensor is different. In applications, this voltage difference is often sent to the comparator for processing. When the rotor rotates one electrical cycle, the comparator also outputs a complete PWM cycle of high and low level switching. The rising and falling edges of the PWM waveform are separated by 180 electrical degrees, but the absolute position of the rotor corresponding to the rising or falling edge is related to the placement of the Hall sensor. Assuming that the rotor angle corresponding to the PWM rising edge is θ, we call this angle θ the position offset of the Hall sensor. Only by knowing this position offset can we accurately parse the rotor position based on the PWM waveform.
[0003] In motor control, the observer calibration method is often used to determine the position offset of the Hall sensor. The observer is an algorithm that determines the motor rotor position based on the voltage of the drive motor and the collected phase current. When the motor speed is high, the reaction force generated by the motor rotation is large. At this time, the rotor position estimated by the observer is very accurate. Figure 1 As shown in the figure, in applications, the motor is usually rotated to a certain speed, and then the rotor position curve estimated by the observer and the position curve output by the Hall sensor are output in the form of sawtooth voltage through a digital-to-analog converter (DAC). Then, the position offset of the Hall sensor is determined by comparing the phase difference between the two position curves. However, this method requires an additional digital-to-analog converter, which increases the design cost. Another way to determine the position offset of the Hall sensor also uses the principle of observer calibration, but the position curves output by the Hall sensor and the observer are presented in PWM form, such as Figure 2 As shown in the figure, the system outputs two PWM position curves to two pins at the same time, and determines the position offset of the Hall sensor by comparing the time difference between the rising edges of the two PWM curves. This method does not require a digital-to-analog converter, but requires two pins with output functions. When the number of available pins is less than 2, this method fails.
[0004] It can be seen that a calibration method for the position offset of a Hall sensor is needed in the art, which can save a digital-to-analog converter module to simplify the circuit structure and save pin resource occupation. Summary of the invention
[0005] The present invention provides a method for calibrating the position offset of a Hall sensor in an inductive motor. The method also uses the position of an observer to calibrate the position offset of the Hall sensor, but does not require a digital-to-analog converter and only requires one pin with an output function, which is simple to implement and uses fewer resources.
[0006] Based on the above technical objectives, the present invention provides a method for calibrating the position offset of a Hall sensor in an inductive motor, the method comprising:
[0007] Step S100, driving the motor to rotate at a high speed and at a constant speed to obtain a first initial PWM signal output by the motor Hall sensor and a second initial PWM signal output by the motor observer;
[0008] Step S101, processing the first initial PWM signal to obtain a first PWM signal;
[0009] Step S102, processing the second initial PWM signal to obtain a second PWM signal;
[0010] Step S103, performing an OR operation on the first PWM signal and the second PWM signal to obtain a third PWM signal;
[0011] Step S104, performing offset detection, and obtaining a position offset value of the Hall sensor by detecting the third PWM signal;
[0012] Step S105, based on the absolute value θ of the Hall sensor angle offset abs Correct the running position of the motor rotor.
[0013] In one embodiment, the offset detection includes:
[0014] Step S200, locating a low level position in the third PWM signal that exceeds a PWM cycle duration T, and recording the position as a first marking position;
[0015] Step S201, locating the positions of two adjacent high-level pulses with a duration of T / 2 that appear after the first mark position, and recording them as second mark positions;
[0016] Step S202, determining the lagging or leading relationship between the Hall sensor and the observer according to the high level pulse state between the first mark position and the second mark position;
[0017] Step S203, calculating the absolute value of the Hall sensor angle offset θ according to the low level time length Δt between two high levels in the second mark position abs .
[0018] In one embodiment, the first initial PWM signal is processed to obtain the first PWM signal; specifically, only the first two cycles of every three consecutive signal cycles of the first initial PWM signal are output, and the remaining third cycle is forced to be a low level output.
[0019] In one embodiment, the second initial PWM signal is processed to obtain the second PWM signal; specifically, only the first cycle of every two consecutive signal cycles of the second initial PWM signal is output, and the remaining second cycle is forced to be output at a low level.
[0020] In one embodiment, a low level time length Δt between two high levels in the second mark position is less than T / 2.
[0021] In one embodiment, the absolute value θ of the Hall sensor angle offset is calculated according to the low level time length Δt between two high levels in the second mark position. abs , specifically:
[0022] In one embodiment, based on the judgment result of step S202, when the Hall sensor position lags behind the observer position, the true rotor position is the Hall position plus θ abs , that is, the position offset calibration value of the Hall sensor is +θ abs ; When the Hall sensor position is ahead of the observer position, the true rotor position is the Hall position minus θ abs , that is, the position offset calibration value of the Hall sensor is -θ abs .
[0023] In one embodiment, the calibration method further includes: detecting the calibrated third PWM signal to detect whether it satisfies the requirement of outputting only 5 cycles of a PWM waveform with a duty cycle of 50% in every 6 PWM cycles, and outputting a low level in the remaining cycle; if the above conditions are met, the calibration is completed.
[0024] Compared with the prior art, one or more embodiments of the present invention may have the following advantages:
[0025] The present invention can determine the position calibration value of the Hall sensor by performing an OR operation on the PWM signal of the Hall sensor and the PWM signal of the observer, and detecting the PWM signal after the operation. Compared with the prior art, the present invention can save a DAC digital-to-analog conversion module and achieve the calibration function by using only one signal pin.
[0026] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0028] Figure 1 It is a waveform diagram of judging the position deviation of a Hall sensor by using a sawtooth voltage in the prior art;
[0029] Figure 2 It is a waveform diagram of using PWM waveform to judge the position deviation of Hall sensor in the prior art;
[0030] Figure 3 It is a waveform diagram of the Hall sensor position deviation judgment of the present invention;
[0031] Figure 4 It is a flow chart of the Hall sensor position offset correction method of the present invention.
[0032] Figure 5 It is a flow chart of the process of detecting the position offset value of the Hall sensor of the present invention. DETAILED DESCRIPTION
[0033] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings.
[0034] It should be understood that when an element or layer is referred to as "on ...", "adjacent to ...", "connected to" or "coupled to" other elements or layers, it can be directly on, adjacent to, connected to or coupled to other elements or layers, or there can be intervening elements or layers. On the contrary, when an element is referred to as "directly on ...", "directly adjacent to ...", "directly connected to" or "directly coupled to" other elements or layers, there is no intervening element or layer. It should be understood that although the terms first, second, third, etc. can be used to describe various elements, components, regions, layers and / or parts, these elements, components, regions, layers and / or parts should not be limited by these terms. These terms are only used to distinguish one element, component, region, layer or part from another element, component, region, layer or part. Therefore, without departing from the teachings of the present invention, the first element, component, region, layer or part discussed below can be represented as the second element, component, region, layer or part. And when the second element, component, region, layer or part is discussed, it does not indicate that the present invention necessarily has the first element, component, region, layer or part.
[0035] Spatially relative terms such as "under", "beneath", "below", "under", "above", "above", etc., may be used here for convenience of description to describe the relationship between an element or feature shown in the figure and other elements or features. It should be understood that in addition to the orientation shown in the figure, the spatial relationship terms are intended to also include different orientations of the device in use and operation. For example, if the device in the accompanying drawings is turned over, then the elements or features described as "under other elements" or "under it" or "under it" will be oriented as "on" other elements or features. Therefore, the exemplary terms "under" and "under" may include both upper and lower orientations. The device can be oriented otherwise (rotated 90 degrees or other orientations) and the spatial descriptors used herein are interpreted accordingly.
[0036] The purpose of the terms used herein is only to describe specific embodiments and is not intended to be limiting of the present invention. When used herein, the singular forms "one", "an" and "said / the" are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "consisting of" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0037] Example 1
[0038] like Figure 3-4As shown, for the Hall sensor PWM waveform and the motor observer PWM waveform in different scenarios, the calibration method of the Hall sensor position offset in the inductive motor of the present invention includes:
[0039] Step S100, driving the motor at a high speed and at a constant speed to obtain the first initial PWM signal output by the motor Hall sensor and the second initial PWM signal output by the motor observer. The first initial PWM signal and the second initial PWM signal refer to the position curve generated by the Hall sensor and the position curve generated by the observer under the high speed state are both presented in the form of PWM, and the first initial PWM signal and the second initial PWM signal are PWM signals with the same cycle duration T; the rising edge of the PWM signal represents the respective "zero position", the falling edge represents the respective "180 degree position", and the duty cycle of PWM is 50%; that is, the high level duration and the low level duration of each cycle of the PWM signal are the same, both T / 2.
[0040] Step S101, the first initial PWM signal is processed to obtain the first PWM signal. The first initial PWM signal is processed such that only the first two cycles of every three consecutive signal cycles are output, and the remaining third cycle is forced to be output at a low level. Figure 3 The Hall sensor PWM curves marked in scenario 1 (the Hall sensor position lags behind the observer position) and scenario 2 (the Hall sensor position is ahead of the observer position) are that in every three consecutive PWM signal cycles, the first two cycles are retained and the third cycle is forced to become a low-level output (indicated by a dotted line).
[0041] Step S102, the second initial PWM signal is processed to obtain a second PWM signal. The second initial PWM signal is processed such that only the first cycle is output in every two consecutive signal cycles, and the remaining second cycle is forced to be output at a low level. Figure 3 The observer PWM curves marked in scenario 1 (the Hall sensor position lags behind the observer position) and scenario 2 (the Hall sensor position is ahead of the observer position) are that in every two consecutive PWM signal cycles, the previous cycle is retained and the next cycle is forced to become a low-level output (indicated by a dotted line).
[0042] Step S103, performing an OR operation on the first PWM signal and the second PWM signal to obtain a third PWM signal. The third PWM signal is the PWM waveform finally output on the pin. The OR operation means that at a certain moment, only when the first PWM signal and the second PWM signal are both low, the waveform after the OR operation is a low level; otherwise, the waveform after the OR operation is a high level. Figure 3 The final output waveform shown in , that is, the third PWM signal obtained by OR operation.
[0043] Step S104, performing offset detection, and obtaining the position offset value of the Hall sensor by detecting the third PWM signal. Figure 5 As shown, the offset detection includes:
[0044] Step S200, locate the low level position of the third PWM signal that exceeds one PWM cycle T, and record the position as the first mark position. If there is an offset between the Hall sensor position and the observer position, the PWM waveform output by the pin must have a long-lasting low level region that exceeds one PWM cycle T, that is, Figure 3 The position shown in ①.
[0045] Step S201, locate the two adjacent high-level positions with a duration of T / 2 that appear after the first mark position, and record them as the second mark position. If there is an offset between the Hall sensor position and the observer position, then in addition to the first mark position, there must be two adjacent 50% duty cycle PWM high-level waveforms, and the low-level time length between the two 50% duty cycle PWM high-level waveforms is less than T / 2. That is, Figure 3 The position shown in ②.
[0046] Step S202, determine the lagging or leading relationship between the Hall sensor and the observer according to the high level pulse state between the first mark position and the second mark position. By comparing the relative relationship between ① and ②, if ① leads ② by one high pulse, that is, Figure 3 As shown in the scene 1 before calibration, the Hall position lags behind the observer position; if ① leads ② by two high pulses, that is, Figure 3 As shown in scene 2 before calibration, the Hall position is ahead of the observer position.
[0047] Step S203, calculating the absolute value of the Hall sensor angle offset θ according to the low level time length Δt between two high levels in the second mark position abs If the duration Δt of the low level between two adjacent 50% duty cycle PWM waveforms is measured, that is, Figure 3 The duration of the position shown in ③; and in two adjacent 50% duty cycle PWM waveforms, the duration of any high level is T / 2, that is, Figure 3 The duration of the position shown in ④; then the absolute value of the Hall sensor angle offset θ abs for
[0048] Step S105, based on the absolute value θ of the Hall sensor angle offset absCorrect the running position of the motor rotor. In step S202, it is determined that the Hall sensor position lags behind the observer position, and the true rotor position is the Hall position plus θ abs , that is, the position offset calibration value of the Hall sensor is +θ abs ; If the Hall sensor position is ahead of the observer position, the true rotor position is the Hall position minus θ abs , that is, the position offset calibration value of the Hall sensor is -θ abs .
[0049] Use the above steps to determine the position offset of the Hall sensor and calibrate the Hall position to obtain the following Figure 3 As shown in the final output waveform after calibration, only 5 PWM waveforms with a duty cycle of 50% are output in every 6 PWM cycles of the final output waveform, and the remaining 1 cycle is forced to output a low level. Therefore, by checking whether the above waveform is output, it can be determined whether the Hall sensor position offset is calibrated correctly.
[0050] The present invention may be a system, method and / or computer program product at any possible level of integrated technical detail. The computer program product may include a computer-readable storage medium (or multiple media) having computer-readable program instructions thereon for causing a processor to perform various aspects of the present invention.
[0051] A computer readable storage medium may be a tangible device that can retain and store instructions used by an instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of computer readable storage media includes the following: a portable computer floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device such as a punch card or a raised structure in a groove on which instructions are recorded, and any suitable combination of the above. A computer readable storage medium, as used herein, should not be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted by a wire.
[0052] The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a corresponding computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical transmission fibers, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in a computer-readable storage medium within the corresponding computing / processing device.
[0053] The computer-readable program instructions for performing the operation of the present invention may be assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, configuration data for integrated circuits, or source code or object code written in any combination of one or more programming languages and process programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer by any type of network including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., by using the Internet of an Internet service provider). In certain embodiments, the electronic circuit including, for example, a programmable logic circuit, a field programmable gate array (FPGA) or a programmable logic array (PLA) may execute the computer-readable program instructions by utilizing the state information of the computer-readable program instructions to personalize the electronic circuit, thereby performing aspects of the present invention.
[0054] Various aspects of the present invention are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It is understood that each block of the flowchart illustration and / or block diagram, and the combination of blocks in the flowchart illustration and / or block diagram, can be implemented by computer-readable program instructions.
[0055] These computer-readable program instructions may be provided to a processor of a computer or other programmable data processing device to produce a machine so that the instructions executed by the processor of the computer or other programmable data processing device create instructions for implementing the flowcharts and / or block diagrams. Figure 1These computer-readable program instructions may also be stored in a computer-readable storage medium capable of booting a computer, a programmable data processing device and / or other device that operates in a specific manner, so that the computer-readable storage medium having the instructions stored therein includes a manufactured product that includes instructions that implement aspects of the functions / actions specified in the flowchart and / or block diagram blocks.
[0056] Computer readable program instructions may also be loaded onto a computer, other programmable data processing device, or other device to cause a series of operating steps to be performed on the computer, other programmable devices or other devices for producing a computer-implemented process, so that the instructions executed on the computer, other programmable device or other device implement the functions / actions specified in the flowchart and / or block diagram blocks.
[0057] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the system, method and computer program product according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, segment or portion of an instruction, which includes one or more executable instructions for implementing a specified logical function. In some optional implementations, the functions indicated in the block may occur outside the order indicated in the figure. For example, in fact, two blocks shown in succession can be completed as a step, and depending on the functions involved, they can be executed concurrently, substantially concurrently, in a partially or fully time-overlapping manner, or sometimes these blocks can be executed in reverse order. It will also be noted that each block of the block diagram and / or flowchart illustration, as well as the combination of blocks in the block diagram and / or flowchart illustration, can be implemented by a dedicated hardware-based system that performs a specified function or action or performs a combination of dedicated hardware and computer instructions.
[0058] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0059] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0060] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
Claims
1. A method for calibrating the position offset of a Hall sensor in an inductive motor, characterized in that: The method comprises: Step S100, driving the motor to rotate at a high speed and at a constant speed to obtain a first initial PWM signal output by the motor Hall sensor and a second initial PWM signal output by the motor observer; Step S101, processing the first initial PWM signal to obtain a first PWM signal; Step S102, processing the second initial PWM signal to obtain a second PWM signal; Step S103, performing an OR operation on the first PWM signal and the second PWM signal to obtain a third PWM signal; Step S104, performing offset detection, and obtaining a position offset value of the Hall sensor by detecting the third PWM signal; Step S105, based on the absolute value θ of the Hall sensor angle offset abs Correct the running position of the motor rotor.
2. The calibration method according to claim 1, characterized in that: The offset detection includes: Step S200, locating a low level position in the third PWM signal that exceeds a PWM cycle duration T, and recording the position as a first marking position; Step S201, locating the positions of two adjacent high-level pulses with a duration of T / 2 that appear after the first mark position, and recording them as second mark positions; Step S202, determining the lagging or leading relationship between the Hall sensor and the observer according to the high level pulse state between the first mark position and the second mark position; Step S203, calculating the absolute value of the Hall sensor angle offset θ according to the low level time length Δt between two high levels in the second mark position abs .
3. The calibration method according to claim 1, characterized in that: The first initial PWM signal is processed to obtain the first PWM signal; specifically, only the first two cycles of every three consecutive signal cycles of the first initial PWM signal are output, and the remaining third cycle is forced to be a low level output.
4. The calibration method according to claim 1, characterized in that: The second initial PWM signal is processed to obtain the second PWM signal; specifically, only the first cycle of every two consecutive signal cycles of the second initial PWM signal is output, and the remaining cycle is forced to be a low level output.
5. The calibration method according to claim 2, characterized in that: The low level time length Δt between two high levels in the second mark position is less than T / 2.
6. The calibration method according to claim 2, characterized in that: The absolute value θ of the Hall sensor angle offset is calculated according to the low level time length Δt between the two high levels in the second mark position abs , specifically:
7. The calibration method according to claim 2, characterized in that: Based on the judgment result of step S202, when the Hall sensor position lags behind the observer position, the true rotor position is the Hall position plus θ abs , that is, the position offset calibration value of the Hall sensor is +θ abs ; When the Hall sensor position is ahead of the observer position, the true rotor position is the Hall position minus θ abs , that is, the position offset calibration value of the Hall sensor is -θ abs .
8. The calibration method according to claim 1, characterized in that: The calibration method further includes: detecting the calibrated third PWM signal to determine whether it satisfies the requirement that only 5 cycles of a PWM waveform with a duty cycle of 50% are output within every 6 PWM cycles, and the remaining cycle outputs a low level; if the above conditions are met, the calibration is completed.
9. A computer-readable storage medium having computer instructions stored thereon, wherein: When the computer instructions are executed by a processor, the steps of the calibration method according to any one of claims 1 to 8 are implemented.
10. An operation control system of an inductive motor, characterized in that The operation control system uses the calibration method as described in any one of claims 1 to 8 to calibrate the position offset of the Hall sensor.
