Initial electrical angle self-calibration method, apparatus and storage medium for servo motor control

By performing a self-calibration process once in the servo motor system and storing the electrical angle offset, the problem of repeated identification every time the servo motor control system is powered on is solved, improving startup efficiency and response speed, and ensuring the accuracy and consistency of the electrical angle offset.

CN121984401BActive Publication Date: 2026-07-10SHENZHEN GUMEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN GUMEI TECH CO LTD
Filing Date
2026-04-03
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing servo motor control systems require repeating the initial electrical angle identification process every time power is turned on, resulting in startup time delays and affecting system response speed and production efficiency.

Method used

A mechanism of one-time self-calibration, storage, and multiple reuse is adopted. After the servo all-in-one machine is powered on, the first power-on self-calibration process is performed to calculate and store the electrical angle offset in non-volatile memory. Subsequent power-on processes can directly read the offset to achieve real-time electrical angle calculation and avoid repeated identification.

Benefits of technology

It significantly improves the startup efficiency and response speed of the servo system, ensures the accuracy and consistency of electrical angle offset, simplifies equipment installation and maintenance, and enhances user-friendliness and control precision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121984401B_ABST
    Figure CN121984401B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of servo motor control, and provides an initial electric angle self-calibration method, device and storage medium for servo motor control. The method comprises the following steps: a controller controls a power circuit to inject a preset direct-current excitation current into a winding of a servo motor, so as to generate a fixed-direction stator resultant magnetic field, and a rotor permanent magnet is dragged and aligned to the fixed-direction stator resultant magnetic field; after judging that the rotor is aligned stably, an aligned mechanical angle output by a magneto-electric encoder is read; an electric angle offset between an installation zero point of the magneto-electric encoder and an electric zero point of the servo motor is calculated and obtained; the electric angle offset is stored in a nonvolatile memory as a control parameter, and initial electric angle self-calibration is completed; after the self-calibration control flow is completed, real-time electric angles used for performing magnetic field orientation control are solved in real time based on the electric angle offset stored in the nonvolatile memory; and the controller performs magnetic field orientation control on the servo motor based on the real-time electric angles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of servo motor control technology, and in particular to an initial electrical angle self-calibration method, apparatus and storage medium for servo motor control. Background Technology

[0002] Servo control systems, due to their high degree of integration, are widely used in industrial automation. They typically consist of a servo motor, a magneto-electric encoder, and a drive control board. The magneto-electric encoder is used to detect the absolute mechanical position of the motor rotor and is crucial for achieving high-precision field-oriented control (FOC). However, due to mechanical assembly tolerances, there is usually a fixed angular deviation between the mechanical zero position of the magneto-electric encoder and the electrical zero position of the servo motor windings (i.e., the U-phase axis). This deviation is called the electrical angle offset. If this offset cannot be accurately determined, the control system will be unable to calculate the correct electrical angle from the encoder readings, leading to control failure, torque fluctuations, or start-up failure.

[0003] Currently, to obtain this crucial parameter, a common practice is to perform an initial electrical angle identification process every time the servo system is powered on. This process typically involves injecting a specific test signal into the motor windings to rotate the rotor to a known electrical position, while simultaneously reading the mechanical position fed back by the encoder. The difference between the two is then calculated to identify the current electrical angle offset in real time, which is then used for control calculations during the current run.

[0004] However, the existing technical solutions have a significant drawback: since the electrical angle offset is a fixed value determined by mechanical installation and typically remains unchanged throughout the servo unit's lifespan, the current methods require repeating the entire identification process every time the device is powered on. This repetitive operation inevitably introduces additional startup time delays, reducing system response speed. Especially in applications requiring frequent starts and stops or demanding high startup speeds, the accumulated identification waiting time each power-on directly impacts the equipment's cycle time and production efficiency. Therefore, how to avoid unnecessary repetitive identification of fixed parameters, thereby improving the startup efficiency of the servo system, has become a pressing issue. Summary of the Invention

[0005] This application provides an initial electrical angle self-calibration method, device, and storage medium for servo motor control. Through the mechanism of "one-time self-calibration, storage, and multiple reuse", the initial electrical angle identification is avoided every time the power is turned on, thereby significantly improving the startup efficiency and response speed of the servo system.

[0006] On one hand, this application provides an initial electrical angle self-calibration method for servo motor control, applied to a servo integrated machine including a servo motor, a magneto-electric encoder, a driver board, and non-volatile memory. The method includes a self-calibration control process executed by the controller of the driver board:

[0007] After the servo all-in-one machine is powered on, the initial power-on self-calibration process is executed, which includes:

[0008] The controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, and executes rotor alignment control to pull and align the rotor permanent magnet to the direction of the fixed stator composite magnetic field.

[0009] After determining that the rotor alignment is stable, the alignment mechanical angle output by the magneto-electric encoder is read;

[0010] Based on the alignment mechanical angle and the preset reference electrical angle phase, the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor is calculated and obtained.

[0011] The electrical angle offset is stored as a control parameter in the non-volatile memory to complete the initial electrical angle self-calibration;

[0012] After the self-calibration control process is completed, the controller reads the mechanical angle of the magneto-electric encoder in real time, and calculates the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory.

[0013] Based on the real-time electrical angle, the controller performs magnetic field orientation control on the servo motor.

[0014] On the other hand, this application provides an initial electrical angle self-calibration device for servo motor control, applied to a servo integrated machine including a servo motor, a magneto-electric encoder, a driver board, and non-volatile memory. The device includes the following module that performs an initial power-on self-calibration process after the servo integrated machine is powered on:

[0015] The alignment module is used by the controller power circuit of the drive board to inject a preset DC excitation current into the winding of the servo motor to generate a stator composite magnetic field with a fixed direction, and to perform rotor alignment control to pull and align the rotor permanent magnet to the direction of the fixed stator composite magnetic field.

[0016] The reading module is used to read the alignment mechanical angle output by the magneto-electric encoder after determining that the rotor alignment is stable;

[0017] The calculation module is used to calculate and obtain the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the alignment mechanical angle and the preset reference electrical angle phase.

[0018] The storage module is used to store the electrical angle offset as a control parameter in the non-volatile memory to complete the initial electrical angle self-calibration;

[0019] The calculation module is used to read the mechanical angle of the magneto-electric encoder in real time after the self-calibration control process is completed, and calculate the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory.

[0020] An execution module is used to perform field orientation control on the servo motor by the controller based on the real-time electrical angle.

[0021] Thirdly, this application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the technical solution of the initial electrical angle self-calibration method for servo motor control as described above.

[0022] Fourthly, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of the technical solution described above for the initial electrical angle self-calibration method for servo motor control.

[0023] As can be seen from the technical solution provided in this application above, on the one hand, a complete self-calibration process is performed when the system is powered on for the first time. After calculating the electrical angle offset, it is stored as a control parameter in a non-volatile memory. In all subsequent power-on and startup processes, the system does not need to perform the time-consuming excitation alignment and calculation process again. It can directly read the stored fixed offset for real-time electrical angle calculation. This "one-time calibration, multiple uses" mechanism eliminates the repetitive identification operation required for each power-on in existing technologies, significantly shortening the system's startup preparation time and improving overall response speed and operating efficiency. On the other hand, by injecting a preset DC excitation current into the motor windings through the control power circuit, a stator composite magnetic field with a fixed direction is generated, thereby pulling and stably aligning the rotor permanent magnet to this fixed direction. This static alignment method based on DC excitation enables the rotor to overcome static friction and stably remain in a defined position, avoiding the uncertainty in alignment position that may be caused by signal noise or algorithm convergence issues during dynamic identification. This provides stable and reliable conditions for accurately reading the alignment mechanical angle of the magneto-electric encoder, ensuring the accuracy of the calculated electrical angle offset. Thirdly, by storing the calculated electrical angle offset in non-volatile memory, this key control parameter can be stored in the set... The parameter is permanently stored after a power outage. Regardless of how many power outages and restarts the system undergoes, as long as the mechanical structure remains unchanged, the parameter remains valid and can be inherited. This not only ensures the consistency of servo motor control performance and avoids the hassle of re-adjustment due to parameter loss, but also facilitates equipment installation, maintenance, and replacement, improving the product's user-friendliness and maintainability. After self-calibration, the controller's real-time control process calculates the real-time electrical angle based on the stored electrical angle offset and the real-time encoder mechanical angle. Essentially, it performs a fixed and accurate coordinate transformation compensation on the original encoder reading, ensuring that the electrical angle signal input to the field-oriented control algorithm accurately reflects the rotor's electrical position. Based on this accurate real-time electrical angle, field-oriented control is executed, ensuring that the motor generates stable and precise torque, achieving high dynamic performance operation, and solving the problem of decreased control accuracy caused by initial angle deviation. In summary, the technical solution of this application, through the mechanism of "one-time self-calibration, storage, and multiple reuse," avoids repeatedly executing the initial electrical angle identification every time power is applied, thereby significantly improving the startup efficiency and response speed of the servo system. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 This is a flowchart of the initial electrical angle self-calibration method for servo motor control provided in the embodiments of this application;

[0026] Figure 2 This is a schematic diagram of the structure of the initial electrical angle self-calibration device for servo motor control provided in the embodiments of this application;

[0027] Figure 3 This is a schematic diagram of the device provided in the embodiments of this application. Detailed Implementation

[0028] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] In this specification, adjectives such as "first" and "second" are used only to distinguish one element or action from another, without necessarily requiring or implying any actual such relationship or order. Where circumstances permit, reference to an element or component or step (etc.) should not be construed as being limited to only one of the elements, components, or steps, but may be one or more of the elements, components, or steps, etc.

[0030] For ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn to actual scale.

[0031] Currently, to obtain the critical parameter of electrical angle offset, the common practice is to perform an initial electrical angle identification process every time the servo system is powered on. This process typically involves injecting a specific test signal into the motor windings to rotate the rotor to a known electrical position, while simultaneously reading the mechanical position feedback from the encoder. The difference between the two is then calculated to identify the current electrical angle offset in real time, which is used for control calculations during the current run. However, the above-mentioned existing solutions have a significant drawback: since the electrical angle offset is a fixed value determined by the mechanical installation and typically does not change throughout the servo unit's lifespan, the existing methods require repeating the entire identification process every time the system is powered on. This repetitive operation inevitably introduces additional startup time delays, reducing system response speed. Especially in applications requiring frequent starts and stops or high startup speeds, the accumulated identification waiting time each power-on directly impacts the equipment's cycle time and production efficiency. Therefore, how to avoid unnecessary repetitive identification of a fixed parameter, thereby improving the startup efficiency of the servo system, has become an urgent problem to be solved.

[0032] To address the aforementioned problems in existing technologies, this application proposes an initial electrical angle self-calibration method for servo motor control, applicable to various servo integrated machines that include a servo motor, a magneto-electric encoder, a drive control board, and non-volatile memory. The drive control board (hereinafter referred to as the drive board) integrates a microprocessor (as a controller), a power inverter circuit (i.e., a power circuit), a current sampling circuit, an encoder interface, etc. The non-volatile memory can be a Flash memory integrated within the microprocessor or an external EEPROM or FRAM chip. The magneto-electric encoder is coaxially mounted with the servo motor and is used to detect the absolute mechanical position of the motor rotor. The software implementation of this method is a control program stored in the drive board's program memory, executed by the controller; its flowchart is attached. Figure 1 As shown, it mainly includes steps S1 to S6, which are detailed below:

[0033] Step S1: The controller controls the power circuit to inject a preset DC excitation current into the winding of the servo motor to generate a stator composite magnetic field with a fixed direction, and executes rotor alignment control to pull and align the rotor permanent magnet to the fixed direction of the stator composite magnetic field.

[0034] Step S1 is the initial action of the self-calibration process, aiming to establish a definite and stable physical position reference for the rotor without relying on any prior angle information. Existing technologies also employ methods such as injecting high-frequency rotating voltage vectors to excite the rotor and estimate its initial position; however, these methods may cause unnecessary rotor micro-motion or noise, and the algorithms are complex, with convergence speed and stability significantly affected by parameters. This application, however, adopts a more direct and stable static alignment strategy.

[0035] Specifically, the controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, which can be achieved through steps S1.1 to S1.3, as detailed below:

[0036] Step S1.1: Set the d-axis current setpoint of the current loop to zero and the q-axis current setpoint to a non-zero constant value.

[0037] In the field-oriented control theory of servo motors, the stator current is decomposed into d-axis current (excitation component) and q-axis current (torque component) in a synchronous rotating coordinate system (dq coordinate system). Setting the d-axis current setpoint to zero means that during this alignment process, no additional increase or decrease in the air gap magnetic field generated by the permanent magnet is required, avoiding complex magnetic saturation effects. Setting the q-axis current setpoint to a non-zero constant value, such as 10% of the motor's rated current, aims to generate a defined electromagnetic torque. The basic formula for electromagnetic torque in the dq coordinate system is: ,in, For extreme logarithms, It is a permanent magnet flux linkage. and These are the d-axis inductance and the q-axis inductance, respectively. When... When =0, the torque simplifies to This indicates that when the d-axis current is zero, the q-axis current directly and linearly determines the magnitude and direction of the electromagnetic torque. This constant given value of the q-axis current is the "power source" for the subsequent generation of a composite magnetic field with a fixed direction.

[0038] Step S1.2: In space vector modulation control, the electrical angle input is forcibly set to an angle value that is consistent with the preset reference electrical angle phase.

[0039] To convert the d-axis and q-axis current setpoints set in step S1.1 into actual voltages applied to the three-phase windings of the motor, the controller needs to perform space vector modulation (SVM). The SVM algorithm requires an electrical angle value as input. A coordinate inverse transformation is performed, that is, from the dq coordinate system to the stationary αβ coordinate system, and then the three-phase duty cycle is generated through the Park inverse transformation or Clarke inverse transformation. Typically, during normal field-oriented control operation, this electrical angle value... The electrical angle is estimated or calculated in real time. However, in this alignment step, since the electrical angle is not yet known, this application adopts a clever approach: the electrical angle input required by the SVM algorithm is forcibly set to a known, fixed angle value, namely, a preset reference electrical angle phase. For example, to The setting is 90 degrees. This means that regardless of the actual rotor position, the controller assumes the current rotor position is 90 degrees. This is used to generate a pulse width modulation (PWM) wave, resulting in the three-phase voltages generated by the inverter synthesizing a spatially fixed magnetic field inside the motor. The direction of this magnetic field strictly corresponds to... This is the key control operation for achieving a fixed-direction stator composite magnetic field.

[0040] In the above embodiments, Setting the reference phase to 90 degrees, i.e., a fixed phase, may be optimal for one type of motor, but not optimal for another (e.g., an internal permanent magnet synchronous motor). To make the reference phase an adaptive variable selected based on the characteristics of the controlled object (i.e., the motor type), the aforementioned preset reference electrical angle phase can be non-fixed. Instead, it can be dynamically selected by the controller from multiple pre-stored candidate phases based on motor type parameters or real-time electrical parameters. For surface-mounted permanent magnet synchronous motors, the phase that maximizes the alignment torque when the d-axis current is zero is selected as the reference electrical angle phase. For internal permanent magnet synchronous motors, the phase that maximizes the alignment torque under the current current or provides the smoothest alignment process is selected as the reference electrical angle phase. This scheme, through dynamic selection, allows the same self-calibration method to adapt to motors with different characteristics, always calling the alignment strategy that is optimal for the motor (e.g., maximum torque or smoothest alignment), greatly improving the versatility of the scheme and the ultimate performance ceiling in different applications.

[0041] Step S1.3: Perform current closed-loop control to stabilize the phase current of the motor at the given value of the q-axis current and maintain the preset excitation duration, thereby generating a stator composite magnetic field with a fixed direction.

[0042] Forced SVM angle to be Then, the controller initiates the current closed-loop. The current sampling circuit monitors the motor phase current in real time and obtains the actual current through coordinate transformation. and The current regulator (usually a PI regulator) will detect... , With a given value Comparison, i.e. Compared with the d-axis current setpoint of 0, With q-axis current setpoint Compare and output the corresponding d-axis and q-axis voltage commands. , These voltage commands, combined with the forced angle settings, The PWM signal for driving the power transistor is generated using SVM. This closed-loop process continues, forcing the actual current to track the given value. Because... Given a positive value, according to the aforementioned torque formula, a driving torque will be generated. This torque will cause the rotor permanent magnet to rotate in a direction aligned with the direction of the stator's combined magnetic field (i.e., the N pole aligned with the S pole). Since the stator magnetic field direction is "locked," the rotor will eventually be pulled and stabilized in the aligned position, that is, the rotor's d-axis (the direction of the permanent magnet's N pole) will point towards... The electrical angle direction (because opposite poles attract). Maintaining a preset excitation duration (e.g., 1.0 second) is to ensure that the rotor has enough time to overcome static friction, mechanical damping, and eventually stabilize. This "aligned" state is a static equilibrium point, and the rotor will remain in this position as long as the current is maintained.

[0043] As can be seen from the above steps S1 and its specific embodiments, by injecting DC excitation current to generate a stator magnetic field with a fixed direction, the rotor is stably pulled and held in a certain physical position by magnetic force, creating a static and strongly maintainable alignment state. In this stable state, the mechanical angle reading corresponding to the magneto-electric encoder can be reliably and without jitter, providing a unique, stable and physically achievable "measurement reference point" for the entire scheme.

[0044] To proactively address the issue of complex debugging or slow convergence of the current closed-loop control when system parameters (e.g., winding resistance, inductance) are unknown or changing, as another embodiment of this application, the controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction. This can be achieved using voltage open-loop control. Specifically, this can be done by: determining the direction of the voltage space vector corresponding to a preset reference electrical angle phase; applying a PWM signal with a preset amplitude and preset duty cycle corresponding to the voltage space vector direction to the power circuit, generating a voltage vector with a fixed direction and amplitude on the motor windings; and using the fixed voltage vector to generate a steady-state DC excitation current in the motor windings, thereby forming a stator composite magnetic field with a fixed direction. Compared to the current closed-loop control method exemplified in steps S1.1 to S1.3, the above voltage open-loop control scheme no longer relies on current sampling accuracy and PI parameters, resulting in a significantly simplified control structure and stronger robustness. It is particularly suitable for cost-sensitive or extremely reliable applications.

[0045] It should be noted that in the above embodiments, the controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, thereby performing rotor alignment control and pulling and aligning the rotor permanent magnet to the fixed direction of the stator composite magnetic field. The phrase "injecting a preset DC excitation current" can also be replaced with "injecting a DC excitation current with periodic pulsating amplitude." Specifically, the controller controls the power circuit to inject a given value of the q-axis current into the windings. It is no longer a constant, but a signal superimposed with low-frequency pulsating components, for example: .in, DC bias (e.g., 8% of rated current). This is the pulsation amplitude (e.g., 4% of the rated current). The pulsation frequency is (e.g., 2~10Hz). Simultaneously, the forced angle of the SVM... The above scheme is equivalent to applying a small "oscillatory excitation" to the static alignment torque, which helps the rotor overcome static and viscous friction and enter and stabilize at the target alignment position more quickly. Especially for large inertia loads, it can avoid excessively long stabilization time due to excessive system damping. When determining alignment stability (i.e., subsequent step S2), the controller needs to monitor the angle change within one cycle of the pulsation to ensure that its change pattern is synchronized with the torque pulsation and the amplitude is within the allowable range.

[0046] Step S2: After determining that the rotor alignment is stable, read the alignment mechanical angle output by the magneto-electric encoder.

[0047] Under the electromagnetic torque generated in step S1, the rotor moves from an arbitrary initial position to the aligned position. This process is not instantaneous; it involves mechanical oscillations and a stabilization process. If the encoder value is read before the alignment oscillations have fully decayed, errors will be introduced. Therefore, a stabilization mechanism is required.

[0048] In this embodiment, the determination of rotor alignment stability is achieved by the controller through the following monitoring and determination steps: after the injected DC excitation current reaches a preset excitation duration (e.g., 1.0 second), the excitation current is maintained for a first delay (e.g., 100 milliseconds); during the first delay, the controller monitors the rate of change of mechanical angle read by the magneto-electric encoder at a certain sampling frequency (e.g., 10 kHz). Since the rotor should be essentially stationary after alignment, its rate of angular change should approach zero. When the rate of change of the mechanical angle is less than a preset stability threshold, for example, when the corresponding rotational speed is below 1 RPM (RPM is an abbreviation for Round Per Minute), the controller determines that the rotor is aligned and stable. This stability determination logic ensures that the mechanical state is stationary or quasi-stationary when the angle is read, thereby improving the accuracy of the measurement reference.

[0049] Considering that when the rotor is fully aligned and stationary, the motor behaves as a stationary inductive load, the phase current should be pure DC with minimal harmonics and fluctuations. Any slight oscillation or misalignment of the rotor will modulate the current, leading to increased harmonics or amplitude fluctuations. Therefore, in order to extract criteria from the high-precision measurable current signal on the drive side and achieve cross-domain (i.e., from mechanical observation to electrical observation) stability judgment, as another embodiment of this application, the determination of rotor alignment stability can also be achieved by the controller through the following monitoring and judgment steps: after the injected DC excitation current reaches a preset excitation duration, the harmonic distortion rate of the motor stator phase current or the amplitude fluctuation of the current vector is monitored; when the harmonic distortion rate is lower than a first threshold, or the current vector amplitude fluctuation is lower than a second threshold, and this remains stable for a certain period of time, the rotor is determined to be aligned and stable. This scheme does not rely on the resolution and dynamic response performance of the encoder itself, and is particularly suitable for low-resolution encoders or scenarios where the encoder signal is severely affected by noise interference.

[0050] The alignment mechanical angle obtained by reading the output of the magnetic encoder can be obtained as follows: After the controller determines that the rotor is aligned and stable, the controller continuously samples the output values ​​of multiple (e.g., 64) magnetic encoders, performs digital filtering on the multiple output values, and uses the filtering result as the alignment mechanical angle. .

[0051] Magnetoelectric encoder outputs may contain high-frequency noise or transient spikes. Continuously sampling multiple points (e.g., a series of data points) and digitally filtering them—for example, calculating the arithmetic mean or performing a first-order low-pass digital filter—can effectively smooth the noise and obtain angle values ​​that more accurately represent the true stationary position. Assuming the sampled values ​​are... , … Then the aligned mechanical angle after filtering can be calculated as follows: This process further improves the reliability and accuracy of the read reference mechanical angles.

[0052] Thus, a high-precision phase with the preset electrical reference was obtained. Corresponding mechanical angle measurement values .

[0053] Step S3: Based on the alignment mechanical angle and the preset reference electrical angle phase, calculate and obtain the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor.

[0054] Step S3 aims to convert the physical measurements obtained in the previous step into key parameters required for control. This includes the electrical angle of the servo motor. With mechanical angle The relationship between them is satisfied ,in, This represents the number of pole pairs of the motor. However, due to mechanical misalignment during encoder installation, the mechanical zero point read from it... The electrical zero point of the motor windings (usually defined on the axis of the U-phase winding) does not coincide with this. Let this fixed deviation angle (electrical angle) be... Therefore, the complete conversion relationship from encoder readings to actual electrical angles should be: .

[0055] In step S1, the rotor is aligned to an electrical angle of [value missing]. The direction of the stator magnetic field (actually, the direction of the rotor d-axis) However, for offset calculation, the relative relationship is of concern. Under ideal, unbiased conditions, the electrical angle converted from the mechanical angle read by the encoder should be: However, the actual alignment mechanical angle read is... Therefore, an equation can be established:

[0056]

[0057] Therefore, the electrical angle offset can be calculated: .

[0058] However, electrical angles are periodic (360° cycle). To ensure that the offset is within the standard 0~360° range, the calculation results need to be processed by modulo operation.

[0059] Specifically, the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor is calculated and obtained based on the alignment mechanical angle and the preset reference electrical angle phase. This can be achieved through the following steps S3.1 to S3.3:

[0060] Step S3.1: Multiply the alignment mechanical angle by the number of pole pairs of the servo motor to obtain the original electrical angle corresponding to the rotor position at the alignment moment.

[0061] Calculate the original electrical angle For example, if (4 indicates a 4-pole motor). (From a mechanical perspective), then (Electrical angle).

[0062] Step S3.2: Calculate the difference between the original electrical angle and the preset reference electrical angle phase.

[0063] Calculate the difference Continuing with the previous example, if... ,but .

[0064] Step S3.3: Perform a modulo 360 operation on the difference to obtain the electrical angle offset ranging from 0 to 360°.

[0065] Perform modular arithmetic: Since 92° is within the range of 0~360°, .this This is the final, crucial parameter that needs to be stored and used. It quantifies the electrical deviation of the encoder installation, and all subsequent real-time electrical angle calculations will be based on this value for compensation.

[0066] Through this series of calculations, this application transforms the result of a physical alignment experiment into a precise, digital, inherent parameter characterizing the individual properties of the device. Compared to manual measurement and calibration at the factory, this application's solution boasts a high degree of automation and good accuracy consistency. Furthermore, unlike online identification methods that perform similar calculations every time the device is powered on, this application's solution eliminates the need to repeat this process once the fixed parameter is obtained.

[0067] Step S4: Store the electrical angle offset as a control parameter in non-volatile memory to complete the initial electrical angle self-calibration.

[0068] Calculated electrical angle offset This is a key inherent parameter characterizing the individual properties of the servo integrated machine. If it is only used in the controller's memory during the current power-on period, it will be lost after power failure, causing the entire alignment and calculation process (steps S1 to S3) to be repeated every time the machine restarts, which takes several seconds. This contradicts the original intention of this application. In the prior art, fixing such parameters usually requires additional host computer software or hardware DIP switches, increasing system complexity and usage costs. This application utilizes the non-volatile memory integrated into the driver board to achieve autonomous and persistent storage of key control parameters, thus truly realizing "one-time calibration, permanent validity".

[0069] As one embodiment of this application, storing the electrical angle offset as a control parameter in a non-volatile memory can be achieved by steps S4.1 and S4.2, as detailed below:

[0070] Step S4.1: The controller combines the electrical angle offset and its corresponding cyclic redundancy check code to form a data packet.

[0071] To prevent data corruption due to memory bit flips, read / write interference, or other reasons, data protection measures must be implemented before storage. The controller will calculate the electrical angle offset. (For example, in 16-bit unsigned integer format, 0~65535 corresponds to 0~360 degrees) and packaged with a checksum. The checksum is preferably a cyclic redundancy check (CRC) code. The specific process is: the controller packages the electrical angle offset... The raw data byte stream is taken as input and calculated using a predetermined CRC generator polynomial (e.g., CRC-16-CCITT) to obtain a 16-bit CRC checksum. Subsequently, the electrical angle offset is... Together with this CRC checksum, they form a complete data packet. For example, the data packet structure could be: [Offset high byte][Offset low byte][CRC high byte][CRC low byte]. During subsequent reads, the CRC can be recalculated and compared with the stored CRC to verify data integrity.

[0072] Step S4.2: The controller controls the writing of data packets into the designated parameter storage area of ​​the non-volatile memory in a page programming or sector erasure manner.

[0073] Non-volatile memories (e.g., EEPROM or Flash) typically have specific write requirements. Page programming or sector erasure refers to the controller performing necessary timing operations such as unlocking, erasing (if necessary), programming, and locking according to the memory datasheet specifications, writing the data packet generated in step S4.1 to a pre-planned, independent, designated parameter storage area. This storage area is isolated from the main control program storage area to prevent accidental parameter read / write operations from affecting the program code. To further improve storage reliability, the designated parameter storage area of ​​the non-volatile memory can be divided into at least two mutually redundant storage sectors. Storage operations may include the controller controlling the simultaneous or sequential writing of data packets to the two backup sectors. When using "sequential writing," the primary sector is typically written first, and after successful verification, the backup sector is written. Using "simultaneous writing" (if hardware supports it) or writing separately between two power-ups provides stronger data security; even if one sector is damaged, parameters can still be recovered from the other sector.

[0074] Although steps S1 and S3 are designed to achieve stability, random errors may still exist in single calculation results under extreme conditions (e.g., strong external interference, mechanical jamming). To improve the robustness of the self-calibration process, a verification step can be added before storage. That is, before completing the initial electrical angle self-calibration, optionally, the following validity verification step for the electrical angle offset, executed by the controller, can be included, specifically implemented by steps S4a to S4d:

[0075] Step S4a: Based on the calculated electrical angle offset, deduce the theoretical mechanical angle that the magneto-electric encoder should read under the condition of no offset.

[0076] From the relation It can be deduced that, assuming the current calculation... When correct, the theoretical value of the mechanical angle read in step S2 should be: Note that the periodicity of the electrical angle needs to be considered here.

[0077] Step S4b: While maintaining the excitation current, read the actual mechanical angle of the magneto-electric encoder again.

[0078] Keeping the excitation current unchanged in step S1, perform a similar stability determination and sampling filtering process as in step S2 again to obtain a new actual mechanical angle measurement value. Since the rotor is always maintained in a fixed magnetic field direction, there should be no macroscopic movement of the rotor between two readings. Should be with Very close.

[0079] Step S4c: Calculate the deviation between the actual mechanical angle and the theoretical mechanical angle.

[0080] Calculate the deviation This deviation reflects the consistency of the measurements and the reliability of the calculation results.

[0081] Step S4d: The controller determines whether the deviation is less than the preset verification threshold and controls the flow accordingly.

[0082] In this embodiment, the verification threshold is determined based on the single-turn resolution of the magnetoelectric encoder, the number of pole pairs, and the mechanical resonant frequency of the servo system, with a value ranging from, for example, 0.2 to 1 electrical angle. The criteria for setting this threshold include: 1) the measurement accuracy limited by the encoder resolution; 2) the pole pair amplification effect (mechanical angle errors are amplified into electrical angle errors); and 3) the small residual oscillations that may be caused by mechanical resonance. If the value is less than the verification threshold, the verification is considered successful, and the controller executes steps S4.1 and S4.2 to store the electrical angle offset as a control parameter in the non-volatile memory to complete the calibration. If the result is greater than or equal to the verification threshold, it indicates that the calibration result is unreliable. The controller discards the current result and can return to step S1 to re-execute the initial power-on self-calibration process. This verification step significantly improves the success rate and parameter accuracy of self-calibration.

[0083] The validity verification of the electrical angle offset in steps S4a to S4d of the above example is essentially a yes / no judgment (i.e., pass or fail). The core is to avoid errors. In order to solve the problem that single-point measurement may be affected by random noise or mechanical hysteresis, resulting in suboptimal accuracy, before completing the initial electrical angle self-calibration, an offset accuracy improvement step executed by the controller can also be included: under the condition of maintaining the excitation current, the preset reference electrical angle phase is finely adjusted to generate a set of stator magnetic fields with small fluctuations near the fixed magnetic field direction; under the action of this set of small fluctuation stator magnetic fields, multiple corresponding magneto-electric encoder mechanical angle values ​​are read respectively; based on the multiple mechanical angle values ​​and their corresponding finely adjusted reference electrical angle phase, the optimized electrical angle offset is obtained by least squares fitting calculation, and the optimized offset is stored. Compared to the validity verification scheme of electrical angle offset in steps S4a to S4d, the accuracy improvement of this scheme is an "optimization process". The core is to pursue better performance. It actively introduces controlled small disturbances and collects data from multiple points. It uses statistical fitting (e.g., least squares method) to estimate the optimal offset. In essence, it replaces the engineering method of "one measurement to see if it is qualified" with the scientific method of "multiple measurements to obtain the optimal estimate". Theoretically, it can obtain higher accuracy and noise resistance than a single measurement.

[0084] Step S5: After the self-calibration control process is completed, the controller reads the mechanical angle of the magneto-electric encoder in real time, and calculates the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory.

[0085] After the initial power-on self-calibration process is completed and After reliable storage, the servo unit possesses permanent angle calculation capabilities. In all subsequent power-on operations, the controller does not need to repeat steps S1 to S4, but directly proceeds to this step and subsequent control steps.

[0086] As one embodiment of this application, the real-time electrical angle for performing field orientation control is calculated in real time based on the electrical angle offset stored in the non-volatile memory. Specifically, this includes real-time readout control, offset compensation control, and angle normalization control, which are described in detail below:

[0087] 1) Real-time read control: In each control cycle (e.g., 100...) us The controller reads the mechanical angle of the magneto-electric encoder in real time through the encoder interface. For multi-pole magneto-electric encoders, the output is already a high-resolution absolute position value equivalent to a single turn, which has undergone internal interpolation and correction. This further improves the accuracy of angle feedback and anti-interference capability.

[0088] 2) Offset compensation control: The controller reads the stored data from the non-volatile memory. Next, coordinate transformation calculations are performed: first, the mechanical angles are converted into the original electrical angles. Then, subtract the stored electrical angle offset from it to obtain the pre-compensated electrical angle. .

[0089] 3) Angle regularization control: Due to the periodicity of the angle, it is necessary to adjust the electrical angle after initial compensation. Perform a modulo 360 operation to normalize it to the standard range of [0°, 360°), and finally obtain the real-time electrical angle used for magnetic field orientation control. .Right now: .

[0090] Through step S5, this application achieves real-time and accurate compensation of encoder readings, converting the original mechanical angle signal into a real-time electrical angle signal aligned with the motor's electrical coordinate system, usable for field-oriented control. The entire process is efficient and deterministic, without any iterative or search delays.

[0091] Step S6: Based on the real-time electrical angle, the controller performs field orientation control on the servo motor.

[0092] This is the ultimate application goal of this application: to obtain accurate real-time electrical angles. The controller can then execute standard field-oriented control algorithms. These include Clarke transform, Park transform, current regulation, inverse Park transform, and space vector modulation.

[0093] 1) Clarke transform, i.e., transforming the sampled three-phase stator currents... , and Transformation to stationary two-phase αβ Coordinate system.

[0094] 2) Park transformation, i.e., using real-time electrical angle ,Will αβ The current in the coordinate system is transformed to the dq coordinate system, which rotates synchronously with the rotor, to obtain... and .

[0095] 3) Current regulation, i.e.: adjusting the current. , Compared with the target value (given by the speed loop or torque loop), the voltage command in the dq coordinate system is output after passing through the PI regulator. and .

[0096] 4) Inverse Park transform, i.e., using the same real-time electrical angle The voltage command in the dq coordinate system and Transform back to rest αβ Coordinate system.

[0097] 5) Space vector modulation, i.e.: according to αβ The voltage generates a PWM signal, which drives the power circuit to precisely control the motor's torque and speed.

[0098] Due to the real-time electrical angle provided in step S5 It accurately reflects the true electrical position of the rotor, so the above FOC algorithm can operate efficiently and smoothly, realizing high-performance control of the servo motor.

[0099] After completing the initial power-on self-calibration and reliably storing the electrical angle offset Subsequently, the method provided in this application demonstrates its advantages of high efficiency and intelligence. This is mainly reflected in its rapid startup upon subsequent power-on and its self-monitoring and maintenance capabilities during operation.

[0100] After the servo all-in-one machine successfully self-calibrates for the first time, the system does not need to repeat the time-consuming alignment, calculation and storage process on any subsequent power-on. Figure 1 The example method also includes a fast-start control process executed by the controller on non-first power-ups. Its core idea is "verification-as-you-go," which includes: after power-up, the controller reads the electrical angle offset and verification code from a specified address in non-volatile memory; if the verification passes, the control process skips the initial power-up self-calibration process and directly performs real-time electrical angle calculation and magnetic field orientation control based on the read offset, achieving fast startup; if the verification or reading fails, the control process automatically triggers and executes the initial power-up self-calibration process. Specific details are as follows:

[0101] After the servo unit is powered on, the controller first performs initialization. Then, the controller reads the electrical angle offset and checksum from a designated address in the non-volatile memory. As before, a complete data packet is read, containing the stored... And its CRC checksum. If the check passes (i.e., the recalculated CRC matches the stored CRC, and...) If the value is within a reasonable range (e.g., 0~65535), it indicates that the previously stored parameters are complete and valid. In this case, the control flow skips the initial power-on self-calibration process (i.e., steps S1 to S4 are not executed at all). The controller is directly loaded into the working memory and immediately proceeds to the aforementioned steps S5 and S6, directly performing real-time electrical angle calculation and magnetic field orientation control based on the read offset. From reading the parameters to starting FOC control, the entire process is typically completed within milliseconds, achieving rapid startup. Conversely, if the verification fails or the reading fails (e.g., CRC check error, read timeout, or the storage area is empty / initial value), it indicates that the stored parameters are unavailable or do not exist. In this case, the control flow automatically triggers and executes the initial power-on self-calibration process (i.e., fully executing steps S1 to S4). This intelligent process branching ensures the fastest startup speed when the parameters are valid and automatically reverts to the complete self-calibration mode when the parameters are abnormal, ensuring the system's robustness and self-recovery capability under various conditions.

[0102] The aforementioned fast startup control process executed by the controller during non-initial power-ups is a single-path selection, meaning it either starts quickly using stored parameters or recalibrates. To address this, a master-slave architecture was constructed: the master loop (foreground) implements unconditional fast startup based on stored parameters to ensure response speed; simultaneously, the slave loop (background) runs a sensorless algorithm for asynchronous, continuous online verification to ensure long-term reliability. Figure 1 The example method can also include a hybrid startup strategy: during non-initial power-on, the controller reads the electrical angle offset from non-volatile memory while simultaneously starting a low-priority, background-running sensorless observer; after performing fast startup and field-oriented control based on the stored electrical angle offset, the sensorless observer asynchronously estimates the actual electrical angle of the motor during operation; the actual electrical angle estimated by the sensorless observer is continuously compared and calibrated with the electrical angle calculated based on the electrical angle offset, and after a period of safe operation, if the deviation between the two is consistently less than the tolerance, the stored parameters are confirmed to be valid; if the deviation shows an increasing trend, an early warning is triggered or a recalibration process is prepared. This solution resolves the contradiction between speed and reliability, that is, it addresses the user's desire for the fastest startup speed while worrying about the "silent failure" of stored parameters, achieving no waiting during startup and self-verification during operation, increasing the dimension of parameter status monitoring during operation without affecting startup time.

[0103] Electrical angle offset When the mechanical structure remains unchanged, the value is fixed. However, during long-term operation of the servo all-in-one machine, extreme conditions (e.g., strong shocks, extreme temperature cycles) may cause the encoder to loosen or its relative position to change slightly, thus affecting the stored values. Deviations from actual values ​​may occur. Furthermore, occasional bit flips in the memory can also lead to parameter errors. To address this low-probability but serious problem, this application further provides an online monitoring mechanism. This includes online monitoring control, anomaly detection control, and self-repair control executed by the controller during operation:

[0104] 1) Online monitoring and control: Based on real-time electrical angle... When operating normally in speed or torque mode, the controller can indirectly monitor the motor using its own physical characteristics. One effective method is for the controller to monitor the motor's back electromotive force waveform or current harmonic characteristics.

[0105] 1.1) Back EMF Monitoring: When the motor rotates, each phase winding will induce a back EMF. Under ideal, unbiased conditions... Under these conditions, the waveform (amplitude and phase) of the back electromotive force matches the theoretical model. The controller can estimate the back electromotive force by detecting phase voltage and current when the motor is running under no-load or light-load conditions, and then compare its actual waveform with the theoretical model. The waveform is compared with the theoretical waveform calculated from the rotational speed.

[0106] 1.2) Current harmonic monitoring: When When errors exist, the decoupling of the d-axis and q-axis currents becomes incomplete, introducing additional torque ripples and current harmonics, especially significantly increasing harmonic components of certain orders (e.g., the 6th order). The controller can calculate the harmonic content in the stator current in real time using Fourier analysis or a specific observer algorithm.

[0107] It should be noted that, considering the slow time-varying offset caused by possible slow mechanical deformation (e.g., bearing wear, coupling loosening), an enhancement can be made to the parameter anomaly monitoring by adding an offset self-learning update mode. That is, at specific moments during normal operation and with stable load (e.g., the low-speed uniform operation phase before each shutdown), the controller not only monitors anomalies but also records with high precision the differences between multiple sets of back EMF observation angles and angles calculated based on the currently stored offset. When a sufficient number of samples (e.g., hundreds) are accumulated and the sample variance is small, the controller calculates the statistical mean of these differences. This average value can be considered as the current storage offset. Estimated deviation between the actual required offset and the actual offset; if If the offset is greater than the learning threshold (e.g., 0.5 degrees) but less than the fault threshold, and the statistical confidence is high, the controller determines that the offset has slowly drifted. In this case, the controller does not immediately change the operating parameters, but instead generates an offset update suggestion and submits the new candidate value. The statistical information, along with the data from this test, is stored in the log area of ​​non-volatile memory. During the next power-on, when parameters are read and control is verified, if a valid update suggestion is found, the controller can prompt the user (or automatically confirm based on a preset strategy) whether to use it. Update the parameters in the main storage area (the update process also needs to follow the storage and verification steps). This scheme enables the system to have the ability to learn and track slowly time-varying parameters. It creatively uses the signals of the servo system during normal operation as a calibration source to achieve online, non-intrusive fine-tuning of core control parameters. This extends the system's maintenance-free calibration cycle, adapts to the equipment aging process, and embodies the concept of intelligent operation and maintenance.

[0108] 2) Anomaly Detection and Control: The controller continuously calculates the deviation between the monitored characteristics and the theoretical expectations. When the monitored characteristics indicate a deviation exceeding the tolerance between the calculated real-time electrical angle and the actual electrical angle of the motor, the controller determines that the stored electrical angle offset may be invalid. For example, a harmonic distortion rate threshold or a back EMF phase deviation threshold can be set. If the monitored deviation exceeds the threshold for multiple consecutive control cycles, a "parameter suspicious" flag is triggered. This judgment is not based on a single accidental disturbance, but on a statistical trend over a period of time, improving the accuracy of the judgment.

[0109] 3) Repair trigger control: Once it is determined that a parameter may be invalid, the system will not suddenly change during operation. (This could lead to control instability), so a safe handling strategy is adopted. First, an alarm is triggered (e.g., by sending an error code via the bus or illuminating a warning light) and the event is logged to a non-volatile log for maintenance personnel to review. Simultaneously, the control servo unit is forced to enter the first-power-on self-calibration process to update control parameters upon the next power-on. This can be achieved by setting a "recalibrate required" flag in memory. When parameters are read upon the next power-on, if this flag is found to be set, then regardless of the original... Regardless of whether the verification passes, the complete self-calibration process is executed first. This design ensures that the system can automatically and safely recalibrate and update parameters after detecting potential problems, achieving full lifecycle health management of control parameters.

[0110] Regarding the reference electrical angle phase: As mentioned before, the preset reference electrical angle phase can be configured as an electrical angle position where the U phase lags behind the anti-axis by 90 degrees in space. This phase is selected as a specific angle that facilitates stable alignment control. The underlying reason is that for a surface-mounted permanent magnet synchronous motor (SPMSM), its d-axis inductance and q-axis inductance are equal. The electromagnetic torque formula does not include a reluctance torque term. The alignment torque is maximized when the alignment magnetic field direction coincides with the q-axis (i.e., the direction producing maximum torque), which facilitates the rapid and stable pulling of the rotor into the alignment position. Setting it to 90° ensures that the direction of the stator's composite magnetic field is aligned with the q-axis. Furthermore, the preset reference electrical angle phase is a constant pre-programmed into the controller program on the drive board. Its selection avoids the commutation points of the motor's three-phase windings and their vicinity, optimizing alignment control and preventing instability. Near the commutation points (e.g., 0°, 120°, or 240°), the magnetic field changes drastically, easily causing minor oscillations in the control. Choosing a position like 90° avoids these sensitive points.

[0111] Regarding control parameters: In step S1.1, the given value of the q-axis current ranges from 5% to 15% of the motor's rated current, and the preset excitation duration ranges from 0.3 seconds to 1.5 seconds. This parameter range is set to achieve effective and safe alignment control. Selecting 5% to 15% of the rated current is to generate sufficient alignment torque to overcome static friction and load (if present), while being much smaller than the rated torque to avoid excessive stress on the mechanical system or overcurrent during the alignment process. The duration of 0.3 to 1.5 seconds provides most small to medium-sized servo motors with sufficient time from start-up to full stability.

[0112] Regarding the verification threshold: In validity verification, the verification threshold is determined comprehensively based on the single-turn resolution of the magneto-electric encoder, the number of pole pairs, and the mechanical resonant frequency of the servo system. For example, a 17-bit (131072 lines) single-turn absolute encoder has a theoretical resolution of approximately... (Mechanical angle). For a 4-pole motor, this corresponds to approximately The electrical angular resolution. Considering the minute jitter that mechanical resonance might introduce (e.g., The mechanical angle is converted into electrical angles with a certain margin. Setting the verification threshold between 0.2 and 1 electrical angle is reasonable and rigorous, which can filter out noise and normal jitter, and capture real calibration errors.

[0113] The parameter anomaly monitoring and self-repair control executed by the controller during the above-mentioned operation utilizes the electrical signals of the motor itself (e.g., back EMF, current harmonics) for monitoring. The observation of back EMF is greatly affected by motor parameters and speed. To eliminate this influence, mechanical information from the load side (e.g., additional photoelectric sensors, limit switch signals) can be used as a reference for cross-verification. That is, the parameter anomaly monitoring executed by the controller during operation also includes cross-verification using load-side information. Specifically, when the servo-driven integrated machine drives a periodically moving load, the real-time electrical angle calculated based on the stored offset at a mechanically fixed point (e.g., the photoelectric sensor trigger moment) is recorded within each motion cycle; the repeatability accuracy or drift trend of this value in multiple consecutive motion cycles is monitored; when the repeatability accuracy exceeds a threshold or a clear trend of drift occurs, it is determined that the electrical angle offset may be faulty, and a repair process is triggered. This solution provides an absolute position reference verification in mechanical space that is independent of motor parameters. When the load mechanical position is fixed, the calculated electrical angle should be strictly repeated under ideal conditions. Any drift in offset will be directly reflected as the periodic change of the angle, making the detection more direct and reliable.

[0114] From the above appendix Figure 1As can be seen from the example of the initial electrical angle self-calibration method for servo motor control, on the one hand, a complete self-calibration process is performed once when the power is first turned on. After calculating the electrical angle offset, it is stored as a control parameter in non-volatile memory. In all subsequent power-on and startup processes, the system does not need to perform the time-consuming excitation alignment and calculation process again. It can directly read the stored fixed offset for real-time electrical angle calculation. This "one-time calibration, multiple uses" mechanism eliminates the repetitive identification operation required for each power-on in existing technologies, significantly shortening the system's startup preparation time and improving overall response speed and operating efficiency. On the other hand, by injecting a preset DC excitation current into the motor windings through the control power circuit, a stator composite magnetic field with a fixed direction is generated, thereby pulling and stably aligning the rotor permanent magnet to this fixed direction. This static alignment method based on DC excitation enables the rotor to overcome static friction and stably remain in a defined position, avoiding the uncertainty in alignment position that may be caused by signal noise or algorithm convergence issues during dynamic identification. This provides stable and reliable conditions for accurately reading the alignment mechanical angle of the magneto-electric encoder, ensuring the accuracy of the calculated electrical angle offset. Thirdly, by storing the calculated electrical angle offset in non-volatile memory, this key control parameter can be stored in the set... The parameter is permanently stored after a power outage. Regardless of how many power outages and restarts the system undergoes, as long as the mechanical structure remains unchanged, the parameter remains valid and can be inherited. This not only ensures the consistency of servo motor control performance and avoids the hassle of re-adjustment due to parameter loss, but also facilitates equipment installation, maintenance, and replacement, improving the product's user-friendliness and maintainability. After self-calibration, the controller's real-time control process calculates the real-time electrical angle based on the stored electrical angle offset and the real-time encoder mechanical angle. Essentially, it performs a fixed and accurate coordinate transformation compensation on the original encoder reading, ensuring that the electrical angle signal input to the field-oriented control algorithm accurately reflects the rotor's electrical position. Based on this accurate real-time electrical angle, field-oriented control is executed, ensuring that the motor generates stable and precise torque, achieving high dynamic performance operation, and solving the problem of decreased control accuracy caused by initial angle deviation. In summary, the technical solution of this application, through the mechanism of "one-time self-calibration, storage, and multiple reuse," avoids repeatedly executing the initial electrical angle identification every time power is applied, thereby significantly improving the startup efficiency and response speed of the servo system.

[0115] Please see the appendix Figure 2This application provides an initial electrical angle self-calibration device for servo motor control, applied to a servo integrated machine including a servo motor, a magneto-electric encoder, a driver board, and non-volatile memory. The device includes an alignment module 201, a reading module 202, a calculation module 203, a storage module 204, a solution module 205, and an execution module 206 that perform the initial power-on self-calibration process after the servo integrated machine is powered on. Details are as follows:

[0116] Alignment module 201 is used by the controller power circuit of the drive board to inject a preset DC excitation current into the winding of the servo motor to generate a stator composite magnetic field with a fixed direction, and to perform rotor alignment control to pull and align the rotor permanent magnet to the fixed direction of the stator composite magnetic field.

[0117] The reading module 202 is used to read the alignment mechanical angle output by the magneto-electric encoder after determining that the rotor alignment is stable;

[0118] The calculation module 203 is used to calculate and obtain the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the alignment mechanical angle and the preset reference electrical angle phase.

[0119] Storage module 204 is used to store the electrical angle offset as a control parameter in non-volatile memory to complete the initial electrical angle self-calibration;

[0120] The calculation module 205 is used to read the mechanical angle of the magneto-electric encoder in real time after the self-calibration control process is completed, and calculate the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory.

[0121] The execution module 206 is used to perform field orientation control on the servo motor by the controller based on the real-time electrical angle.

[0122] From the above appendix Figure 2As can be seen from the example of the initial electrical angle self-calibration device for servo motor control, on the one hand, a complete self-calibration process is performed when the power is first turned on. After calculating the electrical angle offset, it is stored as a control parameter in a non-volatile memory. In all subsequent power-on and startup processes, the system does not need to perform the time-consuming excitation alignment and calculation process again. It can directly read the stored fixed offset for real-time electrical angle calculation. This "one-time calibration, multiple uses" mechanism eliminates the repetitive identification operation required for each power-on in existing technologies, significantly shortening the system's startup preparation time and improving overall response speed and operating efficiency. On the other hand, by injecting a preset DC excitation current into the motor windings through the control power circuit, a stator composite magnetic field with a fixed direction is generated, thereby pulling and stably aligning the rotor permanent magnet to this fixed direction. This static alignment method based on DC excitation enables the rotor to overcome static friction and stably remain in a defined position, avoiding the uncertainty in alignment position that may be caused by signal noise or algorithm convergence issues during dynamic identification. This provides stable and reliable conditions for accurately reading the alignment mechanical angle of the magneto-electric encoder, ensuring the accuracy of the calculated electrical angle offset. Thirdly, by storing the calculated electrical angle offset in non-volatile memory, this key control parameter can be stored in the set... The parameter is permanently stored after a power outage. Regardless of how many power outages and restarts the system undergoes, as long as the mechanical structure remains unchanged, the parameter remains valid and can be inherited. This not only ensures the consistency of servo motor control performance and avoids the hassle of re-adjustment due to parameter loss, but also facilitates equipment installation, maintenance, and replacement, improving the product's user-friendliness and maintainability. After self-calibration, the controller's real-time control process calculates the real-time electrical angle based on the stored electrical angle offset and the real-time encoder mechanical angle. Essentially, it performs a fixed and accurate coordinate transformation compensation on the original encoder reading, ensuring that the electrical angle signal input to the field-oriented control algorithm accurately reflects the rotor's electrical position. Based on this accurate real-time electrical angle, field-oriented control is executed, ensuring that the motor generates stable and precise torque, achieving high dynamic performance operation, and solving the problem of decreased control accuracy caused by initial angle deviation. In summary, the technical solution of this application, through the mechanism of "one-time self-calibration, storage, and multiple reuse," avoids repeatedly executing the initial electrical angle identification every time power is applied, thereby significantly improving the startup efficiency and response speed of the servo system.

[0123] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 3As shown, the electronic device 3 in this embodiment mainly includes: a processor 30, a memory 31, and a computer program 32 stored in the memory 31 and executable on the processor 30, such as a program for an initial electrical angle self-calibration method for servo motor control. When the processor 30 executes the computer program 32, it implements the steps described in the embodiment of the initial electrical angle self-calibration method for servo motor control, for example... Figure 1 Steps S1 to S6 are shown. Alternatively, when processor 30 executes computer program 32, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 2 The functions of the alignment module 201, reading module 202, calculation module 203, storage module 204, solution module 205, and execution module 206 are shown.

[0124] For example, the computer program 32 for the initial electrical angle self-calibration method of servo motor control mainly includes: the controller controlling the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, performing rotor alignment control to pull and align the rotor permanent magnet to the fixed direction of the stator composite magnetic field; after determining that the rotor alignment is stable, reading the alignment mechanical angle output by the magneto-electric encoder; calculating and obtaining the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the phase of the alignment mechanical angle and the preset reference electrical angle; storing the electrical angle offset as a control parameter in a non-volatile memory to complete the initial electrical angle self-calibration; after the self-calibration control process is completed, the controller reads the mechanical angle of the magneto-electric encoder in real time, and calculates the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory; based on the real-time electrical angle, the controller performs field orientation control on the servo motor. The computer program 32 can be divided into one or more modules / units, which are stored in memory 31 and executed by processor 30 to complete this application. One or more modules / units can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of computer program 32 in electronic device 3. For example, computer program 32 can be divided into the functions of alignment module 201, reading module 202, calculation module 203, storage module 204, decomposition module 205, and execution module 206 (a module in a virtual device). The specific functions of each module are as follows: Alignment module 201 is used for the controller of the drive board to control the power circuit to inject a preset DC excitation current into the winding of the servo motor to generate a stator composite magnetic field with a fixed direction, and to perform rotor alignment control to pull and align the rotor permanent magnet to the fixed direction of the stator composite magnetic field; Reading module 202 is used to read the alignment mechanical angle output by the magneto-electric encoder after determining that the rotor alignment is stable; Calculation module 204... 3. Calculates and obtains the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the alignment of the mechanical angle and the preset reference electrical angle phase; Storage module 204 stores the electrical angle offset as a control parameter in a non-volatile memory to complete the initial electrical angle self-calibration; Solving module 205 reads the mechanical angle of the magneto-electric encoder in real time after the self-calibration control process is completed, and calculates the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory; Execution module 206 performs field orientation control on the servo motor by the controller based on the real-time electrical angle.

[0125] Electronic device 3 may include, but is not limited to, processor 30 and memory 31. Those skilled in the art will understand that... Figure 3This is merely an example of electronic device 3 and does not constitute a limitation on electronic device 3. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device may also include input / output devices, network access devices, buses, etc.

[0126] The processor 30 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0127] The memory 31 can be an internal storage unit of the electronic device 3, such as a hard disk or RAM. The memory 31 can also be an external storage device of the electronic device 3, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 31 can include both internal and external storage units of the electronic device 3. The memory 31 is used to store computer programs and other programs and data required by the electronic device. The memory 31 can also be used to temporarily store data that has been output or will be output.

[0128] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed. That is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above-described device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0129] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0130] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0131] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0132] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0133] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0134] If integrated modules / units are implemented as software functional units and sold or used as independent products, they can be stored in a storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program for the initial electrical angle self-calibration method for servo motor control can be stored in a storage medium. When executed by a processor, this computer program can implement the steps of the various method embodiments described above, namely, the controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, executes rotor alignment control, and pulls and aligns the rotor permanent magnet to the fixed direction of the stator composite magnetic field; upon determining that the rotor alignment is stable... Then, the alignment mechanical angle output by the magneto-electric encoder is read; based on the phase of the alignment mechanical angle and the preset reference electrical angle, the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor is calculated and obtained; the electrical angle offset is stored as a control parameter in non-volatile memory to complete the initial electrical angle self-calibration; after the self-calibration control process is completed, the controller reads the mechanical angle of the magneto-electric encoder in real time, and calculates the real-time electrical angle for performing field-oriented control based on the electrical angle offset stored in the non-volatile memory; based on the real-time electrical angle, the controller performs field-oriented control on the servo motor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate form. The storage medium can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the contents of the storage medium may be appropriately added to or subtracted from the contents according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the storage medium may not include electrical carrier signals and telecommunication signals.

[0135] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application. The specific embodiments described above further illustrate the purpose, technical solutions, and beneficial effects of this application. It should be understood that the above descriptions are merely specific embodiments of this application and are not intended to limit the protection scope of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. An initial electrical angle self-calibration method for servo motor control, applied to a servo integrated machine including a servo motor, a magneto-electric encoder, a driver board, and non-volatile memory, characterized in that, The method includes a self-calibration control process executed by the controller of the driver board: After the servo all-in-one machine is powered on, the initial power-on self-calibration process is executed, which includes: The controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, and executes rotor alignment control to pull and align the rotor permanent magnet to the direction of the fixed stator composite magnetic field. After determining that the rotor alignment is stable, the alignment mechanical angle output by the magneto-electric encoder is read; Based on the alignment mechanical angle and the preset reference electrical angle phase, the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor is calculated and obtained. The electrical angle offset is stored as a control parameter in the non-volatile memory to complete the initial electrical angle self-calibration; After the self-calibration control process is completed, the controller reads the mechanical angle of the magneto-electric encoder in real time, and calculates the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory. Based on the real-time electrical angle, the controller performs magnetic field orientation control on the servo motor.

2. The initial electrical angle self-calibration method for servo motor control according to claim 1, characterized in that, The controller controls the power circuit to inject a preset DC excitation current into the windings of the servo motor to generate a stator composite magnetic field with a fixed direction, including: Set the d-axis current setpoint of the current loop to zero, and the q-axis current setpoint to a non-zero constant value; In space vector modulation control, the electrical angle input is forcibly set to an angle value that is consistent with the preset reference electrical angle phase; The current closed-loop control is executed to stabilize the phase current of the motor at the given value of the q-axis current and maintain it for a preset excitation duration, thereby generating a stator composite magnetic field with a fixed direction.

3. The initial electrical angle self-calibration method for servo motor control according to claim 2, characterized in that, The determination of rotor alignment stability is achieved by the controller through the following monitoring and determination steps: After the injected DC excitation current reaches the preset excitation duration, the excitation current is maintained for a first delay. During the first delay period, the controller monitors the rate of change of the mechanical angle read by the magneto-electric encoder; When the rate of change of the mechanical angle is less than the preset stability threshold, the controller determines that the rotor has been aligned and stabilized.

4. The initial electrical angle self-calibration method for servo motor control according to claim 1, characterized in that, The step of calculating and obtaining the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the alignment mechanical angle and the preset reference electrical angle phase includes: Multiply the alignment mechanical angle by the number of pole pairs of the servo motor to obtain the original electrical angle corresponding to the rotor position at the alignment moment; Calculate the difference between the original electrical angle and the preset reference electrical angle phase; Perform a modulo 360 operation on the difference to obtain the electrical angle offset ranging from 0 to 360 degrees.

5. The initial electrical angle self-calibration method for servo motor control according to claim 4, characterized in that, Before the initial electrical angle self-calibration is completed, the following validity verification step for the electrical angle offset is performed by the controller: Based on the calculated electrical angle offset, the theoretical mechanical angle that the magneto-electric encoder should read under the condition of no offset can be deduced. Under the condition of maintaining the excitation current, the actual mechanical angle of the magneto-electric encoder is read again; Calculate the deviation between the actual mechanical angle and the theoretical mechanical angle; The controller determines whether the deviation is less than a preset verification threshold and controls the flow accordingly: if it is less than the threshold, the operation of storing the electrical angle offset as a control parameter in the non-volatile memory is performed to complete the calibration. Otherwise, repeat the initial power-on self-calibration procedure.

6. The initial electrical angle self-calibration method for servo motor control according to claim 1, characterized in that, The method also includes a fast startup control procedure executed by the controller during non-first power-on: After power-on, the controller reads the electrical angle offset and check code from a designated address in the non-volatile memory; If the verification passes, the control process skips the initial power-on self-calibration process and directly performs the real-time electrical angle calculation and magnetic field orientation control based on the read offset, thus achieving rapid startup. If the verification or reading fails, the control flow will automatically trigger and execute the first power-on self-calibration process.

7. The initial electrical angle self-calibration method for servo motor control according to claim 6, characterized in that, It also includes the following online monitoring control, anomaly detection control, and self-repair control steps executed by the controller during operation: Online monitoring and control: When the servo all-in-one machine is operating normally in speed or torque mode based on the real-time electrical angle, the controller monitors the back electromotive force waveform or current harmonic characteristics of the motor; Anomaly detection and control: When the real-time electrical angle calculated based on monitoring characteristics is found to deviate from the actual electrical angle of the motor beyond the tolerance limit, the controller determines that the stored electrical angle offset may be invalid. Repair trigger control: Trigger an alarm and record the event, and control the servo all-in-one machine to force it to enter the first power-on self-calibration process to update the control parameters upon the next power-on.

8. An initial electrical angle self-calibration device for servo motor control, applied to a servo integrated machine including a servo motor, a magneto-electric encoder, a driver board, and non-volatile memory, characterized in that, The device includes the following module that performs the initial power-on self-calibration process after the servo all-in-one machine is powered on: The alignment module is used by the controller power circuit of the drive board to inject a preset DC excitation current into the winding of the servo motor to generate a stator composite magnetic field with a fixed direction, and to perform rotor alignment control to pull and align the rotor permanent magnet to the direction of the fixed stator composite magnetic field. The reading module is used to read the alignment mechanical angle output by the magneto-electric encoder after determining that the rotor alignment is stable; The calculation module is used to calculate and obtain the electrical angle offset between the installation zero point of the magneto-electric encoder and the electrical zero point of the servo motor based on the alignment mechanical angle and the preset reference electrical angle phase. The storage module is used to store the electrical angle offset as a control parameter in the non-volatile memory to complete the initial electrical angle self-calibration; The calculation module is used to read the mechanical angle of the magneto-electric encoder in real time after the self-calibration control process is completed, and calculate the real-time electrical angle for performing field orientation control based on the electrical angle offset stored in the non-volatile memory. An execution module is used to perform field orientation control on the servo motor by the controller based on the real-time electrical angle.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.

10. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.