Method and device for controlling sound production of motor
By decomposing multimedia data and using pulse width modulation frequency and motor current control, it solves the problem of traditional sound prompt devices that cannot accurately control the pitch and loudness, achieves stable sound output of the motor in motion, and improves user experience and energy efficiency.
Patent Information
- Application Number
- CN202410647774.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2024-09-17
AI Technical Summary
The traditional sound prompt device requires dust-proof and waterproof sealing, which increases the weight and cost of the smart terminal. It cannot accurately control the pitch, loudness and timbre of the sound emitted by the motor, and the output torque/speed is unstable when the motor is in motion. Affect user experience.
By decomposing the multimedia data into a preset number of target sounds, and controlling the tone and timbre based on the pulse width modulation frequency, and using the direct-axis and quadrature-axis currents to control the loudness, it ensures that the output torque and speed of the motor remain unchanged during motion. Precisely control the pitch, loudness and timbre of your sounds.
It achieves precise control of sound during motor movement, improving the user's listening experience and comfort while avoiding additional energy consumption and weight increase.
Smart Images

Figure CN118659699A
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor technology, and in particular to a method and device for controlling the sound generation of a motor. Background Art
[0002] In order to facilitate users to use electrical appliances, smart terminals and other products, sound prompt devices are added to the products. However, since traditional sound prompt devices generally need to be sealed to be dust-proof and waterproof, on the one hand, the weight and cost of the smart terminal are increased. On the other hand, the sealing treatment has a great impact on the outward propagation of sound. It is necessary to increase the audio input power to increase the signal strength to increase the sound propagation distance, thereby increasing energy consumption.
[0003] The prior art proposes to replace the traditional sound prompt device by controlling the sound of the motor, but this method cannot accurately control the pitch, loudness, and timbre of the sound emitted by the motor; and it is impossible to maintain accurate control of the motor output torque / speed when the motor is moving, which is not conducive to improving the user experience.
[0004] Therefore, it is particularly important to provide a method for controlling the sound of a motor, which can accurately control the pitch, loudness and timbre of the sound emitted by the motor, and keep the motor output torque / speed unchanged when the motor emits sound in a moving state. Summary of the invention
[0005] In order to solve the above technical problems, the present application proposes a method and device for controlling the sound of a motor.
[0006] On the one hand, an embodiment of the present application provides a method for controlling the sound of a motor, the method comprising:
[0007] In response to a motor sounding instruction carrying multimedia data, decomposing the multimedia data into a preset number of target sounds;
[0008] Controlling first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information comprising at least one of sound length, pitch, and timbre;
[0009] Controlling second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, the second attribute information representing the loudness of the target sound;
[0010] Based on the first attribute information and the second attribute information, the motor is controlled to make sounds in different states, and the different states include a motion state.
[0011] Furthermore, the pulse width modulation frequency includes at least one of a fundamental frequency, a harmonic frequency, and a high frequency frequency.
[0012] Further, controlling the first attribute information of the target sound based on the pulse width modulation frequency includes:
[0013] controlling the pitch of the target sound based on the fundamental frequency;
[0014] Controlling the timbre of a target sound based on harmonic frequencies;
[0015] The duration of the target sound is controlled based on the fundamental frequency, harmonic frequencies, and high-frequency sounds.
[0016] Further, a ratio of a duration of the fundamental frequency to a duration of the harmonic frequency is determined based on the multimedia data.
[0017] Further, the duration of the target sound is controlled based on the fundamental frequency, the harmonic frequency and the high frequency sound, including:
[0018] Determining a duration of the fundamental frequency based on the fundamental frequency, the number of operations of the fundamental frequency, and the ratio;
[0019] Determining the duration of the harmonic frequency based on the harmonic frequency, the number of operations of the harmonic frequency, and the ratio;
[0020] Determining the duration of the high frequency sound based on the high frequency sound and the number of operations of the high frequency sound;
[0021] The sound duration of the target sound is determined based on the duration of the fundamental frequency, the duration of the harmonic frequency, and the duration of the high frequency sound.
[0022] Further, the quadrature-axis current includes a preset quadrature-axis current and a target quadrature-axis current; the direct-axis current includes a target direct-axis current; and the second attribute information of the target sound controlled based on the direct-axis current and the quadrature-axis current of the motor includes:
[0023] Obtaining a preset target current;
[0024] Based on the relationship between the preset target current and the preset quadrature-axis current, a target direct-axis current and a target quadrature-axis current are determined, and second attribute information of the target sound is determined based on the target direct-axis current and the target quadrature-axis current.
[0025] Further, based on the relationship between the preset target current and the preset quadrature-axis current, determining the target direct-axis current and the target quadrature-axis current includes:
[0026] When the preset quadrature-axis current is greater than or equal to the preset target current, the target direct-axis current is determined to be zero, and the target quadrature-axis current is determined to be non-zero.
[0027] Further, based on the relationship between the preset target current and the preset quadrature-axis current, determining the target direct-axis current and the target quadrature-axis current includes:
[0028] When the preset quadrature-axis current is less than the target current, it is determined that the target direct-axis current is not zero, and it is determined that the target quadrature-axis current is not zero.
[0029] Further, controlling the motor to make sounds in different states based on the first attribute information and the second attribute information includes:
[0030] Acquire a first control signal based on the first attribute information;
[0031] acquiring a second control signal based on the second attribute information;
[0032] The motor is controlled to make sounds in different states based on the first control signal and the second control signal.
[0033] On the other hand, the embodiment of the present application further provides a device for controlling the sound of a motor, the device comprising:
[0034] A motor sound command processing module, for responding to a motor sound command carrying multimedia data and decomposing the multimedia data into a preset number of target sounds;
[0035] A first attribute control module, used to control first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information including at least one of sound length, pitch and timbre;
[0036] A second attribute control module, used to control second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, the second attribute information representing the loudness of the target sound;
[0037] The motor sound control module is used to control the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include the motion state.
[0038] Furthermore, the first attribute control module includes a pulse width modulation frequency unit; the pulse width modulation frequency includes at least one of a fundamental frequency, a harmonic frequency, and a high frequency sound.
[0039] Furthermore, the first attribute control module includes:
[0040] A pitch control unit for controlling the pitch of the target sound based on the fundamental frequency;
[0041] A timbre control unit for controlling the timbre of a target sound based on the harmonic frequency;
[0042] The tone length control unit is used to control the tone length of the target sound based on the fundamental frequency, harmonic frequency and high-frequency sound.
[0043] Furthermore, the tone length control unit also includes:
[0044] The ratio determination unit of the duration of the fundamental frequency and the duration of the harmonic frequency is used to determine the ratio of the duration of the fundamental frequency and the duration of the harmonic frequency based on the multimedia data.
[0045] Furthermore, the tone length control unit also includes:
[0046] A fundamental frequency duration determination unit, used to determine the duration of the fundamental frequency based on the fundamental frequency, the running number and the ratio of the fundamental frequency;
[0047] A duration determination unit of a fundamental frequency, for determining the duration of a harmonic frequency based on the harmonic frequency, the number of operations of the harmonic frequency, and the ratio;
[0048] A high-frequency sound duration determination unit, used to determine the duration of the high-frequency sound based on the high-frequency sound and the number of operations of the high-frequency sound;
[0049] The sound length determination unit is used to determine the sound length of the target sound based on the duration of the fundamental frequency, the duration of the harmonic frequency and the duration of the high frequency sound.
[0050] Further, the quadrature-axis current includes a preset quadrature-axis current and a target quadrature-axis current; the direct-axis current includes a target direct-axis current, and the second attribute information control module includes:
[0051] A preset current acquisition unit, used to acquire a preset target current;
[0052] The second attribute information determining unit is used to determine the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current, and determine the second attribute information of the target sound based on the target direct-axis current and the target quadrature-axis current.
[0053] Furthermore, the second attribute information determining unit includes:
[0054] a target direct-axis current and target quadrature-axis current confirmation unit, configured to determine that the target direct-axis current is zero when the preset quadrature-axis current is greater than or equal to the preset target current, and to determine that the target quadrature-axis current is not zero;
[0055] Further, the target direct-axis current and target quadrature-axis current confirmation unit is further configured to determine that the target direct-axis current is not zero when the preset quadrature-axis current is less than the target current, and to determine that the target quadrature-axis current is not zero.
[0056] Furthermore, the motor sound control module includes:
[0057] A first control signal acquisition unit, configured to acquire a first control signal based on the first attribute information;
[0058] A second control signal acquisition unit, configured to acquire a second control signal based on the second attribute information;
[0059] The control electroacoustic sound generating unit is used to control the motor to generate sound in different states based on the first control signal and the second control signal.
[0060] On the other hand, an embodiment of the present application also provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the method for controlling the sound of a motor as described above.
[0061] On the other hand, an embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by a processor to implement the method for controlling the sound of a motor as described above.
[0062] On the other hand, an embodiment of the present application further provides a computer program product, which implements the above-mentioned method for controlling the sound of a motor when the computer program is executed by a processor.
[0063] The method and device for controlling the sound of a motor proposed in the embodiment of the present application respond to the motor sound command carrying multimedia data, decompose the multimedia data into a preset number of target sounds; control the first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information includes at least one of the sound length, pitch, and timbre; control the second attribute information of the target sound based on the direct-axis current and quadrature-axis current of the motor so that the output torque and speed of the motor remain unchanged, and the second attribute information represents the loudness of the target sound; control the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include the motion state. This method is used to achieve the sound of the motor in the motion state, and the pitch, loudness and timbre of the sound emitted by the motor can be accurately controlled while keeping the output torque and speed of the motor unchanged, thereby improving the user's auditory experience and comfort. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0065] Figure 1 The figure is a schematic diagram of an implementation environment of a method for controlling the sound of a motor according to an exemplary embodiment.
[0066] Figure 2The figure is a flow chart of a method for controlling the sound of a motor according to an exemplary embodiment.
[0067] Figure 3 The figure is a schematic diagram of multimedia data decomposition according to an exemplary embodiment.
[0068] Figure 4 is a principle block diagram of vector control according to an exemplary embodiment.
[0069] Figure 5 is a schematic diagram showing target sound composition according to an exemplary embodiment.
[0070] Figure 6 The figure is a flowchart of a method for determining second attribute information according to an exemplary embodiment.
[0071] Figure 7 The present invention is a flowchart of a method for controlling the sound of a motor based on first attribute information and second attribute information according to an exemplary embodiment.
[0072] Figure 8 The figure is a block diagram of a device for controlling the sound generation of a motor according to an exemplary embodiment.
[0073] Fig. 9 The present invention is a hardware structure block diagram of a computer for controlling a method for making a sound of a motor according to an exemplary embodiment. DETAILED DESCRIPTION
[0074] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0075] It should be noted that the terms "first", "second", etc. in the specification and claims of the embodiment of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the embodiment of the present application described here can be implemented in an order other than those illustrated or described here. Thus, the features defined as "first" and "second" can expressly or implicitly include one or more of the features. In the description of the present embodiment, unless otherwise specified, the meaning of "multiple" is two or more. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0076] In order to make the purpose, technical solution and advantages disclosed in the embodiments of the present application more clearly understood, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application and are not used to limit the embodiments of the present application.
[0077] Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a method for controlling the sound of a motor according to an exemplary embodiment. Figure 1 As shown, the implementation environment may include at least an electric device 01 and a motor 02. The electric device 01 and the motor 02 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present application.
[0078] Specifically, the electric device 01 is provided with a motor 02, and a voice command can be issued to the motor 02. Optionally, the electric device 01 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, an intelligent voice interaction device, a smart home appliance, a smart watch, a vehicle terminal, an aircraft, a range hood, an integrated stove, etc., but not limited to this. The embodiments of the present application are applied to various scenarios, including but not limited to the control of motor sound involved in various types of electric devices provided with motors. Optionally, the type of the motor 01 can be a DC motor, an asynchronous motor, a synchronous motor, etc., but not limited to this.
[0079] Specifically, the motor 02 is used to control the operation of the electric device 01, and the electric device 01 can be used to respond to a motor sound instruction carrying multimedia data, decompose the multimedia data into a preset number of target sounds; control the first attribute information of the target sound based on the pulse width modulation frequency, and the first attribute information includes at least one of the sound length, pitch, and timbre; control the second attribute information of the target sound based on the direct-axis current and quadrature-axis current of the motor so that the output torque and speed of the motor remain unchanged, and the second attribute information represents the loudness of the target sound; control the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include motion states.
[0080] Specifically, the functions of the sound produced by the motor 02 include but are not limited to entertainment, safety reminders, fault detection, operating status monitoring, communication and coordination, attention reminders, and sounds that cannot be produced using other sound-generating devices.
[0081] It should be noted that Figure 1 This is just an example. In other scenarios, other implementation environments may also be included.
[0082] Figure 2 It is a flowchart of a method for controlling the sound of a motor according to an exemplary embodiment. This specification provides method operation steps as described in the embodiment or flowchart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual system or server product is executed, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0083] The following further describes the embodiments of the present invention by taking an electronic device as an example. Figure 2 As shown, the method may include:
[0084] S10: In response to the motor sound generation instruction carrying multimedia data, the multimedia data is decomposed into a preset number of target sounds.
[0085] In an exemplary embodiment, Figure 3 As shown, when the electronic device receives a motor sound instruction, the received motor sound instruction carries multimedia data. The electronic device extracts sound information from the multimedia data and decomposes the extracted sound information into a preset number of target sounds.
[0086] Alternatively, if Figure 4As shown, the control method of the present application is based on a vector control (FOC control) block diagram, and the electronic device responds to a motor sound instruction carrying multimedia data, and decomposes the multimedia data into a preset number of target sounds in the multimedia data setting of the FOC block diagram.
[0087] Optionally, the multimedia data includes but is not limited to music, audio data, video carrying music and / or audio data, etc.
[0088] Optionally, the number of target sounds, ie, the preset number, is determined according to the sound information extracted by the electronic device itself, that is, the number of target sounds will be different if the multimedia data set by the user is different.
[0089] Optionally, the motor may be a permanent-magnet synchronous motor (PMSM), which refers to a synchronous motor that generates a synchronous rotating magnetic field by excitation of a permanent magnet.
[0090] Optionally, the preset number is greater than or equal to two.
[0091] S20: controlling first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information including at least one of sound length, pitch, and timbre;
[0092] The "three elements" of sound refer to loudness, pitch and timbre. Sound is a sound wave generated by the vibration of an object; it is a wave phenomenon that is transmitted through a medium (air or solid, liquid) and can be perceived by the auditory organs of humans or animals. Loudness: refers to the strength of sound perceived by the human ear, that is, the degree of loudness of the sound. Based on it, the sounds can be arranged in a sequence from light to loud. The size of the loudness mainly depends on the sound intensity and frequency. The larger the amplitude, the louder the loudness. The smaller the distance between the person and the sound source, the louder the loudness. Pitch: The height of the sound is determined by the frequency. The higher the frequency, the higher the pitch. The human ear's hearing range is 20-20000Hz; below 20Hz is called infrasound, and above 20000Hz is called ultrasound. Tone: audio overtone or harmonic component, that is, the harmonic component based on the pitch.
[0093] In an exemplary embodiment, the first attribute information of the target sound is determined according to the pulse width modulation frequency (PWM) of the motor, and the first attribute information includes at least one of the sound length, pitch, and timbre.
[0094] Exemplarily, the sound duration represents the duration of a target sound.
[0095] Optionally, controlling the first attribute information of the target sound based on the pulse width modulation frequency is performed in a pitch / timbre controller in the FOC block diagram.
[0096] S30: controlling second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, the second attribute information representing the loudness of the target sound;
[0097] In an exemplary embodiment, the direct axis current refers to the d axis current, and the quadrature axis current refers to the q axis current. The d axis refers to the d coordinate axis in a two-phase stationary coordinate system (i.e., a stationary dq coordinate system), and the q axis refers to the q coordinate axis in the stationary dq coordinate system. The stationary dq coordinate system is commonly used to describe the motion of a three-phase alternating current system.
[0098] Specifically, the second attribute information standardizes the loudness of the target sound.
[0099] For example, after the electronic device obtains the direct-axis current and quadrature-axis current of the motor, the loudness of the target sound is controlled based on the direct-axis current and the quadrature-axis current. This method can ensure that the output torque and speed of the motor are not affected when the motor makes a sound, that is, the output torque and speed of the motor remain unchanged.
[0100] Optionally, controlling the second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor is performed in a loudness controller of the FOC control block diagram.
[0101] S40: Based on the first attribute information and the second attribute information, the motor is controlled to make sounds in different states, and the different states include a motion state.
[0102] In an exemplary embodiment, after the electronic device obtains the first attribute information and the second attribute information, that is, after the electronic device obtains the loudness, pitch, timbre and sound length of a preset number of target sounds, the motor is controlled to make sounds based on the obtained first attribute information and the second attribute information. The motor can make sounds in different states, including but not limited to motion state, stationary state, maintenance state, etc.
[0103] The above method decomposes multimedia data into a preset number of target sounds by responding to a motor sounding instruction carrying multimedia data; controls the first attribute information of the target sound based on the pulse width modulation frequency; controls the second attribute information of the target sound based on the direct axis current and quadrature axis current of the motor so that the output torque and speed of the motor remain unchanged; and controls the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include the motion state. The method is used to realize the motor making sounds in the motion state, and the pitch, loudness and timbre of the sound emitted by the motor can be precisely controlled while keeping the output torque and speed of the motor unchanged, thereby improving the user's auditory experience and comfort.
[0104] As an optional implementation, the pulse width modulation frequency includes at least one of a fundamental frequency, a harmonic frequency, and a high-frequency sound.
[0105] Exemplarily, the pulse width modulation frequency (PWM frequency) includes the fundamental frequency f base , harmonic frequency f har , high frequency sound f high At least one of the following. Wherein, the fundamental frequency f base The range is 400-20000Hz, accounting for the main part of the sound; the harmonic frequency f har The range is 400-20000Hz; high frequency sound f high , the frequency range is above 20000Hz and cannot be heard by human ears.
[0106] As an optional implementation, in the above step S20, the first attribute information of the target sound controlled based on the pulse width modulation frequency includes:
[0107] The pitch of the target sound is controlled based on the fundamental frequency; the timbre of the target sound is controlled based on the harmonic frequency; and the duration of the target sound is controlled based on the fundamental frequency, the harmonic frequency and the high frequency sound.
[0108] Exemplarily, the first attribute information of controlling the target sound based on the pulse width modulation frequency includes controlling the pitch of the target sound based on the fundamental frequency, where the fundamental frequency is the lowest frequency in the sound signal. Specifically, the higher the fundamental frequency, the sharper the sound sounds, and the lower the fundamental frequency, the deeper the sound sounds. If you want to control the motor to emit different tones, this is achieved by controlling the fundamental frequency.
[0109] Exemplarily, the first attribute information of controlling the target sound based on the pulse width modulation frequency includes controlling the timbre of the target sound based on the harmonic frequency. The timbre characterizes the characteristics and texture of the sound, so that different instruments or sounds can be distinguished even at the same pitch and loudness. The timbre is mainly composed of the harmonics of the sound, that is, the integer multiple frequencies of the fundamental frequency. At different harmonic frequencies, the timbre is naturally different. If you want to control the motor to emit different timbres, you can achieve this by controlling the harmonic frequency.
[0110] Exemplarily, the first attribute information of controlling the target sound based on the pulse width modulation frequency includes controlling the sound length of the target sound based on the fundamental frequency, the harmonic frequency and the high frequency sound. The sound length refers to the duration of the sound. In the processing of the target sound, the sound length is an important element for controlling the rhythm and expression.
[0111] Optionally, the adjustment method of the tone length includes but is not limited to changing the duration of the sound without changing the pitch through a time expansion algorithm (such as Phase Vocoder, WSOLA, etc.); and keeping the fundamental frequency and the overall pitch unchanged while adjusting the tone length.
[0112] Optionally, in the above steps, the fundamental frequency f base There is only one harmonic frequency f har There are many kinds of high-frequency sound f high There is one and only one.
[0113] Alternatively, if Figure 5 As shown, within the sound length of a target sound, the fundamental frequency, harmonic frequency, and high-frequency sound are arranged in sequence.
[0114] Optionally, within the sound length of a target sound, the fundamental frequency must exist, and the harmonic frequencies and high-frequency sounds may optionally exist.
[0115] It should be noted that the above process only describes the control process of the first attribute information of one target sound. In actual application, a preset number of target sounds are included, and the control method is similar to the above method, which will not be repeated here.
[0116] The above method controls the pitch of the target sound through the fundamental frequency, controls the timbre of the target sound through the harmonic frequency, and controls the duration of the target sound through the fundamental frequency, harmonic frequency and high-frequency sound. This method enables the motor to make sounds while in motion, and precisely controls the pitch, loudness and timbre of the sound emitted by the motor, thereby improving the user's auditory experience and comfort.
[0117] As an optional implementation, the method further includes: determining a ratio between a duration of the fundamental frequency and a duration of the harmonic frequency based on the multimedia data.
[0118] For example, the duration of a fundamental frequency generally refers to the duration of the fundamental frequency continuously sounding in a target sound, and the duration of a harmonic frequency generally refers to the duration of the harmonic frequency continuously sounding in a target sound.
[0119] For example, the duration of the fundamental frequency and the duration of the harmonic frequency satisfy a specific ratio k, and the specific ratio k is determined by the sound information in the multimedia data. That is, when the target sound is different, the ratio k is naturally different.
[0120] Optionally, the ratio k satisfies:
[0121]
[0122] Where n base Indicates the number of fundamental frequency runs within a tone length, n har Indicates the number of harmonic frequencies running within one tone length.
[0123] Optionally, the running number of the fundamental frequency refers to the number of times the fundamental frequency is sounded within a certain period of time, and the running number of the harmonic frequency refers to the number of times the harmonic is sounded within a certain period of time.
[0124] As an optional implementation, in the above steps, controlling the length of the target sound based on the fundamental frequency, harmonic frequency and high-frequency sound includes:
[0125] 1. Determine the duration of the fundamental frequency based on the fundamental frequency, the number of operations of the fundamental frequency and the ratio.
[0126] For example, after determining the ratio of the duration of the fundamental frequency to the duration of the harmonic frequency, the duration t of the fundamental frequency can be calculated. base , the calculation formula is as follows:
[0127]
[0128] Optionally, the duration of the optimal fundamental frequency is calculated as follows:
[0129]
[0130] 2. Determine the duration of the harmonic frequency based on the harmonic frequency, the number of operations of the harmonic frequency and the ratio.
[0131] For example, after determining the ratio of the duration of the fundamental frequency to the duration of the harmonic frequency, the duration t of the harmonic frequency can be calculated. har , the calculation formula is as follows:
[0132]
[0133] Optionally, the duration of the optimal harmonic frequency is calculated as:
[0134]
[0135] 3. Determine the duration of the high-frequency sound based on the high-frequency sound and the number of high-frequency sound operations.
[0136] For example, the duration of the high-frequency sound is high satisfy:
[0137]
[0138] Where n high Indicates the number of high-frequency sounds running within a certain period of time.
[0139] 4. Determine the duration of the target sound based on the duration of the fundamental frequency, the duration of the harmonic frequency, and the duration of the high frequency sound.
[0140] For example, the duration of a target sound is the sum of the duration of the fundamental frequency, the duration of the harmonic frequency and the duration of the high-frequency sound, that is, the duration t note satisfy:
[0141] t note =t base +t har +t high ;
[0142] The above method is used to determine the length of the target music, and this method is used to achieve the sound of the motor in a moving state. It is an important step to achieve precise control of the pitch, loudness and timbre of the sound emitted by the motor, making the sound emitted by the motor more rhythmic and improving the user's auditory experience and comfort.
[0143] As an optional implementation manner, the quadrature-axis current includes a preset quadrature-axis current and a target quadrature-axis current; the direct-axis current includes a target direct-axis current; Figure 6 As shown, in the above step S30, the second attribute information of the target sound controlled based on the direct-axis current and quadrature-axis current of the motor includes:
[0144] S31: Obtaining a preset target current.
[0145] For example, taking an electronic device as an example, Figure 4 As shown, after acquiring the target sound, the loudness controller outputs a preset target current I based on the target sound. 响度 , preset target current I 响度 The current intensity required to meet the loudness requirements.
[0146] S32: Determine a target direct-axis current and a target quadrature-axis current based on a relationship between a preset target current and a preset quadrature-axis current, and determine second attribute information of a target sound based on the target direct-axis current and the target quadrature-axis current.
[0147] Exemplarily, the quadrature-axis current includes a preset quadrature-axis current i q and the target quadrature axis current i q * ; The direct-axis circuit includes the target direct-axis current i d * .like Figure 4 As shown, after the electronic device obtains the target sound, the loudness controller will also output a preset quadrature-axis current i q and the preset direct axis current i d At this time, the target direct-axis current and the target quadrature-axis current are determined according to the relationship between the preset target current and the preset quadrature-axis current, and then the loudness of the target sound is determined based on the target direct-axis current and the target quadrature-axis current, that is, the loudness of the motor sound is controlled.
[0148] Exemplarily, the preset quadrature-axis current is also called quadrature-axis feedback current, which is a feedback value of the q-axis current and is also a target current value of the q-axis corresponding to the preset target current.
[0149] The target quadrature-axis current is also called the quadrature-axis given current, which refers to the current component perpendicular to the rotor magnetic field and is a given q-axis current value, that is, a preset q-axis current value.
[0150] The preset direct-axis current is also called the direct-axis feedback current, which is a feedback value of the d-axis current and is also a target current value of the d-axis corresponding to the preset target current.
[0151] The target direct-axis current is also called the direct-axis given current, which refers to the current component parallel to the rotor magnetic field and is a given d-axis current value, that is, a preset d-axis current value.
[0152] The above method is used to determine the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current, and control the loudness of the motor sound based on the target direct-axis current and the target quadrature-axis current, thereby achieving precise control of the loudness of the sound emitted by the motor and improving the user's auditory experience and comfort.
[0153] As an optional implementation manner, in the above step S32, determining the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current includes:
[0154] When the preset quadrature-axis current is greater than or equal to the preset target current, the target direct-axis current is determined to be zero, and the target quadrature-axis current is determined to be non-zero.
[0155] For example, when the quadrature axis current i q ≥I 响度 , determine that the d-axis current is 0, that is, the d-axis does not allocate current, and the preset quadrature-axis current and the preset target current meet:
[0156]
[0157] At this time, the fundamental frequency and harmonic frequency time satisfy the above formula, and the rest of the time is allocated to high-frequency sound, that is, the time of high-frequency sound satisfies:
[0158]
[0159] At this time, the loudness of the sound produced by the motor is controlled based on the target quadrature-axis current.
[0160] As an optional embodiment, in the above step S32, determining the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current includes:
[0161] When the preset quadrature-axis current is less than the target current, it is determined that the target direct-axis current is not zero, and it is determined that the target quadrature-axis current is not zero.
[0162] For example, when the quadrature axis current i q <I 响度 , determine that the target direct-axis current is not zero, and determine that the target quadrature-axis current is not zero. At this time, the preset target current and the preset quadrature-axis current and the preset direct-axis current satisfy the following:
[0163]
[0164] Optionally, in this case, the fundamental frequency and harmonic frequency still exist, but there is no high-frequency sound, and the tone length satisfies:
[0165]
[0166] At this time, the loudness of the sound generated by the motor is controlled based on the d-axis current and the q-axis current.
[0167] The above method is used to determine the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current, and control the loudness of the motor sound based on the target direct-axis current and the target quadrature-axis current. The specific method of loudness control in different situations is determined, and precise control of the loudness of the sound emitted by the motor is achieved, thereby improving the user's auditory experience and comfort.
[0168] As an optional implementation, Figure 7 As shown, in the above step S40, the above-mentioned controlling the motor to make sounds in different states based on the first attribute information and the second attribute information includes:
[0169] S41: Acquire a first control signal based on first attribute information.
[0170] For example, Figure 4 As shown, after the pitch and timbre information is acquired based on the pitch / timbre controller, it is input into the space vector pulse width modulation (SVPWM) for modulation and outputs a PWM (Pulse width modulation) waveform signal, thereby controlling the on and off of the switching tube in the three-phase bridge to invert the DC voltage into a sinusoidal voltage signal and acquire the first control signal.
[0171] Optionally, the three-phase currents are sampled simultaneously to obtain the current components i in the three-phase stationary coordinate system: a 、i b 、i c , and for i a 、i b 、i cPerform Clark transformation to obtain the current component i in the two-phase stationary coordinate system α 、i β ; Based on the position and velocity estimator, i α 、i β The angle increment w is calculated and represents the magnetic field rotation amplitude of the stator magnetic field of the motor. Then i α 、i β Perform Park transformation to obtain the current component i in the synchronous rotating coordinate system d 、i q .
[0172] S42: Acquire a second control signal based on the second attribute information.
[0173] Exemplarily, based on the i obtained in step S41 above d 、i q and the loudness controller output i d * 、i q * Processed in PI controller (PI-Controller, linear controller), the quadrature axis given voltage V is obtained q and the direct axis given voltage V d Then, the quadrature axis given voltage Vα and the direct axis given voltage Vβ are inversely transformed by park to obtain the current component V in the two-phase stationary coordinate system. α and V β , and then input it into the space vector pulse width modulation (SVPWM) for modulation and output a PWM (Pulse width modulation) waveform signal, so as to control the on and off of the switching tube in the three-phase bridge, invert the DC voltage into a sinusoidal voltage signal, and obtain the second control signal.
[0174] S43: Controlling the motor to make sounds in different states based on the first control signal and the second control signal.
[0175] Exemplarily, after obtaining the first control signal and the second control signal, the three-phase current is sampled to obtain the current component i in the three-phase stationary coordinate system. a 、i b 、i c , based on i a 、i b 、i c Control the state of the motor and control the motor to make sounds in different states.
[0176] The above method realizes controlling the state of the motor and controlling the motor to make sounds in different states by obtaining the first control signal and the second control signal, and can accurately control the pitch, loudness and timbre of the sound emitted by the motor while keeping the output torque and speed of the motor unchanged, thereby improving the user's auditory experience and comfort.
[0177] It should be noted that the above embodiments are described by taking electronic devices as an example, but the technical solution of the present application is not limited to electronic devices.
[0178] The following is an overall description of the method for controlling the sound of a motor provided in an embodiment of the present application, the method comprising:
[0179] Step 1: multimedia data processing. In response to the motor sounding instruction carrying multimedia data, the multimedia data is decomposed into a preset number of target sounds;
[0180] Step 2: Determine the first attribute information. The first attribute information of the target sound is controlled based on the pulse width modulation frequency, and the first attribute information includes at least one of the sound length, pitch, and timbre. Specifically, the pitch of the target sound is controlled based on the fundamental frequency; the timbre of the target sound is controlled based on the harmonic frequency; and the sound length of the target sound is controlled based on the fundamental frequency, the harmonic frequency, and the high-frequency sound.
[0181] Step 3: Determine the second attribute information. The second attribute information of the target sound is controlled based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, and the second attribute information represents the loudness of the target sound. Specifically, the target direct-axis current and the target quadrature-axis current are determined by the relationship between the preset target current and the preset quadrature-axis current, and the second attribute information of the target sound is determined based on the target direct-axis current and the target quadrature-axis current.
[0182] Step 4: Control the motor to make sounds. Based on the first attribute information and the second attribute information, control the motor to make sounds in different states, including motion states. Obtain a first control signal based on the first attribute information; obtain a second control signal based on the second attribute information; and control the motor to make sounds in different states based on the first control signal and the second control signal.
[0183] The embodiment of the present application also provides a device for controlling the sound generation of a motor. Figure 8 is a block diagram of a device for controlling the sound generation of a motor according to an exemplary embodiment. Figure 8 As shown, the device may include at least:
[0184] The motor sound instruction processing module 301 is used to respond to the motor sound instruction carrying multimedia data and decompose the multimedia data into a preset number of target sounds;
[0185] A first attribute control module 303, used to control first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information including at least one of sound length, pitch and timbre;
[0186] A second attribute control module 305, for controlling the second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, the second attribute information representing the loudness of the target sound;
[0187] The motor sound control module 307 is used to control the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include motion states.
[0188] Furthermore, the first attribute control module includes a pulse width modulation frequency unit; the pulse width modulation frequency includes at least one of a fundamental frequency, a harmonic frequency, and a high frequency sound.
[0189] Furthermore, the first attribute control module includes:
[0190] A pitch control unit for controlling the pitch of the target sound based on the fundamental frequency;
[0191] A timbre control unit for controlling the timbre of a target sound based on the harmonic frequency;
[0192] The tone length control unit is used to control the tone length of the target sound based on the fundamental frequency, harmonic frequency and high-frequency sound.
[0193] Furthermore, the tone length control unit also includes:
[0194] The ratio determination unit of the duration of the fundamental frequency and the duration of the harmonic frequency is used to determine the ratio of the duration of the fundamental frequency and the duration of the harmonic frequency based on the multimedia data.
[0195] Furthermore, the tone length control unit also includes:
[0196] A fundamental frequency duration determination unit, used to determine the duration of the fundamental frequency based on the fundamental frequency, the running number and the ratio of the fundamental frequency;
[0197] A duration determination unit of a fundamental frequency, for determining the duration of a harmonic frequency based on the harmonic frequency, the number of operations of the harmonic frequency, and the ratio;
[0198] A high-frequency sound duration determination unit, used to determine the duration of the high-frequency sound based on the high-frequency sound and the number of operations of the high-frequency sound;
[0199] The sound length determination unit is used to determine the sound length of the target sound based on the duration of the fundamental frequency, the duration of the harmonic frequency and the duration of the high frequency sound.
[0200] Further, the quadrature-axis current includes a preset quadrature-axis current and a target quadrature-axis current; the direct-axis current includes a target direct-axis current, and the second attribute information control module includes:
[0201] A preset current acquisition unit, used to acquire a preset target current;
[0202] The second attribute information determining unit is used to determine the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current, and determine the second attribute information of the target sound based on the target direct-axis current and the target quadrature-axis current.
[0203] Furthermore, the second attribute information determining unit includes:
[0204] a target direct-axis current and target quadrature-axis current confirmation unit, configured to determine that the target direct-axis current is zero when the preset quadrature-axis current is greater than or equal to the preset target current, and to determine that the target quadrature-axis current is not zero;
[0205] Further, the target direct-axis current and target quadrature-axis current confirmation unit is further configured to determine that the target direct-axis current is not zero when the preset quadrature-axis current is less than the target current, and to determine that the target quadrature-axis current is not zero.
[0206] Furthermore, the motor sound control module includes:
[0207] A first control signal acquisition unit, configured to acquire a first control signal based on the first attribute information;
[0208] A second control signal acquisition unit, configured to acquire a second control signal based on the second attribute information;
[0209] The control electroacoustic sound generating unit is used to control the motor to generate sound in different states based on the first control signal and the second control signal.
[0210] It should be noted that the embodiment of the motor sound control device provided in the embodiment of the present application and the above-mentioned motor sound control method embodiment are based on the same inventive concept.
[0211] An embodiment of the present application also provides an electronic device for controlling the sound of a motor, the electronic device comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or at least one program being loaded and executed by the processor to implement a method for controlling the sound of a motor as provided in any of the above embodiments.
[0212] An embodiment of the present application also provides a computer-readable storage medium, which can be set in a terminal to store at least one instruction or at least one program for implementing the method for controlling the sound of a motor in a method embodiment, and the at least one instruction or at least one program is loaded and executed by a processor to implement the method for controlling the sound of a motor as provided in the above method embodiment.
[0213] Optionally, in the embodiment of this specification, the storage medium may be located in at least one of the multiple network servers of the computer network. Optionally, in this embodiment, the above storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0214] The memory of the embodiment of this specification can be used to store software programs and modules, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, applications required for functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory may also include a memory controller to provide the processor with access to the memory.
[0215] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method for controlling the sound of the motor provided in the above method embodiment.
[0216] The method embodiments provided in the embodiments of the present application can be executed in a terminal, a computer terminal, a server or a similar computing device. Taking running on a server as an example, Fig. 9 FIG. 1 is a hardware structure block diagram of a server for controlling a motor sound generation method according to an exemplary embodiment. Fig. 9As shown, the server 400 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 410 (the central processing unit 410 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 430 for storing data, and one or more storage media 420 (such as one or more mass storage devices) for storing application programs 423 or data 422. Among them, the memory 430 and the storage medium 420 can be short-term storage or permanent storage. The program stored in the storage medium 420 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 410 can be configured to communicate with the storage medium 420 and execute a series of instruction operations in the storage medium 420 on the server 400. The server 400 may also include one or more power supplies 460, one or more wired or wireless network interfaces 450, one or more input and output interfaces 440, and / or one or more operating systems 421, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0217] The input / output interface 440 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 400. In one example, the input / output interface 440 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices via a base station so as to communicate with the Internet. In one example, the input / output interface 440 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0218] It can be understood by those skilled in the art that Fig. 9 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig. 9 More or fewer components as shown, or with Fig. 9 Different configurations are shown.
[0219] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0220] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and server embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0221] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0222] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A method for controlling the sound of a motor, characterized in that: The method comprises: In response to a motor sounding instruction carrying multimedia data, decomposing the multimedia data into a preset number of target sounds; Controlling first attribute information of the target sound based on the pulse width modulation frequency, the first attribute information including at least one of sound length, pitch, and timbre; controlling second attribute information of the target sound based on the direct-axis current and the quadrature-axis current of the motor so that the output torque and the speed of the motor remain unchanged, wherein the second attribute information represents the loudness of the target sound; The motor is controlled to make sounds in different states based on the first attribute information and the second attribute information, and the different states include a motion state.
2. The method for controlling the sound of a motor according to claim 1, characterized in that: The pulse width modulation frequency includes at least one of a fundamental frequency, a harmonic frequency, and a high frequency frequency.
3. The method for controlling the motor to make sound according to claim 2, characterized in that: The first attribute information of the target sound is controlled based on the pulse width modulation frequency, including: controlling the pitch of the target sound based on the fundamental frequency; controlling the timbre of the target sound based on the harmonic frequency; The sound length of the target sound is controlled based on the fundamental frequency, the harmonic frequency, and the high-frequency sound.
4. The method for controlling the motor to produce sound according to claim 3, characterized in that: The method further comprises: A ratio of the duration of the fundamental frequency to the duration of the harmonic frequencies is determined based on the multimedia data.
5. The method for controlling the motor to produce sound according to claim 4, characterized in that: The controlling the sound length of the target sound based on the fundamental frequency, the harmonic frequency and the high-frequency sound comprises: Determining a duration of the pitch frequency based on the pitch frequency, the number of operations of the pitch frequency, and the ratio; determining a duration of the harmonic frequency based on the harmonic frequency, the number of operations of the harmonic frequency, and the ratio; determining a duration of the high-frequency sound based on the high-frequency sound and the number of operations of the high-frequency sound; The sound duration of the target sound is determined based on the duration of the fundamental frequency, the duration of the harmonic frequency, and the duration of the high-frequency sound.
6. The method for controlling the motor to produce sound according to claim 1, characterized in that: The quadrature-axis current includes a preset quadrature-axis current and a target quadrature-axis current; The direct-axis current includes a target direct-axis current; The second attribute information of controlling the target sound based on the direct-axis current and the quadrature-axis current of the motor includes: Obtaining a preset target current; Based on the relationship between the preset target current and the preset quadrature-axis current, the target direct-axis current and the target quadrature-axis current are determined, and based on the target direct-axis current and the target quadrature-axis current, second attribute information of the target sound is determined.
7. The method for controlling the sound of a motor according to claim 6, characterized in that: The determining the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current comprises: When the preset quadrature-axis current is greater than or equal to the preset target current, the target direct-axis current is determined to be zero, and the target quadrature-axis current is determined to be non-zero.
8. The method for controlling the motor to produce sound according to claim 6, characterized in that: The determining the target direct-axis current and the target quadrature-axis current based on the relationship between the preset target current and the preset quadrature-axis current comprises: When the preset quadrature-axis current is less than the target current, it is determined that the target direct-axis current is not zero, and it is determined that the target quadrature-axis current is not zero.
9. The method for controlling the motor to produce sound according to claim 1, characterized in that: Controlling the motor to make sounds in different states based on the first attribute information and the second attribute information includes: Acquire a first control signal based on the first attribute information; Acquire a second control signal based on the second attribute information; The motor is controlled to generate sound in different states based on the first control signal and the second control signal.
10. A device for controlling the sound generation of a motor, characterized in that: The device comprises: A motor sound instruction processing module, for responding to a motor sound instruction carrying multimedia data and decomposing the multimedia data into a preset number of target sounds; A first attribute control module, used to control first attribute information of the target sound based on the pulse width modulation frequency, wherein the first attribute information includes at least one of sound length, pitch, and timbre; a second attribute control module, used to control second attribute information of the target sound based on the direct-axis current and quadrature-axis current of the motor so that the output torque and speed of the motor remain unchanged, wherein the second attribute information represents the loudness of the target sound; A motor sound control module is used to control the motor to make sounds in different states based on the first attribute information and the second attribute information, and the different states include motion states.
