A method and system for detecting initial magnetic poles of a servo motor

The initial magnetic pole detection method for servo motors, which uses ramp functions and orthogonal magnetic field alignment, solves the problems of poor load change adaptability and misjudgment of phase sequence reversal in existing technologies, and realizes stable starting and high-precision torque output of servo motors.

CN123034779APending Publication Date: 2026-11-03YUEMA INTELLIGENT TECHNOLOGY (JIANGSU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611502118.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing methods for detecting the initial magnetic poles of servo motors cannot adapt to the needs of light and heavy loads when faced with a wide range of load variations, resulting in inaccurate rotor positioning and potential safety hazards such as mechanical impact and misjudgment of phase sequence reversal.

Method used

By gradually increasing the DC drive current ramp function to the target torque, combined with multiple encoder sampling and orthogonal magnetic field alignment, the initial position of the magnetic poles and the reversed phase sequence state are distinguished by positive and negative judgment thresholds, so as to achieve adaptive adjustment and safety interlock.

Benefits of technology

This improves the reliability and safety of magnetic pole detection, avoids mechanical shock and misjudgment due to reversed phase sequence, and ensures smooth start-up and accurate output torque of the servo motor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123034779A_ABST
    Figure CN123034779A_ABST
Patent Text Reader

Abstract

The application discloses a kind of servo motor initial magnetic pole detection method and system, specifically relates to motor magnetic pole detection field, including with current gear target torque is established direct current driving current by ramp function and keeps;In the end time window of keeping stage, encoder position is periodically sampled and the first balance position is obtained by taking arithmetic average;Second balance position is obtained after the target electric angle of stator magnetic field is jumped 90 degrees and then driven;Calculate displacement difference and compare with positive and negative determination threshold, respectively determine detection success, phase sequence connection is reversed or driving force is insufficient.A kind of servo motor initial magnetic pole detection method and system are inhibited by arithmetic average in end window, and there is no phase delay in underdamped oscillation, and phase sequence connection is reversed by 90 degrees jump and three-state determination of double threshold value, and wide range load is adaptively realized by torque increment closed loop iteration, and safe and reliable initial magnetic pole detection is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of motor magnetic pole detection technology, and more specifically, to a method and system for detecting the initial magnetic poles of a servo motor. Background Technology

[0002] Initial magnetic pole detection refers to the process of generating a static magnetic field by injecting a DC current into the stator windings after the motor is powered on and before closed-loop control is engaged, thereby pulling the rotor permanent magnets to a known electrical angle position. Accurate initial magnetic pole detection is a prerequisite for achieving field-oriented vector control and ensuring smooth motor start-up and accurate output torque.

[0003] The current mainstream technology in the industry is the DC injection pre-positioning method: a DC current of fixed amplitude is passed into a certain phase winding of the stator to generate a stator magnetic field with a constant direction. The rotor is pulled to a position aligned with the magnetic field by electromagnetic attraction. After the rotor stabilizes, the encoder value is read as the initial electrical angle, which provides a basic framework for the initial positioning of the servo drive. It can complete basic positioning tasks in situations where the load characteristics are known and the operating conditions are stable.

[0004] However, in actual use, it still has some shortcomings, such as the fixed amplitude DC torque cannot adapt to a wide range of load changes from light load to heavy load, the torque is too small and cannot overcome static friction to pull the rotor, and the torque is too large and will cause mechanical shock under light load. It also lacks an adaptive adjustment mechanism based on actual load response.

[0005] When the rotor is pulled to the equilibrium position under light load or no load conditions, it will generate continuous underdamped mechanical oscillation due to insufficient damping. Traditional solutions are very likely to capture the instantaneous offset position of the oscillation rather than the true equilibrium point, resulting in a large deviation in the initial angle reading. When suppressing such oscillation, a non-negligible phase delay will be introduced, causing systematic position estimation error.

[0006] The existing method relies solely on the absolute value of displacement to determine whether the alignment is successful. However, the absolute value determination cannot distinguish between positive and negative directions, causing the system to mistakenly identify the phase sequence reversal as a successful detection. This can lead to a current positive feedback runaway accident after the closed loop is entered, posing a serious safety hazard. Summary of the Invention

[0007] In order to overcome the above-mentioned defects of the prior art, the present invention provides a method and system for detecting the initial magnetic poles of a servo motor, which solves the problems mentioned in the background art through the following solutions.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] A method for detecting the initial magnetic poles of a servo motor, comprising:

[0010] S1: Apply a DC drive current to the stator of the servo motor with the target torque of the current gear. The DC drive current rises from zero to the target torque value of the current gear through a ramp function and is then held, so that the motor rotor is pulled toward the direction of the stator magnetic field.

[0011] S2: During the final time window of the DC drive current holding phase, the encoder output position is sampled multiple times at equal intervals, and the arithmetic mean of the sampled values ​​is taken as the first equilibrium position P1. The duration of the final time window is greater than an integer multiple of the rotor mechanical oscillation period.

[0012] S3: Change the target electrical angle of the stator magnetic field by 90 degrees, and apply DC drive current to the stator again with the target torque of the current gear to obtain the second equilibrium position P2.

[0013] S4: Calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, and compare ΔP with the positive judgment threshold and the negative judgment threshold:

[0014] When ΔP is greater than the positive judgment threshold, the initial magnetic pole position is determined to be successfully detected and the initial magnetic pole position is output.

[0015] When ΔP is less than the negative judgment threshold, the phase sequence is reversed, the PWM output is immediately blocked and closed-loop control is prohibited.

[0016] When ΔP is between the negative decision threshold and the positive decision threshold, the decision driving force is insufficient;

[0017] S5: When it is determined that the driving force is insufficient, the target torque of the current gear is increased by a fixed percentage, and the increased torque is used as the target torque of the current gear. Then, return to execute S1 until the detection is successful, the target torque reaches the maximum allowable value, or the phase sequence is reversed.

[0018] Preferably, step S1, during the initial execution of the detection process, specifically includes:

[0019] The initial value of the target torque for the current gear is 20% of the motor's rated torque;

[0020] The ramp function is a linear ramp function, and the ramp time is set to 50 milliseconds;

[0021] The duration of the holding phase of the DC drive current is 3 seconds.

[0022] Preferably, in S2, the duration of the final time window is an integer multiple of the rotor mechanical oscillation period, specifically:

[0023] The duration of the final time window is set to N times the rotor mechanical oscillation period, where N is an integer greater than or equal to 2;

[0024] The end time of the final time window coincides with the end time of the DC drive current holding phase, so that the window contains at least one positive offset segment and one negative offset segment of a complete oscillation cycle.

[0025] Preferably, in step S2, the sampling interval for sampling the encoder output position multiple times at equal periods is less than or equal to one-tenth of the rotor mechanical oscillation period, and not greater than the control period duration of the DC drive current holding phase, and the sampled value used to generate the arithmetic mean obtains at least 10 sampling points within a single oscillation period.

[0026] Preferably, in step S2, the number of samplings in the equal-period multiple sampling is determined by the sampling interval and the duration of the final time window;

[0027] The number of samplings is the total number of samples in the final time window, ensuring that the total amount of location data within the final time window meets the minimum size requirement for the statistical properties of the arithmetic mean.

[0028] Preferably, step S3, which involves a 90-degree jump in the target electrical angle of the stator magnetic field, specifically includes:

[0029] The target electrical angle of the stator magnetic field is changed from the 0-degree electrical angle used in the initial alignment to a positive 90-degree electrical angle or a negative 90-degree electrical angle in one step, so that the electrical angle difference between the stator magnetic field and the rotor magnetic pole after the change is π / 2.

[0030] Under the condition that the electrical angle difference is π / 2, the electromagnetic torque and the electrical angle difference satisfy a sinusoidal relationship and the sinusoidal function takes the maximum value of 1, so that the rotor obtains the maximum electromagnetic torque under the same driving current amplitude and generates a deterministic displacement with the largest amplitude.

[0031] Preferably, in step S4, the positive determination threshold is set to one-quarter of the theoretical displacement, and the negative determination threshold is set to one-quarter of the negative theoretical displacement;

[0032] The theoretical displacement is the encoder count change corresponding to a 90-degree electrical angle jump, which is uniquely determined by the number of motor pole pairs and the encoder resolution.

[0033] The positive and negative decision thresholds form a positive-negative symmetrical threshold pair with zero as the center of symmetry, so that all possible values ​​of the displacement difference ΔP are divided into three decision intervals.

[0034] Preferably, step S4, in the process of calculating the displacement difference ΔP, specifically includes:

[0035] Based on the encoder's total count range The rewind modulus is the direct difference between the second equilibrium position P2 and the first equilibrium position P1. Greater than When this occurs, it is determined that encoder count rollback has occurred;

[0036] Will minus The displacement difference ΔP is then used as the displacement difference. The sign function for the original displacement difference.

[0037] Preferably, step S5, which increases the target torque of the current gear by a fixed percentage, specifically includes:

[0038] The target torque after the increment is equal to the target torque before the increment multiplied by 1.2;

[0039] The maximum permissible torque is set to 50% of the motor's rated torque;

[0040] When the target torque of the current gear reaches the maximum allowable torque but the driving force is still insufficient, the iteration is terminated and a mechanical jamming alarm is reported.

[0041] To achieve the above objectives, the present invention provides the following technical solution: a servo motor initial magnetic pole detection system, which implements the above-mentioned servo motor initial magnetic pole detection method, comprising:

[0042] Adaptive drive force generation module: used to apply DC drive current to the stator of the servo motor with the target torque of the current gear. The DC drive current rises from zero to the target torque value of the current gear through a ramp function and is held, so that the motor rotor is pulled towards the direction of the stator magnetic field.

[0043] End-of-phase statistical position acquisition module: used to sample the encoder output position multiple times at equal intervals within the end-of-phase time window of the DC drive current holding phase, and take the arithmetic mean of the sampled values ​​as the first equilibrium position P1. The duration of the end-of-phase time window is greater than an integer multiple of the rotor mechanical oscillation period.

[0044] Orthogonal magnetic field alignment module: After obtaining the first equilibrium position P1, the target electrical angle of the stator magnetic field jumps by 90 degrees, triggering the adaptive driving force generation module to apply DC driving current again with the same gear target torque, and triggering the final statistical position picking module to obtain the second equilibrium position P2.

[0045] Direction symbol perception and verification module: used to calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, compare ΔP with the positive judgment threshold and the negative judgment threshold, and output the judgment result: the initial position of the magnetic pole was successfully detected, the phase sequence was reversed or the driving force was insufficient.

[0046] Closed-loop feedback module: When the judgment result is insufficient driving force, it increases the target torque of the current gear by a fixed percentage, triggers iterative detection, until the detection is successful, the target torque reaches the maximum allowable value, or the phase sequence is reversed.

[0047] The technical effects and advantages of this invention are as follows:

[0048] 1. This invention utilizes the sinusoidal relationship between electromagnetic torque and stator-rotor electrical angle difference under DC drive conditions to lock the electrical angle difference after a jump. The electromagnetic torque reaches its maximum value under the same q-axis current amplitude, generating a deterministic displacement with known direction and maximum amplitude. This significantly improves the reliability of direction determination and provides a clear physical reference for subsequent phase sequence state identification, effectively alleviating the problem in the prior art that the positive and negative directions cannot be distinguished due to the lack of directional reference in a single pull.

[0049] 2. This invention constructs a pair of positive and negative symmetrical thresholds with zero as the center of symmetry and an amplitude of one-quarter of the theoretical displacement. It divides the possible values ​​of the displacement difference into three mutually exclusive and complete judgment intervals. When ΔP is less than the negative judgment threshold, it immediately blocks the PWM output and prohibits entry into closed-loop control. This achieves direct detection and safety interlocking of the phase sequence reversal state, effectively avoiding the safety risk of current positive feedback overrunning accidents caused by the misjudgment of phase sequence reversal as successful detection in the prior art.

[0050] 3. This invention achieves automatic optimization of drive torque from low to high by using 20% ​​of the rated torque as the initial gear and increasing it incrementally with a maximum allowable torque. It takes into account both the need for light-load shock prevention and the need to overcome static friction under heavy load. It effectively alleviates the problems in the prior art where fixed amplitude DC torque cannot adapt to a wide range of load changes, and where too little torque cannot overcome static friction while too much torque leads to mechanical shock under light load.

[0051] 4. This invention uses a linear ramp function to prevent abrupt changes in the establishment of the driving current, and the rate of change of the current is constrained to a constant value. This effectively reduces the impact and disturbance of the detection process on light-load mechanical systems such as direct-drive turntables, and alleviates the mechanical impact problem caused by directly giving a fixed torque in the prior art.

[0052] 5. This invention achieves spatial filtering of the equilibrium position without phase delay by setting the duration of the final time window to be greater than an integer multiple of the rotor mechanical oscillation period and coinciding with the end of the holding phase, and sampling periodically within the window at a sampling interval not exceeding one-tenth of the oscillation period. This effectively solves the problems of misreading the true equilibrium point due to the instantaneous offset position of the oscillation in the prior art and the introduction of non-negligible phase delay when suppressing oscillation by low-pass filtering.

[0053] 6. This invention uses S4 to distinguish between three working conditions: insufficient driving force, successful detection, and reversed phase sequence, based on positive and negative symmetrical dual threshold three-state determination, providing clear incremental triggering conditions for S5; S5 incrementally increases the target torque based on the insufficient driving force determination result of S4 and re-executes the complete detection process, forming a closed-loop control, which automatically converges to the vicinity of the minimum torque level that can produce effective displacement under unknown load, thus improving the success rate of the first detection and limiting the maximum driving torque;

[0054] 7. The present invention provides a first equilibrium position P1 and a second equilibrium position P2 through S2, and a deterministic displacement with known direction and maximum amplitude through S3, thereby supporting the reliable detection of mutually exclusive complete coverage of intervals and phase sequence reversal in S4.

[0055] 8. In this invention, when returning to S1 in each iteration, the q-axis current command is re-established from zero through a ramp function and rises to the target torque of the current gear after incrementing. The ramp buffer mechanism is completely repeated in each iteration, so that the torque gear switching caused by the increment of S5 will not cause a sudden change in current step. The torque establishment process of each gear maintains a constant current slope, thereby achieving the overcoming of static friction by progressive loading while avoiding the accumulation of mechanical shock due to the progressive increase of torque in multiple iterations. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating the steps of a servo motor initial magnetic pole detection method according to an embodiment of this application.

[0057] Figure 2 This is a flowchart for determining displacement difference according to an embodiment of this application.

[0058] Figure 3 This is a decision graph for torque increment termination conditions provided according to an embodiment of this application.

[0059] Figure 4 This is a block diagram of a servo motor initial magnetic pole detection system provided according to an embodiment of this application. Detailed Implementation

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

[0061] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to and includes any or all possible combinations of one or more of the listed items.

[0062] Hereinafter, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first," "second," and "third" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0063] As attached Figure 1 The method for detecting the initial magnetic poles of a servo motor, as shown, includes the following specific steps:

[0064] This embodiment uses a 600W permanent magnet synchronous servo motor as the specific implementation object, with a rated torque of 3.0 N·m, a rated speed of 2000 rpm, 4 pole pairs, and an encoder resolution of no less than 17 bits per revolution. The servo driver adopts a dual closed-loop vector control architecture with a current loop control period of 125 μs, and has independent PI controllers for the q-axis current loop and the d-axis current loop.

[0065] S1: Apply DC drive to the stator of the servo motor with the target torque of the current gear. The q-axis current command rises from zero to the current amplitude corresponding to the target torque of the current gear through a ramp function and is held, so that the motor rotor is pulled towards the direction of the stator magnetic field.

[0066] The target torque for the current gear is determined by the incremental strategy of S5.

[0067] The initial gear target torque is 20% of the rated torque, i.e., 0.6 N·m. When the load conditions are unknown, 20% of the rated torque is used as the drive torque for the first round of testing, so that it has the drive force required to pull the rotor under typical light load conditions (such as the no-load / half-load state of a direct-drive turntable, where the required drive force usually does not exceed 15% of the rated torque).

[0068] In subsequent testing rounds, the target torque for the current gear is driven by feedback from the S4 displacement verification results of the previous round: when S4 determines that the driving force is insufficient, the target torque for the current gear is increased by a fixed percentage of 20% based on its own value. The increased target torque is equal to the target torque before the increase multiplied by 1.2, and this increased value is used as the target torque for the current gear in the new round S1.

[0069] In this embodiment, the iterative process is constrained by the maximum permissible torque, which is preset to 50% of the rated torque, i.e., 1.5 N·m.

[0070] When the target torque after incrementing reaches or exceeds 1.5 N·m, 1.5 N·m is used as the target torque for the last round of testing. If the driving force is still determined to be insufficient, the iteration is terminated and a mechanical jamming alarm is reported. The alternative torque gear sequence generated according to this rule is shown in Table 1 below.

[0071] Table 1

[0072]

[0073] Table 1 above shows the torque gear sequence formed when the torque increases by a fixed 20% percentage and the maximum permissible torque is 50% of the rated torque. The residual of the 7th gear increment is caused by the cutoff of the maximum permissible torque.

[0074] The ramp function is a linear ramp function, and the ramp time is preset to 50ms.

[0075] During S1 execution, the driver's current command generation unit performs linear interpolation calculations on the q-axis current command value within each control cycle of 125μs. This ensures that the q-axis current command rises from zero at a constant slope to the current amplitude corresponding to the target torque of the current gear and remains constant. The q-axis current command generated by the current command generation unit is input to the q-axis current loop PI controller, while the d-axis current command remains zero. The current loop PI controller outputs d-axis and q-axis voltage commands, which are then subjected to Park inverse transformation to obtain α-axis and β-axis voltage reference components. These components are then modulated by SVPWM to generate six PWM switching signals, which are applied to the three-phase inverter bridge.

[0076] Taking the first round of testing as an example, the target torque is 0.6 N·m. During the ramp, the rate of change of the target q-axis current command in each control cycle is determined by the following formula: , ,in, This is the target command (A) for the q-axis current at the nth control cycle during the ramp period. When n=0... =0; The current amplitude (A) of the q-axis corresponding to the target torque of the current gear is given. Nramp is the total number of control cycles included during the ramp (in this embodiment, Nramp = 50ms / 125μs = 400), and n is the control cycle number during the ramp.

[0077] After the slope is finished, Equal to Taking the target torque of 0.6 N·m in the first round of testing as an example, The target q-axis current amplitude is calculated by the torque constant calibration module. This torque constant calibration module is a standard torque constant calibration function in servo drives, which obtains the motor torque constant through offline constant current experiments and writes it into a parameter table; it is a known module.

[0078] The application of the linear ramp command keeps the change in the q-axis current command value constant in each control cycle. The establishment of the driving current does not involve any abrupt changes. In this embodiment, the current amplitude is smoothly established through a uniform transition of 400 control cycles using the aforementioned linear ramp function, and the current slope during torque establishment is constrained to a constant value.

[0079] Furthermore, the mapping relationship between the target torque of the current gear and the q-axis current command is determined by the following formula: ,in, The target current amplitude (A) corresponding to the target torque is the q-axis current target command value. Let be the target torque value (N·m) for the current gear in the k-th round, where k = 1, 2, ... =0.6 N·m, The torque constant of the motor is 0.5 N·m / A. In this embodiment, the torque constant of the 600W prototype is 0.5 N·m / A.

[0080] The initial testing rounds fix the target electrical angle of the stator magnetic field to 0° electrical angle.

[0081] After entering the hold phase, the q-axis current command is held at... The constant value of the d-axis current command is kept at zero, the coordinate transformation angle is kept at 0° electrical angle and the constant DC current flows through the three-phase stator windings, and the stator composite magnetic field forms a stationary magnetic field in space with a direction fixed at 0° electrical angle.

[0082] The rotor permanent magnet is subjected to electromagnetic attraction torque under the action of the static magnetic field. When the amplitude of this torque is greater than the static friction torque of the load, the rotor is pulled and rotated to a position where the direction of the rotor magnetic pole is aligned with the direction of the stator magnetic field. After that, the rotor generates residual oscillations near the equilibrium position due to the underdamped effect, while the drive current remains constant during the holding phase to stably maintain the alignment state.

[0083] In this embodiment, the amplitude of the q-axis current command is fixed at... Furthermore, the coordinate transformation angle is fixed at 0° electrical angle, keeping the stator magnetic field direction command constant during the holding phase and avoiding magnetic field direction disturbances introduced by angle command fluctuations; the repeatability of the rotor's final alignment position is affected by both the stability of the current loop and the encoder sampling accuracy.

[0084] It should be noted that the torque holding phase of S1 is preset to last for 3 seconds.

[0085] Within the 3-second holding time, the rotor's macroscopic approach motion basically ends and the residual oscillation has entered a steady state. At the same time, the total time for single-wheel detection is controlled to the order of several seconds, without significantly extending the overall machine debugging cycle.

[0086] When entering the hold phase, S1 transmits the hold phase start time flag to S2. Specifically, S1 sets this start time as an event flag during the control cycle of entering the hold phase and passes it to S2 through a shared global state variable. S2 queries this flag in each control cycle and calculates the window opening conditions on the same time base. S2 performs the final time window positioning based on this flag.

[0087] In an alternative embodiment, the form of the ramp function can be an S-curve ramp. When executing S1, each S-curve trajectory has a non-linear transition section with continuous curvature at both ends, so that the torque change rate of the drive current in the starting and ending sections is smaller than that of a linear ramp, which is suitable for direct-drive applications of reducers with extremely strict requirements for mechanical shock.

[0088] The torque increment management method can be replaced by using a preset step table to increment step by step. That is, before the actual test, the absolute value of the candidate target torque is written into the driver parameter table. The increment operation of S5 is changed to read the next value in the step table, which is equivalent to the fixed percentage increment in the above embodiment in terms of detection effect.

[0089] The percentage of the initial gear target torque can be preset to other values ​​within the range of 20% to 30% of the rated torque, depending on the application scenario. This only affects the probability of successful first drive and the overall number of convergence cycles in light-load scenarios, without changing the torque management mechanism of this step.

[0090] S2: During the final time window of the DC drive current holding phase, the encoder output position is sampled multiple times at equal intervals, and the arithmetic mean of the sampled values ​​is taken as the first equilibrium position P1. The duration of the final time window can be selected as an integer multiple of 1, 2, or 3 times the rotor mechanical oscillation period, depending on the oscillation characteristics of the specific system.

[0091] An anti-oscillation spatial filtering framework is constructed based on the time window at the end of the torque holding stage. The encoder output position is sampled and arithmetically averaged multiple times at equal periods to generate the first equilibrium position P1 without phase delay.

[0092] The encoder output is assumed to be an unsigned 32-bit integer throughout the entire detection process, with a value range of 0 to 2. 32 -1. The encoder count rewind, accumulation overflow and cross-loop overflow corrections described below shall all be based on this.

[0093] In this embodiment, the total duration of the torque holding phase in S1 is... Set to 3 seconds, duration of the final time window. Set to 0.5 seconds.

[0094] The end of the final time window coincides with the end of the torque holding phase (i.e., 3 seconds after the start of the holding phase), and the start of the final time window is 2.5 seconds after the start of the holding phase. The relationship between these two moments and the holding phase time axis is shown in the following formula: ; ,in, This represents the start time (s) of the final time window. This represents the end time (s) of the final time window. The start time (s) of the torque holding phase. The total duration of the torque holding phase (in seconds) is taken as 3 seconds in this embodiment. The duration of the final time window (in seconds) is 0.5 seconds in this embodiment.

[0095] The determination of the window opening condition is performed once by the driver's embedded processor in each control cycle. The control cycle during which S1 enters the hold phase is reset to zero, and then increments by 125 μs for each subsequent control cycle. This increments by 125 μs over time. Greater than or equal to When the time window is entered, the encoder position sampling and accumulation process is started.

[0096] Before sampling and accumulation begins, the accumulator is activated at the start of each torque holding phase (i.e., in the same control cycle when S1 enters the holding phase). and sampling counter All values ​​are initialized to 0 to ensure that the accumulated results of each round of detection are not contaminated by historical data. In this embodiment, the accumulator... Using 64-bit unsigned integer storage, after sampling and accumulation, the accumulated value is divided by... The data is then truncated to 32 bits, and the result is stored in a 32-bit register. If, during the final sampling window, the jump between any two adjacent sample values ​​exceeds [a certain threshold], [further action is taken]. The encoder count rollback was determined to have occurred within the window; the cross-loop overflow correction in S4 was first performed on all sampled values ​​within the window, and then the average was accumulated.

[0097] Furthermore, the mechanical oscillation period of the rotor around the equilibrium position under underdamped conditions is determined by the equivalent moment of inertia and the equivalent torque stiffness of the transmission system, and its theoretical calculation formula is as follows: ,in, The rotor mechanical oscillation period (s) is given. The equivalent moment of inertia (kg·m) referred to the motor shaft end 2 ), The equivalent torsional stiffness is (N·m / rad).

[0098] The prototype in this embodiment is connected to a direct-drive turntable load, and the equivalent moment of inertia is calculated. 2.1×10 -5 kg·m 2 Equivalent torsional stiffness The value is 8.3 N·m / rad. Substituting this into the above formula, the theoretical calculated value of the rotor mechanical oscillation period is 0.0100 s (i.e., 10 ms). The 0.5-second end-of-cycle time window used in this embodiment can accommodate approximately 50 complete oscillation cycles.

[0099] In this embodiment, the driver's control cycle is 125μs. The sampling operation is triggered synchronously with the control cycle interrupt, and the encoder position register is read once in each control cycle. A total of 4000 equal-cycle samplings are performed within a 0.5-second end-of-cycle time window, and the time interval between two adjacent samplings is always 125μs.

[0100] During each control cycle, the 32-bit unsigned absolute position value output by the encoder is added to the accumulator. Simultaneously, the sampling counter Perform an increment operation. The quantitative relationship between the sampling interval and the rotor mechanical oscillation period is shown in the following formula: in, The sampling interval (s) is the time interval between samples. The rotor mechanical oscillation period (s).

[0101] In this embodiment =125μs, =10ms, the sampling interval is one-eightieth of the oscillation period, and 80 sampling points are obtained within a single oscillation period.

[0102] Furthermore, at the end of the window (i.e. achieve At the moment when the sampling and accumulation branch exits, the division operation is performed: the accumulator is... The sum of positions divided by the sampling counter The arithmetic mean obtained is taken as the first equilibrium position P1.

[0103] The calculation method for the first equilibrium position P1 is shown in the following formula: Wherein, P1 is the first equilibrium position (encoder counting unit). In this embodiment, the total number of samples taken within the final time window is [number]. =4000, This represents the absolute position value of the encoder obtained from the m-th sample (the encoder counting unit), where m is the sample number.

[0104] After sampling is completed, the sampling counter The value is equal to ,Right now .

[0105] The comparative data in Tables 2 to 6 below were all measured under the same bench conditions: direct drive turntable load equivalent torque 0.5 N·m, equivalent inertia 2.1 × 10⁻⁶. -5 kg·m 2 The encoder resolution was 17 bits, the ambient temperature was 25℃, and each method was repeated 50 times. The encoder position was read through the driver position feedback interface, and the sampling frequency was synchronized with the control cycle; the load was applied by a direct-drive turntable loading device, and the ambient temperature was controlled at 25℃ by a constant temperature chamber; the PWM carrier frequency was 8kHz. Tables 2 and 4 show the maximum absolute deviation values ​​from the 50 repeated experiments; the percentage range in Table 3 represents the statistical range of the results from the 50 repeated experiments; the statistical results in Table 6 are expressed as a range.

[0106] Table 2 presents quantitative comparison data between the late-stage moving average spatial filtering method and two existing location picking strategies in this embodiment.

[0107] Table 2

[0108]

[0109] In Table 2 above, the single snapshot method refers to the method of reading the encoder position value once at any single moment during the torque holding phase as the equilibrium position; the full-time low-pass filtering method refers to the method of continuously low-pass filtering the encoder position signal during the entire torque holding phase and using the filtered output as the equilibrium position. The low-pass filter is a first-order low-pass filter with a cutoff frequency of 10Hz; the final moving average method refers to the method of taking the arithmetic mean by opening a window at the end of the holding phase in this embodiment.

[0110] In an optional embodiment, the duration of the final time window can be alternatively selected as an integer multiple of 1, 2, or 3 times the rotor mechanical oscillation period, depending on the oscillation characteristics of the specific system. When a smaller multiple is selected, the window is shortened and the detection time per round is reduced, while when a larger multiple is selected, the statistical residual of oscillation symmetry cancellation is smaller.

[0111] The mean calculation method can be alternatively weighted average, which assigns higher weights to the sampled values ​​near the end of the window to suppress the influence of the asymmetric oscillation components that may remain in the beginning of the window on the mean.

[0112] The sampling triggering method can be replaced by a hardware timer triggering independent of the control cycle, but the sampling interval still needs to maintain the same period and not be greater than one-tenth of the rotor mechanical oscillation period in order to meet the condition of discretization of the oscillation waveform.

[0113] S3: The target electrical angle of the stator magnetic field is changed by 90 degrees, and the DC drive current is applied to the stator again with the target torque of the current gear to obtain the second equilibrium position P2.

[0114] A secondary position alignment driving framework is constructed based on the 90-degree electrical angle orthogonal transition. After obtaining the first equilibrium position P1, a physical displacement with deterministic directional characteristics is generated. The second equilibrium position P2 is generated by reusing the terminal moving average spatial filter.

[0115] In this embodiment, the target electrical angle of the stator magnetic field used in the initial detection round (first round S1) is 0° electrical angle.

[0116] When S2 outputs P1, S3 will jump the target electrical angle of the stator magnetic field from 0° electrical angle to positive 90° electrical angle in one go, with a jump offset of positive 90°.

[0117] The jump direction is a positive jump. The controller software writes the coordinate transformation angle register of the current loop once during the first control cycle starting from S3. From the moment of writing, the angle reference used by the Park inverse transformation switches from 0° to positive 90°. The direction of the stator's synthesized magnetic field rotates 90° electrical angle in space (for a 4-pole pair motor, the corresponding mechanical angle is 22.5°).

[0118] The jump action is completed within a single control cycle, without intermediate angle transition. The relationship between the electrical angle difference in space between the stator magnetic field direction and the rotor magnetic pole direction after the jump is shown below: ,in, It represents the electrical angle difference between the stator magnetic field and the rotor magnetic poles, expressed in radians (rad). This represents the actual electrical angle of the stator magnetic field, expressed in radians (rad). This represents the actual electrical angle of the rotor magnetic poles, expressed in radians (rad).

[0119] When S3 abruptly changes the electrical angle of the stator magnetic field by 90°, before the rotor begins to move... for rad (i.e., positive 90°) means that the stator magnetic field and the rotor magnetic poles are orthogonal in space.

[0120] In this embodiment, by abruptly changing the target electrical angle of the stator magnetic field from 0° to ±90° within a single control cycle, the electrical angle difference between the stator magnetic field and the rotor magnetic poles is locked at the moment of secondary drive startup. The electromagnetic torque is established without an intermediate transition angle, and the secondary drive reaches the maximum torque angle state in the first control cycle after the jump.

[0121] In this embodiment, the jump angle is selected as 90° electrical angle.

[0122] Under DC drive conditions (d-axis current is zero, q-axis current is DC), the electromagnetic torque and the angle between the stator magnetic field and the rotor poles satisfy a sinusoidal relationship, as shown in the following equation: , The electromagnetic torque is (N·m). In this embodiment, the number of pole pairs of the motor is... =4, The flux linkage (Wb) of the permanent magnet is 8.33 × 10⁻⁶ in this embodiment. -2 Wb, The q-axis current amplitude (A) is obtained by dividing the target torque of the current gear by the torque constant. It represents the electrical angle difference between the stator magnetic field and the rotor magnetic poles, expressed in radians (rad). The value is the sine function of the angle difference.

[0123] It should be noted that the torque constant With permanent magnet magnetic flux The relationship between them is satisfied This holds true under the conditions of surface-mounted permanent magnet synchronous motor, zero d-axis current, and steady-state DC drive.

[0124] In this embodiment =4, =8.33×10 -2 Wb, substitute into =0.5N·m / A, which is consistent with the torque constant calibration value in S1.

[0125] Based on the above characteristics, when = At rad, =1, the electromagnetic torque reaches its maximum value under the same q-axis current amplitude. When deviating from 90°, the electromagnetic torque decreases sinusoidally, and the displacement amplitude decreases accordingly.

[0126] Under maximum torque drive conditions, the rotor obtains the maximum angular acceleration and displacement response amplitude during secondary drive, and the displacement difference ΔP between the second equilibrium position P2 and the first equilibrium position P1 has the maximum amplitude.

[0127] In this embodiment, the DC drive current application of S3 reuses the complete drive path of S1: the vector control unit takes the q-axis current amplitude corresponding to the target torque of the current gear as the target value, keeps the d-axis current command at zero, and the q-axis current command rises from zero to the current amplitude corresponding to the target torque of the current gear using the same linear ramp function as S1 and then remains there.

[0128] The ramp time and hold phase duration of the secondary drive current are consistent with those of S1, which are 50ms and 3s respectively; the target torque value used in the secondary drive is consistent with the target torque value of the same gear used in S1.

[0129] In this embodiment, when the jump direction is positive 90° and the phase sequence wiring is correct, the actual spatial direction of the stator's synthesized magnetic field is consistent with the command direction, which is the positive 90° direction after the jump. Under the action of this magnetic field, the rotor is subjected to a positive electromagnetic torque and is pulled towards the positive 90° direction side. Finally, the second equilibrium position P2 is located on the positive direction side of the first equilibrium position P1 along the jump direction.

[0130] When the phase sequence is reversed (such as any two phases in UVW being swapped), the actual spatial rotation direction of the stator magnetic field is opposite to the spatial direction corresponding to the command. The actual spatial direction of the stator composite magnetic field is negative 90°. Under the action of this reverse magnetic field, the rotor is subjected to a reverse electromagnetic torque, and the second equilibrium position P2 is located on the negative side of the first equilibrium position P1.

[0131] The positional relationship between P2 and P1 under the two working conditions is shown in the following formula: >0; <0.

[0132] Under correct phase sequence conditions, ΔP will always be positive; under reverse connection conditions, ΔP will always be negative.

[0133] In this embodiment, the 90° transition direction is used as a known reference direction. The sign of ΔP is positive when the phase sequence is correct and negative when the phase sequence is reversed.

[0134] In this embodiment, after the secondary drive current of S3 enters the holding phase, the same late-stage moving average spatial filtering algorithm as S2 is executed: within the late time window of the secondary drive current holding phase, the encoder output position is sampled, accumulated, and arithmetically averaged at equal periods to generate the second equilibrium position P2.

[0135] The duration of the final time window, the sampling triggering method, the accumulator bit width, and the division operation method used are all consistent with S2.

[0136] Table 3 presents quantitative comparison data between the two-stage orthogonal magnetic field alignment scheme in this embodiment and two existing direction determination schemes.

[0137] Table 3

[0138]

[0139] In Table 3 above, the signal-to-noise ratio refers to the ratio of the magnitude of ΔP to the magnitude of the position estimation errors of P1 and P2.

[0140] In an optional embodiment, the jump angle can be alternatively selected from other angle values ​​within the electrical angle range of 60° to 120°. When it deviates from 90°, the electromagnetic torque decreases according to a sinusoidal relationship, and the displacement amplitude decreases accordingly, but the principle of direction sign determination remains unchanged. The jump direction can be alternatively adopted as a negative jump (-90°). At this time, the rotor is pulled to the negative direction side under the correct phase sequence condition and to the positive direction side under the reverse phase sequence condition. The determination directions of the positive determination threshold and the negative determination threshold in the three-state determination logic in S4 are reversed accordingly, so that the positive jump and the negative jump are completely symmetrical in the determination principle. The drive torque for secondary alignment can be set independently instead of reusing the current gear of S1. When set independently, the expected value of displacement amplitude needs to be scaled accordingly according to the ratio of the two torques in the threshold calculation of S4.

[0141] S4: Calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, and compare ΔP with the positive and negative judgment thresholds, as shown in the appendix. Figure 2 As shown.

[0142] A direction-sensitive displacement difference calculation framework is constructed based on the first equilibrium position P1 and the second equilibrium position P2. A three-state safety judgment result covering all possible working conditions is generated through positive and negative symmetrical double threshold comparison.

[0143] When ΔP is greater than the positive judgment threshold, the initial magnetic pole position is determined to be successfully detected and the initial magnetic pole position is output; when ΔP is less than the negative judgment threshold, the phase sequence is determined to be reversed, the PWM output is immediately blocked and closed-loop control is prohibited; when ΔP is between the negative judgment threshold and the positive judgment threshold, the driving force is determined to be insufficient.

[0144] In this embodiment, the displacement difference ΔP is calculated using arithmetic subtraction as the basic operation, and its basic calculation formula is shown below: in, P1 is the original displacement difference without overflow correction (encoder count unit), P2 is the second equilibrium position (encoder count unit), and P1 is the first equilibrium position (encoder count unit).

[0145] Based on this, cross-circle overflow correction is performed on the original displacement difference.

[0146] The physical condition for cross-turn overflow is as follows: After the count value of a multi-turn absolute encoder reaches the upper limit of its total count range, it rewinds to the lower limit and starts counting again. When P2 and P1 are exactly distributed at the two ends of the encoder's counting cycle (i.e., the two pickups in a single detection process cross the encoder's count rewind point), the original displacement difference obtained by directly subtracting them is... The magnitude and sign of the displacement are opposite to those of the actual displacement.

[0147] For the above operating conditions, the judgment condition and correction formula for cross-cycle overflow correction are as follows:

[0148] like ,but ;

[0149] like ,but ;

[0150] Where ΔP is the corrected displacement difference (encoder counting unit). The encoder counts the rewind modulus, and we take 2. 32 The encoder uses 17 bits for single-turn counting and 15 bits for multi-turn counting, together forming 32 bits of unsigned data, with a counting range of 0 to 2. 32 -1. In this embodiment =2 32 , / 2=2 31 , This is the sign function for the original displacement difference. It takes the value +1 when the original displacement difference is positive and -1 when it is negative.

[0151] In this embodiment, the positive and negative judgment thresholds are set based on the theoretical displacement, and the specific numerical relationship is shown in the following formula: ; ,in, This is the positive decision threshold (encoder counting unit). This is the negative decision threshold (encoder counting unit). This is the theoretical displacement (encoder counting unit).

[0152] In this embodiment, the threshold value is 1 / 4 of the theoretical displacement, which takes into account mechanical friction, encoder noise, and position estimation errors of P1 and P2.

[0153] The theoretical displacement is defined as the mechanical angle count change corresponding to the rotor moving from the current aligned position to the position where the stator magnetic field direction is completely aligned after the jump, under the condition of a 90-degree electrical angle jump and the correct phase sequence. This value is determined by the number of motor pole pairs and the encoder resolution and is independent of the driving torque amplitude.

[0154] In this embodiment, the number of pole pairs is 4, a 90° electrical angle corresponds to a mechanical angle of 22.5°, and the encoder has 131,072 counting units per revolution. The calculation process for the theoretical mechanical counting displacement corresponding to a 90° electrical angle jump is shown in the following formula: in, This represents the number of pole pairs of the motor; in this embodiment, it is set to 4. This represents the total number of encoder revolutions, which is 131072 in this embodiment.

[0155] Correspondingly, the positive decision threshold is 2048 encoder count units, and the negative decision threshold is -2048 encoder count units.

[0156] The decision logic takes the corrected displacement difference ΔP as input and uses the positive and negative decision thresholds as comparison benchmarks. All comparison operations are completed within the first control cycle after acquiring P2. In the decision logic of this embodiment, The corresponding positive judgment threshold is set at 2048 encoder count units.

[0157] First decision branch: The trigger condition for the successful branch is that the corrected displacement difference ΔP is greater than the positive decision threshold (i.e., ΔP>2048 count units).

[0158] The rotor experienced an effective displacement exceeding the threshold along the positive direction consistent with the jump direction, and both the direction and magnitude of the displacement met the success determination requirements.

[0159] The execution action is as follows: The initial magnetic pole position detection is successful. Using the first equilibrium position P1 as the mechanical angle reference, and combining the number of pole pairs of the servo motor and the encoder offset, the current electrical angle position of the rotor is calculated according to the following conversion relationship: ,in, P1 is the initial magnetic pole electrical angle position (degrees, electrical angle) output, and P1 is the first equilibrium position (encoder counting unit). This refers to the encoder bias (encoder counting unit), in this embodiment... The factory calibration value is 0, meaning the encoder zero point coincides with the motor's electrical zero point; when the prototype is replaced or the encoder is reinstalled... The parameters were remeasured and entered into the parameter table according to the manufacturer's calibration process. This represents the number of pole pairs of the motor. This represents the total number of encoder revolutions. In this embodiment, the number of pole pairs is... =4, the encoder offset is written into the parameter table by the factory calibration, and the other parameters follow the previous definition.

[0160] The conversion result is normalized modulo 360° to ensure that the output electrical angle position always falls within the range of 360°. Within the interval, the modulo operation does not affect the physical meaning of the electrical angle position. The calculated electrical angle position is written into the vector control unit as the initial reference angle for rotor field orientation when entering closed-loop control.

[0161] The second decision branch, the phase sequence reversed branch, is triggered when the corrected displacement difference ΔP is less than the negative decision threshold (i.e., ΔP < -2048 count units).

[0162] The rotor experienced an effective displacement exceeding the threshold in the negative direction opposite to the jump direction. The displacement amplitude met the standard, but the direction was reversed. This condition physically corresponds to the UVW power line phase sequence being reversed.

[0163] The execution actions are as follows: if the phase sequence is reversed, the PWM output is immediately blocked. Specifically, the drive signals of all power stage switching transistors are turned off, the motor windings are de-energized, and the positive current feedback path is physically blocked. At the same time, closed-loop control is prohibited. Specifically, the state machine of the vector control unit is locked in the initial magnetic pole detection state, and the closed-loop operation switching command is refused to be responded to until the phase sequence reversed fault is manually cleared and the lock is released. At the same time, the phase sequence reversed fault code is output through the driver fault diagnosis system, so that the status is reported simultaneously in the form of machine-readable fault code and human-readable alarm.

[0164] The third decision branch, the insufficient driving force branch, is triggered when the corrected displacement difference ΔP is between the negative decision threshold and the positive decision threshold (i.e., -2048≤ΔP≤2048 count units).

[0165] If the rotor does not experience an effective displacement exceeding the threshold, regardless of whether its direction sign is positive or negative, the displacement amplitude is insufficient to prove that the rotor has been successfully pulled. This corresponds to two working conditions: static friction force not being overcome or mechanical jamming.

[0166] The execution action is as follows: if the driving force is insufficient, the failure counter is triggered to increment. The failure counter counts the number of consecutive determinations of insufficient driving force, and this count value serves as the direct basis for the torque increment operation in S5.

[0167] It should be noted that the judgment interval is bounded by zero, and no direction determination is made for positive and negative small displacements: when the driving force is insufficient, the rotor may produce positive displacement, negative displacement or no displacement with an amplitude less than the threshold, and no direction determination is made in any of these cases, so as to avoid unreliable judgment of the direction sign under the condition that the driving force itself is insufficient.

[0168] Table 4 provides a quantitative comparison of the direction symbol sensing security verification scheme in this embodiment with the absolute value determination scheme in the prior art.

[0169] Table 4

[0170]

[0171] In Table 4 above, the absolute value determination scheme refers to the existing method that compares |ΔP| with a single positive threshold and uses a binary search to determine whether it is successful or unsuccessful.

[0172] In an optional embodiment, the positive and negative decision thresholds can be alternatively set to independent absolute values ​​for the positive and negative thresholds, respectively, to cover application scenarios where the resistance to motion in the positive and negative directions is asymmetrical (such as a screw drive system with a unidirectional load structure).

[0173] The threshold can be replaced by an adaptive adjustment mechanism, which dynamically scales the threshold based on the cumulative displacement response amplitude in multiple iterations, so that the threshold is updated adaptively with the actual performance of the transmission mechanism.

[0174] Alarm code definitions can alternatively use other coded values ​​in the driver-defined fault code system;

[0175] The safety procedure for reversed phase sequence connection can be replaced by additional safety actions such as connecting the braking resistor and disconnecting the main circuit contactor.

[0176] S5: When insufficient driving force is detected, the target torque of the current gear is increased by a fixed percentage, and the increased torque is used as the target torque of the current gear. The process returns to S1, continuing until the detection is successful, the target torque reaches the maximum allowable value, or a phase sequence reversal is detected, as shown in the appendix. Figure 3 As shown.

[0177] Based on the determination of insufficient driving force, a torque gear increment and closed-loop iterative control framework is constructed to generate a target torque sequence that is upgraded round by round, and an automatic optimization detection strategy is implemented under triple termination conditions.

[0178] In this embodiment, when S4 determines that the driving force is insufficient, the increment operation uses the current value of the target torque of the current gear as the calculation basis. The target torque after increment is equal to the current value before increment multiplied by 1.2, that is... ,in Let T_ref(1) be the target torque (N·m) for the current gear in the kth round, k=1,2,…,T_ref(1)=0.6N·m.

[0179] In this embodiment, the constraint of the maximum permissible torque is executed immediately after the increment operation is completed. The determination rule is as follows: when the target torque after increment reaches or exceeds the maximum permissible torque of 1.5 N·m, the maximum permissible torque of 1.5 N·m is used as the target torque for the last round of detection. If the driving force is still insufficient in the S4 round, the system determines that there is a permanent fault such as mechanical jamming, terminates the closed-loop iteration and reports a mechanical jamming alarm.

[0180] The coupling relationship between the constraint rules and the increment operation is shown in the following equation: in, The actual target torque (N·m) is generated in the kth round. Let N be the target torque (N·m) for the current gear in the kth round. In this embodiment, the maximum permissible torque (N·m) is... =1.5 N·m, This is for calculating the minimum value.

[0181] When S4 determines that the driving force is insufficient and the increased target torque has not yet reached the maximum allowable torque, the system uses the increased target torque as the new target torque for the current gear, returns to execute S1, and enters the next round of the complete detection process. Each time the insufficient driving force determination is triggered, the failure counter increments by 1.

[0182] The failure counter counts the number of consecutive decisions due to insufficient driving force.

[0183] The failure counter is reset under the following conditions: when the S4 determination of the initial position of the magnetic pole is successful or the phase sequence is reversed in any detection round, the failure counter is immediately reset to 0; when the closed-loop iteration terminates abnormally due to the torque reaching the maximum allowable value, the failure counter retains its final value until the entire detection process is restarted and then reset.

[0184] When each iteration returns to S1, the q-axis current command of S1 is re-established from zero by the ramp function and rises to the current amplitude corresponding to the target torque of the current gear after incrementing, and then remains there. The ramp buffer mechanism is completely repeated in each iteration.

[0185] The feedback path is from S4 through S5 to S1.

[0186] In this embodiment, by instantly counting the results of insufficient driving force determination and instantly feeding back the increased torque, the increment decision and determination are completed within the same control cycle. The increased target torque takes effect from the next control cycle. The torque establishment in each iteration is re-executed from zero through the ramp function.

[0187] Furthermore, the exit of the closed-loop iteration is controlled by three termination conditions, which have a fixed priority structure, as shown in Table 5 below.

[0188] Table 5

[0189]

[0190] In Table 5 above, the three termination conditions have a fixed priority and cannot be changed by the iterative state during the detection process.

[0191] When S4 determines that the phase sequence is reversed in any iteration, regardless of the torque gear or failure count, the closed-loop iteration is immediately terminated, PWM blocking and alarm are executed, and no subsequent torque increment operation is performed. Successful detection has the next highest priority and exits normally if the phase sequence reversal is ruled out. Target torque reaching the maximum allowable value has the lowest priority and is only executed when neither safety fault nor success condition is triggered and all gears have been used.

[0192] Table 6 presents a quantitative comparison of the closed-loop iterative scheme in this embodiment with the fixed torque single detection scheme and the manual parameter modification retry scheme in the prior art.

[0193] Table 6

[0194]

[0195] In Table 6 above, the values ​​of the fixed torque single test index are the typical performance range of the fixed phase-finding current scheme in the servo drive industry under unknown load conditions; the data of the manual parameter modification and retry scheme are the control data measured on the bench in this embodiment; and the data of the closed-loop iteration scheme are the range obtained by repeating the experiment 50 times under the same load conditions in this embodiment.

[0196] In an alternative embodiment, the incremental strategy may instead employ an exponential incremental approach, whereby the increment gradually increases with the number of failures to accelerate convergence to a torque level sufficient to drive heavy loads.

[0197] The incremental strategy can be replaced by fuzzy control increment, which uses the displacement response amplitude and failure number of previous rounds as inputs and determines the increment step size of the next round through fuzzy reasoning.

[0198] The failure count limit can be set in conjunction with the torque increment setting. When the failure count reaches the preset intermediate value, the intermediate gear is skipped and the torque increment is directly increased to a higher gear to shorten the total detection time under heavy load conditions.

[0199] The combination of termination conditions can be used as an alternative to increase the upper limit of the total number of iterations as an additional termination condition to prevent the closed-loop iteration from becoming too long under abnormal operating conditions.

[0200] As attached Figure 4The servo motor initial magnetic pole detection system shown includes: an adaptive driving force generation module, a final statistical position picking module, an orthogonal magnetic field alignment module, a direction sign perception and verification module, and a closed-loop feedback module.

[0201] The adaptive driving force generation module is used to apply a DC driving current to the stator of the servo motor with the target torque of the current gear. The DC driving current rises from zero to the target torque value of the current gear through a ramp function and is then held, so that the motor rotor is pulled towards the direction of the stator magnetic field.

[0202] The end-of-phase statistical position acquisition module is used to sample the encoder output position multiple times at equal intervals within the end-of-phase time window of the DC drive current holding phase, and take the arithmetic mean of the sampled values ​​as the first equilibrium position P1. The duration of the end-of-phase time window is an integer multiple of the rotor mechanical oscillation period.

[0203] The orthogonal magnetic field alignment module is used to jump the target electrical angle of the stator magnetic field by 90 degrees after obtaining the first equilibrium position P1, trigger the adaptive driving force generation module to apply DC driving current again with the same gear target torque, and trigger the final statistical position picking module to obtain the second equilibrium position P2.

[0204] The direction symbol sensing and verification module is used to calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, compare ΔP with the positive judgment threshold and the negative judgment threshold, and output the judgment result: the initial position of the magnetic pole is successfully detected, the phase sequence is reversed, or the driving force is insufficient.

[0205] The closed-loop feedback module is used to increase the target torque of the current gear by a fixed percentage when the determination result is insufficient driving force, triggering iterative detection until the detection is successful, the target torque reaches the maximum allowable value, or the phase sequence is reversed.

[0206] Secondly: The accompanying drawings of the embodiments disclosed in this invention only involve the structures involved in the embodiments disclosed in this invention. Other structures can refer to the general design. In the absence of conflict, the same embodiment and different embodiments of this invention can be combined with each other.

[0207] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for detecting the initial magnetic poles of a servo motor, characterized in that, include: S1: Apply a DC drive current to the stator of the servo motor with the target torque of the current gear. The DC drive current rises from zero to the target torque value of the current gear through a ramp function and is then held, so that the motor rotor is pulled toward the direction of the stator magnetic field. S2: During the final time window of the DC drive current holding phase, the encoder output position is sampled multiple times at equal intervals, and the arithmetic mean of the sampled values ​​is taken as the first equilibrium position P1. The duration of the final time window is greater than an integer multiple of the rotor mechanical oscillation period. S3: Change the target electrical angle of the stator magnetic field by 90 degrees, and apply DC drive current to the stator again with the target torque of the current gear to obtain the second equilibrium position P2. S4: Calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, and compare ΔP with the positive judgment threshold and the negative judgment threshold: When ΔP is greater than the positive judgment threshold, the initial magnetic pole position is determined to be successfully detected and the initial magnetic pole position is output. When ΔP is less than the negative judgment threshold, the phase sequence is reversed, the PWM output is immediately blocked and closed-loop control is prohibited. When ΔP is between the negative decision threshold and the positive decision threshold, the decision driving force is insufficient; S5: When it is determined that the driving force is insufficient, the target torque of the current gear is increased by a fixed percentage, and the increased torque is used as the target torque of the current gear. Then, return to execute S1 until the detection is successful, the target torque reaches the maximum allowable value, or the phase sequence is reversed.

2. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: S1, when the detection process is executed for the first time, specifically includes: The initial value of the target torque for the current gear is 20% of the motor's rated torque; The ramp function is a linear ramp function, and the ramp time is set to 50 milliseconds; The duration of the holding phase of the DC drive current is 3 seconds.

3. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: The duration of the final time window in S2 is an integer multiple of the rotor mechanical oscillation period, specifically: The duration of the final time window is set to N times the rotor mechanical oscillation period, where N is an integer greater than or equal to 2; The end time of the final time window coincides with the end time of the DC drive current holding phase, so that the window contains at least one positive offset segment and one negative offset segment of a complete oscillation cycle.

4. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: In S2, the sampling interval for sampling the encoder output position multiple times at equal periods is less than or equal to one-tenth of the rotor mechanical oscillation period, and not greater than the control period duration of the DC drive current holding phase. The sampled value used to generate the arithmetic mean obtains at least 10 sampling points within a single oscillation period.

5. The method for detecting the initial magnetic poles of a servo motor according to claim 4, characterized in that: In step S2, the number of samplings in the equal-period multiple sampling is determined by the sampling interval and the duration of the final time window. The number of samplings is the total number of samples in the final time window, ensuring that the total amount of location data within the final time window meets the minimum size requirement for the statistical properties of the arithmetic mean.

6. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: S3, which involves a 90-degree jump in the target electrical angle of the stator magnetic field, specifically includes: The target electrical angle of the stator magnetic field is changed from the 0-degree electrical angle used in the initial alignment to a positive 90-degree electrical angle or a negative 90-degree electrical angle in one step, so that the electrical angle difference between the stator magnetic field and the rotor magnetic pole after the change is π / 2. Under the condition that the electrical angle difference is π / 2, the electromagnetic torque and the electrical angle difference satisfy a sinusoidal relationship and the sinusoidal function takes the maximum value of 1, so that the rotor obtains the maximum electromagnetic torque under the same driving current amplitude and generates a deterministic displacement with the largest amplitude.

7. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: In step S4, the positive judgment threshold is set to one-quarter of the theoretical displacement, and the negative judgment threshold is set to one-quarter of the negative theoretical displacement. The theoretical displacement is the encoder count change corresponding to a 90-degree electrical angle jump, which is uniquely determined by the number of motor pole pairs and the encoder resolution. The positive and negative decision thresholds form a positive-negative symmetrical threshold pair with zero as the center of symmetry, so that all possible values ​​of the displacement difference ΔP are divided into three decision intervals.

8. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: S4, in the process of calculating the displacement difference ΔP, specifically includes: Based on the encoder's total count range The rewind modulus is the direct difference between the second equilibrium position P2 and the first equilibrium position P1. Greater than When this occurs, it is determined that encoder count rollback has occurred; Will minus The displacement difference ΔP is then used as the displacement difference. The sign function for the original displacement difference.

9. The method for detecting the initial magnetic poles of a servo motor according to claim 1, characterized in that: S5 increases the target torque of the current gear by a fixed percentage, specifically including: The target torque after the increment is equal to the target torque before the increment multiplied by 1.2; The maximum permissible torque is set to 50% of the motor's rated torque; When the target torque of the current gear reaches the maximum allowable torque but the driving force is still insufficient, the iteration is terminated and a mechanical jamming alarm is reported.

10. A servo motor initial magnetic pole detection system, comprising a servo motor initial magnetic pole detection method according to any one of claims 1-8, characterized in that, include: Adaptive drive force generation module: used to apply DC drive current to the stator of the servo motor with the target torque of the current gear. The DC drive current rises from zero to the target torque value of the current gear through a ramp function and is held, so that the motor rotor is pulled towards the direction of the stator magnetic field. End-of-phase statistical position acquisition module: used to sample the encoder output position multiple times at equal intervals within the end-of-phase time window of the DC drive current holding phase, and take the arithmetic mean of the sampled values ​​as the first equilibrium position P1. The duration of the end-of-phase time window is greater than an integer multiple of the rotor mechanical oscillation period. Orthogonal magnetic field alignment module: After obtaining the first equilibrium position P1, the target electrical angle of the stator magnetic field jumps by 90 degrees, triggering the adaptive driving force generation module to apply DC driving current again with the same gear target torque, and triggering the final statistical position picking module to obtain the second equilibrium position P2. Direction symbol perception and verification module: used to calculate the displacement difference ΔP based on the first equilibrium position P1 and the second equilibrium position P2, compare ΔP with the positive judgment threshold and the negative judgment threshold, and output the judgment result: the initial position of the magnetic pole was successfully detected, the phase sequence was reversed or the driving force was insufficient. Closed-loop feedback module: When the judgment result is insufficient driving force, it increases the target torque of the current gear by a fixed percentage, triggers iterative detection, until the detection is successful, the target torque reaches the maximum allowable value, or the phase sequence is reversed.