Device rotation control method, device, electronic device and readable storage medium
By calculating the rotation time of the rotatable smart speaker and generating a continuous PWM signal, the problem of stuttering noise generated by the speaker rotation when the user moves continuously is solved, improving the sound quality and user experience.
Patent Information
- Application Number
- CN202111602889.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2041-12-24
AI Technical Summary
When the existing rotatable smart speakers move continuously, the face recognition module frequently sets the rotation angle, causing the PWM signal to be frequently turned off and turned on, causing stuttering noise, affecting the sound quality and user experience.
By obtaining the angle to be rotated and the current rotation speed, calculating the rotation time, and generating a target PWM continuous signal, control the speaker to rotate within the specified time to ensure that the PWM signal is continuous and uninterrupted.
It effectively solves the problem of stuttering noise during rotation, improves the sound quality and user experience, and ensures that the speaker does not stutter during rotation.
Smart Images

Figure CN114363766B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent audio devices, and in particular to a device rotation control method, apparatus, electronic device and readable storage medium. Background Art
[0002] With the continuous development of science and technology, some smart speakers have gradually appeared on the market, such as rotatable smart speakers. At present, rotatable smart speakers can rotate in real time according to human faces or human shapes, so that the screen can always face the user. Specifically, when the user moves, the face recognition module captures the user's face and calculates the deviation angle of the user relative to the screen of the speaker. When the deviation angle exceeds the rotation threshold, the face recognition module issues a rotation angle to the motor module, and the motor module determines the PWM (Pulse Width Modulation) signal required to rotate the angle, and controls the motor rotation according to the PWM signal, thereby controlling the motor to rotate the angle in this way. However, when the user is in a continuous movement, the face recognition module usually frequently issues the angle to be rotated at intervals of tens or hundreds of milliseconds, thereby generating a series of intermittent PWM interval signals, and these PWM interval signals will overlap each other, so that the PWM signal will be frequently turned off and on, causing the rotatable smart speaker to freeze during the selection process, and the consequence is that the user will often hear the freeze noise when the rotatable smart speaker rotates, affecting the listening quality of the rotatable smart speaker, and the user experience is poor. Summary of the invention
[0003] The main purpose of this application is to provide a device rotation control method, device, electronic device and readable storage medium, aiming to solve the technical problem of stuttering noise when a rotatable smart speaker rotates in the prior art.
[0004] To achieve the above object, the present application provides a device rotation control method, which is applied to a rotatable smart speaker. The device rotation control method includes:
[0005] When it is determined that the rotatable smart speaker needs to be rotated, obtaining the to-be-rotated angle and the corresponding current rotation speed of the rotatable smart speaker;
[0006] Calculate the rotation time of the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated;
[0007] generating a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration;
[0008] According to the target PWM duration signal, the rotatable smart speaker is controlled to rotate within the rotation duration, so as to control the rotatable smart speaker to follow the target user.
[0009] To achieve the above purpose, the present application also provides a device rotation control device, which is applied to a rotatable smart speaker, and the device rotation control device includes:
[0010] A parameter acquisition module, for acquiring, when it is determined that the rotatable smart speaker needs to be rotated, an angle to be rotated and a current rotation speed corresponding to the rotatable smart speaker;
[0011] A duration calculation module, used to calculate the rotation duration corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated;
[0012] A PWM signal generating module, configured to generate a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration;
[0013] The rotation control module is used to control the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user.
[0014] The present application also provides an electronic device, which includes: a memory, a processor, and a program of the device rotation control method stored in the memory and executable on the processor. When the program of the device rotation control method is executed by the processor, the steps of the device rotation control method as described above can be implemented.
[0015] The present application also provides a computer-readable storage medium, on which is stored a program for implementing the device rotation control method. When the program of the device rotation control method is executed by a processor, the steps of the device rotation control method as described above are implemented.
[0016] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned device rotation control method when executed by a processor.
[0017] The present application provides a device rotation control method, apparatus, electronic device and readable storage medium. Compared with the prior art, when the user moves, the face recognition module calculates the deviation angle of the user relative to the screen of the speaker by capturing the user's face. When the deviation angle exceeds the rotation threshold, the face recognition module sends a rotation angle to the motor module, and the motor module determines the PWM signal required to rotate the angle, and controls the motor rotation according to the PWM signal, thereby controlling the motor to rotate the angle in this way. The technical means, when determining that the rotatable smart speaker needs to be rotated, the present application first obtains the corresponding angle to be rotated and the corresponding current rotation speed of the rotatable smart speaker, and then calculates the corresponding rotation time of the rotatable smart speaker according to the current rotation speed, the angle to be rotated and the maximum rotation speed corresponding to the angle to be rotated, and then generates a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation time, and then controls the rotatable smart speaker to rotate within the rotation time according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user. Among them, the present application continuously controls the rotation of the rotatable smart speaker by generating a continuously issued PWM signal and a rotation time, rather than intermittently controlling the rotatable smart speaker with a series of intermittent PWM interval signals. During the entire rotation control process, since the PWM continuous signal is not interrupted, the PWM signal is only turned on and off once, so it overcomes the situation when the user is in continuous movement. The face recognition module usually frequently issues the rotation angle at intervals of tens or hundreds of milliseconds, thereby generating a series of intermittent PWM interval signals, and these PWM interval signals will overlap each other, so that the PWM signal will be frequently turned off and on, resulting in the technical defect of the rotatable smart speaker causing jamming during the selection process. It solves the technical problem of jamming noise when the rotatable smart speaker rotates, improves the body sound quality of the rotatable smart speaker, and thus improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] 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.
[0019] 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 labor.
[0020] Figure 1 This is a flow chart of the first embodiment of the device rotation control method of the present application;
[0021] Figure 2 A schematic diagram of the distribution of rotation speed of the rotatable smart speaker in the device rotation control method of the present application, showing the rotation speed changing with time when the rotatable smart speaker rotates;
[0022] Figure 3 This is a flow chart of the second embodiment of the device rotation control method of the present application;
[0023] Figure 4 Schematic diagram of the device structure of the hardware operating environment involved in the device rotation control method in the embodiment of the present application.
[0024] 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
[0025] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.
[0026] Embodiment 1
[0027] The present application embodiment provides a device rotation control method. In the first embodiment of the device rotation control method of the present application, it is applied to a rotatable smart speaker. Figure 1 , the device rotation control method comprises:
[0028] Step S10, when it is determined that the rotatable smart speaker needs to be rotated, obtaining the to-be-rotated angle and the corresponding current rotation speed of the rotatable smart speaker;
[0029] In this embodiment, it should be noted that the rotatable smart speaker is provided with a motor module, and the motor module includes a stepper motor and a signal generator, wherein the stepper motor is used to drive the rotatable smart speaker to rotate, and the signal transmitter is used to send a PWM signal to the stepper motor, and the PWM signal is used to control the stepper motor to operate. Optionally, the rotatable smart speaker can also be provided with a face recognition module, wherein the face recognition module is used to detect the angle of user movement and send angle information to the motor module, and the signal generator can generate a corresponding PWM signal according to the angle information.
[0030] In addition, it should be noted that the basic control principle of the stepper motor is that the main control chip sends a certain frequency and a certain number of PWM waves to the stepper motor control chip, and the motor chip can control the motor to rotate at a certain speed and a certain angle. The frequency of the PWM wave determines the motor rotation speed, and the number of PWM waves determines the motor rotation angle. Therefore, the rotation process of the rotatable smart speaker is determined by the number and frequency of the PWM wave.
[0031] When it is determined that the rotatable smart speaker needs to be rotated, the corresponding angle to be rotated and the corresponding current rotation speed of the rotatable smart speaker are obtained. Specifically, the face recognition module is used to detect whether the moving angle of the target user is greater than the preset deviation angle. If the moving angle of the target user is greater than the preset deviation angle, the moving angle is sent to the motor module as the angle to be rotated; it is determined whether the motor module is detected to receive the angle to be rotated. If the motor module is not detected to receive the angle to be rotated, it is determined that the rotatable smart speaker does not need to be rotated. If the motor module is detected to receive the angle to be rotated, it is determined that the rotatable smart speaker needs to be rotated, and then the corresponding angle to be rotated and the corresponding current rotation speed of the rotatable smart speaker are obtained.
[0032] Step S20, calculating the rotation time corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated;
[0033] In this embodiment, it should be noted that in order to prevent the rotatable smart speaker from rotating too fast and generating noise, a maximum rotation speed is set for the rotatable smart speaker in the embodiment of the present application, wherein the maximum rotation speed can be a fixed preset value, or it can be set to a value associated with the angle to be rotated. In order to ensure that the rotation time of the rotatable smart speaker is not too long, it can be set that the larger the angle to be rotated, the larger the value of the maximum rotation speed.
[0034] In addition, it should be noted that the rotatable smart speaker includes multiple rotation stages in the rotation process of the angle to be rotated. When the current rotation speed is equal to the maximum rotation speed, the first rotation stage is a uniform rotation process of maintaining the maximum rotation speed, and the second rotation stage is a uniform deceleration rotation process of decelerating from the maximum rotation speed to stopping rotation; when the current rotation speed is not equal to the maximum rotation speed, the first rotation stage is a uniform speed rotation process of changing from the current rotation speed to the maximum rotation speed, the second rotation stage is a uniform rotation process of maintaining the maximum rotation speed, and the third rotation stage is a uniform deceleration rotation process of decelerating from the maximum rotation speed to stopping rotation.
[0035] According to the current rotation speed, the angle to be rotated and the maximum rotation speed corresponding to the angle to be rotated, the rotation duration corresponding to the rotatable smart speaker is calculated. Specifically, according to the current rotation speed and the maximum rotation speed, the rotation stages corresponding to the rotatable smart speaker are determined, and according to the current rotation speed, the maximum rotation speed, the angle to be rotated, the preset rotation acceleration, and the correlation between the rotation speed, the rotation angle, the rotation acceleration and the rotation duration, the rotation duration corresponding to each rotation stage is calculated, wherein the rotation duration includes the rotation duration corresponding to each rotation stage.
[0036] Step S30, generating a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration;
[0037] In this embodiment, it should be noted that the target PWM duration signal includes a stage PWM duration signal of each rotation stage.
[0038] According to the current rotation speed, the maximum rotation speed and the rotation duration, a target PWM continuous signal is generated. Specifically, according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the rotation duration, the distribution of the rotation speed in each rotation stage over time is determined to obtain the rotation speed distribution corresponding to each rotation stage; according to the mapping relationship between the rotation speed and the PWM signal frequency, the stage PWM signal frequency distribution corresponding to each rotation speed distribution is determined; by inputting each PWM signal frequency distribution into the signal generator, a target PWM continuous signal composed of the PWM continuous signals of each stage is generated. Among them, since the PWM continuous signals of each stage are continuous in time, the target PWM continuous signal is a continuous and uninterrupted PWM signal, that is, the signal generator continuously sends the target PWM signal to the stepper motor during the rotation of the rotatable smart speaker.
[0039] Step S40, controlling the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user.
[0040] Specifically, the target PWM continuous signal is sent to the stepper motor over time, and the rotatable smart speaker is controlled to rotate within the rotation duration, so as to control the rotatable smart speaker to follow the target user.
[0041] The rotation duration at least includes the rotation duration corresponding to a rotation stage.
[0042] The step of calculating the rotation time corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated comprises:
[0043] Step S21, determining each rotation stage corresponding to the rotatable smart speaker according to the current rotation speed and the maximum rotation speed;
[0044] Step S22, calculating the rotation duration corresponding to each rotation stage according to the current rotation speed, the angle to be rotated, the maximum rotation speed and the preset rotation acceleration.
[0045] In this embodiment, steps S21 to S22 include: determining the rotation process type corresponding to the rotatable smart speaker based on a comparison result between the value of the current rotation speed and the value of the maximum rotation speed, and determining the rotation stages corresponding to the rotatable smart speaker based on the rotation process type; calculating the rotation duration corresponding to each rotation stage based on the current rotation speed, the angle to be rotated, the maximum rotation speed and the preset rotation acceleration.
[0046] As an example, step S21 is step S22, wherein the rotation process type corresponding to the rotatable smart speaker is determined according to the comparison result between the value of the current rotation speed and the value of the maximum rotation speed, and each rotation stage corresponding to the rotatable smart speaker is determined according to the rotation process type; and the step of calculating the rotation duration corresponding to each rotation stage according to the current rotation speed, the angle to be rotated, the maximum rotation speed and the preset rotation acceleration includes:
[0047] The current rotation speed is compared with the maximum rotation speed. If the current rotation speed is equal to the maximum rotation speed, the rotation process type corresponding to the rotatable smart speaker belongs to the first rotation process type, and then each rotation stage is a uniform rotation stage for rotating at the maximum rotation speed and a uniform deceleration rotation stage for decelerating from the maximum rotation speed to stop rotation; if the current rotation speed is not equal to the maximum rotation speed, the rotation process type corresponding to the rotatable smart speaker belongs to the second rotation process type, and then each rotation stage is a uniform speed rotation stage for rotating from the current rotation speed to the maximum rotation speed, a uniform speed rotation stage for rotating at the maximum rotation speed and a uniform deceleration rotation stage for decelerating from the maximum rotation speed to stop rotation; when each of the rotation stages is a uniform speed rotation stage and a uniform deceleration rotation stage During the rotation stage, the rotation duration corresponding to the uniform rotation stage is calculated based on the maximum rotation speed and the angle to be rotated, and the rotation duration corresponding to the uniform deceleration rotation stage is calculated based on the maximum rotation speed and the preset rotation acceleration; when each of the rotation stages is the uniform speed rotation stage, the uniform speed rotation stage and the uniform deceleration rotation stage, the rotation duration corresponding to the uniform speed rotation stage is calculated based on the current rotation speed, the maximum rotation speed and the preset rotation acceleration, the rotation duration corresponding to the uniform speed rotation stage is calculated based on the current rotation speed, the maximum rotation speed, the preset rotation acceleration, the angle to be rotated and the rotation duration corresponding to the uniform speed rotation stage, and the rotation duration corresponding to the uniform deceleration rotation stage is calculated based on the maximum rotation speed and the preset rotation acceleration.
[0048] Wherein, each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage and a uniform deceleration stage,
[0049] The step of determining each rotation stage corresponding to the rotatable smart speaker according to the current rotation speed and the maximum rotation speed includes:
[0050] Step S211, if the current rotation speed is less than the maximum rotation speed, then the rotation stages are respectively the rotation duration of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the uniform speed rotation stage of maintaining the maximum rotation speed, and the uniform deceleration rotation stage from the maximum rotation speed to rotation stop;
[0051] Step S212, if the current rotation speed is equal to the maximum rotation speed, then the rotation stages are respectively a uniform rotation stage for maintaining the maximum rotation speed and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop;
[0052] Step S213, if the current rotation speed is greater than the maximum rotation speed, the rotation stages are respectively a uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, a uniform speed rotation stage maintaining the maximum rotation speed, and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop.
[0053] In this embodiment, it should be noted that when the current rotation speed is less than the maximum rotation speed, the current rotation speed may be zero or greater than zero. The second rotation process type includes a type where the last rotation maximum speed is smaller than this time and a type where the last rotation maximum speed is larger than this time, wherein the type where the last rotation maximum speed is smaller than this time includes a type where the current rotation speed is zero and a type where the current rotation speed is greater than zero.
[0054] Reference Figure 2 , Figure 2 It is a rotation speed distribution diagram of the rotation speed changing with time when the rotatable smart speaker rotates, wherein the first rotation speed distribution diagram corresponding to "single rotation" is the rotation speed distribution diagram corresponding to the type where the current rotation speed is zero, the second rotation speed distribution diagram corresponding to "the maximum speed of the last rotation is the same as this time" is the rotation speed distribution diagram corresponding to the first rotation process type, the third rotation speed distribution diagram corresponding to "the maximum speed of the last rotation is smaller than this time" is the rotation speed distribution diagram corresponding to the type where the maximum speed of the last rotation is smaller than this time, and the fourth rotation speed distribution diagram corresponding to "the maximum speed of the last rotation is larger than this time" is the rotation speed distribution diagram corresponding to the type where the maximum speed of the last rotation is larger than this time, wherein the area of the shaded part is equal to the value of the angle to be rotated, Vm is the maximum rotation speed, Vm1 is the current rotation speed, and the size of the slope in the figure is the size of the preset rotation acceleration, wherein the preset rotation acceleration in the uniform deceleration rotation process and the uniform acceleration rotation process can be set to be consistent in size or inconsistent in size, which is not limited here.
[0055] The rotation duration includes a second rotation duration from the maximum rotation speed to the selected stop and a first rotation duration other than the second rotation duration.
[0056] The step of controlling the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal comprises:
[0057] Step S41, controlling the rotatable smart speaker to rotate within the first rotation duration according to the target PWM duration signal, and detecting whether the target user moves within the first rotation duration;
[0058] Step S42: if the target user is not detected to move, controlling the rotatable smart speaker to rotate at a reduced speed within the second rotation time according to the target PWM duration signal until the rotatable smart speaker stops rotating;
[0059] Step S43: if it is detected that the target user moves, return to the execution step: obtaining the angle to be rotated of the target user.
[0060] In this embodiment, steps S41 to S43 include: by sending the target PWM duration signal to the stepper motor over time within the first rotation time, controlling the rotatable smart speaker to rotate within the first rotation time, and judging whether the motor module is detected to receive the angle to be rotated again within the first rotation time; if the motor module is not detected to receive the angle to be rotated again within the first rotation time, it is determined that the target user is not detected to move, and then by sending the target PWM duration signal to the stepper motor over time within the second rotation time, controlling the rotatable smart speaker to decelerate and rotate within the second rotation time until the rotatable smart speaker stops rotating; if the motor module is detected to receive the angle to be rotated again within the first rotation time, it is determined that the target user is detected to move, and then returning to the execution step: obtaining the angle to be rotated of the target user to adjust the frequency of the target PWM duration signal, and controlling the rotatable smart speaker to rotate according to the adjusted target PWM duration signal, so as to control the rotatable smart speaker to follow the target user until the rotatable smart speaker stops rotating. The target PWM continuous signal does not need to be interrupted during the process of adjusting the frequency of the target PWM continuous signal. The specific process of adjusting the frequency of the target PWM continuous signal can refer to the specific contents of the above steps S10 to S40 and their detailed steps, which will not be repeated here.
[0061] The embodiment of the present application provides a device rotation control method. Compared with the prior art, when the user moves, the face recognition module calculates the deviation angle of the user relative to the screen of the speaker by capturing the user's face. When the deviation angle exceeds the rotation threshold, the face recognition module sends a rotation angle to the motor module, and the motor module determines the PWM signal required to rotate the angle, and controls the motor rotation according to the PWM signal, thereby controlling the motor to rotate the angle in this way. The technical means, when determining that the rotatable smart speaker needs to be rotated, the embodiment of the present application first obtains the corresponding angle to be rotated and the corresponding current rotation speed of the rotatable smart speaker, and then calculates the corresponding rotation time of the rotatable smart speaker according to the current rotation speed, the angle to be rotated and the maximum rotation speed corresponding to the angle to be rotated, and then generates a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation time, and then controls the rotatable smart speaker to rotate within the rotation time according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user. Among them, the present application continuously controls the rotation of the rotatable smart speaker by generating a continuously issued PWM signal and a rotation time, rather than intermittently controlling the rotatable smart speaker with a series of intermittent PWM interval signals. During the entire rotation control process, since the PWM continuous signal is not interrupted, the PWM signal is only turned on and off once, so it overcomes the situation when the user is in continuous movement. The face recognition module usually frequently issues the rotation angle at intervals of tens or hundreds of milliseconds, thereby generating a series of intermittent PWM interval signals, and these PWM interval signals will overlap each other, so that the PWM signal will be frequently turned off and on, resulting in the technical defect of the rotatable smart speaker causing jamming during the selection process. It solves the technical problem of jamming noise when the rotatable smart speaker rotates, improves the body sound quality of the rotatable smart speaker, and thus improves the user experience.
[0062] Embodiment 2
[0063] Further, refer to Figure 3 In another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above description and will not be described in detail later. On this basis, the rotation duration at least includes the rotation duration corresponding to a rotation stage,
[0064] The step of generating a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration comprises:
[0065] Step S31, determining a rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0066] As an example, step S31 includes: determining the type of rotation process to which each rotation stage belongs; calculating the stage rotation speed distribution of the rotatable smart speaker in each rotation stage based on the rotation process type, the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation, wherein the rotation speed distribution is the distribution of the rotation speed value over time.
[0067] As an example, step S31 further includes:
[0068] If the rotation process type corresponding to the rotatable smart speaker belongs to the first rotation process type, then each of the rotation stages is a uniform rotation stage and a uniform deceleration rotation stage, and the stage rotation speed distribution in the uniform rotation stage is to keep the maximum rotation speed unchanged within the corresponding rotation duration, and the stage rotation speed distribution corresponding to the uniform deceleration rotation stage is to uniformly decelerate from the maximum rotation speed to zero within the corresponding rotation duration; if the rotation process type corresponding to the rotatable smart speaker belongs to the second rotation process type, then each of the rotation stages is a uniformly variable speed rotation stage, a uniform speed rotation stage and a uniformly decelerated rotation stage, and the stage rotation speed distribution corresponding to the uniformly variable speed rotation stage is to uniformly transform the current rotation speed to the maximum rotation speed within the corresponding rotation duration, the stage rotation speed distribution in the uniform rotation stage is to keep the maximum rotation speed unchanged within the corresponding rotation duration, and the stage rotation speed distribution corresponding to the uniform deceleration rotation stage is to uniformly decelerate from the maximum rotation speed to zero within the corresponding rotation duration.
[0069] Step S32, determining the PWM signal frequency distribution of the rotation speed distribution according to the mapping relationship between the rotation speed and the PWM signal frequency;
[0070] Specifically, according to the one-to-one mapping relationship between the rotation speed and the PWM signal frequency, the PWM signal frequency corresponding to each rotation speed in the rotation speed distribution is determined to obtain the PWM signal frequency distribution, wherein the PWM signal frequency distribution is the distribution of the PWM signal frequency corresponding to the rotation speed over time.
[0071] Step S33, generating the target PWM duration signal according to the PWM signal frequency distribution.
[0072] In this embodiment, specifically, the target PWM duration signal is generated by inputting the PWM signal frequency distribution into a signal generator.
[0073] Wherein, each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage and a uniform deceleration stage, and the rotation speed distribution includes a stage rotation speed distribution corresponding to each of the rotation stages,
[0074] The step of determining the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation comprises:
[0075] Step S311, if the current rotation speed is less than the maximum rotation speed, then determining the stage rotation speed distribution of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform speed rotation stage maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0076] Step S312, if the current rotation speed is equal to the maximum rotation speed, then determining the stage rotation speed distribution of the uniform rotation stage for maintaining the maximum rotation speed and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0077] Step S313, if the current rotation speed is greater than the maximum rotation speed, then determine the stage rotation speed distribution of the uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform rotation stage while maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop based on the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation.
[0078] In this embodiment, it should be noted that the current rotation speed may be zero or non-zero. The second rotation process type includes a type where the previous maximum rotation speed is smaller than the current one and a type where the previous maximum rotation speed is larger than the current one, wherein the type where the previous maximum rotation speed is smaller than the current one includes a type where the current rotation speed is zero and a type where the current rotation speed is greater than zero. For details, please refer to the above description of Figure 2 The specific description process will not be repeated here.
[0079] Wherein, the step of generating the target PWM continuous signal according to the PWM signal frequency distribution includes:
[0080] Step S331, if the current rotation speed is zero, start the signal generator, and generate the target PWM continuous signal by inputting the PWM signal frequency distribution into the signal generator;
[0081] Step S332: If the current rotation speed is not zero, the PWM signal currently output by the signal generator is adjusted according to the PWM signal frequency distribution to obtain the target PWM continuous signal.
[0082] In this embodiment, specifically, if the current rotation speed is zero, it proves that the rotatable smart speaker is in a stationary state and the signal generator is not working, and then the signal generator is started, and the target PWM continuous signal is generated by inputting the PWM signal frequency distribution into the signal generator, so that the signal generator can continuously send the target PWM continuous signal to the stepper motor over time to control the rotatable smart speaker to rotate; if the current rotation speed is not zero, it proves that the rotatable smart speaker is in a rotating state and the signal generator is working, so that according to the PWM signal frequency distribution, the frequency of the PWM continuous signal currently output by the signal generator is adjusted to obtain the target PWM continuous signal, so that the signal generator can continuously send the target PWM continuous signal to the stepper motor over time to control the rotatable smart speaker to rotate.
[0083] An embodiment of the present application provides a method for generating a PWM continuous signal, namely, determining the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation; determining the PWM signal frequency distribution of the rotation speed distribution according to the mapping relationship between the rotation speed and the PWM signal frequency; and generating the target PWM continuous signal based on the PWM signal frequency distribution. Among them, the embodiment of the present application can determine the PWM signal frequency distribution according to the rotation speed distribution when the rotatable smart speaker rotates the angle to be rotated, and the one-to-one correspondence between the rotation speed and the PWM signal frequency. Since the PWM signal in the embodiment of the present application is continuously output, there is only one PWM wave in the entire rotation process. Therefore, based on the determination of the PWM signal frequency distribution, a complete PWM wave can be generated to control the rotation of the stepper motor, so that there is no PWM signal and no signal interruption in the entire rotation process. The PWM signal is only turned on and off once, thereby overcoming the situation when the user is in continuous movement, the face recognition module usually frequently issues the angle to be rotated at intervals of tens or hundreds of milliseconds, thereby generating a series of intermittent PWM interval signals, and these PWM interval signals will overlap each other, so that the PWM signal will be frequently turned off and on, resulting in the technical defect of the rotatable smart speaker causing jamming during the selection process.
[0084] Embodiment 3
[0085] The present application also provides a device rotation control device, which is applied to a rotatable smart speaker. The device rotation control device includes:
[0086] A parameter acquisition module, for acquiring, when it is determined that the rotatable smart speaker needs to be rotated, an angle to be rotated and a current rotation speed corresponding to the rotatable smart speaker;
[0087] A duration calculation module, used to calculate the rotation duration corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated;
[0088] A PWM signal generating module, configured to generate a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration;
[0089] The rotation control module is used to control the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user.
[0090] Optionally, the rotation duration at least includes a rotation duration corresponding to a rotation stage, and the PWM signal generating module is further used for:
[0091] Determine the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0092] Determining the PWM signal frequency distribution of the rotation speed distribution according to the mapping relationship between the rotation speed and the PWM signal frequency;
[0093] The target PWM duration signal is generated according to the PWM signal frequency distribution.
[0094] Optionally, each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage and a uniform deceleration stage, the rotation speed distribution includes a stage rotation speed distribution corresponding to each of the rotation stages, and the PWM signal generating module is further used for:
[0095] If the current rotation speed is less than the maximum rotation speed, then determining the stage rotation speed distribution of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform speed rotation stage maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0096] If the current rotation speed is equal to the maximum rotation speed, then determining the stage rotation speed distribution of the uniform rotation stage for maintaining the maximum rotation speed and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation;
[0097] If the current rotation speed is greater than the maximum rotation speed, the stage rotation speed distribution of the uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform rotation stage while maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop are determined based on the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation.
[0098] Optionally, the PWM signal generating module is further used for:
[0099] If the current rotation speed is zero, start the signal generator to generate the target PWM continuous signal by inputting the PWM signal frequency distribution into the signal generator;
[0100] If the current rotation speed is not zero, the PWM signal currently output by the signal generator is adjusted according to the PWM signal frequency distribution to obtain the target PWM continuous signal.
[0101] Optionally, the rotation duration at least includes a rotation duration corresponding to a rotation stage, and the duration calculation module is further used for:
[0102] Determine, according to the current rotation speed and the maximum rotation speed, each rotation stage corresponding to the rotatable smart speaker;
[0103] The rotation duration corresponding to each rotation stage is calculated according to the current rotation speed, the angle to be rotated, the maximum rotation speed and the preset rotation acceleration.
[0104] Optionally, each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage and a uniform deceleration stage, and the duration calculation module is further used for:
[0105] If the current rotation speed is less than the maximum rotation speed, the rotation stages are respectively the rotation duration of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the uniform speed rotation stage of maintaining the maximum rotation speed, and the uniform deceleration rotation stage from the maximum rotation speed to rotation stop;
[0106] If the current rotation speed is equal to the maximum rotation speed, then each of the rotation stages is respectively a uniform rotation stage of maintaining the maximum rotation speed and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop;
[0107] If the current rotation speed is greater than the maximum rotation speed, the rotation stages are respectively a uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, a uniform speed rotation stage maintaining the maximum rotation speed, and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop.
[0108] Optionally, the rotation duration includes a second rotation duration from the maximum rotation speed to the selected stop and a first rotation duration other than the second rotation duration, and the rotation control module is further configured to:
[0109] According to the target PWM duration signal, control the rotatable smart speaker to rotate within the first rotation duration, and detect whether the target user moves within the first rotation duration;
[0110] If the target user is not detected to move, the rotatable smart speaker is controlled to rotate at a reduced speed within the second rotation time according to the target PWM duration signal until the rotatable smart speaker stops rotating;
[0111] If it is detected that the target user moves, the process returns to the step of obtaining the angle to be rotated of the target user.
[0112] The device rotation control device provided by the present invention adopts the device rotation control method in the above-mentioned embodiment 1 or embodiment 2 to solve the technical problem of the existence of stuttering noise when the rotatable smart speaker rotates. Compared with the prior art, the beneficial effects of the device rotation control device provided by the embodiment of the present invention are the same as the beneficial effects of the device rotation control method provided by the above-mentioned embodiment, and other technical features in the device rotation control device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0113] Embodiment 4
[0114] An embodiment of the present invention provides an electronic device, which may be a rotatable smart speaker. The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable 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 device rotation control method in the above-mentioned embodiment one.
[0115] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure. The electronic device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0116] like Figure 4 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0117] Typically, the following systems can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc.; and communication devices. The communication device can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.
[0118] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains 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, or installed from a ROM. When the computer program is executed by a processing device, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0119] The electronic device provided by the present invention adopts the device rotation control method in the above-mentioned embodiment 1 or embodiment 2 to solve the technical problem of the existence of stuttering noise when the rotatable smart speaker rotates. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the device rotation control method provided by the above-mentioned embodiment 1, and other technical features in the electronic device are the same as the features disclosed in the above-mentioned embodiment method, which will not be repeated here.
[0120] It should be understood that the various parts of the present disclosure can be implemented with 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.
[0121] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0122] Embodiment 5
[0123] This embodiment provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the method for controlling device rotation in the first embodiment described above.
[0124] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. 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), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0125] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0126] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: when it is determined that the rotatable smart speaker needs to be rotated, obtains the corresponding angle to be rotated and the corresponding current rotation speed of the rotatable smart speaker; calculates the corresponding rotation time of the rotatable smart speaker according to the current rotation speed, the angle to be rotated and the maximum rotation speed corresponding to the angle to be rotated; generates a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation time; and controls the rotatable smart speaker to rotate within the rotation time according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user.
[0127] Computer program code for performing the operations of the present disclosure 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 cases involving 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., through the Internet using an Internet service provider).
[0128] 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 invention. 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 the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0129] The modules involved in the embodiments described in the present disclosure 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.
[0130] The computer-readable storage medium provided by the present invention stores computer-readable program instructions for executing the above-mentioned device rotation control method, which solves the technical problem of the existence of stuttering noise when the rotatable smart speaker rotates. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the embodiment of the present invention are the same as the beneficial effects of the device rotation control method provided by the above-mentioned embodiment 1 or embodiment 2, and will not be repeated here.
[0131] Embodiment 6
[0132] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned device rotation control method when executed by a processor.
[0133] The computer program product provided by the present application solves the technical problem of the presence of stuttering noise when the rotatable smart speaker rotates. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the device rotation control method provided by the above-mentioned embodiment 1 or embodiment 2, which will not be repeated here.
[0134] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A device rotation control method, characterized in that: Applied to a rotatable smart speaker, the device rotation control method includes: When it is determined that the rotatable smart speaker needs to be rotated, obtaining the to-be-rotated angle and the corresponding current rotation speed of the rotatable smart speaker; Calculate the rotation time of the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated; generating a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration; According to the target PWM duration signal, the rotatable smart speaker is controlled to rotate within the rotation duration, so as to control the rotatable smart speaker to follow the target user; The rotation duration at least includes a rotation duration corresponding to a rotation stage, and the step of generating a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration includes: Determine the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation; Determining the PWM signal frequency distribution of the rotation speed distribution according to the mapping relationship between the rotation speed and the PWM signal frequency; The target PWM duration signal is generated according to the PWM signal frequency distribution.
2. The device rotation control method according to claim 1, characterized in that: Each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage, and a uniform deceleration stage, and the rotation speed distribution includes a stage rotation speed distribution corresponding to each of the rotation stages. The step of determining the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation comprises: If the current rotation speed is less than the maximum rotation speed, then determining the stage rotation speed distribution of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform speed rotation stage maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation; If the current rotation speed is equal to the maximum rotation speed, then determining the stage rotation speed distribution of the uniform rotation stage for maintaining the maximum rotation speed and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation; If the current rotation speed is greater than the maximum rotation speed, the stage rotation speed distribution of the uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, the stage rotation speed distribution of the uniform rotation stage while maintaining the maximum rotation speed, and the stage rotation speed distribution of the uniform deceleration rotation stage from the maximum rotation speed to rotation stop are determined based on the current rotation speed, the maximum rotation speed, the preset rotation acceleration and the duration of each rotation.
3. The device rotation control method according to claim 1, characterized in that: The step of generating the target PWM duration signal according to the PWM signal frequency distribution comprises: If the current rotation speed is zero, start the signal generator to generate the target PWM continuous signal by inputting the PWM signal frequency distribution into the signal generator; If the current rotation speed is not zero, the PWM signal currently output by the signal generator is adjusted according to the PWM signal frequency distribution to obtain the target PWM continuous signal.
4. The device rotation control method according to claim 1, characterized in that: The rotation duration at least includes the rotation duration corresponding to a rotation stage. The step of calculating the rotation time corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated comprises: Determine, according to the current rotation speed and the maximum rotation speed, each rotation stage corresponding to the rotatable smart speaker; The rotation duration corresponding to each rotation stage is calculated according to the current rotation speed, the angle to be rotated, the maximum rotation speed and the preset rotation acceleration.
5. The device rotation control method according to claim 4, characterized in that: Each of the rotation stages includes one or more of a uniform acceleration stage, a uniform speed stage and a uniform deceleration stage, The step of determining each rotation stage corresponding to the rotatable smart speaker according to the current rotation speed and the maximum rotation speed includes: If the current rotation speed is less than the maximum rotation speed, the rotation stages are respectively the rotation duration of the uniform acceleration rotation stage from the current rotation speed to the maximum rotation speed, the uniform speed rotation stage of maintaining the maximum rotation speed, and the uniform deceleration rotation stage from the maximum rotation speed to rotation stop; If the current rotation speed is equal to the maximum rotation speed, then each of the rotation stages is respectively a uniform rotation stage of maintaining the maximum rotation speed and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop; If the current rotation speed is greater than the maximum rotation speed, the rotation stages are respectively a uniform deceleration rotation stage from the current rotation speed to the maximum rotation speed, a uniform speed rotation stage maintaining the maximum rotation speed, and a uniform deceleration rotation stage from the maximum rotation speed to rotation stop.
6. The device rotation control method according to claim 1, characterized in that: The rotation time period includes a second rotation time period from the maximum rotation speed to the selected stop and a first rotation time period other than the second rotation time period, The step of controlling the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal comprises: According to the target PWM duration signal, control the rotatable smart speaker to rotate within the first rotation duration, and detect whether the target user moves within the first rotation duration; If the target user is not detected to move, the rotatable smart speaker is controlled to rotate at a reduced speed within the second rotation time according to the target PWM duration signal until the rotatable smart speaker stops rotating; If it is detected that the target user moves, the process returns to the step of obtaining the angle to be rotated of the target user.
7. A device rotation control device, characterized in that: Applied to a rotatable smart speaker, the device rotation control device comprises: A parameter acquisition module, for acquiring a to-be-rotated angle and a corresponding current rotation speed of the rotatable smart speaker when it is determined that the rotatable smart speaker needs to be rotated; A duration calculation module, used to calculate the rotation duration corresponding to the rotatable smart speaker according to the current rotation speed, the angle to be rotated, and the maximum rotation speed corresponding to the angle to be rotated; A PWM signal generation module is used to generate a target PWM duration signal according to the current rotation speed, the maximum rotation speed and the rotation duration; the rotation duration at least includes a rotation duration corresponding to a rotation stage, and the PWM signal generation module is also used to determine the rotation speed distribution corresponding to the rotatable smart speaker according to the current rotation speed, the maximum rotation speed, the preset rotation acceleration and each rotation duration; determine the PWM signal frequency distribution of the rotation speed distribution according to the mapping relationship between the rotation speed and the PWM signal frequency; generate the target PWM duration signal according to the PWM signal frequency distribution; The rotation control module is used to control the rotatable smart speaker to rotate within the rotation duration according to the target PWM duration signal, so as to control the rotatable smart speaker to follow the target user.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory 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 to enable the at least one processor to perform the steps of the device rotation control method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program for implementing the device rotation control method, and the program for implementing the device rotation control method is executed by a processor to implement the steps of the device rotation control method as claimed in any one of claims 1 to 6.
Citation Information
Patent Citations
E-drive system
CN102145661A
Secondary sorting robot for logistics transfer station
CN108942872A