CN112152542A - Hall signal processing method and device, motor controller and storage medium - Google Patents

Hall signal processing method and device, motor controller and storage medium Download PDF

Info

Publication number
CN112152542A
CN112152542A CN202011019429.7A CN202011019429A CN112152542A CN 112152542 A CN112152542 A CN 112152542A CN 202011019429 A CN202011019429 A CN 202011019429A CN 112152542 A CN112152542 A CN 112152542A
Authority
CN
China
Prior art keywords
motor
hall signal
sine
cosine
per
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011019429.7A
Other languages
Chinese (zh)
Other versions
CN112152542B (en
Inventor
陈毅东
季传坤
杨立保
郭中义
孙清原
魏代友
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dongguan Zhaowei Electromechanical Co ltd
Shenzhen Zhaowei Machinery and Electronics Co Ltd
Original Assignee
Shenzhen Zhaowei Machinery and Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhaowei Machinery and Electronics Co Ltd filed Critical Shenzhen Zhaowei Machinery and Electronics Co Ltd
Priority to CN202011019429.7A priority Critical patent/CN112152542B/en
Publication of CN112152542A publication Critical patent/CN112152542A/en
Application granted granted Critical
Publication of CN112152542B publication Critical patent/CN112152542B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P29/00Arrangements for regulating or controlling electric motors, appropriate for both AC and DC motors
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02PCONTROL OR REGULATION OF ELECTRIC MOTORS, ELECTRIC GENERATORS OR DYNAMO-ELECTRIC CONVERTERS; CONTROLLING TRANSFORMERS, REACTORS OR CHOKE COILS
    • H02P23/00Arrangements or methods for the control of AC motors characterised by a control method other than vector control
    • H02P23/14Estimation or adaptation of motor parameters, e.g. rotor time constant, flux, speed, current or voltage

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Control Of Motors That Do Not Use Commutators (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)

Abstract

The application provides a Hall signal processing method and device, a motor controller and a storage medium, and belongs to the technical field of motor signal processing. The method comprises the following steps: according to the Hall signal acquired when the motor works, the Hall signal value of the motor when the motor works is obtained; performing per-unit processing on a Hall signal value of the motor during working according to a preset per-unit basic value; fitting sine and cosine waveforms of Hall signals of the motor according to the Hall signal values after per unit processing; and calculating the angle of the motor according to the fitted sine and cosine waveforms. The embodiment of the application can reduce the error of the amplitude of the obtained Hall signal, so that the accuracy of the obtained motor angle can be improved, and the error of calculation is reduced.

Description

Hall signal processing method and device, motor controller and storage medium
Technical Field
The application relates to the technical field of motor control, in particular to a Hall signal processing method and device, a motor controller and a storage medium.
Background
In order to perform the correlation processing according to the signal output by the motor, it is usually necessary to acquire the position of the motor, that is, the angle of the motor.
In the prior art, a hall sensor is usually used to detect the position of a motor, a tangent value of a motor angle is calculated according to a ratio of collected two-phase hall signals, and then a corresponding click angle is obtained according to a tangent table query.
However, this method is only suitable for the case when the hall signal of the motor receives less external interference. Therefore, when the errors of the amplitude and the phase of the hall signal are relatively large, the accuracy of the motor angle obtained by the method is relatively low, and the calculated error is large.
Disclosure of Invention
The application aims to provide a Hall signal processing method and device, a motor controller and a storage medium, which can improve the accuracy of obtaining the motor angle and reduce the error of calculation.
The embodiment of the application is realized as follows:
in one aspect of the embodiments of the present application, a hall signal processing method is provided, including:
according to the Hall signal acquired when the motor works, the Hall signal value of the motor when the motor works is obtained;
performing per-unit processing on a Hall signal value of the motor during working according to a preset per-unit basic value;
fitting sine and cosine waveforms of Hall signals of the motor according to the Hall signal values after per unit processing;
and calculating the angle of the motor according to the fitted sine and cosine waveforms.
Optionally, obtaining a hall signal value of the motor at the time of operation according to the hall signal collected at the time of operation of the motor includes:
sampling the Hall signal;
and determining the Hall signal value of the motor during working according to the difference value between the sampled Hall signal value and the pre-acquired initial Hall signal value.
Optionally, before performing per-unit processing on the hall signal value of the motor during operation according to a preset per-unit base value, the method further includes:
and determining the maximum Hall signal value as a per unit basic value from a plurality of Hall signal values of the motor in operation.
Optionally, fitting a sine-cosine waveform of the hall signal of the motor according to the hall signal value after per unit processing includes:
calculating the reference angular frequency of a Hall signal corresponding to the motor according to the rotation frequency of the motor;
obtaining a waveform parameter corresponding to the motor by adopting a least square method according to the Hall signal value subjected to per unit processing and the reference angular frequency; the waveform parameters include: a target phase and a target amplitude;
and fitting sine and cosine waveforms according to the target phase, the target amplitude and the reference angular frequency.
Optionally, calculating a reference angular frequency of a hall signal corresponding to the motor according to the rotation frequency of the motor includes:
calculating the time spent when the motor rotates for one circle according to the rotating frequency of the motor;
calculating the frequency of a Hall signal corresponding to the motor according to the time spent when the motor rotates for one circle and the number of cycles of sine and cosine signals generated when the motor rotates for one circle;
and obtaining the reference angular frequency according to the Hall signal frequency.
Optionally, obtaining a waveform parameter corresponding to the motor by using a least square method according to the hall signal value subjected to the per unit processing and the reference angular frequency, where the method includes:
obtaining a first matrix of Hall signal values according to the product of the function matrix and the parameter matrix; wherein the function matrix comprises: a plurality of sets of sine and cosine functions, each set of sine and cosine functions comprising: presetting a cosine function and a sine function of the integral multiple of the reference angular frequency; the parameter matrix includes: multiple sets of sine and cosine parameters, each set of sine and cosine parameters comprising: a cosine amplitude parameter and a sine amplitude function; the first matrix includes: a calculated Hall signal value obtained by the product of a group of sine and cosine functions and a group of sine and cosine parameters;
obtaining a residual matrix according to a second matrix formed by the Hall signal values after per unit processing and the first matrix; the residual matrix includes: the difference value of the Hall signal value after per unit processing and a calculated Hall signal value;
determining the sine and cosine parameter when the product of the residual matrix and the transpose of the residual matrix is minimum as a target sine and cosine parameter;
and respectively calculating a target phase and a target amplitude according to the target sine and cosine parameters.
Optionally, calculating an angle of the motor according to the fitted sine and cosine waveform includes:
and processing the sine and cosine waveforms by adopting an arc tangent method to obtain the angle of the motor.
In another aspect of the embodiments of the present application, there is provided a hall signal processing apparatus, including: the device comprises a signal acquisition module, a per-unit processing module, a waveform fitting module and an angle calculation module; the signal acquisition module is used for acquiring a Hall signal value of the motor during working according to the Hall signal acquired during working of the motor; the per-unit processing module is used for per-unit processing the Hall signal value of the motor during working according to a preset per-unit base value; the waveform fitting module is used for fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values after per unit processing; and the angle calculation module is used for calculating the angle of the motor according to the fitted sine and cosine waveforms.
Optionally, the signal acquisition module is specifically configured to sample a hall signal; and determining the Hall signal value of the motor during working according to the difference value between the sampled Hall signal value and the pre-acquired initial Hall signal value.
Optionally, the per-unit processing module is specifically configured to determine the maximum hall signal value as a per-unit base value from among a plurality of hall signal values of the motor during operation.
Optionally, the waveform fitting module is specifically configured to calculate a reference angular frequency of a hall signal corresponding to the motor according to a rotation frequency of the motor; obtaining a waveform parameter corresponding to the motor by adopting a least square method according to the Hall signal value subjected to per unit processing and the reference angular frequency; the waveform parameters include: a target phase and a target amplitude; and fitting sine and cosine waveforms according to the target phase, the target amplitude and the reference angular frequency.
Optionally, the waveform fitting module is further configured to calculate a time spent when the motor rotates for one turn according to the rotation frequency of the motor; calculating the frequency of a Hall signal corresponding to the motor according to the time spent when the motor rotates for one circle and the number of cycles of sine and cosine signals generated when the motor rotates for one circle; and obtaining the reference angular frequency according to the Hall signal frequency.
Optionally, the waveform fitting module is further configured to obtain a first matrix of hall signal values according to a product of the function matrix and the parameter matrix; wherein the function matrix comprises: a plurality of sets of sine and cosine functions, each set of sine and cosine functions comprising: presetting a cosine function and a sine function of the integral multiple of the reference angular frequency; the parameter matrix includes: multiple sets of sine and cosine parameters, each set of sine and cosine parameters comprising: a cosine amplitude parameter and a sine amplitude function; the first matrix includes: a calculated Hall signal value obtained by the product of a group of sine and cosine functions and a group of sine and cosine parameters; obtaining a residual matrix according to a second matrix formed by the Hall signal values after per unit processing and the first matrix; the residual matrix includes: the difference value of the Hall signal value after per unit processing and a calculated Hall signal value; determining the sine and cosine parameter when the product of the residual matrix and the transpose of the residual matrix is minimum as a target sine and cosine parameter; and respectively calculating a target phase and a target amplitude according to the target sine and cosine parameters.
Optionally, the angle calculation module is specifically configured to process the sine and cosine waveforms by using an arctangent method to obtain the angle of the motor.
In another aspect of the embodiments of the present application, there is provided a motor controller, including: the Hall signal processing method comprises a memory and a processor, wherein a computer program capable of running on the processor is stored in the memory, and the steps of the Hall signal processing method are realized when the processor executes the computer program.
In another aspect of the embodiments of the present application, a storage medium is provided, and a computer program is stored on the storage medium, and when being executed by a processor, the computer program implements the steps of the hall signal processing method.
The beneficial effects of the embodiment of the application include:
according to the Hall signal processing method and device, the motor controller and the storage medium, the Hall signal value of the motor during working can be obtained according to the Hall signal collected during working of the motor; performing per-unit processing on the Hall signal value of the motor during working according to a preset per-unit base value; fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values subjected to per unit processing; then, the angle of the motor can be calculated according to the fitted sine and cosine waveforms of the Hall signal of the motor, the error of the amplitude of the obtained Hall signal can be reduced by fitting the sine and cosine waveforms of the Hall signal of the motor, the accuracy of the obtained motor angle can be improved, and the accuracy of motor control can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flow chart of a hall signal processing method according to an embodiment of the present disclosure;
fig. 2 is a schematic flow chart of obtaining a hall signal value of a motor during operation according to an embodiment of the present disclosure;
fig. 3 is a schematic flow chart of fitting sine and cosine waveforms of hall signals of a motor according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of calculating a reference angular frequency of a hall signal corresponding to a motor according to an embodiment of the present disclosure;
FIG. 5 is a schematic flowchart of a calculation process using a least square method according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a hall signal processing apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a motor controller according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it is noted that the terms "first", "second", "third", and the like are used merely for distinguishing between descriptions and are not intended to indicate or imply relative importance.
The following explains a specific implementation procedure of the hall signal processing method provided in the embodiments of the present application by a specific embodiment.
Fig. 1 is a schematic flow chart of a hall signal processing method according to an embodiment of the present application, and referring to fig. 1, a hall signal processing method includes:
s110: and obtaining the Hall signal value of the motor during working according to the Hall signal acquired during the working of the motor.
It should be noted that, under the condition that the motor works, an output hall signal can be generated, the hall signal can be detected and acquired through the linear hall sensor, and the signal of the working motor can be acquired through the acquisition circuit or the acquisition device, so that the hall signal value of the working motor can be acquired.
Optionally, the hall signal output by the motor during operation is an analog quantity, and the hall signal values obtained by sampling a plurality of samples can be obtained by sampling the output hall signal through the acquisition circuit or the acquisition device.
S120: and performing per-unit processing on the Hall signal value of the motor during working according to a preset per-unit base value.
It should be noted that the preset per-unit base value may be one of the collected multiple hall signal values, or may be a preset fixed value, and the per-unit processing may be implemented by performing division operation on each hall signal value and the preset per-unit base value, so as to obtain a per-unit processing result of the multiple hall signal values.
S130: and fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values after per unit processing.
It should be noted that after obtaining a plurality of per-unit processed hall signal values, the sine and cosine waveforms of the hall signal of the motor may be fitted according to the hall signal values, where the sine and cosine waveforms of the hall signal may be represented in the form of a waveform formula, and the relevant parameters in the waveform formula are calculated according to the per-unit processed hall signal values, so as to obtain the result of the waveform formula, that is, the sine and cosine waveforms of the hall signal are obtained.
Alternatively, the sine-cosine waveform of the hall signal obtained above may be a standard sine waveform or a standard cosine waveform.
S140: and calculating the angle of the motor according to the fitted sine and cosine waveforms.
It should be noted that after the fitted sine and cosine waveforms are obtained, the angle of the motor may be calculated according to a waveform formula of the sine and cosine waveforms, the waveform formula of the sine and cosine waveforms is usually obtained by superimposing a plurality of sine waveforms and a plurality of cosine waveforms, and the formula may be arithmetically solved to calculate the angle of the motor.
According to the Hall signal processing method provided by the embodiment of the application, the Hall signal value of the motor during working can be obtained according to the Hall signal collected during working of the motor; performing per-unit processing on the Hall signal value of the motor during working according to a preset per-unit base value; fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values subjected to per unit processing; then, the angle of the motor can be calculated according to the fitted sine and cosine waveforms of the Hall signal of the motor, the error of the amplitude of the obtained Hall signal can be reduced by fitting the sine and cosine waveforms of the Hall signal of the motor, the accuracy of the obtained motor angle can be improved, and the accuracy of motor control can be improved.
The following explains a specific implementation process of obtaining a hall signal value of the motor during operation in the embodiment of the present application by using a specific embodiment.
Fig. 2 is a schematic flow chart illustrating a process of obtaining a hall signal value of a motor during operation according to an embodiment of the present application, please refer to fig. 2, where obtaining the hall signal value of the motor during operation according to a hall signal collected during operation includes:
s210: the hall signal is sampled.
It should be noted that, the hall signal during operation may be subjected to AD sampling (analog-digital sampling) by a collecting circuit disposed on the motor or a collecting device connected to the motor, where the sampling may be the hall signal output when the motor rotates for one circle, and a plurality of hall signal values in the hall signal are sampled.
S220: and determining the Hall signal value of the motor during working according to the difference value between the sampled Hall signal value and the pre-acquired initial Hall signal value.
It should be noted that the pre-obtained initial hall signal values may be output hall signal values acquired by the motor during power-on, the number of sampled hall signal values may be multiple, the initial hall signal values are subtracted from the multiple sampled hall signal values, and the obtained multiple difference values are the multiple hall signal values of the motor during operation.
Optionally, before performing per-unit processing on the hall signal value of the motor during operation according to a preset per-unit base value, the method further includes:
and determining the maximum Hall signal value as a per unit basic value from a plurality of Hall signal values of the motor in operation.
It should be noted that, in the process of performing the AD sampling, difference processing may be performed on the hall signal acquired each time, and then the maximum value of the acquired hall signal value is determined according to the result of the difference processing, where if the motor is a multi-phase motor, the maximum hall signal value of each phase may be found by the difference processing, and then the maximum hall signal value of each phase in the multi-phase is compared, and then the maximum value is used as the maximum hall signal value in the current sampling process, and the value may be used as a per unit base value.
The following explains a specific implementation process of fitting sine and cosine waveforms of hall signals of the motor provided in the embodiments of the present application by using a specific embodiment.
Fig. 3 is a schematic flow chart of fitting a sine-cosine waveform of a hall signal of a motor according to an embodiment of the present application, please refer to fig. 3, where fitting the sine-cosine waveform of the hall signal of the motor according to a hall signal value after per unit processing includes:
s310: and calculating the reference angular frequency of the Hall signal corresponding to the motor according to the rotation frequency of the motor.
It should be noted that the rotation frequency of the motor can be calculated by the rotation speed of the motor and the number of pole pairs of the motor, wherein the rotation speed of the motor can be obtained by measuring the rotation of the motor, the number of pole pairs of the motor is a fixed parameter of the motor when the motor leaves a factory, and the specific calculation formula is as follows:
f=N×p/60;
wherein f is the rotation frequency of the motor, N is the rotation speed (unit: r/min) of the motor, and p is the pole pair number of the motor.
The frequency of the Hall signal can be obtained through the rotation frequency of the motor, and then the reference angular frequency of the Hall signal can be obtained through the frequency calculation of the Hall signal.
S320: and obtaining the waveform parameters corresponding to the motor by adopting a least square method according to the Hall signal value subjected to per unit processing and the reference angular frequency.
Wherein the waveform parameters include: a target phase and a target amplitude.
It should be noted that a waveform formula may be constructed according to the obtained plurality of per unit processed hall signal values and the reference angular frequency, and a least square method is adopted to obtain corresponding waveform parameters in the waveform formula.
And selecting a target amplitude meeting the requirement from the plurality of amplitudes according to a least square method, and taking the target amplitude as the calculated waveform parameter of the motor.
S330: and fitting sine and cosine waveforms according to the target phase, the target amplitude and the reference angular frequency.
It should be noted that after the target phase, the target amplitude, and the reference angular frequency are obtained, a waveform formula for fitting sine and cosine waveforms may be constructed based on the target phase, the target amplitude, and the reference angular frequency, and the specific formula is as follows:
y^(i)=C cos(ωi+θ);
and y ^ (i) is a waveform formula of sine and cosine waveforms obtained through fitting, C is a target amplitude, theta is a target phase, omega is a reference angular frequency, and i is the ith Hall signal value.
The following explains a specific implementation process of calculating the reference angular frequency of the hall signal corresponding to the motor provided in the embodiment of the present application by using a specific embodiment.
Fig. 4 is a schematic flowchart of a process of calculating a reference angular frequency of a hall signal corresponding to a motor according to an embodiment of the present application, please refer to fig. 4, where calculating the reference angular frequency of the hall signal corresponding to the motor according to a rotation frequency of the motor includes:
s410: and calculating the time spent when the motor rotates for one circle according to the rotating frequency of the motor.
It should be noted that, the specific calculation method for the time spent by one rotation of the motor is as follows:
T=1/f;
wherein, T is the time of one rotation of the motor, and f is the rotation frequency of the motor.
S420: and calculating the frequency of the Hall signal corresponding to the motor according to the time spent by the motor rotating for one circle and the number of cycles of sine and cosine signals generated by the motor rotating for one circle.
It should be noted that, a circle of rotation of the motor will generate sine and cosine signals equivalent to the number of cycles of the pole pair value, that is, a circle of rotation of the motor will generate sine and cosine signals of p cycles; the period of the Hall signal can be determined according to the time spent when the motor rotates for one circle and the number of cycles of sine and cosine signals generated when the motor rotates for one circle, and the specific calculation formula is as follows:
T’=T/p;
wherein, T' is the period of the hall signal, and the hall signal frequency can be determined according to the period of the hall signal, and the specific calculation formula is as follows:
f’=1/T’=p/T=p×f;
wherein f' is the Hall signal frequency.
S430: and obtaining the reference angular frequency according to the Hall signal frequency.
After the hall signal frequency is determined, the reference angular frequency can be calculated according to the hall signal frequency, and the specific calculation process is as follows:
ω=2πf′;
where ω is the reference angular frequency.
The following explains a specific implementation procedure of the least square calculation provided in the embodiments of the present application by using a specific embodiment.
Fig. 5 is a schematic flowchart of a process of calculating by using a least square method according to an embodiment of the present application, please refer to fig. 5, where obtaining a waveform parameter corresponding to a motor by using a least square method according to a hall signal value after per unit processing and a reference angular frequency includes:
s510: and obtaining a first matrix of the Hall signal values according to the product of the function matrix and the parameter matrix.
Wherein the function matrix comprises: a plurality of sets of sine and cosine functions, each set of sine and cosine functions comprising: presetting a cosine function and a sine function of the integral multiple of the reference angular frequency; the parameter matrix includes: multiple sets of sine and cosine parameters, each set of sine and cosine parameters comprising: a cosine amplitude parameter and a sine amplitude function; the first matrix includes: a set of sine and cosine functions and a set of sine and cosine parameters.
It should be noted that, the trigonometric function expansion processing may be performed on the constructed waveform formula, and the waveform formula is decomposed into a superposition of a plurality of standard sine waveforms and a plurality of standard cosine waveforms:
y(t)=Ccos(2πft+θ)=Acos(2πft)+B sin(2πft);
the minimum residual square sum of the constructed waveform formula can be determined by a least square method, and the calculation formula of the residual square sum is specifically as follows:
Figure BDA0002699126990000111
where E is the sum of the squares of the residuals, yiConstructing a correlation matrix according to the correlation parameters in the calculation formula of the residual sum of squares for a plurality of per unit processed Hall signal values, wherein A is a cosine amplitude parameter, B is a sine amplitude function, i is the ith Hall signal value, n is the total number of Hall signal values, and M is specifically constructed as follows:
Figure BDA0002699126990000112
parameter matrix X0The concrete construction is as follows:
Figure BDA0002699126990000113
the first matrix is: m X0
S520: and obtaining a residual matrix according to a second matrix formed by the Hall signal values after per unit processing and the first matrix.
Wherein the residual matrix comprises: and the difference value of the Hall signal value after one per unit processing and the calculated Hall signal value.
It should be noted that the second matrix is specifically as follows:
Figure BDA0002699126990000114
constructing a residual matrix, wherein the residual matrix is as follows: (y-MX)0)。
S530: and determining the sine and cosine parameter when the product of the residual matrix and the transpose of the residual matrix is minimum as a target sine and cosine parameter.
The sum of the squares of the residuals may be minimal when the product of the residual matrix and the transpose of the residual matrix is minimal, i.e.:
E=E(ω)=(y-MX0)T(y-MX0);
when the value of E is minimum, solving the formula can obtain:
Figure BDA0002699126990000121
wherein the content of the first and second substances,
Figure BDA0002699126990000122
is X0Is the minimum of the fit values of (a), to give X at that time0Wherein the target cosine parameter and the target sine parameter are respectively A0And B0
S540: and respectively calculating a target phase and a target amplitude according to the target sine and cosine parameters.
According to the target sine and cosine parameter A0And B0The target amplitude may be determined as:
Figure BDA0002699126990000123
the target phase is:
Figure BDA0002699126990000124
optionally, calculating an angle of the motor according to the fitted sine and cosine waveform includes:
and processing the sine and cosine waveforms by adopting an arc tangent method to obtain the angle of the motor.
The sine and cosine waveform obtained by the method can be processed by adopting an inverse tangent method, and the angle of the motor can be solved.
It should be noted that after the target phase and the target amplitude are obtained by calculation, a target cosine signal can be obtained, and the target cosine signal can be represented as follows:
y(t)=Ccos(2πft+θ);
the target cosine signal may be fitted to a standard cosine signal:
that is, y (t) cos (θ');
accordingly, the hall signal is a two-phase signal, and the other phase signal corresponds to y (t) sin (θ');
on the basis, theta' is the angle of the motor, and is solved by adopting an arctangent method:
tanθ’=sinθ’/cosθ’;
θ’=arctan(sinθ’/cosθ’);
and then solving to obtain a motor angle theta'.
The following describes apparatuses, devices, and storage media for executing the hall signal processing method provided by the present application, and specific implementation processes and technical effects thereof are referred to above, and will not be described again below.
Fig. 6 is a schematic structural diagram of a hall signal processing apparatus according to an embodiment of the present application, and referring to fig. 6, the hall signal processing apparatus includes: the device comprises a signal acquisition module 100, a per-unit processing module 200, a waveform fitting module 300 and an angle calculation module 400; the signal acquisition module 100 is configured to obtain a hall signal value of the motor during operation according to a hall signal acquired during operation of the motor; the per-unit processing module 200 is used for per-unit processing the hall signal value of the motor during working according to a preset per-unit base value; the waveform fitting module 300 is used for fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values after per unit processing; and an angle calculation module 400, configured to calculate an angle of the motor according to the fitted sine and cosine waveforms.
Optionally, the signal obtaining module 100 is specifically configured to sample a hall signal; and determining the Hall signal value of the motor during working according to the difference value between the sampled Hall signal value and the pre-acquired initial Hall signal value.
Optionally, the per-unit processing module 200 is specifically configured to determine the maximum hall signal value as a per-unit base value from a plurality of hall signal values of the motor during operation.
Optionally, the waveform fitting module 300 is specifically configured to calculate a reference angular frequency of a hall signal corresponding to the motor according to a rotation frequency of the motor; obtaining a waveform parameter corresponding to the motor by adopting a least square method according to the Hall signal value subjected to per unit processing and the reference angular frequency; the waveform parameters include: a target phase and a target amplitude; and fitting sine and cosine waveforms according to the target phase, the target amplitude and the reference angular frequency.
Optionally, the waveform fitting module 300 is further configured to calculate a time spent by the motor rotating for one turn according to the rotation frequency of the motor; calculating the frequency of a Hall signal corresponding to the motor according to the time spent when the motor rotates for one circle and the number of cycles of sine and cosine signals generated when the motor rotates for one circle; and obtaining the reference angular frequency according to the Hall signal frequency and the periodicity.
Optionally, the waveform fitting module 300 is further configured to obtain a first matrix of hall signal values according to a product of the function matrix and the parameter matrix; wherein the function matrix comprises: a plurality of sets of sine and cosine functions, each set of sine and cosine functions comprising: presetting a cosine function and a sine function of the integral multiple of the reference angular frequency; the parameter matrix includes: multiple sets of sine and cosine parameters, each set of sine and cosine parameters comprising: a cosine amplitude parameter and a sine amplitude function; the first matrix includes: a calculated Hall signal value obtained by the product of a group of sine and cosine functions and a group of sine and cosine parameters; obtaining a residual matrix according to a second matrix formed by the Hall signal values after per unit processing and the first matrix; the residual matrix includes: the difference value of the Hall signal value after per unit processing and a calculated Hall signal value; determining the sine and cosine parameter when the product of the residual matrix and the transpose of the residual matrix is minimum as a target sine and cosine parameter; and respectively calculating a target phase and a target amplitude according to the target sine and cosine parameters.
Optionally, the angle calculating module 400 is specifically configured to process the sine and cosine waveforms by using an arctangent method to obtain the angle of the motor.
The above-mentioned apparatus is used for executing the method provided by the foregoing embodiment, and the implementation principle and technical effect are similar, which are not described herein again.
These above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when one of the above modules is implemented in the form of a Processing element scheduler code, the Processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 7 is a schematic structural diagram of a motor controller according to an embodiment of the present application, and referring to fig. 7, the motor controller includes: the hall signal processing method comprises a memory 500 and a processor 600, wherein a computer program which can be run on the processor 600 is stored in the memory 500, and when the processor 600 executes the computer program, the steps of the hall signal processing method are realized.
In another aspect of the embodiments of the present application, a storage medium is further provided, where a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the hall signal processing method are implemented.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A hall signal processing method, comprising:
according to Hall signals collected when the motor works, a Hall signal value of the motor during working is obtained;
performing per-unit processing on a Hall signal value of the motor during working according to a preset per-unit base value;
fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values after per unit processing;
and calculating the angle of the motor according to the fitted sine and cosine waveforms.
2. The method of claim 1, wherein obtaining the hall signal value of the motor during operation according to the hall signal collected during operation of the motor comprises:
sampling the Hall signal;
and determining the Hall signal value of the motor during working according to the difference value between the sampled Hall signal value and the pre-acquired initial Hall signal value.
3. The method according to claim 1, wherein before performing per-unit processing on the hall signal value of the motor in operation according to a preset per-unit base value, the method further comprises:
and determining the maximum Hall signal value as the per-unit basic value from a plurality of Hall signal values of the motor in operation.
4. The method according to claim 1, wherein the fitting the sine-cosine waveform of the hall signal of the motor according to the per-unit processed hall signal values comprises:
calculating the reference angular frequency of a Hall signal corresponding to the motor according to the rotation frequency of the motor;
obtaining a waveform parameter corresponding to the motor by adopting a least square method according to the Hall signal value subjected to per unit processing and the reference angular frequency; the waveform parameters include: a target phase and a target amplitude;
and fitting the sine and cosine waveform according to the target phase, the target amplitude and the reference angular frequency.
5. The method of claim 4, wherein calculating the reference angular frequency of the Hall signal corresponding to the motor based on the rotational frequency of the motor comprises:
calculating the time for the motor to rotate for one circle according to the rotation frequency of the motor;
calculating the frequency of a Hall signal corresponding to the motor according to the time of one rotation of the motor and the number of cycles of sine and cosine signals generated by one rotation of the motor;
and obtaining the reference angular frequency according to the Hall signal frequency.
6. The method according to claim 4, wherein obtaining the waveform parameters corresponding to the motor by a least square method according to the per-unit processed hall signal values and the reference angular frequency comprises:
obtaining a first matrix of Hall signal values according to the product of the function matrix and the parameter matrix; wherein the function matrix comprises: a plurality of sets of sine and cosine functions, each set of sine and cosine functions comprising: presetting integral multiple cosine function and sine function of the reference angular frequency; the parameter matrix includes: multiple sets of sine and cosine parameters, each set of sine and cosine parameters comprising: a cosine amplitude parameter and a sine amplitude function; the first matrix includes: a calculated Hall signal value obtained by the product of a group of sine and cosine functions and a group of sine and cosine parameters;
obtaining a residual matrix according to a second matrix formed by the Hall signal values after the per-unit processing and the first matrix; the residual matrix includes: the difference value of the Hall signal value after per unit processing and a calculated Hall signal value;
determining a sine and cosine parameter when the product of the residual matrix and the transpose of the residual matrix is minimum as a target sine and cosine parameter;
and respectively calculating the target phase and the target amplitude according to the target sine and cosine parameters.
7. The method of claim 1, wherein said calculating an angle of said motor from said fitted sine and cosine waveforms comprises:
and processing the sine and cosine waveforms by adopting an inverse tangent method to obtain the angle of the motor.
8. A hall signal processing apparatus, comprising: the device comprises a signal acquisition module, a per-unit processing module, a waveform fitting module and an angle calculation module;
the signal acquisition module is used for acquiring a Hall signal value of the motor during working according to the Hall signal acquired during working of the motor;
the per-unit processing module is used for per-unit processing the Hall signal value of the motor during working according to a preset per-unit basic value;
the waveform fitting module is used for fitting sine and cosine waveforms of the Hall signals of the motor according to the Hall signal values after per unit processing;
and the angle calculation module is used for calculating the angle of the motor according to the fitted sine and cosine waveforms.
9. A motor controller, comprising: memory in which a computer program is stored which is executable on the processor, and a processor which, when executing the computer program, carries out the steps of the method according to any one of the preceding claims 1 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202011019429.7A 2020-09-24 2020-09-24 Hall signal processing method and device, motor controller and storage medium Active CN112152542B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011019429.7A CN112152542B (en) 2020-09-24 2020-09-24 Hall signal processing method and device, motor controller and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011019429.7A CN112152542B (en) 2020-09-24 2020-09-24 Hall signal processing method and device, motor controller and storage medium

Publications (2)

Publication Number Publication Date
CN112152542A true CN112152542A (en) 2020-12-29
CN112152542B CN112152542B (en) 2022-04-19

Family

ID=73896849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011019429.7A Active CN112152542B (en) 2020-09-24 2020-09-24 Hall signal processing method and device, motor controller and storage medium

Country Status (1)

Country Link
CN (1) CN112152542B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090160687A1 (en) * 2007-12-21 2009-06-25 Japan Aviation Electronics Industry Limited R/D converter and angle detecting apparatus
CN104613986A (en) * 2015-02-05 2015-05-13 哈尔滨工业大学 Method for compensating reference voltage of photoelectric encoder based on least square fitting curve
CN110940371A (en) * 2019-12-13 2020-03-31 浙江禾川科技股份有限公司 Calibration method, device and equipment of rotary magnetoelectric encoder

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090160687A1 (en) * 2007-12-21 2009-06-25 Japan Aviation Electronics Industry Limited R/D converter and angle detecting apparatus
CN104613986A (en) * 2015-02-05 2015-05-13 哈尔滨工业大学 Method for compensating reference voltage of photoelectric encoder based on least square fitting curve
CN110940371A (en) * 2019-12-13 2020-03-31 浙江禾川科技股份有限公司 Calibration method, device and equipment of rotary magnetoelectric encoder

Also Published As

Publication number Publication date
CN112152542B (en) 2022-04-19

Similar Documents

Publication Publication Date Title
CN110940371B (en) Calibration method, device and equipment of rotary magnetoelectric encoder
JP5807770B2 (en) Rotation angle detector
CN109959400B (en) Method and device for calculating absolute encoder parameters and terminal equipment
CN108204825A (en) The correcting device and angular transducer of angular transducer
CN107566726B (en) A kind of method and device correcting rotating camera rotation angle
JP2012189376A (en) Rotation angle detection device and torque detection device
CN109540482B (en) Method and device for analyzing keyless synchronous vibration parameters of turbine blade
CN112152542B (en) Hall signal processing method and device, motor controller and storage medium
CN109307795B (en) Waveform point detection method and device
JP4794509B2 (en) Device for detecting the rotational position of a rotating body using a resolver
CN108555906B (en) Robot control method and device and robot
KR20180114743A (en) Absolute encoder, method for generating look-up table of sinusoidal wave, and method for detecting absolute angle using the same
JP4862496B2 (en) Resolver digital converter, rotation angle position detection device, and rotation machine control device
CN110849414A (en) Method, device and equipment for identifying bending direction of rotor and storage medium
CN115208247A (en) Method and device for measuring rotor position of motor
CN112560762B (en) Vehicle body rotation angle data processing method, device, controller and medium
CN110895131A (en) Monitoring method and system for excitation signal and response signal of rotary transformer
CN111750906A (en) Magnetoelectric encoder
JP4862485B2 (en) Resolver digital converter, rotation angle position detection device, and rotation machine control device
CN115310471A (en) Invalid blood flow signal identification method and device, ultrasonic equipment and readable storage medium
CN109061223B (en) Method and system for detecting motor fan steering
JPH1038576A (en) Azimuth sensor
CN116772904B (en) Signal compensation method of magnetic encoder, magnetic encoder and calibration system
CN116436360B (en) Magnetic declination anomaly detection method, apparatus, device and readable storage medium
US11722343B1 (en) Resolver integral demodulation using zero crossing points

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20221025

Address after: 523000 Room 601, No. 8, Jinniu Road, wanglian village, Wangniudun Town, Dongguan City, Guangdong Province

Patentee after: Dongguan Zhaowei electromechanical Co.,Ltd.

Patentee after: SHENZHEN ZHAOWEI MACHINERY&ELECTRONICS Co.,Ltd.

Address before: 518000 101, office building, 62 Yanhu Road, Yanchuan community, Yanluo street, Bao'an District, Shenzhen City, Guangdong Province

Patentee before: SHENZHEN ZHAOWEI MACHINERY&ELECTRONICS Co.,Ltd.