disclosure of Invention
To solve the above technical problems, the present invention aims to: the method, the system and the device for compensating the angle error of the servo motor have high practicability, are easy to implement and have low labor cost, so that the precision of angle error adjustment is improved.
The first technical scheme adopted by the invention is as follows:
the compensation method for the angle error of the servo motor comprises the following steps:
calculating the current value of a q axis of the servo motor in an open loop operation state;
calculating the operation electrical angular velocity of the servo motor according to the current value of the q axis of the servo motor;
and calculating an angle error compensation value of the servo motor according to the running electrical angular velocity of the servo motor.
Further, the step of calculating the current value of the q axis of the servo motor in the open loop operation state includes the steps of:
acquiring an open-loop operation equation of the servo motor according to the equivalent equation of the servo motor; wherein, the equivalent equation of the servo motor is as follows:
wherein u is
dRepresenting the component of the stator voltage on the d-axis; r
sRepresents the stator resistance; i.e. i
dRepresenting the component of the stator current in the d-axis;
representing a differential operator; psi
dRepresenting the component of the stator flux linkage in the d-axis; omega
eRepresenting the operating electrical angular velocity of the servo motor; psi
qRepresenting the component of the stator flux linkage in the q-axis; i.e. i
qRepresenting the component of the stator current in the q-axis; u. of
qRepresenting the component of the stator voltage on the q-axis;
calculating the current value of the q axis of the servo motor according to the open loop operation equation of the servo motor; the open-loop operation equation of the servo motor is as follows:
wherein L isqRepresents the q-axis inductance; l isdRepresents the d-axis inductance; psifRepresenting the rotor flux.
Further, the step of calculating the current value of the q axis of the servo motor according to the open loop operation equation of the servo motor comprises the following steps:
controlling the starting of the motor according to an open-loop operation equation of the servo motor;
detecting three-phase current of the servo motor through a Hall sensor;
and calculating the current value of the q axis of the servo motor according to the three-phase current of the servo motor.
Further, the step of controlling the motor to start up according to the open-loop operation equation of the servo motor comprises the following steps:
converting a voltage set value of a d axis of the servo motor into a voltage set value of an alpha axis, and converting a voltage set value of a q axis of the servo motor into a voltage set value of a beta axis;
converting the voltage set value of the alpha axis and the voltage set value of the beta axis into corresponding pulse widths;
and controlling the inverter to drive the servo motor to operate according to the pulse width obtained by conversion.
Further, in the step of calculating the operating electrical angular velocity of the servo motor according to the current value of the q axis of the servo motor, the calculation formula of the operating electrical angular velocity is as follows:
wherein, ω iseRepresenting the operating electrical angular velocity of the servo motor; psifRepresenting the rotor flux; psiqRepresenting the component of the stator flux linkage in the q-axis; rsRepresents the stator resistance; l isdRepresents the d-axis inductance; i.e. iqRepresenting the component of the stator current in the q-axis; u. ofqRepresenting the component of the stator voltage on the q-axis.
Further, the step of calculating the angle error compensation value of the servo motor according to the operating electrical angular velocity of the servo motor includes the steps of:
acquiring an actual angular velocity value of the servo motor through an angular velocity sensor;
calculating the angular velocity error of the servo motor according to the actual angular velocity value and the operation electrical angular velocity of the servo motor;
calculating the angle error of the servo motor according to the angular speed error of the servo motor;
and carrying out error compensation according to the angle error of the servo motor.
The second technical scheme adopted by the invention is as follows:
servo motor angular error's compensation system includes:
the current value calculation module is used for calculating the current value of the q axis of the servo motor in an open-loop operation state;
the electric angular velocity calculation module is used for calculating the operation electric angular velocity of the servo motor according to the current value of the q axis of the servo motor;
and the compensation value calculating module is used for calculating the angle error compensation value of the servo motor according to the running electrical angular velocity of the servo motor.
Further, the current value calculation module includes:
the open-loop operation equation obtaining unit is used for obtaining an open-loop operation equation of the servo motor according to the equivalent equation of the servo motor;
and the current value calculating unit is used for calculating the current value of the q axis of the servo motor according to the open-loop operation equation of the servo motor.
Further, the offset value calculation module includes:
the actual angular velocity value calculating unit is used for acquiring an actual angular velocity value of the servo motor through the angular velocity sensor;
the angular velocity error calculation unit is used for calculating the angular velocity error of the servo motor according to the actual angular velocity value and the operation electrical angular velocity of the servo motor;
the angle error calculation unit is used for calculating the angle error of the servo motor according to the angular speed error of the servo motor;
and the error compensation unit is used for carrying out error compensation according to the angle error of the servo motor.
The third technical scheme adopted by the invention is as follows:
the compensation arrangement of servo motor angle error includes:
a memory for storing a program;
and the processor is used for loading a program to execute the compensation method of the angle error of the servo motor according to the first technical scheme.
The invention has the beneficial effects that: the method includes the steps that the current value of a q axis of the servo motor in an open-loop operation state and the operation electrical angular speed of the servo motor are calculated, and finally the angle error compensation value of the servo motor is obtained; the angle compensation method can perform angle compensation in real time under the open-loop operation state of the servo motor, does not need human intervention, is easy to realize and low in labor cost, and simultaneously avoids errors of manual correction, thereby improving the precision of angle detection; in addition, the invention does not need to drive the motor to run to a certain speed through an external motion mechanism, only needs to calculate the current value of the q axis of the servo under the open-loop running state, and has high practicability.
Detailed Description
The invention will be further explained and explained with reference to the drawings and the embodiments in the description. The step numbers in the embodiments of the present invention are set for convenience of illustration only, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
Referring to fig. 1, the method for compensating the angle error of the servo motor of the present invention includes the following steps:
calculating the current value of a q axis of the servo motor in an open loop operation state;
calculating the operation electrical angular velocity of the servo motor according to the current value of the q axis of the servo motor;
and calculating an angle error compensation value of the servo motor according to the running electrical angular velocity of the servo motor.
Further preferably, the step of calculating the current value of the q axis of the servo motor in the open loop operation state includes the steps of:
acquiring an open-loop operation equation of the servo motor according to the equivalent equation of the servo motor; wherein, the equivalent equation of the servo motor is as follows:
wherein u is
dRepresenting the component of the stator voltage on the d-axis; r
sRepresents the stator resistance; i.e. i
dRepresenting the component of the stator current in the d-axis;
representing a differential operator; psi
dRepresenting the component of the stator flux linkage in the d-axis; omega
eRepresenting the operating electrical angular velocity of the servo motor; psi
qRepresenting the component of the stator flux linkage in the q-axis; i.e. i
qRepresenting the component of the stator current in the q-axis; u. of
qRepresenting the component of the stator voltage on the q-axis;
calculating the current value of the q axis of the servo motor according to the open loop operation equation of the servo motor; the open-loop operation equation of the servo motor is as follows:
wherein L isqRepresents the q-axis inductance; l isdRepresents the d-axis inductance; psifRepresenting the rotor flux.
Further, as a preferred embodiment, the step of calculating the current value of the q-axis of the servo motor according to the open loop operation equation of the servo motor includes the steps of:
controlling the starting of the motor according to an open-loop operation equation of the servo motor;
detecting three-phase current of the servo motor through a Hall sensor;
and calculating the current value of the q axis of the servo motor according to the three-phase current of the servo motor.
Further, as a preferred embodiment, the step of controlling the motor to start according to the open-loop operation equation of the servo motor includes the following steps:
converting a voltage set value of a d axis of the servo motor into a voltage set value of an alpha axis, and converting a voltage set value of a q axis of the servo motor into a voltage set value of a beta axis;
converting the voltage set value of the alpha axis and the voltage set value of the beta axis into corresponding pulse widths;
and controlling the inverter to drive the servo motor to operate according to the pulse width obtained by conversion.
In a further preferred embodiment, in the step of calculating the operating electrical angular velocity of the servo motor based on the current value of the q-axis of the servo motor, the operating electrical angular velocity is calculated by the following formula:
wherein, ω iseRepresenting the operating electrical angular velocity of the servo motor; psifRepresenting the rotor flux; psiqRepresenting the component of the stator flux linkage in the q-axis; rsRepresents the stator resistance; l isdRepresents the d-axis inductance; i.e. iqRepresenting the component of the stator current in the q-axis; u. ofqRepresenting the component of the stator voltage on the q-axis.
Further, as a preferred embodiment, the step of calculating the angular error compensation value of the servo motor according to the operating electrical angular velocity of the servo motor includes the steps of:
acquiring an actual angular velocity value of the servo motor through an angular velocity sensor;
calculating the angular velocity error of the servo motor according to the actual angular velocity value and the operation electrical angular velocity of the servo motor;
calculating the angle error of the servo motor according to the angular speed error of the servo motor;
and carrying out error compensation according to the angle error of the servo motor.
Corresponding to the method of fig. 1, the compensation system for the angle error of the servo motor of the invention comprises:
the current value calculation module is used for calculating the current value of the q axis of the servo motor in an open-loop operation state;
the electric angular velocity calculation module is used for calculating the operation electric angular velocity of the servo motor according to the current value of the q axis of the servo motor;
and the compensation value calculating module is used for calculating the angle error compensation value of the servo motor according to the running electrical angular velocity of the servo motor.
Further preferably, the current value calculating module includes:
the open-loop operation equation obtaining unit is used for obtaining an open-loop operation equation of the servo motor according to the equivalent equation of the servo motor;
and the current value calculating unit is used for calculating the current value of the q axis of the servo motor according to the open-loop operation equation of the servo motor.
Further as a preferred embodiment, the offset value calculation module includes:
the actual angular velocity value calculating unit is used for acquiring an actual angular velocity value of the servo motor through the angular velocity sensor;
the angular velocity error calculation unit is used for calculating the angular velocity error of the servo motor according to the actual angular velocity value and the operation electrical angular velocity of the servo motor;
the angle error calculation unit is used for calculating the angle error of the servo motor according to the angular speed error of the servo motor;
and the error compensation unit is used for carrying out error compensation according to the angle error of the servo motor.
Corresponding to the method of fig. 1, the compensation device for the angle error of the servo motor of the invention comprises:
a memory for storing a program;
and the processor is used for loading a program to execute the compensation method of the servo motor angle error.
The following takes the angular error compensation system shown in fig. 2 as an example to describe in detail the specific implementation steps of the compensation method for the angular error of the servo motor of the present invention:
s1, acquiring an open-loop operation equation of the servo motor according to the equivalent equation of the servo motor;
wherein, the equivalent equation of the servo motor in step S1 is as follows:
wherein u is
dRepresenting the component of the stator voltage on the d-axis; r
sRepresents the stator resistance; i.e. i
dRepresenting the component of the stator current in the d-axis;
representing a differential operator; psi
dRepresenting the component of the stator flux linkage in the d-axis; omega
eRepresenting the operating electrical angular velocity of the servo motor; psi
qRepresenting the component of the stator flux linkage in the q-axis; i.e. i
qRepresenting the component of the stator current in the q-axis; u. of
qRepresenting the component of the stator voltage on the q-axis;
in this embodiment, let u in the equivalent equation
d=0,
And
obtaining:
0=Rsid-ωeψq
uq=Rsiq+ωeψd,
wherein psiq=iqLq;ψq=idLd+ψf;LdRepresents the d-axis inductance; l isqRepresents the q-axis inductance; psifRepresenting the rotor flux;
and finally, obtaining an open-loop operation equation of the servo motor by sorting:
s2, calculating the current value of the q axis of the servo motor according to the open loop operation equation of the servo motor;
wherein, step S2 specifically includes the following steps:
s21, controlling the motor to start according to the open-loop operation equation of the servo motor; step S21 specifically includes the following steps;
s211, converting a voltage set value of a d axis of the servo motor into a voltage set value of an alpha axis, and converting a voltage set value of a q axis of the servo motor into a voltage set value of a beta axis;
s212, converting the voltage set value of the alpha axis and the voltage set value of the beta axis into corresponding pulse widths;
and S213, controlling the inverter to drive the servo motor to operate according to the converted pulse width.
Such as: by controlling u in the open-loop operating equationqAnd controlling the servo motor to start within the range of 0-10V.
S22, detecting three-phase current of the servo motor through a Hall sensor;
and S23, calculating the current value of the q axis of the servo motor according to the three-phase current of the servo motor.
In this embodiment, a matrix calculation method is adopted to obtain a current value of a q axis of a servo motor, where the matrix calculation method is:
wherein iA、iBAnd iCRepresenting three-phase currents of the servo motor; the current value i of the q axis of the servo motor can be obtained through calculation of the two matrix equationsq。
S3, calculating the operation electrical angular velocity of the servo motor according to the current value of the q axis of the servo motor; the calculation formula of the operating electrical angular velocity is as follows:
wherein, ω iseRepresenting the operating electrical angular velocity of the servo motor; psifRepresenting the rotor flux; psiqRepresenting the component of the stator flux linkage in the q-axis; rsRepresents the stator resistance; l isdRepresents the d-axis inductance; i.e. iqRepresenting the component of the stator current in the q-axis; u. ofqRepresenting the component of the stator voltage on the q-axis.
And S4, calculating an angle error compensation value of the servo motor according to the running electrical angular velocity of the servo motor.
Wherein, step S4 specifically includes the following steps:
s41, acquiring an actual angular velocity value of the servo motor through an angular velocity sensor;
s42, calculating the angular velocity error of the servo motor according to the actual angular velocity value and the operation electrical angular velocity of the servo motor; the calculation formula of the angular speed error of the servo motor is as follows:
wherein e (ω) represents an angular velocity error; omegarRepresenting the actual angular velocity value of the servo motor acquired by the angular velocity sensor; omegaeRepresenting the operating electrical angular velocity of the servo motor; psifRepresenting the rotor flux; rsRepresents the stator resistance;Ldrepresents the d-axis inductance; i.e. iqRepresenting the component of the stator current in the q-axis; u. ofqRepresenting the component of the stator voltage on the q-axis.
S43, calculating the angle error of the servo motor according to the angular speed error of the servo motor; the calculation formula of the angle error is as follows: Δ θ ═ e (ω) T, where Δ θ represents the angle error; e (ω) represents the angular velocity error; t is the sampling time of the servo motor.
And S44, compensating the error according to the angle error of the servo motor. Step S44 specifically includes: acquiring actual rotation angle theta of servo motor through angle sensor1Then, according to the actual rotation angle and the angle error obtained by settlement, the ideal rotation angle theta of the servo motor is calculated, and the calculation formula is as follows: theta is equal to theta1And + delta theta, and finally, the ideal rotation angle is sent to a corresponding control module for error compensation.
In summary, the method, system and device for compensating the angle error of the servo motor of the invention have the following advantages:
1) the method can perform angle compensation in real time under the open-loop operation state of the servo motor, does not need human intervention, is easy to realize, has low labor cost, and simultaneously improves the precision of angle detection;
2) real-time angle compensation is carried out on each adopted period, dynamic error compensation of motor operation can be realized, and accurate operation angle detection and control are obtained;
3) according to the invention, the motor is not required to be driven to run to a certain speed by an external motion mechanism, the current value of the q axis of the servo motor can be calculated only according to the open-loop running equation, and the practicability is high.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.