Stepping motor control method, intelligent sound box, storage medium and program product

By dividing and controlling the acceleration, uniform speed and deceleration sub-period of stepper motors in intelligent audio, the problems of noise and idleness during operation of stepper motors are solved, and the user experience is improved.

CN119154727APending Publication Date: 2024-12-17GOLDANA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411352947.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

The stepper motors of existing smart audio have abnormal noise problems such as noise and idleness during operation, which affects the user's hearing experience.

Method used

By obtaining the running angle, running time and speed parameters of the stepper motor, the duration is divided into acceleration, uniform speed and deceleration periods, and these periods are divided into multiple sub-period periods, and the step information and timer count of each sub-period period are calculated. Value information, according to these information, the operation of the stepper motor is controlled to achieve step-type acceleration and step-type deceleration.

Benefits of technology

It effectively avoids the noise and idle problems caused by the large leap in the running speed of stepper motors, and improves the user's auditory experience when using smart speakers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119154727A_ABST
    Figure CN119154727A_ABST
Patent Text Reader

Abstract

The invention discloses a stepping motor control method, intelligent sound equipment, a storage medium and a program product, and relates to the technical field of intelligent sound equipment, and the method comprises the steps: obtaining the operation angle, operation duration and operation speed parameters of a stepping motor; dividing the running time length into an acceleration time period, a constant speed time period and a deceleration time period, equally dividing the acceleration time period into a plurality of acceleration sub-time periods, and equally dividing the deceleration time period into a plurality of deceleration sub-time periods; according to the operation angle and the operation speed parameter, time period step number information and timer count value information corresponding to each acceleration sub-time period, the constant speed time period and each deceleration sub-time period are calculated; and controlling the stepping motor to operate according to the time period step number information and the timer count value information. The technical problem that abnormal sound exists in the operation process of a stepping motor of an existing intelligent sound box is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent audio technology, and in particular to a stepper motor control method, an intelligent audio system, a storage medium and a program product. Background Art

[0002] As cars continue to develop towards intelligence, the smart cockpit is the direct carrier connecting users and cars, among which smart speakers are a key component of the smart cockpit.

[0003] In order to provide users with a better auditory experience, the smart speaker allows users to select the appropriate sound field in the central control interface or mobile phone application, such as the center sound field, the main driver sound field, the co-driver sound field, etc., so that the smart speaker can turn to the corresponding position according to the user's sound field selection. However, if the stepper motor of the smart speaker is directly started and stopped at the preset speed, it usually causes abnormal noise, idling and other abnormal sound problems, which seriously affects the user's auditory experience. That is, the stepper motor of the existing smart speaker has abnormal noise during operation.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a stepper motor control method, smart speaker, storage medium and program product, aiming to solve the technical problem of abnormal noise in the operation of the stepper motor of the existing smart speaker.

[0006] To achieve the above object, the present application proposes a stepper motor control method, the stepper motor control method comprising:

[0007] Get the running angle, running time and running speed parameters of the stepper motor;

[0008] Dividing the running time into an acceleration period, a constant speed period and a deceleration period, and equally dividing the acceleration period into a plurality of acceleration sub-periods, and equally dividing the deceleration period into a plurality of deceleration sub-periods;

[0009] According to the running angle and the running speed parameter, the time period step number information and the timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods are calculated;

[0010] According to the time period step number information and the timer count value information, the stepping motor is controlled to run.

[0011] In one embodiment, the step of equally dividing the acceleration period into a plurality of acceleration sub-periods and equally dividing the deceleration period into a plurality of deceleration sub-periods comprises:

[0012] Obtaining the initial running speed, final running speed, running acceleration and running deceleration from the running speed parameters;

[0013] Calculating a calibrated speed according to the running angle and the running time;

[0014] Calculating a first division order according to the difference between the calibrated speed and the initial running speed, and the running acceleration;

[0015] Divide the acceleration period equally according to the first division order to obtain acceleration sub-periods;

[0016] The second division order is calculated according to the difference between the calibrated speed and the final running speed, and the running deceleration;

[0017] The deceleration period is equally divided according to the second division order to obtain deceleration sub-periods.

[0018] In one embodiment, the step of calculating the time period step number information and the timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period, and each of the deceleration sub-periods according to the running angle and the running speed parameter comprises:

[0019] According to the running speed parameter, the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods is calculated;

[0020] According to the speed information of the speed change period, as well as the basic counting frequency and step angle of the stepping motor, the speed change period step number information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods are calculated;

[0021] The number of steps in the uniform speed period is calculated according to the running angle and the number of steps in the speed change period, and the count value of the uniform speed period is calculated according to the number of steps in the uniform speed period;

[0022] The speed change period step number information and the uniform speed period step number information are used as period step number information, and the speed change period count value information and the uniform speed period count value are used as timer count value information.

[0023] In one embodiment, the step of calculating the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the running speed parameter comprises:

[0024] The first sub-period speed of each acceleration sub-period is calculated according to the initial running speed, the running acceleration and the accumulated duration corresponding to each acceleration sub-period in the running speed parameter;

[0025] The second sub-period speed of each deceleration sub-period is calculated according to the running final speed, the running deceleration, and the accumulated duration corresponding to each deceleration sub-period in the running speed parameter;

[0026] The first sub-period speed of each of the acceleration sub-periods and the second sub-period speed of each of the deceleration sub-periods are used as the speed change period speed information.

[0027] In one embodiment, the step of calculating the speed change period step number information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the speed change period speed information, and the basic counting frequency and step angle of the stepping motor comprises:

[0028] The number of steps in the first sub-period of each acceleration sub-period is calculated according to the first sub-period duration of each acceleration sub-period, the step angle, and the first sub-period speed of each acceleration sub-period in the speed information of the speed change period;

[0029] Calculate the first sub-period count value of each acceleration sub-period according to the basic counting frequency, the step angle, and the first sub-period speed of each acceleration sub-period;

[0030] The number of steps in the second sub-period of each deceleration sub-period is calculated according to the second sub-period duration of each deceleration sub-period, the step angle, and the second sub-period speed of each deceleration sub-period in the speed information of the speed change period;

[0031] Calculate the second sub-period count value of each deceleration sub-period according to the basic counting frequency, the step angle and the second sub-period speed of each deceleration sub-period;

[0032] The first sub-period step count of each acceleration sub-period and the second sub-period step count of each deceleration sub-period are used as the speed change period step count information, and the first sub-period count value of each acceleration sub-period and the second sub-period count value of each deceleration sub-period are used as the speed change period count value information.

[0033] In one embodiment, the step of calculating the number of steps in the uniform speed period according to the running angle and the number of steps in the speed change period, and calculating the count value of the uniform speed period according to the number of steps in the uniform speed period includes:

[0034] According to the step number information of the speed change period, the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period are calculated, and the sum of the total number of acceleration steps and the total number of deceleration steps is used as the total number of speed change steps;

[0035] The total number of running steps is calculated according to the running angle and the step angle of the stepping motor, and the difference between the total number of running steps and the total number of speed change steps is used as the number of steps in the uniform speed period;

[0036] The uniform speed period speed of the uniform speed period is calculated according to the number of steps in the uniform speed period, the step angle of the stepping motor and the duration of the uniform speed period;

[0037] The uniform speed period count value is calculated according to the uniform speed period speed of the uniform speed period and the basic counting frequency and step angle of the stepping motor.

[0038] In one embodiment, the step of controlling the operation of the stepper motor according to the time period step number information and the timer count value information includes:

[0039] In each of the acceleration sub-periods, a pulse signal is output to the stepper motor according to the first sub-period count value of each of the acceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the first sub-period count value of each of the acceleration sub-periods until the stepper motor completes the first sub-period steps of each of the acceleration sub-periods in the period step information;

[0040] During the uniform speed period, a pulse signal is output to the stepper motor according to the uniform speed period count value of the uniform speed period in the period step number information, so that the stepper motor runs at a speed corresponding to the uniform speed period count value until the stepper motor completes the uniform speed period steps of the uniform speed period in the period step number information;

[0041] In each of the deceleration sub-periods, a pulse signal is output to the stepper motor according to the second sub-period count value of each of the deceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the second sub-period count value of each of the deceleration sub-periods until the stepper motor completes the second sub-period steps of each of the deceleration sub-periods in the period step information.

[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes an intelligent speaker, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the stepper motor control method described above.

[0043] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the stepper motor control method described above are implemented.

[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the stepper motor control method described above are implemented.

[0045] One or more technical solutions proposed in this application have at least the following technical effects:

[0046] The present application can obtain the running angle, running time and running speed parameters of the stepper motor. Then the running time is divided into an acceleration period, a uniform speed period and a deceleration period, and the acceleration period is equally divided into a plurality of acceleration sub-periods, and the deceleration period is equally divided into a plurality of deceleration sub-periods. Thus, the present application can be divided into a plurality of acceleration sub-periods, a uniform speed period and a plurality of deceleration sub-periods by the running time of the stepper motor. Then, according to the running angle and the running speed parameters, the time period step information and the timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods can be calculated. Thus, the timer count value and the number of steps required to be completed in each time period that meet the running speed requirements of each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods are calculated. Then, according to the time period step information and the timer count value information, the stepper motor operation is controlled. Therefore, in the present application, the stepper motor can be controlled to achieve step-by-step acceleration in each of the acceleration sub-periods, run at a uniform speed in the uniform speed period, and achieve step-by-step deceleration in each of the deceleration sub-periods, thereby avoiding the noise, idling and other abnormal sound problems caused by a large leap in the running speed of the stepper motor, and avoiding the user's abnormal sound affecting the auditory experience when using the smart speaker. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 A schematic diagram of a flow chart of a first embodiment of a stepper motor control method of the present application;

[0050] Figure 2 This is an example diagram of the operating speed of the stepper motor involved in the embodiment of the present application;

[0051] Figure 3A schematic diagram of a flow chart of a second embodiment of a stepper motor control method of the present application;

[0052] Figure 4 A schematic diagram of a flow chart of a third embodiment of a stepper motor control method of the present application;

[0053] Figure 5 This is an overall flow chart of the stepper motor control method involved in the embodiment of the present application;

[0054] Figure 6 Schematic diagram of the device structure of the smart speaker involved in the stepper motor control method in the embodiment of the present application.

[0055] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0057] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0058] The main solution of the embodiment of the present application is: obtaining the operating angle, operating time and operating speed parameters of the stepper motor; dividing the operating time into an acceleration period, a uniform speed period and a deceleration period, and dividing the acceleration period into a plurality of acceleration sub-periods, and dividing the deceleration period into a plurality of deceleration sub-periods; according to the operating angle and the operating speed parameters, calculating the time period step information and timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods; and controlling the operation of the stepper motor according to the time period step information and the timer count value information.

[0059] In this embodiment, for the convenience of description, the following description is made using the smart speaker as the execution subject.

[0060] As cars continue to develop towards intelligence, the smart cockpit is the direct carrier connecting users and cars, among which smart speakers are a key component of the smart cockpit.

[0061] In order to provide users with a better auditory experience, the smart speaker allows users to select the appropriate sound field in the central control interface or mobile phone application, such as the center sound field, the main driver sound field, the co-driver sound field, etc., so that the smart speaker can turn to the corresponding position according to the user's sound field selection. However, if the stepper motor of the smart speaker is directly started and stopped at the preset speed, it usually causes abnormal noise, idling and other abnormal sound problems, which seriously affects the user's auditory experience. That is, the stepper motor of the existing smart speaker has abnormal noise during operation.

[0062] The present application provides a solution, which divides the running time of the stepper motor into multiple acceleration sub-periods, uniform speed periods and multiple deceleration sub-periods. Then, according to the running angle and the running speed parameters, the time period step information and timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods can be calculated. Therefore, in the present application, the stepper motor can be controlled to achieve step-by-step acceleration in each of the acceleration sub-periods, run at a uniform speed in the uniform speed period, and achieve step-by-step deceleration in each of the deceleration sub-periods, thereby avoiding the noise, idling and other abnormal sound problems caused by the large leap in the running speed of the stepper motor, and avoiding the user's abnormal sound when using the smart speaker affects the auditory experience.

[0063] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a smart speaker, etc. The following takes a smart speaker as an example to illustrate this embodiment and the following embodiments.

[0064] Based on this, the present application embodiment provides a stepper motor control method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the stepper motor control method of the present application.

[0065] In this embodiment, the stepper motor control method includes steps S10 to S40:

[0066] Step S10, obtaining the running angle, running time and running speed parameters of the stepper motor;

[0067] It should be noted that the operating angle is the angle at which the stepper motor is expected to rotate, and the operating time is the time taken for the stepper motor to rotate the operating angle. The operating speed parameter is a speed-related parameter for setting the operation of the stepper motor, such as the initial operating speed, the final operating speed, the operating acceleration, the operating deceleration, etc.

[0068] Additionally, it should be noted that the stepper motor may be a motor provided on the smart speaker for controlling the orientation of the speaker assembly of the smart speaker. It is understandable that when the smart speaker has rotation requirements in multiple dimensions, the smart speaker may be provided with multiple stepper motors. For example, if the smart speaker has rotation requirements in the horizontal and vertical dimensions, the smart speaker may be provided with a stepper motor for rotation in the horizontal dimension and another stepper motor for rotation in the vertical direction.

[0069] Since the user requires the smart speaker to adopt different types of sound fields, the angle required for the stepper motor to run will also be different. In this embodiment, the sound field angle corresponding to the target sound field pointed to by the sound field instruction can be obtained in response to the user's sound field instruction, and the angle difference between the sound field angle and the current angle of the stepper motor is used as the running angle of the stepper motor. The running time and the running speed parameters can be set according to specific needs. For example, in order to reflect the solemnity, a longer running time and a smaller running speed parameter (such as running acceleration, initial speed, etc.) can be used. Exemplarily, for the running time of the stepper motor, this embodiment can adopt a fixed running time, or select the corresponding running time according to the running angle, and the running time is positively correlated with the running angle, etc. to obtain the running time of the stepper motor.

[0070] Step S20, dividing the running time into an acceleration period, a constant speed period and a deceleration period, and equally dividing the acceleration period into a plurality of acceleration sub-periods, and equally dividing the deceleration period into a plurality of deceleration sub-periods;

[0071] As an example, the present embodiment can divide the running time according to a predetermined division ratio to obtain an acceleration period, a uniform speed period, and a deceleration period. As another example, when the running time is relatively fixed, the larger the running angle, the larger the ratio of the acceleration period and the deceleration period, so as to avoid the situation where the acceleration time or the deceleration time is too short, resulting in a sharp acceleration or deceleration of the stepper motor. Exemplarily, the present embodiment can select different division ratios according to the different running angles, and then divide the running time according to the division ratio to obtain an acceleration period, a uniform speed period, and a deceleration period. The ratio of the acceleration period and the deceleration period in the division ratio is positively correlated with the running angle. In this way, the division of time periods can be more in line with the requirements of different running angles. The present embodiment can divide the running time t t Divide into n total The acceleration period accounts for n1 parts, the uniform speed period accounts for n2 parts, and the deceleration period accounts for n3 parts, that is, n total =n1+n2+n3, then the division ratio is n1:n2:n3.

[0072] The acceleration period is The uniform speed period is The deceleration period is where t t is the running time of the stepper motor.

[0073] As an example, the present embodiment can divide the acceleration period into acceleration sub-periods of the first division order according to a predetermined first division order, and divide the deceleration period into deceleration sub-periods of the second division order according to a predetermined second division order. As an example, the present embodiment can obtain the initial operation speed, the final operation speed, the operation acceleration and the operation deceleration in the operation speed parameters; calculate the calibration speed according to the operation angle and the operation time; calculate the first division order according to the difference between the calibration speed and the initial operation speed, and the operation acceleration; divide the acceleration period into equal parts according to the first division order to obtain each acceleration sub-period; calculate the second division order according to the difference between the calibration speed and the final operation speed, and the operation deceleration; divide the deceleration period into equal parts according to the second division order to obtain each deceleration sub-period.

[0074] In a feasible implementation manner, the step of dividing the acceleration period into a plurality of acceleration sub-periods and the step of dividing the deceleration period into a plurality of deceleration sub-periods in step S20 may include steps S21 to S26:

[0075] Step S21, obtaining the initial running speed, final running speed, running acceleration and running deceleration in the running speed parameters;

[0076] Step S22, calculating a calibration speed according to the running angle and the running time;

[0077] Step S23, calculating a first division order according to the difference between the calibrated speed and the initial running speed, and the running acceleration;

[0078] Step S24, dividing the acceleration period equally according to the first division order to obtain acceleration sub-periods;

[0079] Step S25, calculating a second division order according to the difference between the calibrated speed and the final running speed, and the running deceleration;

[0080] Step S26, dividing the deceleration period into equal parts according to the second division order to obtain deceleration sub-periods.

[0081] In this embodiment, the initial speed, final speed, acceleration and deceleration of the running speed parameters can be obtained, and then the calibration speed can be calculated according to the running angle and the running time. For example, the calibration speed v s The calculation formula is as follows:

[0082]

[0083] Where r is the running angle, in degrees; tt It is the running time in seconds.

[0084] Then, the first division order can be calculated according to the difference between the calibration speed and the initial running speed, and the running acceleration. For example, the first division order n of the acceleration period is acc The calculation formula is as follows:

[0085]

[0086] Among them, v s is the rated speed of the stepper motor, in ° / s; v start is the initial running speed in the running speed parameter, in degrees / s; a acc It is the running acceleration in the running speed parameter, in degrees / s 2 For example, the calibration speed is 25° / s, the initial running speed is 5° / s, and the acceleration is 5° / s 2 , then the first division order of the acceleration period is n acc =(25-5) / 5=4.

[0087] Therefore, the acceleration period can be equally divided according to the first division order to obtain various acceleration sub-periods.

[0088] Then, the second division order can be calculated based on the difference between the calibrated speed and the final running speed, and the running deceleration. For example, the second division order n of the deceleration period is decel The calculation formula is as follows:

[0089]

[0090] Wherein, vs is the calibrated speed of the stepper motor, in units of ° / s; v decel is the final running speed in the running speed parameter, in degrees / s; a decel It is the running deceleration in the running speed parameter, in degrees / s.

[0091] Therefore, the deceleration period can be equally divided according to the second division order to obtain deceleration sub-periods.

[0092] In this embodiment, the initial speed, final speed, acceleration and deceleration of the running speed parameters are obtained; the calibration speed is calculated according to the running angle and the running time; the first division order is calculated according to the difference between the calibration speed and the initial speed, and the running acceleration; the acceleration period is divided equally according to the first division order to obtain each acceleration sub-period; the second division order is calculated according to the difference between the calibration speed and the final speed, and the running deceleration; the deceleration period is divided equally according to the second division order to obtain each deceleration sub-period. Therefore, this embodiment divides the time periods according to the running acceleration and the running deceleration, so that the acceleration process of each acceleration sub-period and the deceleration process of each deceleration sub-period conform to the running acceleration and the running deceleration, and satisfies the user's control over the acceleration process and the deceleration process.

[0093] Step S30, calculating the time period step number information and timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods according to the running angle and the running speed parameter;

[0094] It should be noted that the time period step number information includes the number of steps required for each acceleration sub-period, the uniform speed period and each deceleration sub-period, and the timer count value information includes the count value of the timer for each acceleration sub-period, the uniform speed period and each deceleration sub-period. It can be understood that when the timer counts to the count value, a pulse signal is output to the stepper motor to drive the stepper motor to run. The timer is a component configured inside the smart speaker for timing, measuring time intervals and controlling the sequence of events. The component can be a hardware timer or a software timer. Therefore, different count values ​​can generate different pulse frequencies to make the stepper motor run at different speeds. In this process, the running speed v (i.e., the speed) of the stepper motor is related to the pulse frequency f. p is proportional to the pulse frequency f p The running speed v of the stepper motor is negatively correlated with the pulse frequency f. p The relationship between them is calculated as follows:

[0095]

[0096] When the timer counts to the count value c, it generates a pulse signal and outputs it to the stepper motor. The corresponding pulse frequency is f p for:

[0097]

[0098] Since the basic counting frequency f of the timer baseIt is generally a fixed value, so for a specified running speed v, the count value c required by the timer can be calculated by the following formula:

[0099]

[0100] Furthermore, when the pulse signal is output according to the count value c, the rotation speed of the stepping motor can be made to be the specified operating speed v.

[0101] In this embodiment, the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods can be calculated based on the operating speed parameter and the duration of each of the acceleration sub-periods and each of the deceleration sub-periods. It can be understood that the speed information of the speed change period can include the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period. Therefore, the number of steps of the first sub-period of the acceleration sub-period can be obtained based on the first sub-period speed and the duration of the acceleration sub-period and the step angle of the stepper motor, and the first sub-period count value corresponding to the first sub-period speed of the acceleration sub-period can be calculated based on the corresponding relationship between the operating speed of the stepper motor and the count value of the timer, so that under the first sub-period count value, the stepper motor runs at the first sub-period speed. Similarly, the number of steps in the second sub-period of the deceleration sub-period can be obtained according to the speed of the second sub-period and the duration of the deceleration sub-period and the step angle of the stepper motor, and the second sub-period count value corresponding to the speed of the second sub-period of the deceleration sub-period can be calculated according to the corresponding relationship between the running speed of the stepper motor and the count value of the timer, so that under the second sub-period count value, the stepper motor runs at the speed of the second sub-period. In order to complete the rotation of the running angle, the remaining steps other than the steps completed in the acceleration period and the deceleration period can be completed in the uniform speed period. In this embodiment, the number of steps in the uniform speed period of the uniform speed period can be calculated according to the running angle and the number of steps in the speed change period, and the uniform speed period speed of the uniform speed period can be calculated according to the number of steps in the uniform speed period, and the uniform speed period count value corresponding to the uniform speed period speed can be calculated according to the corresponding relationship between the running speed of the stepper motor and the count value of the timer. Then, the step count information of the speed change period and the step count information of the uniform speed period can be used as the period step count information, and the count value information of the speed change period and the count value of the uniform speed period can be used as the timer count value information.

[0102] Step S40: Control the stepping motor to run according to the step number information of the time period and the timer count value information.

[0103] It should be noted that the time period step count information includes the speed change period step count information and the uniform speed period step count information, and the speed change period step count information includes the first sub-period step count of each acceleration sub-period and the second sub-period step count of each deceleration sub-period. The timer count value information is a count value used to control the timer to generate a pulse signal.

[0104] In this embodiment, in each acceleration sub-period, a pulse signal is output to the stepper motor according to the first sub-period count value of each acceleration sub-period in the period step information, so that the stepper motor runs at the first sub-period speed corresponding to each first sub-period count value until the stepper motor completes the first sub-period steps of each acceleration sub-period in the period step information. After completing the first sub-period steps, the uniform speed period is entered, and in the uniform speed period, a pulse signal is output to the stepper motor according to the uniform speed period count value of the uniform speed period in the period step information, so that the stepper motor runs at the uniform speed period speed corresponding to the uniform speed period count value until the stepper motor completes the uniform speed period steps of the uniform speed period in the period step information.

[0105] In a feasible implementation, step S40 may include steps S41 to S43:

[0106] Step S41, in each of the acceleration sub-periods, outputting a pulse signal to the stepper motor according to the first sub-period count value of each of the acceleration sub-periods in the period step number information, so that the stepper motor runs at a speed corresponding to the first sub-period count value of each of the acceleration sub-periods until the stepper motor completes the first sub-period steps of each of the acceleration sub-periods in the period step number information;

[0107] Step S42, during the uniform speed period, outputting a pulse signal to the stepper motor according to the uniform speed period count value of the uniform speed period in the period step number information, so that the stepper motor runs at a speed corresponding to the uniform speed period count value until the stepper motor completes the uniform speed period steps of the uniform speed period in the period step number information;

[0108] Step S43, within each of the deceleration sub-periods, a pulse signal is output to the stepper motor according to the second sub-period count value of each of the deceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the second sub-period count value of each of the deceleration sub-periods until the stepper motor completes the second sub-period steps of each of the deceleration sub-periods in the period step information.

[0109] Please refer to Figure 2 , Figure 2 This is an example diagram of the operating speed of the stepper motor involved in the embodiment of the present application. Figure 20~t1 is the acceleration period, t1~(t1+t2) is the uniform speed period, (t1+t2)~t t is the deceleration period, t acc is the duration of the acceleration sub-period, n acc is the number of acceleration sub-periods within the acceleration period. start is the initial speed, v a1 is the speed of the first sub-period of the first acceleration sub-period in the acceleration period, v a2 is the speed of the first sub-period of the second acceleration sub-period in the acceleration period, v d1 is the speed of the second sub-period of the last deceleration sub-period in the deceleration period, v stop is the final running speed. It can be understood that the acceleration sub-period or the deceleration sub-period in this embodiment is a uniform speed operation, which can avoid the problem of changing the count value of the timer in real time due to the real-time change of the running speed, effectively reducing the control difficulty of the stepper motor, especially suitable for the scene with low motor speed on the smart speaker. In each of the acceleration sub-periods, this embodiment outputs a pulse signal to the stepper motor according to the first sub-period count value of each of the acceleration sub-periods in the period step information, so that the stepper motor runs at the first sub-period speed corresponding to each of the first sub-period count values, until the stepper motor completes the first sub-period steps of each of the acceleration sub-periods in the period step information. Then, after completing the first sub-period steps, it enters the uniform speed period, and in the uniform speed period, according to the uniform speed period count value of the uniform speed period in the period step information, the pulse signal is output to the stepper motor, so that the stepper motor runs at the uniform speed period corresponding to the uniform speed period count value, until the stepper motor completes the uniform speed period steps of the uniform speed period in the period step information.

[0110] The first embodiment of the present application provides a stepper motor control method, which can obtain the running angle, running time and running speed parameters of the stepper motor. Then the running time is divided into an acceleration period, a uniform speed period and a deceleration period, and the acceleration period is equally divided into a plurality of acceleration sub-periods, and the deceleration period is equally divided into a plurality of deceleration sub-periods. Thus, this embodiment can be divided into a plurality of acceleration sub-periods, a uniform speed period and a plurality of deceleration sub-periods by the running time of the stepper motor. Then, according to the running angle and the running speed parameters, the time period step information and timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods can be calculated. Thus, the timer count value and the number of steps required to be completed in each period that meet the running speed requirements of each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods are calculated. Then, according to the time period step information and the timer count value information, the stepper motor operation is controlled. Therefore, in this embodiment, the stepper motor can be controlled to achieve step-by-step acceleration in each acceleration sub-period, run at a uniform speed in the uniform speed period, and achieve step-by-step deceleration in each deceleration sub-period, thereby avoiding the noise, idling and other abnormal sound problems caused by a large leap in the running speed of the stepper motor, and avoiding the user's abnormal sound affecting the auditory experience when using the smart speaker.

[0111] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , step S30 includes steps S31 to S34:

[0112] Step S31, calculating and obtaining the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the running speed parameter;

[0113] Step S32, calculating the speed change period step number information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the speed change period speed information, and the basic counting frequency and step angle of the stepping motor;

[0114] Step S33, calculating the number of steps in the uniform speed period according to the running angle and the number of steps in the speed change period, and calculating the count value of the uniform speed period according to the number of steps in the uniform speed period;

[0115] Step S34: taking the step number information of the speed change period and the step number of the uniform speed period as the period step number information, and taking the count value information of the speed change period and the count value of the uniform speed period as the timer count value information.

[0116] This embodiment can calculate the speed information of the speed change period corresponding to each acceleration sub-period and each deceleration sub-period based on the running speed parameters and the duration of each acceleration sub-period and each deceleration sub-period. Exemplarily, this embodiment can calculate the speed of the first sub-period of each acceleration sub-period based on the running initial speed, running acceleration and the accumulated duration corresponding to each acceleration sub-period in the running speed parameters, wherein the accumulated duration corresponding to each acceleration sub-period is the accumulated duration of the acceleration sub-periods arranged in sequence in the acceleration period, and the accumulated duration corresponding to the acceleration sub-period is the product of the sequence number of the acceleration sub-period in the acceleration period and the duration of the acceleration sub-period, for example, the accumulated duration of the i-th acceleration sub-period is t acc ×i. Similarly, the second sub-period speed of each deceleration sub-period can be calculated based on the final running speed, running deceleration, and the accumulated duration corresponding to each deceleration sub-period in the running speed parameter, so that the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period can be used as the speed information of the speed change period.

[0117] Then, the number of steps of the first sub-period of the acceleration sub-period can be obtained according to the speed of the first sub-period, the duration of the acceleration sub-period, and the step angle of the stepper motor, and the first sub-period count value corresponding to the speed of the first sub-period of the acceleration sub-period can be calculated according to the corresponding relationship between the running speed of the stepper motor and the count value of the timer, so that the stepper motor runs at the first sub-period speed under the count value of the first sub-period. Similarly, the number of steps of the second sub-period of the deceleration sub-period can be obtained according to the speed of the second sub-period, the duration of the deceleration sub-period, and the step angle of the stepper motor, and the second sub-period count value corresponding to the speed of the second sub-period of the deceleration sub-period can be calculated according to the corresponding relationship between the running speed of the stepper motor and the count value of the timer, so that the stepper motor runs at the second sub-period speed under the count value of the second sub-period. Exemplarily, the number of steps in the first sub-period of each acceleration sub-period can be calculated based on the first sub-period duration of each acceleration sub-period, the step angle and the first sub-period speed of each acceleration sub-period in the speed information of the speed change period; the first sub-period count value of each acceleration sub-period can be calculated based on the basic counting frequency, the step angle and the first sub-period speed of each acceleration sub-period; the number of steps in the second sub-period of each deceleration sub-period can be calculated based on the second sub-period duration of each deceleration sub-period, the step angle and the second sub-period speed of each deceleration sub-period in the speed information of the speed change period; the second sub-period count value of each deceleration sub-period can be calculated based on the basic counting frequency, the step angle and the second sub-period speed of each deceleration sub-period; the number of steps in the first sub-period of each acceleration sub-period and the number of steps in the second sub-period of each deceleration sub-period are used as the step number information of the speed change period, and the first sub-period count value of each acceleration sub-period and the second sub-period count value of each deceleration sub-period are used as the count value information of the speed change period.

[0118] Furthermore, in order to complete the rotation of the operating angle, the remaining steps other than the steps completed in the acceleration period and the deceleration period can be completed in the uniform speed period. This embodiment can calculate the uniform speed period steps of the uniform speed period according to the operating angle and the speed change period step information, and calculate the uniform speed period speed of the uniform speed period according to the uniform speed period steps, and calculate the uniform speed period count value corresponding to the uniform speed period speed according to the corresponding relationship between the operating speed of the stepping motor and the count value of the timer. Then, the speed change period step information and the uniform speed period step can be used as the period step information, and the speed change period count value information and the uniform speed period count value can be used as the timer count value information.

[0119] In a feasible implementation, step S31 may include steps A10 to A30:

[0120] Step A10, calculating the first sub-period speed of each acceleration sub-period according to the running initial speed, the running acceleration, and the accumulated duration corresponding to each acceleration sub-period in the running speed parameter;

[0121] Step A20, calculating the second sub-period speed of each deceleration sub-period according to the running final speed, the running deceleration, and the accumulated duration corresponding to each deceleration sub-period in the running speed parameter;

[0122] Step A30: taking the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period as speed information of the speed change period.

[0123] It should be noted that the cumulative duration corresponding to each of the acceleration sub-periods is the cumulative duration of the acceleration sub-periods arranged in sequence in the acceleration period, and the cumulative duration corresponding to the acceleration sub-period is the product of the sequence number of the acceleration sub-period in the acceleration period and the duration of the acceleration sub-period. For example, the cumulative duration of the i-th acceleration sub-period is t acc ×i. Similarly, the cumulative duration corresponding to each deceleration sub-period is the cumulative duration of the deceleration sub-periods in the deceleration period in sequence, and the cumulative duration corresponding to the deceleration sub-period is the product of the sequence number of the deceleration sub-period in the deceleration period and the duration of the deceleration sub-period. For example, the cumulative duration of the jth deceleration sub-period is t decel ×j.

[0124] In this embodiment, the speed of the first sub-period of each acceleration sub-period is calculated based on the initial speed and acceleration of the operation in the operation speed parameters, and the accumulated duration corresponding to each acceleration sub-period. Since the speed of the first sub-period is kept unchanged in the acceleration sub-period, the speed v of the first sub-period of the i-th acceleration sub-period is i The calculation formula is as follows:

[0125] v i =v start +a acc ×t acc ×i, where v start is the initial running speed, a acc is the running acceleration, t acc =t1 / n acc , t1 is the acceleration period, n acc is the first division order, and i is the sequence number of the acceleration sub-period within the acceleration period.

[0126] Then, according to the final speed and deceleration in the running speed parameter, and the accumulated duration corresponding to each deceleration sub-period, the second sub-period speed of each deceleration sub-period is calculated. Similarly, since the second sub-period speed is kept constant in the deceleration sub-period, the second sub-period speed v of the jth deceleration sub-period is j The calculation formula is as follows:

[0127] v j =v stop +a decel ×t decel ×j, where v stop is the final running speed, a decel is the running deceleration, t decel =t3 / n decel , t3 is the deceleration period, n decel is the second division order, and j is the sequence number of the deceleration sub-period within the deceleration period.

[0128] Thus, the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period can be used as the speed change period speed information.

[0129] This embodiment calculates the first sub-period speed of each acceleration sub-period according to the running initial speed, running acceleration, and the accumulated duration corresponding to each acceleration sub-period in the running speed parameters; calculates the second sub-period speed of each deceleration sub-period according to the running final speed, running deceleration, and the accumulated duration corresponding to each deceleration sub-period in the running speed parameters; and uses the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period as the speed information of the speed change period. Thus, this embodiment calculates the first sub-period speed of each acceleration sub-period and the second sub-period speed of each deceleration sub-period.

[0130] In a feasible implementation, step S32 may include steps B10 to B50:

[0131] Step B10, calculating the number of steps in the first sub-period of each acceleration sub-period according to the first sub-period duration of each acceleration sub-period, the step angle, and the first sub-period speed of each acceleration sub-period in the speed information of the speed change period;

[0132] Step B20, calculating the first sub-period count value of each acceleration sub-period according to the basic counting frequency, the step angle and the first sub-period speed of each acceleration sub-period;

[0133] Step B30, calculating the number of steps in the second sub-period of each deceleration sub-period according to the second sub-period duration of each deceleration sub-period, the step angle, and the second sub-period speed of each deceleration sub-period in the speed information of the speed change period;

[0134] Step B40, calculating a second sub-period count value of each deceleration sub-period according to the basic counting frequency, the step angle, and the second sub-period speed of each deceleration sub-period;

[0135] Step B50, taking the number of steps in the first sub-period of each acceleration sub-period and the number of steps in the second sub-period of each deceleration sub-period as the speed change period step information, and taking the first sub-period count value of each acceleration sub-period and the second sub-period count value of each deceleration sub-period as the speed change period count value information.

[0136] In this embodiment, the number of steps in the first sub-period of each acceleration sub-period can be calculated based on the first sub-period duration of each acceleration sub-period, the step angle, and the first sub-period speed of each acceleration sub-period in the speed information of the speed change period. For example, the number of steps in the first sub-period of the i-th acceleration sub-period s i The calculation formula is as follows:

[0137]

[0138] Among them, v i is the speed of the first sub-period of the i-th acceleration sub-period, t acc is the duration of the acceleration sub-period, is the step angle.

[0139] When the timer counts to the count value, a pulse signal is output to the stepper motor to drive the stepper motor to run. Therefore, different count values ​​can generate different pulse frequencies to make the stepper motor run at different speeds. In this process, the running speed v (i.e., the speed) of the stepper motor is proportional to the pulse frequency fp, and the pulse frequency fp is negatively correlated with the count value c of the timer. In this embodiment, the first sub-period count value of each acceleration sub-period can be calculated based on the basic counting frequency, the step angle, and the first sub-period speed of each acceleration sub-period. Exemplarily, the first sub-period count value c of the i-th acceleration sub-period is i The calculation formula is as follows:

[0140]

[0141] Among them, v i is the speed of the first sub-period of the i-th acceleration sub-period, f base is the basic counting frequency of the timer, is the step angle.

[0142] Similarly, for the deceleration period, this embodiment can calculate the number of steps in the second sub-period of each deceleration sub-period according to the second sub-period duration of each deceleration sub-period, the step angle, and the second sub-period speed of each deceleration sub-period in the speed information of the speed change period. For example, the number of steps in the second sub-period of the jth deceleration sub-period s j The calculation formula is as follows:

[0143]

[0144] Among them, v j is the speed of the second sub-period of the jth deceleration sub-period, t decel is the duration of the deceleration sub-period, is the step angle.

[0145] Then, the second sub-period count value of each deceleration sub-period can be calculated according to the basic counting frequency, the step angle and the second sub-period speed of each deceleration sub-period. j The calculation formula is as follows:

[0146]

[0147] Among them, v j is the speed of the second sub-period of the jth deceleration sub-period, f base is the basic counting frequency of the timer, is the step angle.

[0148] In the second embodiment of the present application, the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods is calculated according to the running speed parameter; the speed change period step information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods are calculated according to the speed change period speed information, and the basic counting frequency and step angle of the stepping motor; the uniform speed period step number of the uniform speed period is calculated according to the running angle and the speed change period step number information, and the uniform speed period count value is calculated according to the uniform speed period step number; the speed change period step number information and the uniform speed period step number are used as the period step number information, and the speed change period count value information and the uniform speed period count value are used as the timer count value information. This embodiment calculates the number of steps required to run in each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods, and the timer count value that matches the running speed of each period in each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods.

[0149] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 4 , step S33 may include steps C10 to C50:

[0150] Step C10, calculating the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period according to the step number information of the speed change period, and taking the sum of the total number of acceleration steps and the total number of deceleration steps as the total number of speed change steps;

[0151] Step C20, calculating the total number of running steps according to the running angle and the step angle of the stepping motor, and taking the difference between the total number of running steps and the total number of speed change steps as the number of steps in the uniform speed period;

[0152] Step C30, calculating the uniform speed period speed of the uniform speed period according to the number of steps in the uniform speed period, the step angle of the stepping motor and the duration of the uniform speed period;

[0153] Step C40, calculating a uniform speed period count value according to the uniform speed period speed of the uniform speed period and the basic counting frequency and step angle of the stepping motor.

[0154] In this embodiment, the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period can be calculated based on the step number information of the speed change period, and the sum of the total number of acceleration steps and the total number of deceleration steps is used as the total number of speed change steps. acc The calculation formula is as follows:

[0155]

[0156] Among them, s i is the number of steps in the first sub-period of the i-th acceleration sub-period, n acc is the number of acceleration sub-periods in the acceleration period.

[0157] The total number of deceleration steps in the entire deceleration period s decel The calculation formula is as follows:

[0158]

[0159] Among them, s j is the number of steps in the second sub-period of the jth deceleration sub-period, n decel is the number of deceleration sub-periods in the deceleration period.

[0160] Then, the total number of running steps can be calculated according to the running angle and the step angle of the stepping motor, and the difference between the total number of running steps and the total number of speed change steps is used as the number of steps in the uniform speed period. total The calculation formula is as follows:

[0161]

[0162] Where r is the running angle, is the step angle.

[0163] The number of uniform speed steps s that need to be output during the uniform speed period u The calculation formula is:

[0164] s u =s total -(s acc +s decel )

[0165] Among them, s total is the total number of running steps, s decel is the total number of deceleration steps, s acc is the total number of acceleration steps.

[0166] Then, the uniform speed period speed of the uniform speed period can be calculated according to the number of steps in the uniform speed period, the step angle of the stepping motor and the duration of the uniform speed period. u The calculation formula is as follows:

[0167]

[0168] Among them, s u is the number of steps during the uniform speed period, is the step angle, and t2 is the duration of the uniform speed period.

[0169] The uniform speed period count value is calculated based on the uniform speed period speed of the uniform speed period and the basic counting frequency and step angle of the stepping motor. u The calculation formula is as follows:

[0170]

[0171] Among them, v u is the uniform speed during the uniform period, f base is the basic counting frequency of the timer, is the step angle.

[0172] The third embodiment of the present application calculates the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period according to the step number information of the speed change period, and takes the sum of the total number of acceleration steps and the total number of deceleration steps as the total number of speed change steps; calculates the total number of operation steps according to the operation angle and the step angle of the stepper motor; takes the difference between the total number of operation steps and the total number of speed change steps as the number of uniform speed period steps in the uniform speed period; calculates the uniform speed period speed of the uniform speed period according to the number of uniform speed period steps, the step angle of the stepper motor and the duration of the uniform speed period; calculates the uniform speed period count value according to the uniform speed period speed of the uniform speed period and the basic counting frequency and step angle of the stepper motor. This embodiment calculates the uniform speed period steps required to run in the uniform speed period through the total number of operation steps and the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period, and then determines the corresponding uniform speed period speed, and outputs the timer count value required for the uniform speed period speed.

[0173] Reference Figure 5 , Figure 5 The overall flow chart of the stepper motor control method involved in the embodiment of the present application. In this embodiment, after receiving the operation instruction of the stepper motor, the time period step information and timer count value information corresponding to each acceleration sub-period, the uniform speed period and each deceleration sub-period are calculated. Then it is judged whether the current moment is in the acceleration sub-period in the acceleration period. If so, a pulse signal is output to the stepper motor according to the first sub-period count value of the current acceleration sub-period in the timer counter information until the first sub-period step of the current acceleration sub-period is completed, and then the step is executed: it is judged whether the current moment is in the acceleration sub-period in the acceleration period, and the next acceleration sub-period is entered until the operation corresponding to all acceleration sub-periods in the acceleration period is completed. After the current moment is in the uniform speed period, a pulse signal can be output to the stepper motor according to the uniform speed period count value of the uniform speed period in the period step information, so that the stepper motor runs at the speed corresponding to the uniform speed period count value until the stepper motor completes the uniform speed period step of the uniform speed period in the period step information. In each of the deceleration sub-periods, a pulse signal is output to the stepper motor according to the second sub-period count value of each of the deceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the second sub-period count value of each of the deceleration sub-periods until the stepper motor completes the second sub-period steps of each of the deceleration sub-periods in the period step information.

[0174] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the stepper motor control method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0175] The present application provides a smart speaker, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the stepper motor control method in the above-mentioned embodiment one.

[0176] Reference below Figure 6 , which shows a schematic diagram of the structure of the smart speaker suitable for implementing the embodiment of the present application. The smart speaker in the embodiment of the present application can be an independent audio device or an audio device integrated in a designated device (such as a smart cockpit). It can be understood that Figure 6 The smart speaker shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0177] like Figure 6 As shown, the smart speaker may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the smart speaker are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the smart speaker to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a smart speaker with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0178] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0179] The smart speaker provided by this application adopts the stepper motor control method in the above embodiment, which can solve the technical problem that the stepper motor of the existing smart speaker has abnormal noise during operation. Compared with the prior art, the beneficial effects of the smart speaker provided by this application are the same as the beneficial effects of the stepper motor control method provided in the above embodiment, and the other technical features in the smart speaker are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0180] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0181] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0182] In addition, the present application may also provide a smart cockpit, which includes the smart speakers as described above. It is understandable that the smart cockpit may also include components such as a voice interaction module and an auxiliary driving module that meet the operating requirements of the smart cockpit.

[0183] In addition, the present application may also provide a vehicle, the vehicle including the smart speaker as described above. It is understandable that the vehicle may also include a drive system, a control system, and other systems for maintaining normal operation of the vehicle.

[0184] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the stepper motor control method in the above-mentioned embodiment.

[0185] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0186] The computer-readable storage medium may be included in the smart speaker, or may exist independently without being installed in the smart speaker.

[0187] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the smart speaker, the smart speaker: obtains the operating angle, operating time and operating speed parameters of the stepper motor; divides the operating time into an acceleration period, a uniform speed period and a deceleration period, and divides the acceleration period into a plurality of acceleration sub-periods, and divides the deceleration period into a plurality of deceleration sub-periods; calculates the time period step information and timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods according to the operating angle and the operating speed parameters; controls the operation of the stepper motor according to the time period step information and the timer count value information.

[0188] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0189] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0190] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0191] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned stepper motor control method, and can solve the technical problem that the stepper motor of the existing smart speaker has abnormal noise during operation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the stepper motor control method provided in the above-mentioned embodiment, and will not be repeated here.

[0192] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the stepper motor control method as described above are implemented.

[0193] The computer program product provided in this application can solve the technical problem that the stepper motor of the existing smart speaker has abnormal noise during operation. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the stepper motor control method provided in the above embodiment, which will not be repeated here.

[0194] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A stepper motor control method, characterized in that: The stepper motor control method comprises: Get the running angle, running time and running speed parameters of the stepper motor; Dividing the running time into an acceleration period, a constant speed period and a deceleration period, and equally dividing the acceleration period into a plurality of acceleration sub-periods, and equally dividing the deceleration period into a plurality of deceleration sub-periods; According to the running angle and the running speed parameter, the time period step number information and the timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods are calculated; According to the time period step number information and the timer count value information, the stepping motor is controlled to run.

2. The stepper motor control method according to claim 1, characterized in that: The step of equally dividing the acceleration period into a plurality of acceleration sub-periods and equally dividing the deceleration period into a plurality of deceleration sub-periods comprises: Obtaining the initial running speed, final running speed, running acceleration and running deceleration from the running speed parameters; Calculating a calibrated speed according to the running angle and the running time; Calculating a first division order according to the difference between the calibrated speed and the initial running speed, and the running acceleration; Divide the acceleration period equally according to the first division order to obtain acceleration sub-periods; The second division order is calculated according to the difference between the calibrated speed and the final running speed, and the running deceleration; The deceleration period is equally divided according to the second division order to obtain deceleration sub-periods.

3. The stepper motor control method according to claim 1, characterized in that: The step of calculating the time period step number information and the timer count value information corresponding to each of the acceleration sub-periods, the uniform speed period and each of the deceleration sub-periods according to the running angle and the running speed parameter comprises: According to the running speed parameter, the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods is calculated; According to the speed information of the speed change period, as well as the basic counting frequency and step angle of the stepping motor, the speed change period step number information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods are calculated; The number of steps in the uniform speed period is calculated according to the running angle and the number of steps in the speed change period, and the count value of the uniform speed period is calculated according to the number of steps in the uniform speed period; The speed change period step number information and the uniform speed period step number information are used as period step number information, and the speed change period count value information and the uniform speed period count value are used as timer count value information.

4. The stepper motor control method according to claim 3, characterized in that: The step of calculating the speed information of the speed change period corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the running speed parameter comprises: The first sub-period speed of each acceleration sub-period is calculated according to the initial running speed, the running acceleration and the accumulated duration corresponding to each acceleration sub-period in the running speed parameter; The second sub-period speed of each deceleration sub-period is calculated according to the running final speed, the running deceleration, and the accumulated duration corresponding to each deceleration sub-period in the running speed parameter; The first sub-period speed of each of the acceleration sub-periods and the second sub-period speed of each of the deceleration sub-periods are used as the speed change period speed information.

5. The stepper motor control method according to claim 3, characterized in that: The step of calculating the speed change period step number information and the speed change period count value information corresponding to each of the acceleration sub-periods and each of the deceleration sub-periods according to the speed change period speed information, and the basic counting frequency and step angle of the stepping motor comprises: The number of steps in the first sub-period of each acceleration sub-period is calculated according to the first sub-period duration of each acceleration sub-period, the step angle, and the first sub-period speed of each acceleration sub-period in the speed information of the speed change period; Calculate the first sub-period count value of each acceleration sub-period according to the basic counting frequency, the step angle, and the first sub-period speed of each acceleration sub-period; The number of steps in the second sub-period of each deceleration sub-period is calculated according to the second sub-period duration of each deceleration sub-period, the step angle, and the second sub-period speed of each deceleration sub-period in the speed information of the speed change period; Calculating a second sub-period count value of each deceleration sub-period according to the basic counting frequency, the step angle, and the second sub-period speed of each deceleration sub-period; The first sub-period step count of each acceleration sub-period and the second sub-period step count of each deceleration sub-period are used as the speed change period step count information, and the first sub-period count value of each acceleration sub-period and the second sub-period count value of each deceleration sub-period are used as the speed change period count value information.

6. The stepper motor control method according to claim 3, characterized in that: The step of calculating the number of steps in the uniform speed period according to the running angle and the number of steps in the speed change period, and calculating the count value of the uniform speed period according to the number of steps in the uniform speed period, comprises: According to the step number information of the speed change period, the total number of acceleration steps in the acceleration period and the total number of deceleration steps in the deceleration period are calculated, and the sum of the total number of acceleration steps and the total number of deceleration steps is used as the total number of speed change steps; The total number of running steps is calculated according to the running angle and the step angle of the stepping motor, and the difference between the total number of running steps and the total number of speed change steps is used as the number of steps in the uniform speed period; The uniform speed period speed of the uniform speed period is calculated according to the number of steps in the uniform speed period, the step angle of the stepping motor and the duration of the uniform speed period; The uniform speed period count value is calculated according to the uniform speed period speed of the uniform speed period and the basic counting frequency and step angle of the stepping motor.

7. The stepper motor control method according to any one of claims 1 to 6, characterized in that: The step of controlling the operation of the stepper motor according to the time period step number information and the timer count value information comprises: In each of the acceleration sub-periods, a pulse signal is output to the stepper motor according to the first sub-period count value of each of the acceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the first sub-period count value of each of the acceleration sub-periods until the stepper motor completes the first sub-period steps of each of the acceleration sub-periods in the period step information; During the uniform speed period, a pulse signal is output to the stepper motor according to the uniform speed period count value of the uniform speed period in the period step number information, so that the stepper motor runs at a speed corresponding to the uniform speed period count value until the stepper motor completes the uniform speed period steps of the uniform speed period in the period step number information; In each of the deceleration sub-periods, a pulse signal is output to the stepper motor according to the second sub-period count value of each of the deceleration sub-periods in the period step information, so that the stepper motor runs at a speed corresponding to the second sub-period count value of each of the deceleration sub-periods until the stepper motor completes the second sub-period steps of each of the deceleration sub-periods in the period step information.

8. An intelligent speaker, characterized in that: The smart speaker comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the stepper motor control method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the stepper motor control method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the stepper motor control method according to any one of claims 1 to 7 are implemented.