Motor reciprocating control scheme generation method, electronic device and storage medium
Through a motor reciprocating control scheme generation method, the motor control scheme is automatically generated and adaptively adjusted, and the problems of complex and low efficiency of motor reciprocating motion control in the prior art are solved, thereby achieving more efficient and more accurate motor motion control.
Patent Information
- Application Number
- CN202510016700.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-01-06
AI Technical Summary
The prior art is difficult to effectively control the reciprocating movement of brushless DC motors, resulting in problems such as unstable frequency, lengthened stroke, improper frequency, insufficient uniform motion time or excessive vibration amplitude, and requires manual complex motor control scheme setting and debugging.
A method for generating a motor reciprocating control scheme is provided. By obtaining the reciprocating frequency, uniform speed, uniform speed movement time and stroke range input by the user, it automatically generates and adaptively adjusts the control scheme so that the output frequency and stroke parameters meet user needs and meet the motor operation characteristics.
It reduces the time and labor costs of motor control and debugging, improves the efficiency and accuracy of motor motion control, and reduces the complexity of manual debugging.
Smart Images

Figure CN119401881B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to a method for generating a motor reciprocating control scheme, an electronic device and a storage medium. Background Art
[0002] Brushless DC motors have been widely used in many fields such as home appliances, medical and industrial automation due to their significant advantages such as high efficiency, high reliability, low noise and long life. In the medical field in particular, brushless DC motors have become an indispensable core component of various medical equipment, especially in surgical instruments that require planing and cutting functions, where various motor motion modes have been fully utilized.
[0003] In these applications, the control of the reciprocating motion of the motor with the characteristics of short stroke and high frequency is particularly critical. At present, there are two main ways to control this reciprocating motion in the market: one is to control the reciprocating motion by stroke setting, which can ensure that the predetermined position is reached, but the frequency is unstable and the stroke may be extended; the other is to adjust the frequency, which can achieve the expected cutting frequency, but may cause problems such as improper frequency, insufficient uniform motion time or excessive vibration amplitude, and requires manual setting and debugging of the motor control solution, which is time-consuming and laborious.
[0004] There is currently no effective technical solution to the above problems. Summary of the invention
[0005] The purpose of the present application is to provide a method for generating a reciprocating control scheme for a motor, an electronic device and a storage medium, so as to automatically generate and adaptively modify the control scheme for the motor, so that the frequency and stroke parameters of the control scheme outputted by the motor meet the user's usage requirements and conform to the operating characteristics of the motor, thereby reducing the time and labor costs used for debugging.
[0006] In a first aspect, the present application provides a method for generating a motor reciprocating control scheme, which is applied in motor control, and the method comprises the following steps:
[0007] S1. Obtain input parameters, wherein the input parameters include original parameters and range parameters. The original parameters include reciprocating frequency, uniform speed, and uniform motion duration. The range parameters include travel range.
[0008] S2. Calculate and obtain the one-way motion duration according to the reciprocating frequency;
[0009] S3, calculating the acceleration and deceleration duration according to the uniform motion duration and the one-way motion duration;
[0010] S4, calculating and obtaining the acceleration and deceleration speed according to the acceleration and deceleration duration and the uniform speed;
[0011] S5, calculating and obtaining the motion stroke according to the uniform motion duration, the acceleration / deceleration speed and the acceleration / deceleration duration;
[0012] S6. Determine whether the motion stroke is within the stroke range. If yes, output a control scheme including the uniform motion duration, the acceleration / deceleration speed, and the acceleration / deceleration duration. Otherwise, adjust the uniform motion duration or the reciprocating frequency to generate a new control scheme.
[0013] The motor reciprocating control scheme generation method of the present application can automatically generate and adaptively modify the motor control scheme based on the reciprocating frequency, uniform speed, uniform motion duration and stroke range input by the user, so that the frequency and stroke parameters of the control scheme output by it meet the user's usage requirements and conform to the operating characteristics of the motor. There is no need for the user to repeatedly debug the settings, effectively reducing the time and labor costs used for debugging.
[0014] The motor reciprocating control scheme generating method, wherein the range parameter also includes a frequency range, and the method further includes a step performed between step S1 and step S2:
[0015] SA. Determine whether the reciprocating frequency is within the frequency range. If yes, execute step S2; otherwise, generate a first warning message.
[0016] The motor reciprocating control scheme generation method of the present application also adds a frequency verification step SA, which is used to determine whether the reciprocating frequency originally set by the user or the reciprocating frequency adjusted in step S6 is within the frequency range that meets the motor usage requirements. If the verification passes, step S2 is continued to generate the control scheme. If the verification fails, it indicates that the currently used reciprocating frequency does not meet the motor usage requirements and a control scheme matching the motor cannot be generated. Therefore, a first warning message is generated to inform the user that there is a problem with the currently set input parameters.
[0017] The motor reciprocating control scheme generating method, wherein the range parameter also includes a lower limit of the uniform speed duration;
[0018] The step of adjusting the uniform motion duration or the reciprocating frequency to generate a new control scheme includes:
[0019] S61, adjusting the duration of the uniform motion according to the direction in which the motion stroke exceeds the stroke range;
[0020] S62, determine whether the adjusted uniform motion duration is lower than the uniform motion duration lower limit, if so, adjust the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range and return to the uniform motion duration before adjustment, return to step SA, otherwise fix the adjusted uniform motion duration and return to step S3.
[0021] The motor reciprocating control scheme generating method, wherein step S61 comprises:
[0022] When the movement stroke is greater than the upper limit of the stroke range, reducing the uniform motion duration, and then executing step S62;
[0023] When the movement stroke is less than the lower limit of the stroke range, the uniform motion duration is increased, and then the process returns to step S3.
[0024] The method for generating a motor reciprocating control scheme, wherein the step of adjusting the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range comprises:
[0025] When the movement stroke is greater than the upper limit of the stroke range, increasing the reciprocating frequency;
[0026] When the movement stroke is smaller than the lower limit of the stroke range, the reciprocating frequency is reduced.
[0027] In a second aspect, the present application also provides another method for generating a motor reciprocating control scheme, which is applied to the control of a motor with inconsistent forward and reverse motions, and the method comprises the following steps:
[0028] A1. Obtain input parameters, which include original parameters and range parameters. The original parameters include reciprocating frequency, uniform speed, forward uniform motion duration, and reverse uniform motion duration. The range parameters include the total travel range.
[0029] A2. Calculate and obtain the one-way motion duration according to the reciprocating frequency;
[0030] A3, calculating the forward acceleration and deceleration duration according to the forward uniform motion duration and the one-way motion duration, and calculating the reverse acceleration and deceleration duration according to the reverse uniform motion duration and the one-way motion duration;
[0031] A4. Calculate the forward acceleration and deceleration according to the forward acceleration and deceleration duration and the uniform speed, and calculate the reverse acceleration and deceleration according to the reverse acceleration and deceleration duration and the uniform speed;
[0032] A5. Calculate the forward motion stroke according to the forward uniform motion duration, the forward acceleration / deceleration, and the forward acceleration / deceleration duration, and calculate the reverse motion stroke according to the reverse uniform motion duration, the reverse acceleration / deceleration, and the reverse acceleration / deceleration duration;
[0033] A6. Determine whether the sum of the forward motion stroke and the reverse motion stroke is within the total stroke range. If so, output a control scheme including the forward uniform motion duration, the reverse uniform motion duration, the forward acceleration / deceleration, the forward acceleration / deceleration duration, the reverse acceleration / deceleration, and the reverse acceleration / deceleration duration. Otherwise, adjust the forward uniform motion duration and the reverse uniform motion duration at the same time or adjust the reciprocating frequency alone to generate a new control scheme.
[0034] The motor reciprocating control scheme generation method of the present application can automatically generate and adaptively modify the control scheme for a motor with inconsistent forward and reverse strokes based on the reciprocating frequency, uniform speed, forward uniform motion duration, reverse uniform motion duration, and total stroke range input by the user, so that the frequency and stroke parameters of the control scheme output by it meet the user's usage requirements and conform to the operating characteristics of the motor. There is no need for the user to repeatedly debug the settings, effectively reducing the time and labor costs used for debugging.
[0035] The motor reciprocating control scheme generating method, wherein, in step A6, the ratio of the adjustment amplitude of the forward uniform motion duration to the adjustment amplitude of the reverse uniform motion duration is equal to the ratio of the forward motion stroke to the reverse motion stroke.
[0036] In this example, when the total travel range verification fails, in order to ensure that the ratio of the forward rotation number to the reverse rotation number remains unchanged, the processing method of adjusting the uniform motion duration needs to adjust the forward uniform motion duration and the reverse uniform motion duration at the same time, and the adjustment range is determined according to the ratio of the forward motion stroke to the reverse motion stroke.
[0037] The motor reciprocating control scheme generating method, wherein the range parameter also includes a lower limit of the acceleration and deceleration time;
[0038] The method further comprises the step of performing between steps A3 and A4:
[0039] Determine whether the forward acceleration / deceleration duration and / or the reverse acceleration / deceleration duration is greater than the lower limit of the acceleration / deceleration duration. If so, execute step A4; otherwise, adjust the corresponding forward uniform motion duration and / or the reverse uniform motion duration to obtain the corresponding, new forward acceleration / deceleration duration and / or reverse acceleration / deceleration duration.
[0040] In a third aspect, the present application further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method provided in the first aspect are executed.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps in the method provided in the first aspect are executed.
[0042] From the above, it can be seen that the present application provides a motor reciprocating control scheme generation method, an electronic device and a storage medium, wherein the motor reciprocating control scheme generation method can automatically generate and adaptively modify the motor control scheme based on the reciprocating frequency, uniform speed, uniform motion duration and stroke range input by the user, so that the frequency and stroke parameters of the control scheme output by it meet the user's usage requirements and conform to the operating characteristics of the motor, without the user having to repeatedly debug the settings, effectively reducing the time cost and labor cost used for debugging. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A flowchart of a method for generating a motor reciprocating control scheme provided in an embodiment of the first aspect of the present application.
[0044] Figure 2 A flowchart of a method for generating a motor reciprocating control scheme provided in an embodiment of the second aspect of the present application.
[0045] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0046] Reference numerals: 301, processor; 302, memory; 303, communication bus. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0048] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0049] First, please refer to Figure 1 Some embodiments of the present application provide a method for generating a motor reciprocating control scheme, which is applied in motor control. The method includes the following steps:
[0050] S1. Obtain input parameters, which include original parameters and range parameters. The original parameters include reciprocating frequency, uniform speed, and uniform motion duration, and the range parameters include travel range;
[0051] S2, calculating and obtaining the one-way motion duration according to the reciprocating frequency;
[0052] S3, calculating the acceleration and deceleration duration according to the uniform motion duration and the one-way motion duration;
[0053] S4, calculate and obtain the acceleration and deceleration according to the acceleration and deceleration duration and the uniform speed;
[0054] S5, calculating and obtaining the motion stroke according to the uniform motion duration, acceleration and deceleration speed, and acceleration and deceleration duration;
[0055] S6. Determine whether the motion stroke is within the stroke range. If so, output a control scheme including uniform motion duration, acceleration / deceleration, and acceleration / deceleration duration. Otherwise, adjust the uniform motion duration or reciprocating frequency to generate a new control scheme.
[0056] Specifically, the motor reciprocating control scheme generating method of the embodiment of the present application is used to adaptively generate a control scheme that matches the input parameters set by the user and can be directly used for motor control, so that the motor can operate based on the control scheme output by the motor reciprocating control scheme generating method of the embodiment of the present application to meet the user's usage requirements.
[0057] More specifically, the original parameters in the input parameters are parameter data originally set and input by the user for describing or defining the operating state of the motor; wherein, the reciprocating frequency is the number of times the motor rotates and switches back and forth per unit time, and in the embodiment of the present application, one forward rotation and one reverse rotation of the motor belong to one reciprocating switching number; the motor includes three stages of accelerated rotation, uniform rotation and decelerated rotation in the process of one rotation (forward rotation or reverse rotation), wherein accelerated rotation is the process of uniformly accelerated rotation based on a positive acceleration, and decelerated rotation is the process of uniformly decelerated rotation based on a negative acceleration; uniform speed is the rotation speed during the uniform rotation process, and uniform motion duration is the duration of the uniform rotation process during each rotation of the motor.
[0058] More specifically, the range parameter is a numerical condition for constraining the parameter data of the motor's operating state, so that the motor reciprocating control scheme generation method of the embodiment of the present application can adaptively adjust the parameter data of the motor's operating state to construct a control scheme that meets user needs while satisfying the range parameter. The range parameter can be input by the user according to the instruction manual of the motor, or it can be preset based on the motor type to ensure that the final output control scheme meets the usage characteristics of the motor; wherein the stroke range is the stroke data of the motor used for constraining one rotation or one reciprocating switching, including an upper stroke limit and a lower stroke limit, wherein, in the embodiment of the present application, the stroke of the motor can be the rotation angle or the number of rotations of the motor output end.
[0059] More specifically, the motor reciprocating control scheme generation method provided in the first aspect of the present application is mainly used to generate and design the control scheme when the forward and reverse rotation strokes of the motor are consistent. Therefore, in this embodiment, the stroke range is preferably used to constrain the stroke data for one rotation.
[0060] More specifically, the duration of a single motion may be the time taken for one rotation of the motor or one reciprocating switch. In this embodiment, it is preferably the time taken for one rotation of the motor, which may be directly determined based on the motion cycle converted from the reciprocating frequency.
[0061] More specifically, in the field of motor control, the acceleration rotation and deceleration rotation of the motor are generally symmetrical motion processes, that is, the two processes are based on the same absolute value of acceleration and the same duration of movement to pull the motor from 0 speed to a uniform speed and from a uniform speed to 0 speed; therefore, the duration of the acceleration rotation and the deceleration rotation are the same, and the acceleration and deceleration duration in step S3 is the sum of the duration of the acceleration rotation and the deceleration rotation, which can be obtained by subtracting the one-way motion duration and the uniform speed motion duration, and step S4 can calculate the acceleration and deceleration based on the 0 speed, the acceleration and deceleration duration and the uniform speed, and the acceleration and deceleration represents the absolute value of the aforementioned positive acceleration or negative acceleration.
[0062] More specifically, after determining the acceleration and deceleration speed and the acceleration and deceleration duration, step S5 can respectively calculate the three strokes corresponding to the acceleration rotation, uniform rotation and deceleration rotation of the motor in one rotation process, and sum them up to obtain the motion stroke representing the total stroke of the rotation process, thereby completing the preliminary generation of the motor control scheme, and then combining step S6 to verify the scheme, that is, by using the range parameter to verify whether the control scheme meets the user's set requirements, and adaptively adjust the original parameters to regenerate a new control scheme when the range parameter is not met, until a control scheme that meets the user's set requirements is obtained; wherein, in step S6, the control scheme is mainly verified by the stroke range in the range parameter. When the motion stroke obtained in the previous step is not within the stroke range, step S6 adjusts the uniform motion duration or reciprocating frequency according to the preset adjustment logic (such as percentage increase or decrease, fixed value increase or decrease) to achieve local adjustment of the original parameters, and then generates the control scheme based on the previous steps of the adjusted data range, thereby achieving adaptive adjustment of the control scheme without human intervention.
[0063] More specifically, in the embodiment of the present application, the control scheme is mainly composed of three data: uniform motion duration, acceleration and deceleration, and acceleration and deceleration duration. In the actual control of the motor, the motor can control the acceleration and deceleration stage based on the acceleration and deceleration and the acceleration and deceleration duration. At the end of the acceleration stage, the speed is based on the speed at the end of the acceleration stage to maintain the speed rotation within the uniform motion duration to achieve uniform rotation; in some embodiments, the control scheme may also include a uniform speed, which is used to determine whether the speed in the uniform rotation stage is wrong; in some other embodiments, the control scheme may also be composed of three data: uniform motion duration, acceleration and deceleration, and uniform speed. The motor can accelerate and decelerate based on the acceleration and deceleration, wherein the acceleration rotation stage switches to uniform rotation by determining whether the speed is increased to a uniform speed.
[0064] The motor reciprocating control scheme generating method of the embodiment of the present application can automatically generate and adaptively modify the control scheme of the motor based on the reciprocating frequency, uniform speed, uniform motion duration and travel range input by the user, so that the frequency and travel parameters of the control scheme output by it meet the user's usage requirements and conform to the operating characteristics of the motor. There is no need for the user to repeatedly debug the settings, effectively reducing the time and manpower costs used for debugging.
[0065] In some preferred embodiments, the range parameter further includes a frequency range, and the method further includes a step performed between step S1 and step S2:
[0066] SA, determine whether the reciprocating frequency is within the frequency range, if yes, execute step S2, otherwise generate a first warning message.
[0067] Specifically, in order to avoid improper frequency design, the motor reciprocating control scheme generating method of the embodiment of the present application also adds a frequency verification step SA, which is used to determine whether the reciprocating frequency originally set by the user or the reciprocating frequency adjusted in step S6 is within the frequency range that meets the motor usage requirements. If the verification passes, step S2 is continued to generate the control scheme. If the verification fails, it indicates that the currently used reciprocating frequency does not meet the motor usage requirements and a control scheme matching the use of the motor cannot be generated. Therefore, a first warning message is generated to inform the user that there is a problem with the currently set input parameters.
[0068] More specifically, the first warning message is a signal for triggering a warning, and its warning method is related to the function of the terminal carrier carried by the motor reciprocating control scheme generating method of the embodiment of the present application. If the terminal carrier carried by the motor reciprocating control scheme generating method of the embodiment of the present application has a display screen, then the first warning message can be prompted through the display screen.
[0069] In some preferred embodiments, the range parameter also includes a lower limit of the uniform speed duration;
[0070] The steps of adjusting the duration of uniform motion or the reciprocating frequency to generate a new control scheme include:
[0071] S61, adjusting the duration of the uniform motion according to the direction in which the motion stroke exceeds the stroke range;
[0072] S62, determine whether the adjusted uniform motion duration is lower than the lower limit of the uniform motion duration. If so, adjust the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range and return to the uniform motion duration before adjustment, and return to step SA; otherwise, fix the adjusted uniform motion duration and return to step S3.
[0073] Specifically, in this embodiment, the adjustment priority of the uniform motion duration is higher than the reciprocating frequency. This is because the time taken to adjust the uniform motion duration to generate a new control scheme is less than the time taken to adjust the reciprocating frequency to generate a new control scheme. Secondly, changing the reciprocating frequency may still result in improper setting of the reciprocating frequency and exceeding the frequency range, resulting in failure to generate the control scheme.
[0074] More specifically, in step S61, the direction in which the movement stroke exceeds the travel range includes two situations: less than the lower limit of the travel range and greater than the upper limit of the travel range. Adjusting the uniform motion duration to match the two situations is equivalent to changing the acceleration and deceleration duration at the same time, so as to simultaneously change the proportion of the three stages of acceleration rotation, uniform rotation and deceleration rotation in the entire one-way motion duration, thereby changing the movement stroke.
[0075] More specifically, the lower limit of the uniform speed duration represents the minimum duration of the uniform rotation stage required to meet the motor usage scenario, which is used to ensure that the equipment carried by the motor can operate normally. Therefore, step S62 needs to ensure that the adjusted uniform speed motion duration is greater than or equal to the lower limit of the uniform speed duration to ensure that the motor can be used normally. When this condition is not met, step S62 returns the uniform speed motion duration to the uniform speed motion duration before adjustment, and changes the one-way motion duration by adjusting the reciprocating frequency to adjust the motion stroke.
[0076] More specifically, after adjusting the reciprocating frequency, step S62 returns to step SA to determine the frequency range. It should be noted that in an embodiment that does not include step SA, step S62 can directly return to step S2 after adjusting the reciprocating frequency.
[0077] In some other embodiments, step S1 also includes obtaining an identification bit indicating whether the frequency can be modified, and the identification bit is set based on the user; in step S62, before adjusting the reciprocating frequency, it is necessary to first determine whether the identification bit indicates that the reciprocating frequency can be modified. If so, the reciprocating frequency is modified, otherwise a second warning message is generated.
[0078] Specifically, in order to avoid problems such as excessive vibration amplitude, in some application scenarios, the frequency of the motor can only be a fixed reciprocating frequency that cannot be modified. The motor reciprocating control scheme generation method of the embodiment of the present application adds a judgment step of whether the reciprocating frequency can be modified to distinguish the usage scenario requirements of the motor, thereby avoiding the output control scheme being unable to match the application scenario. The terminal carrier carried by the motor reciprocating control scheme generation method of the embodiment of the present application can conveniently change the state of the identification bit to realize the switching of the generation function, so that the motor reciprocating control scheme generation method of the embodiment of the present application has the advantages of convenient operation and wide applicability.
[0079] More specifically, since the above-mentioned identification position determination step is performed after the uniform motion duration is adjusted, it indicates that the second warning information is generated corresponding to the situation where the uniform motion duration and / or uniform speed are improperly set.
[0080] More specifically, the second warning information may be information consistent with the first warning information, or may be more detailed information for prompting that the currently set uniform motion duration and / or uniform speed is improperly set.
[0081] In some preferred embodiments, step S61 includes:
[0082] When the motion stroke is greater than the upper limit of the stroke range, the uniform motion duration is reduced, and then step S62 is executed;
[0083] When the motion stroke is less than the lower limit of the stroke range, the uniform motion duration is increased, and then the process returns to step S3.
[0084] Specifically, reducing the duration of uniform motion is equivalent to increasing the duration of acceleration and deceleration at the same time. This processing method can reduce the motion range corresponding to the newly generated control scheme; increasing the duration of uniform motion is equivalent to reducing the duration of acceleration and deceleration at the same time. This processing method can increase the motion range corresponding to the newly generated control scheme.
[0085] More specifically, in the processing method of increasing the uniform motion duration, step S62 can also be executed, but the increased uniform motion duration must be higher than the lower limit of the uniform duration, and it will also return to step S3. Therefore, in this case, step S62 can be skipped directly and return directly to step S3 to generate a new control scheme.
[0086] More specifically, the process of reducing the uniform motion duration and increasing the uniform motion duration can be to adjust the uniform motion duration based on a fixed value and a percentage, so as to generate a suitable control scheme through several cycles of adjustment, or to determine the adjustment step of the uniform motion duration based on the ratio of the motion stroke to the upper or lower limit of the corresponding exceeded stroke range multiplied by a preset reference duration parameter. The latter can more effectively and quickly obtain a suitable and new control scheme, but it is also more likely that the uniform motion duration will be lower than the lower limit of the uniform duration. It can be selected for use according to usage requirements.
[0087] In some preferred embodiments, the step of adjusting the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range includes:
[0088] When the motion stroke is greater than the upper limit of the stroke range, increase the reciprocating frequency;
[0089] When the movement stroke is less than the lower limit of the stroke range, reduce the reciprocating frequency.
[0090] Specifically, increasing the reciprocating frequency is equivalent to reducing the motion cycle at the same time, that is, reducing the one-way motion duration, which is equivalent to reducing the acceleration and deceleration duration at the same time. This processing method can reduce the motion stroke corresponding to the newly generated control scheme; reducing the reciprocating frequency is equivalent to increasing the motion cycle at the same time, that is, increasing the one-way motion duration, which is equivalent to increasing the acceleration and deceleration duration at the same time. This processing method can increase the motion stroke corresponding to the newly generated control scheme.
[0091] More specifically, the process of reducing the reciprocating frequency and increasing the reciprocating frequency can be to adjust the reciprocating frequency based on a fixed value and a percentage, so as to generate a suitable control scheme through several cycles of adjustment, or to determine the adjustment step of the reciprocating frequency based on the ratio of the motion stroke to the upper or lower limit of the corresponding exceeded stroke range multiplied by a preset reference time parameter. The latter can more effectively and quickly obtain a suitable and new control scheme, but it is also more likely that the reciprocating frequency will exceed the frequency range. It can be selected for use according to usage requirements.
[0092] Second, please refer to Figure 2 Some embodiments of the present application also provide another method for generating a motor reciprocating control scheme, which is applied to the control of a motor with inconsistent forward and reverse motions. The method includes the following steps:
[0093] A1. Obtain input parameters, which include original parameters and range parameters. Original parameters include reciprocating frequency, uniform speed, forward uniform motion duration, and reverse uniform motion duration. Range parameters include total travel range.
[0094] A2. Calculate the one-way motion duration based on the reciprocating frequency;
[0095] A3. Calculate the forward acceleration and deceleration duration based on the forward uniform motion duration and the one-way motion duration, and calculate the reverse acceleration and deceleration duration based on the reverse uniform motion duration and the one-way motion duration;
[0096] A4. Calculate the forward acceleration and deceleration according to the forward acceleration and deceleration time and the uniform speed, and calculate the reverse acceleration and deceleration according to the reverse acceleration and deceleration time and the uniform speed;
[0097] A5. The forward motion stroke is calculated based on the forward uniform motion duration, the forward acceleration and deceleration, and the forward acceleration and deceleration duration; and the reverse motion stroke is calculated based on the reverse uniform motion duration, the reverse acceleration and deceleration, and the reverse acceleration and deceleration duration;
[0098] A6. Determine whether the sum of the forward motion stroke and the reverse motion stroke is within the total stroke range. If so, output a control scheme including the forward uniform motion duration, the reverse uniform motion duration, the forward acceleration and deceleration, the forward acceleration and deceleration duration, the reverse acceleration and deceleration, and the reverse acceleration and deceleration duration. Otherwise, adjust the forward uniform motion duration and the reverse uniform motion duration at the same time or adjust the reciprocating frequency alone to generate a new control scheme.
[0099] Specifically, the motor reciprocating control scheme generation method provided in the second aspect of the present application is mainly used to generate and design the control scheme when the forward and reverse rotation strokes of the motor are inconsistent. Therefore, in this embodiment, the total stroke range is preferably used to constrain the sum of the stroke data of one forward rotation and one reverse rotation.
[0100] More specifically, the inconsistency in the forward and reverse motion of the motor refers to the different requirements for the duration of uniform rotation in the forward rotation and reverse rotation of the motor, that is, different forward uniform motion durations and reverse uniform motion durations are generated, and then forward motion strokes and reverse motion strokes with different values are generated to meet the use requirements of the equipment mounted on the motor.
[0101] More specifically, when the reciprocating frequency and uniform speed are determined, the control scheme generated by the motor reciprocating control scheme generating method of the embodiment of the present application includes a forward control part and a reverse control part. The former corresponds to the forward uniform motion duration, forward acceleration and deceleration, and forward acceleration and deceleration duration; the latter corresponds to the reverse uniform motion duration, reverse acceleration and deceleration, and reverse acceleration and deceleration duration. Its control principle is similar to that of the motor reciprocating control scheme generating method of the embodiment of the present application provided in the first aspect, and will not be repeated here.
[0102] More specifically, in the embodiment of the present application, step A6 verifies the control scheme based on the total stroke range, wherein the total stroke range can be the sum of the absolute values of the forward motion stroke and the reverse motion stroke, or can be the sum of the forward motion stroke expressed as a positive value and the reverse motion stroke expressed as a negative value. The former is suitable for use in situations where the total number of rotations of the motor is controlled, and the latter is suitable for use in situations where the deviation of the forward and reverse rotation times of the motor is controlled, and can be selected according to the application requirements of the equipment equipped with the motor.
[0103] The motor reciprocating control scheme generating method of the embodiment of the present application can automatically generate and adaptively modify the control scheme for the motor with inconsistent forward and reverse strokes based on the reciprocating frequency, uniform speed, forward uniform motion duration, reverse uniform motion duration and total stroke range input by the user, so that the frequency and stroke parameters of the output control scheme meet the user's usage requirements and conform to the operating characteristics of the motor, without the user having to repeatedly debug the settings, effectively reducing the time and manpower costs used for debugging.
[0104] In some preferred embodiments, in step A6, the ratio of the adjustment amplitude of the forward uniform motion duration to the adjustment amplitude of the reverse uniform motion duration is equal to the ratio of the forward motion stroke to the reverse motion stroke.
[0105] Specifically, when the forward and reverse rotation strokes of the motor are inconsistent, there is generally a ratio requirement for the forward rotation times and the reverse rotation times of the motor. Therefore, in step A6, when the total travel range verification fails, in order to ensure that the ratio of the forward rotation times to the reverse rotation times remains unchanged, the processing method for adjusting the uniform motion duration needs to adjust the forward uniform motion duration and the reverse uniform motion duration at the same time, and the adjustment range is determined according to the ratio of the forward motion stroke to the reverse motion stroke.
[0106] In some preferred embodiments, the range parameter further includes a frequency range, and the method further includes a step performed between step A1 and step A2:
[0107] AA. Determine whether the reciprocating frequency is within the frequency range. If yes, execute step A2; otherwise, generate a first warning message.
[0108] In some preferred embodiments, the range parameter also includes a lower limit of the forward uniform speed duration and a lower limit of the reverse uniform speed duration;
[0109] The steps of simultaneously adjusting the duration of the forward uniform motion and the duration of the reverse uniform motion or adjusting the reciprocating frequency alone to generate a new control scheme include:
[0110] A61. Adjust the duration of the forward uniform motion and the duration of the reverse uniform motion simultaneously according to the direction in which the sum of the forward motion stroke and the reverse motion stroke exceeds the total stroke range;
[0111] A62. Determine whether the forward motion stroke is lower than the lower limit of the forward uniform speed duration and / or whether the reverse motion stroke is lower than the lower limit of the reverse uniform speed duration. If so, adjust the reciprocating frequency according to the direction in which the sum of the forward motion stroke and the reverse motion stroke exceeds the total stroke range and return to the forward uniform speed duration and the reverse uniform speed duration before adjustment. Otherwise, fix the adjusted forward uniform speed duration and the reverse uniform speed duration and return to step A3.
[0112] In some other embodiments, step A1 also includes obtaining an identification bit indicating whether the frequency can be modified, and the identification bit is set based on the user; in step A62, before adjusting the reciprocating frequency, it is necessary to first determine whether the identification bit indicates that the reciprocating frequency can be modified. If so, the reciprocating frequency is modified, otherwise a second warning message is generated.
[0113] In some preferred embodiments, step A61 includes:
[0114] When the sum of the forward motion stroke and the reverse motion stroke is greater than the upper limit of the total stroke range, the forward uniform motion duration and the reverse uniform motion duration are reduced at the same time, and then step A62 is executed;
[0115] When the sum of the forward motion stroke and the reverse motion stroke is less than the lower limit of the total stroke range, the forward uniform motion duration and the reverse uniform motion duration are increased, and then the process returns to step A3.
[0116] In some preferred embodiments, the step of adjusting the reciprocating frequency according to the direction in which the sum of the forward motion stroke and the reverse motion stroke exceeds the total stroke range comprises:
[0117] When the sum of the forward motion stroke and the reverse motion stroke is greater than the upper limit of the total stroke range, increase the reciprocating frequency;
[0118] When the sum of the forward movement stroke and the reverse movement stroke is less than the lower limit of the total stroke range, reduce the reciprocating frequency.
[0119] In some preferred embodiments, the range parameter also includes a lower limit of the acceleration and deceleration time;
[0120] The method further comprises the step of performing between steps A3 and A4:
[0121] AB. Determine whether the forward acceleration / deceleration duration and / or the reverse acceleration / deceleration duration is greater than the lower limit of the acceleration / deceleration duration. If so, execute step A4; otherwise, adjust the corresponding forward uniform motion duration and / or reverse uniform motion duration to obtain the corresponding, new forward acceleration / deceleration duration and / or reverse acceleration / deceleration duration.
[0122] Specifically, in order to avoid the problem that the motor cannot complete acceleration and deceleration within the effective time, the range parameter is also set with a lower limit of the acceleration and deceleration time to perform numerical verification of the forward acceleration and deceleration time and the reverse acceleration and deceleration time in the control scheme. If the verification fails, the forward acceleration and deceleration time and the reverse acceleration and deceleration time are adjusted by adjusting the forward uniform motion time and / or the reverse uniform motion time.
[0123] More specifically, in order to ensure that the ratio of the number of forward rotations to the number of reverse rotations remains unchanged, this step preferably adjusts the duration of the forward uniform motion and the duration of the reverse uniform motion at the same time, and the magnitude of the adjustment can be determined based on the proportional relationship between the duration of the forward uniform motion and the duration of the reverse uniform motion before the adjustment multiplied by the adjustment base.
[0124] Third, please refer to Figure 3 Some embodiments of the present application also provide a structural diagram of an electronic device. The present application provides an electronic device, including: a processor 301 and a memory 302. The processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not marked). The memory 302 stores computer-readable instructions executable by the processor 301. When the electronic device is running, the processor 301 executes the computer-readable instructions to execute the method in any optional implementation of the above embodiments.
[0125] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method in any optional implementation of the above embodiment is executed. The computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk.
[0126] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0127] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0128] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0129] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0130] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various modifications and variations. Any adjustments, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for generating a motor reciprocating control scheme, applied in motor control, characterized in that: The method comprises the following steps: S1. Obtain input parameters, wherein the input parameters include original parameters and range parameters. The original parameters include reciprocating frequency, uniform speed, and uniform motion duration. The range parameters include travel range and frequency range. SA, determining whether the reciprocating frequency is within the frequency range, if yes, executing step S2, otherwise generating a first warning message; S2. Calculate and obtain the one-way motion duration according to the reciprocating frequency; S3, calculating the acceleration and deceleration duration according to the uniform motion duration and the one-way motion duration; S4, calculating and obtaining the acceleration and deceleration speed according to the acceleration and deceleration duration and the uniform speed; S5, calculating and obtaining the motion stroke according to the uniform motion duration, the acceleration / deceleration speed and the acceleration / deceleration duration; S6, determining whether the motion stroke is within the stroke range, if yes, outputting a control scheme including the uniform motion duration, the acceleration / deceleration speed and the acceleration / deceleration duration, otherwise adjusting the uniform motion duration or the reciprocating frequency to generate a new control scheme; The range parameters also include a lower limit of the uniform speed duration; The step of adjusting the uniform motion duration or the reciprocating frequency to generate a new control scheme includes: S61, adjusting the duration of the uniform motion according to the direction in which the motion stroke exceeds the stroke range; S62, determine whether the adjusted uniform motion duration is lower than the uniform motion duration lower limit, if so, adjust the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range and return to the uniform motion duration before adjustment, return to step SA, otherwise fix the adjusted uniform motion duration and return to step S3.
2. The method for generating a motor reciprocating control scheme according to claim 1, characterized in that: Step S61 includes: When the movement stroke is greater than the upper limit of the stroke range, reducing the uniform motion duration, and then executing step S62; When the movement stroke is less than the lower limit of the stroke range, the uniform motion duration is increased, and then the process returns to step S3.
3. The method for generating a motor reciprocating control scheme according to claim 1, characterized in that: The step of adjusting the reciprocating frequency according to the direction in which the motion stroke exceeds the stroke range comprises: When the movement stroke is greater than the upper limit of the stroke range, increasing the reciprocating frequency; When the movement stroke is smaller than the lower limit of the stroke range, the reciprocating frequency is reduced.
4. A method for generating a motor reciprocating control scheme, applied to the control of a motor with inconsistent forward and reverse motions, characterized in that: The method comprises the following steps: A1. Obtain input parameters, which include original parameters and range parameters. The original parameters include reciprocating frequency, uniform speed, forward uniform motion duration, and reverse uniform motion duration. The range parameters include the total travel range. A2. Calculate and obtain the one-way motion duration according to the reciprocating frequency; A3, calculating the forward acceleration and deceleration duration according to the forward uniform motion duration and the one-way motion duration, and calculating the reverse acceleration and deceleration duration according to the reverse uniform motion duration and the one-way motion duration; A4. Calculate the forward acceleration and deceleration according to the forward acceleration and deceleration duration and the uniform speed, and calculate the reverse acceleration and deceleration according to the reverse acceleration and deceleration duration and the uniform speed; A5. Calculate the forward motion stroke according to the forward uniform motion duration, the forward acceleration / deceleration, and the forward acceleration / deceleration duration, and calculate the reverse motion stroke according to the reverse uniform motion duration, the reverse acceleration / deceleration, and the reverse acceleration / deceleration duration; A6. Determine whether the sum of the forward motion stroke and the reverse motion stroke is within the total stroke range. If so, output a control scheme including the forward uniform motion duration, the reverse uniform motion duration, the forward acceleration / deceleration, the forward acceleration / deceleration duration, the reverse acceleration / deceleration, and the reverse acceleration / deceleration duration. Otherwise, adjust the forward uniform motion duration and the reverse uniform motion duration at the same time or adjust the reciprocating frequency alone to generate a new control scheme.
5. The method for generating a motor reciprocating control scheme according to claim 4, characterized in that: In step A6, the ratio of the adjustment amplitude of the forward uniform motion duration to the adjustment amplitude of the reverse uniform motion duration is equal to the ratio of the forward motion stroke to the reverse motion stroke.
6. The method for generating a motor reciprocating control scheme according to claim 4, characterized in that: The range parameters also include a lower limit of acceleration and deceleration time; The method further comprises the step of performing between steps A3 and A4: Determine whether the forward acceleration / deceleration duration and / or the reverse acceleration / deceleration duration is greater than the lower limit of the acceleration / deceleration duration. If so, execute step A4; otherwise, adjust the corresponding forward uniform motion duration and / or the reverse uniform motion duration to obtain the corresponding, new forward acceleration / deceleration duration and / or reverse acceleration / deceleration duration.
7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the steps in the method according to any one of claims 1 to 6 are executed.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Acceleration and deceleration motion control method and device, equipment and medium
CN112532146A