Motor speed change control method and device, computer equipment and storage medium

文档序号:786437 发布日期:2021-04-09 浏览:16次 中文

阅读说明:本技术 电机变速控制方法、装置、计算机设备和存储介质 (Motor speed change control method and device, computer equipment and storage medium ) 是由 张贻众 屈孟 于 2020-12-11 设计创作,主要内容包括:本申请涉及一种电机变速控制方法、装置、计算机设备和存储介质。所述方法包括:获取单轴电机的运行总路程、加速时长、开始周期、目标周期以及开始周期和目标周期的固定比值;通过对固定比值、开始周期和加速时长进行计算,确定单轴电机的变速阶段的脉冲总数;获取单轴电机的脉冲积累时长;根据脉冲积累时长和加速时长确定单轴电机的固定周期步长;基于单轴电机的目标运动方式,控制单轴电机以固定周期步长进行变速。采用本方法能够减少单片机的计算量,提高单片机的处理性能。(The application relates to a motor speed change control method, a motor speed change control device, computer equipment and a storage medium. The method comprises the following steps: acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor; determining the total number of pulses of the single-shaft motor in the speed change stage by calculating a fixed ratio, a starting period and an acceleration duration; acquiring pulse accumulation duration of the single-shaft motor; determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration; and controlling the single-shaft motor to change the speed at a fixed periodic step length based on the target motion mode of the single-shaft motor. By adopting the method, the calculated amount of the singlechip can be reduced, and the processing performance of the singlechip is improved.)

1. A method of variable speed control of an electric motor, the method comprising:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining a fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

and controlling the single-shaft motor to change the speed by the fixed period step length based on the target motion mode of the single-shaft motor, wherein the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

2. The method of claim 1, wherein said controlling the single-shaft motor to shift at the fixed cycle step based on the target motion profile of the single-shaft motor comprises:

determining a target motion mode of the single-shaft motor according to the total number of pulses and the total running distance;

and controlling the single-shaft motor to change the speed by the fixed period step length based on the target motion mode of the single-shaft motor.

3. The method of claim 2, wherein determining the target motion profile for the single-shaft motor based on the total number of pulses and the total travel comprises:

and when the total running distance is larger than a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is acceleration firstly, then deceleration at a constant speed.

4. The method of claim 2, wherein determining the target motion profile for the single-shaft motor based on the total number of pulses and the total travel comprises:

and when the total running distance is less than or equal to a preset times value of the total number of pulses, determining that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate.

5. The method according to any one of claims 1 or 2, wherein controlling the single-shaft motor to shift at the fixed cycle step based on the target motion profile of the single-shaft motor comprises:

based on the target motion mode of the single-shaft motor, timing a timer through the fixed period step length, and sending a pulse signal to the single-shaft motor;

and controlling the single-shaft motor to change speed through the pulse signal.

6. The method of claim 1, wherein determining the fixed cycle step size for the single-shaft motor based on the pulse accumulation duration and the acceleration duration comprises:

and when the pulse accumulation duration is less than or equal to the acceleration duration, determining the fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration.

7. The method of claim 1, wherein determining the fixed cycle step size for the single-shaft motor based on the pulse accumulation duration and the acceleration duration comprises:

and when the pulse accumulation duration is longer than the acceleration duration, determining the target period as the fixed period step length of the single-shaft motor.

8. A motor speed change control device, characterized in that the device comprises:

the first acquisition module is used for acquiring the running total distance, the acceleration duration, the starting period, the target period of the single-shaft motor and the fixed ratio of the starting period to the target period;

the calculation module is used for determining the total number of pulses in the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

the second acquisition module is used for acquiring the pulse accumulation duration of the single-shaft motor;

the determining module is used for determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

the control module is used for controlling the single-shaft motor to change the speed at the fixed period step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.

Technical Field

The present application relates to the field of automation equipment technologies, and in particular, to a motor speed change control method and apparatus, a computer device, and a storage medium.

Background

At present, in the field of automation equipment control, motors are indispensable electrical elements in motion control, and the requirements on rapidity, continuity and reliability of motor rotation speed acquisition in various fields are higher and higher. The improper control method of the motor speed easily causes the problems of impact, step loss, oscillation or overtravel.

At present, most algorithms adopted by the acceleration and deceleration control of the motor need to consume large computing resources or the acceleration and deceleration are too simple. For example, T-type acceleration and deceleration is simple in calculation, but large fluctuation occurs when starting and stopping, and an S-shaped curve, a polynomial curve and a spline curve are relatively complex to realize on a single chip microcomputer, and the real-time performance is not high.

Disclosure of Invention

In view of the above, it is necessary to provide a motor speed change control method, a motor speed change control apparatus, a computer device, and a storage medium, which can reduce the amount of calculation of a single chip microcomputer and improve the processing performance of the single chip microcomputer.

A method of variable speed control of an electric motor, the method comprising:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining a fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

controlling the single-shaft motor to change the speed at the fixed periodic step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

In one embodiment, the controlling the single-shaft motor to shift at the fixed cycle step based on the target motion mode of the single-shaft motor includes:

determining a target motion mode of the single-shaft motor according to the total number of pulses and the total running distance;

and controlling the single-shaft motor to change the speed by the fixed period step length based on the target motion mode of the single-shaft motor.

In one embodiment, the determining the target movement mode of the single-shaft motor according to the total number of pulses and the total running distance includes:

and when the total running distance is larger than a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is acceleration firstly, then deceleration at a constant speed.

In one embodiment, the determining the target movement mode of the single-shaft motor according to the total number of pulses and the total running distance includes:

and when the total running distance is less than or equal to a preset times value of the total number of pulses, determining that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate.

In one embodiment, the controlling the single-shaft motor to shift at the fixed cycle step based on the target motion mode of the single-shaft motor includes:

based on the target motion mode of the single-shaft motor, timing a timer through the fixed period step length, and sending a pulse signal to the single-shaft motor;

and controlling the single-shaft motor to change speed through the pulse signal.

In one embodiment, the determining the fixed cycle step size of the single-shaft motor according to the pulse accumulation duration and the acceleration duration includes:

and when the pulse accumulation duration is less than or equal to the acceleration duration, determining the fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration.

In one embodiment, the determining the fixed cycle step size of the single-shaft motor according to the pulse accumulation duration and the acceleration duration includes:

and when the pulse accumulation duration is longer than the acceleration duration, determining the target period as the fixed period step length of the single-shaft motor.

A motor variable speed control device, the device comprising:

the first acquisition module is used for acquiring the running total distance, the acceleration duration, the starting period, the target period of the single-shaft motor and the fixed ratio of the starting period to the target period;

the calculation module is used for determining the total number of pulses in the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

the second acquisition module is used for acquiring the pulse accumulation duration of the single-shaft motor;

the determining module is used for determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

the control module is used for controlling the single-shaft motor to change the speed at the fixed period step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining a fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

controlling the single-shaft motor to change the speed at the fixed periodic step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining a fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

controlling the single-shaft motor to change the speed at the fixed periodic step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

According to the motor speed change control method, the motor speed change control device, the computer equipment and the storage medium, the total number of pulses in the speed change stage of the single-shaft motor is determined by acquiring the running total distance, the acceleration duration, the starting period, the target period of the single-shaft motor and the fixed ratio of the starting period to the target period, and the pulse accumulation duration of the single-shaft motor is acquired; determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration; based on the target motion mode of the single-shaft motor, the single-shaft motor is controlled to change speed in a fixed period step length mode, namely the total number of pulses is determined by reducing the data calculation amount of the single chip microcomputer, and the processing performance of the single chip microcomputer is improved.

Drawings

FIG. 1 is a schematic flow chart of a motor speed change control method according to one embodiment;

FIG. 2 is a schematic flow chart of a motor shift control method in another embodiment;

FIG. 3 is a diagram of a pulse acceleration model of a single-shaft motor with a fixed period according to one embodiment;

FIG. 4 is a block diagram showing the construction of a motor shift control device according to an embodiment;

FIG. 5 is a block diagram showing the construction of a motor shift control device in another embodiment;

FIG. 6 is a diagram illustrating an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

In one embodiment, as shown in fig. 1, a motor speed change control method is provided, and this embodiment is illustrated by applying the method to a terminal, and it is understood that the method may also be applied to a server, and may also be applied to a system including a terminal and a server, and is implemented by interaction between the terminal and the server. In this embodiment, the method includes the steps of:

step 102, acquiring the running total distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor.

The acceleration duration refers to the total duration of the single-shaft motor in the acceleration process, the unit of the acceleration duration can be but is not limited to millisecond, and the acceleration duration is preset; the fixed ratio is the ratio of the starting period to the target period, and is preset; the fixed ratio may be an empirical value derived from the actual conditions of the single-shaft motor application. Fixed ratio r and start period TstartAnd a target period TendThe relationship between can be represented as Tstart=r*Tend(ii) a The total running distance and the starting period of the single-shaft motor are preset, and the unit of the starting period and the target period can be, but is not limited to, seconds.

And step 104, determining the total number of pulses in the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration.

Wherein the speed change phase comprises an acceleration phase and/or a deceleration phase; by the pair of acceleration periods tshiftDividing according to a preset time interval to obtain the accelerated subdivision times dsub

In particular, according to a fixed ratior and the acceleration subdivision times and the starting period determine the period variation of each speed change of the single-shaft motor in the speed change process, and the period variation b can be expressed asAccording to acceleration duration tshiftAnd the acceleration subdivision times determine the time interval c of speed switching of the single-shaft motor in the process of speed change, and the time interval c of speed switching can be expressed asCalculating by macro-definition of time interval of speed switching and period of speed change of the single-shaft motor to obtain total number S of pulses of the single-shaft motor in the speed change stageacceAnd determining the total number of pulses of the speed change stage of the single-shaft motor according to the fixed ratio, the starting period and the acceleration duration through calculation.

Wherein, S is obtained by newly adding a fixed ratio racceThe calculation expression of (a) is as follows:

according to the amount of cycle variationTime interval of speed switchingRelation T satisfied by fixed ratio rstart=r*TendFurther determining S of the total number of pulses of the speed change phase of the single-shaft motoracceThe calculation expression is as follows:

where i represents the acceleration sequence in the acceleration subdivision: value range of 0 to dsubDetermining the total number of pulses SacceIs expressed as:

according to the macro definition of the single-shaft motor and the determined fixed ratio r, the total number of pulses and the target period of the single-shaft motor are determined by reducing the data calculation amount of the single-chip microcomputer, and the processing performance of the single-chip microcomputer is improved.

And 106, acquiring the pulse accumulation duration of the single-shaft motor.

Wherein the pulse accumulation duration is the operation duration of the single-shaft motor.

And step 108, determining the fixed period step length of the single-shaft motor according to the pulse accumulation time length and the acceleration time length.

The fixed period step length refers to that the starting period is accelerated to the target period by the fixed step length, and the total running distance of the motor is mapped to the pulse, namely the total number of the sent pulses.

Specifically, when the pulse accumulation duration is less than or equal to the acceleration duration, a fixed period step length of the single-shaft motor is determined by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration, and when the pulse accumulation duration is greater than the acceleration duration, the target period is determined to be the fixed period step length of the single-shaft motor. Determining the fixed cycle step size of the single-shaft motor from the pulse accumulation period and the acceleration period can be expressed by the following expression:

wherein T (T) is a fixed period step length, T is a pulse accumulation duration, TstartTo start the cycle, TendIs a target period, dsubTo accelerate subdivisionNumber of times, tshiftIs the acceleration period.

And step 110, controlling the single-shaft motor to change the speed at a fixed period step length based on the target motion mode of the single-shaft motor.

The target motion mode comprises a motion mode of first accelerating, then uniformly decelerating and then decelerating, a motion mode of first accelerating and then decelerating and the like. The target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

Specifically, based on the target motion mode of the single-shaft motor, the single-shaft motor is controlled to accelerate first and then decelerate at a constant speed or accelerate first and then decelerate at a fixed period step length.

In the motor speed change control method, the total number of pulses in the speed change stage of the single-shaft motor is determined by acquiring the total running distance, the acceleration duration, the starting period, the target period of the single-shaft motor and the fixed ratio of the starting period to the target period, and the pulse accumulation duration of the single-shaft motor is acquired; determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration; based on the target motion mode of the single-shaft motor, the single-shaft motor is controlled to change speed in a fixed period step length mode, namely the total number of pulses is determined by reducing the data calculation amount of the single chip microcomputer, and the processing performance of the single chip microcomputer is improved.

In another embodiment, as shown in fig. 2, a method for controlling the speed change of a motor is provided, and this embodiment is exemplified by applying the method to a terminal. In this embodiment, the method includes the steps of:

step 202, acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor.

And step 204, determining the total number of pulses in the speed change stage of the single-shaft motor by calculating the fixed ratio, the starting period and the acceleration duration.

Specifically, the period variation of each speed change of the single-shaft motor in the speed change process is determined according to the fixed ratio r, the acceleration subdivision times and the starting period; and according to the acceleration duration tshiftAnd accelerating subdivision times to determine speed switching of single-shaft motor in speed change processThe time interval c of the speed switching and the period quantity of the speed change of the single-shaft motor are calculated by macro definition, and the total number S of pulses of the single-shaft motor in the speed change stage is obtainedacce

And step 206, acquiring the pulse accumulation duration of the single-shaft motor.

Wherein the pulse accumulation duration is determined based on the total number of pulses.

And step 208, determining the fixed period step length of the single-shaft motor according to the pulse accumulation time length and the acceleration time length.

Specifically, when the pulse accumulation duration is less than or equal to the acceleration duration, determining the fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration; and when the pulse accumulation duration is longer than the acceleration duration, determining the target period as the fixed period step length of the single-shaft motor.

And step 210, determining a target motion mode of the single-shaft motor according to the total number of pulses and the total running distance.

Specifically, when the total running distance is larger than a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is firstly accelerated, then decelerated at a constant speed; when the total running distance is less than or equal to a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate, wherein the preset multiple can be but is not limited to 2; that is, when the total running distance is equal to 2 times of the total number of pulses, the control unit controls the movement mode of the single-shaft motor to be accelerated to the maximum speed VmaxThen, immediately carrying out deceleration movement, and determining the maximum speed target period; when the total running distance is less than 2 times of the total number of pulses, the single-shaft motor is accelerated to an intermediate speed VmiddleThe deceleration movement is immediately carried out.

And 212, timing a timer through fixed period step length based on the target motion mode of the single-shaft motor, and sending a pulse signal to the single-shaft motor.

And step 214, controlling the single-shaft motor to change the speed through the pulse signal.

Specifically, the determined fixed period step length is assigned to a register address of a timer, a pulse signal is triggered at fixed time, and the single-shaft motor is controlled by the pulse signal to move in a variable speed mode according to a target movement mode. Fig. 3 is a diagram of a model of an embodiment of a single-shaft motor accelerating with fixed cycle step size pulses controlled single-shaft motor acceleration, wherein the abscissa represents time in milliseconds, the ordinate represents frequency in hertz, and the ordinate represents frequency.

In the motor speed change control method, the total number of pulses in the speed change stage of the single-shaft motor is determined by calculating a fixed ratio, a starting period and an acceleration duration, and the pulse accumulation duration of the single-shaft motor is determined according to the total number of the pulses; determining the fixed period step length of the single-shaft motor according to the size relation between the pulse accumulation duration and the acceleration duration; the fixed cycle step length of the single-shaft motor is determined through simple calculation, the complexity of calculation of the single-shaft motor is reduced, the single-shaft motor is controlled to change speed with the fixed cycle step length based on the target movement mode of the single-shaft motor, the total number of pulses is determined by reducing the data calculation amount of the single-shaft motor, and the processing performance of the single-shaft motor and the stability of the single-shaft motor are improved.

It should be understood that although the various steps in the flow charts of fig. 1-2 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-2 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.

In one embodiment, as shown in fig. 4, there is provided a motor shift control device including: a first obtaining module 402, a calculating module 404, a second obtaining module 406, a determining module 408, and a control module 410, wherein:

a first obtaining module 402, configured to obtain a total running distance, an acceleration duration, a starting period, a target period, and a fixed ratio of the starting period to the target period of the single-shaft motor.

A calculation module 404 for determining the total number of pulses in the speed change phase of the single-shaft motor by calculating the fixed ratio, the start period and the acceleration duration.

And a second obtaining module 406, configured to obtain a pulse accumulation duration of the single-shaft motor.

A determining module 408 for determining a fixed cycle step size of the single-shaft motor based on the pulse accumulation duration and the acceleration duration.

And the control module 410 is used for controlling the single-shaft motor to change the speed in a fixed period step length based on the target motion mode of the single-shaft motor.

In the motor speed change control device, the total number of pulses in the speed change stage of the single-shaft motor is determined by acquiring the total running distance, the acceleration duration, the starting period, the target period of the single-shaft motor and the fixed ratio of the starting period to the target period, and the pulse accumulation duration of the single-shaft motor is acquired; determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration; based on the target motion mode of the single-shaft motor, the single-shaft motor is controlled to change speed in a fixed period step length mode, namely the total number of pulses is determined by reducing the data calculation amount of the single chip microcomputer, and the processing performance of the single chip microcomputer is improved.

In another embodiment, as shown in fig. 5, there is provided a motor speed change control device, which comprises, in addition to a first obtaining module 402, a calculating module 404, a second obtaining module 406, a determining module 408 and a control module 410: a determining module 412 and a pulse transmitting module 414, wherein:

the determination module 408 is further configured to determine a target motion pattern of the single-shaft motor according to the total number of pulses and the total running distance.

The control module 410 is further configured to control the single-shaft motor to change speed at a fixed cycle step size based on a target motion profile of the single-shaft motor.

And the judging module 412 is configured to determine that the target motion mode of the single-shaft motor is acceleration first, then uniform speed and then deceleration when the total operation route is greater than a preset multiple value of the total number of pulses.

The determining module 412 is further configured to determine that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate when the total running distance is smaller than or equal to a preset multiple value of the total number of pulses.

And the pulse sending module 414 is configured to time the timer by a fixed period step length based on the target motion mode of the single-axis motor, and send a pulse signal to the single-axis motor.

The control module 410 is also used for controlling the single-shaft motor to change speed through pulse signals.

The calculation module 404 is further configured to determine a fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the start period, the acceleration duration, and the acceleration subdivision number obtained by dividing the acceleration duration when the pulse accumulation duration is less than or equal to the acceleration duration.

The determining module 412 is further configured to determine the target period as a fixed period step of the single-shaft motor when the pulse accumulation duration is greater than the acceleration duration.

In one embodiment, the total number of pulses in the speed change stage of the single-shaft motor is determined by calculating a fixed ratio, a starting period and an acceleration time length, and the pulse accumulation time length of the single-shaft motor is determined according to the total number of pulses; determining the fixed period step length of the single-shaft motor according to the size relation between the pulse accumulation duration and the acceleration duration; the fixed cycle step length of the single-shaft motor is determined through simple calculation, the complexity of calculation of the single-shaft motor is reduced, the single-shaft motor is controlled to change speed with the fixed cycle step length based on the target movement mode of the single-shaft motor, the total number of pulses is determined by reducing the data calculation amount of the single-shaft motor, and the processing performance of the single-shaft motor and the stability of the single-shaft motor are improved.

For specific limitations of the motor speed change control device, reference may be made to the above limitations of the motor speed change control method, which are not described herein again. The various modules in the above-described motor shift control device may be implemented in whole or in part by software, hardware, and combinations thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 6. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to implement a motor speed change control method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.

Those skilled in the art will appreciate that the architecture shown in fig. 6 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the single-shaft motor in the speed change stage by calculating a fixed ratio, a starting period and an acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

controlling the single-shaft motor to change speed in fixed periodic step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

determining a target motion mode of the single-shaft motor according to the total number of pulses and the total running distance;

and controlling the single-shaft motor to change the speed at a fixed periodic step length based on the target motion mode of the single-shaft motor.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

when the total running distance is larger than a preset multiple value of the total number of pulses, the target motion mode of the single-shaft motor is determined to be that the motor is accelerated first and then decelerated at a constant speed.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and when the total running distance is less than or equal to a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

based on the target motion mode of the single-shaft motor, timing the timer through a fixed period step length, and sending a pulse signal to the single-shaft motor;

the single-shaft motor is controlled to change speed through pulse signals.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and when the pulse accumulation duration is less than or equal to the acceleration duration, determining the fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and when the pulse accumulation duration is longer than the acceleration duration, determining the target period as the fixed period step length of the single-shaft motor.

In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:

acquiring the total running distance, the acceleration duration, the starting period, the target period and the fixed ratio of the starting period to the target period of the single-shaft motor;

determining the total number of pulses of the single-shaft motor in the speed change stage by calculating a fixed ratio, a starting period and an acceleration duration;

acquiring pulse accumulation duration of the single-shaft motor;

determining the fixed period step length of the single-shaft motor according to the pulse accumulation duration and the acceleration duration;

controlling the single-shaft motor to change speed in fixed periodic step length based on the target motion mode of the single-shaft motor; and the target motion mode of the single-shaft motor is determined according to the total number of pulses and the total running distance.

In one embodiment, the computer program when executed by the processor further performs the steps of:

determining a target motion mode of the single-shaft motor according to the total number of pulses and the total running distance;

and controlling the single-shaft motor to change the speed at a fixed periodic step length based on the target motion mode of the single-shaft motor.

In one embodiment, the computer program when executed by the processor further performs the steps of:

when the total running distance is larger than a preset multiple value of the total number of pulses, the target motion mode of the single-shaft motor is determined to be that the motor is accelerated first and then decelerated at a constant speed.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and when the total running distance is less than or equal to a preset multiple value of the total number of pulses, determining that the target motion mode of the single-shaft motor is to accelerate to a set speed and then decelerate.

In one embodiment, the computer program when executed by the processor further performs the steps of:

based on the target motion mode of the single-shaft motor, timing the timer through a fixed period step length, and sending a pulse signal to the single-shaft motor;

the single-shaft motor is controlled to change speed through pulse signals.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and when the pulse accumulation duration is less than or equal to the acceleration duration, determining the fixed period step length of the single-shaft motor by performing weighted calculation on the pulse accumulation duration, the starting period, the acceleration duration and the acceleration subdivision times obtained by dividing the acceleration duration.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and when the pulse accumulation duration is longer than the acceleration duration, determining the target period as the fixed period step length of the single-shaft motor.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于电机控制指令曲线的电机控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!