CN114337404B - DC motor control method, air conditioner and computer readable storage medium - Google Patents

DC motor control method, air conditioner and computer readable storage medium Download PDF

Info

Publication number
CN114337404B
CN114337404B CN202111657852.4A CN202111657852A CN114337404B CN 114337404 B CN114337404 B CN 114337404B CN 202111657852 A CN202111657852 A CN 202111657852A CN 114337404 B CN114337404 B CN 114337404B
Authority
CN
China
Prior art keywords
motor
speed
value
time period
speed value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111657852.4A
Other languages
Chinese (zh)
Other versions
CN114337404A (en
Inventor
王新民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Guangdong Air Conditioning Co Ltd
Original Assignee
Hisense Guangdong Air Conditioning Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Guangdong Air Conditioning Co Ltd filed Critical Hisense Guangdong Air Conditioning Co Ltd
Priority to CN202111657852.4A priority Critical patent/CN114337404B/en
Publication of CN114337404A publication Critical patent/CN114337404A/en
Application granted granted Critical
Publication of CN114337404B publication Critical patent/CN114337404B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Control Of Motors That Do Not Use Commutators (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

本发明公开了一种直流电机控制方法、空调器和计算机可读存储介质,直流电机控制方法,包括:S1,接收到电机最终目标转速值;S2,根据速度曲线获得当前目标转速值;S3,根据最终目标转速值和当前目标转速值获得计算电机转速的时间周期;S4,获取电机反馈脉冲计数值,根据电机反馈脉冲计数值获得计算电机转速的时间周期内电机的平均转速值;S5,根据当前目标转速值和平均转速值获得对应当前目标转速值的调速占空比,以驱动电机;S6,确定电机转速达到当前目标转速值,将当前目标转速值赋值电机的当前转速,并返回步骤S2,直至电机转速达到最终目标转速值。采用该方法可以提高电机的动态响应能力,提高电机调速过程中的准确性和稳定性。

The invention discloses a direct current motor control method, an air conditioner and a computer-readable storage medium. The direct current motor control method comprises: S1, receiving the final target speed value of the motor; S2, obtaining the current target speed value according to the speed curve; S3, obtaining the time period for calculating the motor speed according to the final target speed value and the current target speed value; S4, obtaining the motor feedback pulse count value, and obtaining the average speed value of the motor within the time period for calculating the motor speed according to the motor feedback pulse count value; S5, obtaining the speed regulation duty ratio corresponding to the current target speed value according to the current target speed value and the average speed value to drive the motor; S6, determining that the motor speed reaches the current target speed value, assigning the current target speed value to the current speed of the motor, and returning to step S2 until the motor speed reaches the final target speed value. The method can improve the dynamic response capability of the motor and improve the accuracy and stability in the motor speed regulation process.

Description

直流电机控制方法、空调器和计算机可读存储介质DC motor control method, air conditioner and computer readable storage medium

技术领域Technical Field

本发明涉及直流电机技术领域,尤其是涉及一种直流电机控制方法、空调器和计算机可读存储介质。The present invention relates to the technical field of direct current motors, and in particular to a direct current motor control method, an air conditioner and a computer-readable storage medium.

背景技术Background technique

相关技术中,对于直流电机的调速控制,通过采用固定的时间周期来计算电机的当前转速,并将当前转速直接与最终目标转速值进行比较,根据比较结果来调整输出调速占空比的大小。但是,由于采用固定时间周期来对转速进行计算和调节,计算的转速实际为固定时间周期内的平均速度,所以,对于加速或减速的动态需求较高的情况,则会影响输出转速的准确程度。In the related art, for the speed control of a DC motor, a fixed time period is used to calculate the current speed of the motor, and the current speed is directly compared with the final target speed value, and the size of the output speed control duty cycle is adjusted according to the comparison result. However, since a fixed time period is used to calculate and adjust the speed, the calculated speed is actually the average speed within the fixed time period. Therefore, in the case of high dynamic requirements for acceleration or deceleration, the accuracy of the output speed will be affected.

发明内容Summary of the invention

本发明旨在至少解决现有技术中存在的技术问题之一。为此,本发明的一个目的在于提出一种直流电机控制方法,采用该方法可以提高电机的动态响应能力,提高电机调速过程中的准确性和稳定性。The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide a DC motor control method, which can improve the dynamic response capability of the motor and improve the accuracy and stability of the motor speed regulation process.

本发明的目的之二在于提出一种空调器。A second object of the present invention is to provide an air conditioner.

本发明的目的之三在于提出一种计算机可读存储介质。A third objective of the present invention is to provide a computer-readable storage medium.

为了解决上述问题,本发明第一方面实施例提供一种直流电机控制方法,包括:S1,接收到电机最终目标转速值;S2,根据速度曲线获得当前目标转速值;S3,根据所述最终目标转速值和所述当前目标转速值获得计算电机转速的时间周期;S4,获取电机反馈脉冲计数值,根据所述电机反馈脉冲计数值获得所述计算电机转速的时间周期内电机的平均转速值;S5,根据所述当前目标转速值和所述平均转速值获得对应所述当前目标转速值的调速占空比,以驱动所述电机;S6,确定电机转速达到所述当前目标转速值,将所述当前目标转速值赋值所述电机的当前转速,并返回步骤S2,直至所述电机转速达到所述最终目标转速值。In order to solve the above problems, the first aspect of the present invention provides a DC motor control method, including: S1, receiving the final target speed value of the motor; S2, obtaining the current target speed value according to the speed curve; S3, obtaining the time period for calculating the motor speed according to the final target speed value and the current target speed value; S4, obtaining the motor feedback pulse count value, and obtaining the average speed value of the motor within the time period for calculating the motor speed according to the motor feedback pulse count value; S5, obtaining the speed regulation duty ratio corresponding to the current target speed value according to the current target speed value and the average speed value to drive the motor; S6, determining that the motor speed reaches the current target speed value, assigning the current target speed value to the current speed of the motor, and returning to step S2 until the motor speed reaches the final target speed value.

根据本发明实施例的直流电机控制方法,在对电机调速时,以最终目标转速值和当前目标转速值来获得计算电机转速的时间周期,也就是说,计算电机转速的时间周期的确定与最终目标转速值和当前目标转速值有关,计算电机转速的时间周期不是唯一固定的,进而以该计算电机转速的时间周期内的电机反馈脉冲计数值来计算电机的平均转速值,相较于采用固定时间周期计算电机的平均转速值的方式,可以根据电机的动态需求改善电机的动态响应能力,提高电机调速过程中的准确性和稳定性。According to the DC motor control method of the embodiment of the present invention, when the motor speed is adjusted, the final target speed value and the current target speed value are used to obtain the time period for calculating the motor speed. That is to say, the determination of the time period for calculating the motor speed is related to the final target speed value and the current target speed value, and the time period for calculating the motor speed is not uniquely fixed. Then, the average speed value of the motor is calculated based on the motor feedback pulse count value within the time period for calculating the motor speed. Compared with the method of calculating the average speed value of the motor using a fixed time period, the dynamic response capability of the motor can be improved according to the dynamic requirements of the motor, thereby improving the accuracy and stability of the motor speed regulation process.

在一些实施例中,根据所述最终目标转速值和所述当前目标转速值获得计算电机转速的时间周期,包括:计算所述电机最终目标转速与所述当前目标转速值的速度差值;根据所述速度差值获得所述计算电机转速的时间周期。In some embodiments, obtaining the time period for calculating the motor speed based on the final target speed value and the current target speed value includes: calculating the speed difference between the final target speed of the motor and the current target speed value; and obtaining the time period for calculating the motor speed based on the speed difference.

在一些实施例中,根据所述速度差值获得所述计算电机转速的时间周期,包括:确定所述速度差值小于或等于预设速度阈值,所述计算电机转速的时间周期为第一时间周期;确定所述速度差值大于预设速度阈值,则所述计算电机转速的时间周期为第二时间周期,其中,所述第二时间周期小于所述第一时间周期。In some embodiments, obtaining the time period for calculating the motor speed based on the speed difference includes: determining that the speed difference is less than or equal to a preset speed threshold, and the time period for calculating the motor speed is a first time period; determining that the speed difference is greater than the preset speed threshold, and the time period for calculating the motor speed is a second time period, wherein the second time period is less than the first time period.

在一些实施例中,根据所述当前目标转速值和所述平均转速值获得对应所述当前目标转速值的调速占空比,包括:根据所述计算电机转速的时间周期获得所述目标调节参数;根据所述当前目标转速值和所述平均转速值以及所述目标调节参数获得对应所述当前目标转速值的调速占空比。In some embodiments, the speed regulation duty ratio corresponding to the current target speed value is obtained based on the current target speed value and the average speed value, including: obtaining the target adjustment parameter based on the time period for calculating the motor speed; obtaining the speed regulation duty ratio corresponding to the current target speed value based on the current target speed value, the average speed value and the target adjustment parameter.

在一些实施例中,根据所述计算电机转速的时间周期获得所述目标调节参数,包括:确定所述计算电机转速的时间周期为所述第一时间周期,所述目标调节参数为第一调节参数。In some embodiments, obtaining the target adjustment parameter according to the time period for calculating the motor speed includes: determining that the time period for calculating the motor speed is the first time period, and the target adjustment parameter is the first adjustment parameter.

在一些实施例中,根据所述计算电机转速的时间周期获得所述目标调节参数,还包括:确定所述计算电机转速的时间周期为所述第二时间周期,则所述目标调节参数为第二调节参数,其中,所述第二调节参数与所述第一调节参数不同。In some embodiments, obtaining the target adjustment parameter based on the time period for calculating the motor speed also includes: determining that the time period for calculating the motor speed is the second time period, then the target adjustment parameter is the second adjustment parameter, wherein the second adjustment parameter is different from the first adjustment parameter.

在一些实施例中,所述目标调节参数包括目标比例参数和目标积分参数,根据所述当前目标转速值和所述平均转速值以及所述目标调节参数获得对应所述当前目标转速值的调速占空比,包括:根据所述当前目标转速值和所述平均转速值以及所述目标比例参数和所述目标积分参数进行比例积分计算,以获得所述调速占空比。In some embodiments, the target adjustment parameters include a target proportional parameter and a target integral parameter, and the speed regulation duty cycle corresponding to the current target speed value is obtained according to the current target speed value, the average speed value and the target adjustment parameters, including: performing proportional integral calculation according to the current target speed value, the average speed value, the target proportional parameter and the target integral parameter to obtain the speed regulation duty cycle.

在一些实施例中,所述第一时间周期取值为0.5s~1s。In some embodiments, the first time period is between 0.5s and 1s.

本发明第二方面实施例提供一种空调器,包括:至少一个处理器;与所述至少一个处理器通信连接的存储器;其中,所述存储器中存储有可被所述至少一个处理器执行的计算机程序,所述至少一个处理器执行所述计算机程序时实现上述实施例所述的直流电机控制方法。A second aspect of the present invention provides an air conditioner, comprising: at least one processor; a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and when the at least one processor executes the computer program, the DC motor control method described in the above embodiment is implemented.

根据本发明实施例的空调器,通过处理器执行上述实施例提供的直流电机控制方法,可以提高电机的动态响应能力,提高电机调速过程中的准确性和稳定性。According to the air conditioner of the embodiment of the present invention, the dynamic response capability of the motor can be improved, and the accuracy and stability of the motor speed regulation process can be improved by executing the DC motor control method provided by the above embodiment through the processor.

本发明第三方面实施例提供一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被处理器执行时实现上述实施例所述的直流电机控制方法。A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the DC motor control method described in the above embodiment.

本发明的附加方面和优点将在下面的描述中部分给出,部分将从下面的描述中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

图1是根据本发明一个实施例的直流电机控制方法的流程图;FIG1 is a flow chart of a DC motor control method according to an embodiment of the present invention;

图2是根据本发明另一个实施例的直流电机控制方法的流程图;FIG2 is a flow chart of a DC motor control method according to another embodiment of the present invention;

图3是根据本发明一个实施例的空调器的结构框图。FIG. 3 is a structural block diagram of an air conditioner according to an embodiment of the present invention.

附图标记:Reference numerals:

空调器10;Air conditioner 10;

处理器1;存储器2。Processor 1; Memory 2.

具体实施方式Detailed ways

下面详细描述本发明的实施例,参考附图描述的实施例是示例性的,下面详细描述本发明的实施例。Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.

相关技术中,对于采用固定速度周期计算电机的反馈转速的方式,其速度计算精度=60/(A*N),其中,A为固定速度周期,N为电机每转反馈脉冲数。但是,由于电机型号固定,每转反馈脉冲数N固定,因此,速度计算精度仅与固定速度周期A相关,而A越大,速度计算精度越高,但计算固定速度周期内的平均转速的时间越长,而计算的时间越长则越容易导致计算的平均速度越偏离电机的当前实际转速,因此,对于电机速度启动或要求快速变化的情况,则会影响输出转速的准确程度。例如,电机需要频繁加减速时,在加减速之交时刻将速度进行平均,总会导致输出的占空比不能很好地驱动电机按设定的速度曲线运行,如要求电机转速从500rpm升高到1000rpm再马上减速到500rpm,电机总会在升高到超过1000rpm才开始减速,且在减速到加速转换过程同样也会在转速小于500rpm后才开始加速。In the related art, for the method of using a fixed speed cycle to calculate the feedback speed of the motor, the speed calculation accuracy = 60/(A*N), where A is the fixed speed cycle and N is the number of feedback pulses per motor revolution. However, since the motor model is fixed and the number of feedback pulses per revolution N is fixed, the speed calculation accuracy is only related to the fixed speed cycle A. The larger A is, the higher the speed calculation accuracy is, but the longer the time to calculate the average speed within the fixed speed cycle is, and the longer the calculation time is, the more likely it is that the calculated average speed will deviate from the current actual speed of the motor. Therefore, for situations where the motor speed is started or requires rapid changes, it will affect the accuracy of the output speed. For example, when the motor needs to accelerate and decelerate frequently, averaging the speed at the intersection of acceleration and deceleration will always result in the output duty cycle not being able to drive the motor to run according to the set speed curve well. For example, if the motor speed is required to increase from 500rpm to 1000rpm and then immediately decelerate to 500rpm, the motor will always start to decelerate after it increases to more than 1000rpm, and in the process of deceleration to acceleration, it will also start to accelerate after the speed is less than 500rpm.

为了解决上述问题,本发明第一方面实施例提出一种直流电机控制方法,采用该方法可以提高电机的动态响应能力,提高电机调速过程中的准确性和稳定性。In order to solve the above problems, a first embodiment of the present invention proposes a DC motor control method, which can improve the dynamic response capability of the motor and improve the accuracy and stability of the motor speed regulation process.

下面参考图1描述本发明实施例的直流电机控制方法,如图1所示,该直流电机控制方法至少包括步骤S1-步骤S6。The DC motor control method according to an embodiment of the present invention is described below with reference to FIG. 1 . As shown in FIG. 1 , the DC motor control method at least includes steps S1 to S6 .

步骤S1,接收到电机最终目标转速值。Step S1, receiving the final target speed value of the motor.

其中,电机最终目标转速值为在调整电机转速时,最终将电机的实际转速所调整到的转速值。The final target speed value of the motor is the speed value to which the actual speed of the motor is finally adjusted when the motor speed is adjusted.

具体地,以空调器为例,空调器在上电启动后,空调器的控制器会根据设定温度计算出电机最终目标转速值,并发送电机启动指令和电机最终目标转速值至电机控制器。Specifically, taking an air conditioner as an example, after the air conditioner is powered on and started, the controller of the air conditioner will calculate the final target speed value of the motor according to the set temperature, and send a motor start instruction and the final target speed value of the motor to the motor controller.

步骤S2,根据速度曲线获得当前目标转速值。Step S2, obtaining the current target speed value according to the speed curve.

具体地,响应于电机启动指令,电机控制器可以根据接收的电机最终目标转速值和设定的调速时间来生成速度曲线,并将速度曲线按照一定的规则分成多个运行阶段,每个运行阶段的上限值作为此运行阶段的当前目标转速值。其中,速度曲线可以为斜线或S曲线,对此不作限制。Specifically, in response to the motor start instruction, the motor controller can generate a speed curve according to the received motor final target speed value and the set speed regulation time, and divide the speed curve into multiple operation stages according to certain rules, and the upper limit value of each operation stage is used as the current target speed value of this operation stage. The speed curve can be a diagonal line or an S curve, which is not limited.

其中,设定的调速时间可以根据实际情况进行设定,可以理解的是,相同目标转速下调速时间越短,电机转速的变化速率越快,反之电机转速的变化速率越慢。Among them, the set speed regulation time can be set according to actual conditions. It can be understood that, at the same target speed, the shorter the speed regulation time is, the faster the rate of change of the motor speed is, and vice versa, the slower the rate of change of the motor speed is.

举例说明,以电机最终目标转速值为100rpm,调速时间为1s为例,电机启动时的初始转速为0rpm,若将速度曲线分为十个运行阶段,可以每隔0.1s上升10rpm,则对应每个运行阶段的当前目标转速值分别为:10rpm、20rpm、30rpm、40rpm、50rpm、60rpm、70rpm、80rpm、90rpm、100rpm。For example, taking the final target speed value of the motor as 100rpm and the speed regulation time as 1s, the initial speed of the motor when it starts is 0rpm. If the speed curve is divided into ten operating stages, it can increase by 10rpm every 0.1s. The current target speed values corresponding to each operating stage are: 10rpm, 20rpm, 30rpm, 40rpm, 50rpm, 60rpm, 70rpm, 80rpm, 90rpm, and 100rpm respectively.

步骤S3,根据最终目标转速值和当前目标转速值获得计算电机转速的时间周期。Step S3, obtaining a time period for calculating the motor speed according to the final target speed value and the current target speed value.

其中,计算电机转速的时间周期是指电机转速的计算周期。The time period for calculating the motor speed refers to the calculation period of the motor speed.

在实施例中,由于采用固定时间周期计算电机转速时,计算的电机转速实际为固定时间周期内的平均转速,但对于电机加速或减速等动态需求较高的情况,因计算时间较长,使得计算的平均转速偏离电机的当前实际转速,影响输出转速的准确性,对此,本发明实施例中在对电机调速时,不再是直接采用固定的反馈速度计算时间周期,而是以最终目标转速值和当前目标转速值来获得反馈速度计算计算电机转速的时间周期,也就是说,计算电机转速的时间周期的确定与最终目标转速值和当前目标转速值有关,计算电机转速的时间周期不是唯一固定的,进而以该计算电机转速的时间周期内的电机反馈脉冲计数值来计算电机的平均转速值,相较于采用固定时间周期计算电机的平均转速值的方式,可以根据电机的动态需求改善电机的动态响应能力,提高电机调速过程中的准确性和稳定性。In the embodiment, when the motor speed is calculated using a fixed time period, the calculated motor speed is actually the average speed within the fixed time period. However, for situations with high dynamic requirements such as motor acceleration or deceleration, the calculation time is long, so that the calculated average speed deviates from the current actual speed of the motor, affecting the accuracy of the output speed. In this regard, in the embodiment of the present invention, when regulating the motor speed, a fixed feedback speed calculation time period is no longer directly used, but the final target speed value and the current target speed value are used to obtain the feedback speed to calculate the time period for calculating the motor speed. In other words, the determination of the time period for calculating the motor speed is related to the final target speed value and the current target speed value, and the time period for calculating the motor speed is not uniquely fixed. Furthermore, the average speed value of the motor is calculated using the motor feedback pulse count value within the time period for calculating the motor speed. Compared with the method of calculating the average speed value of the motor using a fixed time period, the dynamic response capability of the motor can be improved according to the dynamic requirements of the motor, and the accuracy and stability of the motor speed regulation process can be improved.

具体地,由最终目标转速值与当前目标转速值来确定电机的运行状态,以获得更符合电机的运行状态的计算电机转速的时间周期,例如,根据最终目标转速值和当前目标转速值确定电机处于加速或减速等动态需求较高的状态时,可以适当地减小计算电机转速的时间周期,从而后续在计算计算电机转速的时间周期内的平均转速值时,相较于采用固定时间周期计算电机转速的方式,可以明显使得计算平均电机转速的时间越短,使得计算的平均转速值也越接近电机当前时刻的真实转速,同时调节转速的周期也更短,提高后续计算PWM(Pulse width modulation,脉冲宽度调制)的频率,提高电机的动态响应能力,提高电机调速过程中的准确性,提高调速性能;或者,根据最终目标转速值和当前目标转速值确定电机处于稳定运行的状态时,由于此情况下,电机的转速仅会在很小的范围内波动,因此可以适当地增大电机转速的时间周期,从而后续在计算计算电机转速的时间周期内的平均转速值时,可以提高电机转速的计算精度,使得电机的转速更好地稳定于一定转速处,降低速度波动,减小速度偏差,且节省电机稳定运行时的芯片资源。Specifically, the running state of the motor is determined by the final target speed value and the current target speed value to obtain a time period for calculating the motor speed that is more in line with the running state of the motor. For example, when it is determined that the motor is in a state with high dynamic requirements such as acceleration or deceleration according to the final target speed value and the current target speed value, the time period for calculating the motor speed can be appropriately reduced. Therefore, when subsequently calculating the average speed value within the time period for calculating the motor speed, compared with the method of calculating the motor speed using a fixed time period, the time for calculating the average motor speed can be significantly shortened, so that the calculated average speed value is closer to the actual speed of the motor at the current moment, and the period for adjusting the speed is also shorter, thereby improving the subsequent calculation of PWM (Pulse width Modulation, pulse width modulation) frequency, improve the dynamic response capability of the motor, improve the accuracy of the motor speed regulation process, and improve the speed regulation performance; or, when the motor is determined to be in a stable operation state according to the final target speed value and the current target speed value, because in this case, the motor speed will only fluctuate within a very small range, the time period of the motor speed can be appropriately increased, so that when the average speed value within the time period of the motor speed is subsequently calculated, the calculation accuracy of the motor speed can be improved, so that the motor speed can be better stabilized at a certain speed, the speed fluctuation is reduced, the speed deviation is reduced, and the chip resources when the motor is running stably are saved.

步骤S4,获取电机反馈脉冲计数值,根据电机反馈脉冲计数值获得计算电机转速的时间周期内电机的平均转速值。Step S4, obtaining the motor feedback pulse count value, and obtaining the average speed value of the motor within the time period for calculating the motor speed according to the motor feedback pulse count value.

其中,对于电机反馈脉冲计数值,可以通过计算计算电机转速的时间周期内的外部中断来获得,具体可以配置外部中断为上升下降沿触发。The motor feedback pulse count value can be obtained by calculating the external interrupt within the time period of the motor speed. Specifically, the external interrupt can be configured to be triggered by the rising or falling edge.

具体地,可以通过以下公式来计算平均转速值。Specifically, the average rotation speed value can be calculated by the following formula.

其中,为平均转速值,/>为电机反馈脉冲计数值,/>为计算电机转速的时间周期,/>为电机每转反馈脉冲数。其中,在电机每转反馈脉冲数与电机型号相关,电机型号固定后,电机每转反馈脉冲数也对应固定。in, is the average speed value, /> is the motor feedback pulse count value, /> To calculate the time period of the motor speed, /> The number of feedback pulses per motor revolution is related to the motor model. When the motor model is fixed, the number of feedback pulses per motor revolution is also fixed accordingly.

步骤S5,根据当前目标转速值和平均转速值获得对应当前目标转速值的调速占空比,以驱动电机。Step S5, obtaining a speed regulation duty ratio corresponding to the current target speed value according to the current target speed value and the average speed value to drive the motor.

具体地,现有技术中直接采用最终目标转速值与计算的平均转速值进行比较,以调整输出占空比,但是,该方式容易在电机启动时因加速过快造成速度超调,或因加速过慢造成电机的转速迟迟达不到最终目标转速值,而且由于转速计算误差的存在,输出占空比必然会在某一个值处上下波动,无法实现最佳的性能,对此,本发明实施例不再直接以最终目标转速值作为速度给定,而是以速度曲线来获得每个运行阶段的当前目标转速值,从在不同的运行阶段可以获得不同的调速占空比,以此控制电机驱动,提高电机的运行稳定性。Specifically, in the prior art, the final target speed value is directly compared with the calculated average speed value to adjust the output duty cycle. However, this method is prone to speed overshoot due to excessive acceleration when the motor starts, or the motor speed fails to reach the final target speed value due to excessive acceleration. In addition, due to the existence of speed calculation errors, the output duty cycle will inevitably fluctuate around a certain value, and optimal performance cannot be achieved. In this regard, the embodiment of the present invention no longer directly uses the final target speed value as the speed given, but uses the speed curve to obtain the current target speed value for each operating stage, so that different speed regulation duty cycles can be obtained in different operating stages, thereby controlling the motor drive and improving the operating stability of the motor.

步骤S6,确定电机转速达到当前目标转速值,将当前目标转速值赋值电机的当前转速,并返回步骤S2,直至电机的转速达到最终目标转速值。Step S6, determining whether the motor speed reaches the current target speed value, assigning the current target speed value to the current speed of the motor, and returning to step S2 until the motor speed reaches the final target speed value.

根据本发明实施例的直流电机控制方法,在对电机调速时,以最终目标转速值和当前目标转速值来获得计算电机转速的时间周期,也就是说,计算电机转速的时间周期的确定与最终目标转速值和当前目标转速值有关,计算电机转速的时间周期不是唯一固定的,进而以该计算电机转速的时间周期内的电机反馈脉冲计数值来计算电机的平均转速值,相较于采用固定时间周期计算电机的平均转速值的方式,可以根据电机的动态需求改善电机的动态响应能力,提高电机调速过程中的准确性和稳定性。According to the DC motor control method of the embodiment of the present invention, when the motor speed is adjusted, the final target speed value and the current target speed value are used to obtain the time period for calculating the motor speed. That is to say, the determination of the time period for calculating the motor speed is related to the final target speed value and the current target speed value, and the time period for calculating the motor speed is not uniquely fixed. Then, the average speed value of the motor is calculated based on the motor feedback pulse count value within the time period for calculating the motor speed. Compared with the method of calculating the average speed value of the motor using a fixed time period, the dynamic response capability of the motor can be improved according to the dynamic requirements of the motor, thereby improving the accuracy and stability of the motor speed regulation process.

在一些实施例中,计算电机最终目标转速与当前目标转速值的速度差值,以通过速度差值的大小来判断电机是处于调速状态或是稳定运行状态,例如,速度差值较大时则说明电机处于加速或减速的调速状态,反之速度差值较小时则说明电机处于稳定运行状态;进而根据速度差值获得计算电机转速的时间周期,从而在电机处于调速状态时,可以适当地减小电机转速的时间周期,以在计算计算电机转速的时间周期内的平均转速值时,可以缩短计算平均转速的时间,使得计算的平均转速值更加接近电机当前时刻的真实转速,同时调节转速的周期也更短,提高后续计算占空比的频率,提高电机的动态响应能力,提高电机调速过程中的准确性,提高调速性能,以及在电机处于稳定运行状态时,可以适当地增大电机转速的时间周期,以在计算计算电机转速的时间周期内的平均转速值时,可以提高电机转速的计算精度,使得电机的转速更好地稳定于一定转速处,降低速度波动,减小速度偏差,且节省电机稳定运行时的芯片资源。In some embodiments, the speed difference between the final target speed of the motor and the current target speed value is calculated to determine whether the motor is in a speed regulation state or a stable operation state according to the size of the speed difference. For example, when the speed difference is large, it indicates that the motor is in an accelerating or decelerating speed regulation state, whereas when the speed difference is small, it indicates that the motor is in a stable operation state; and then the time period for calculating the motor speed is obtained according to the speed difference, so that when the motor is in the speed regulation state, the time period for calculating the motor speed can be appropriately reduced, so that when calculating the average speed value within the time period for calculating the motor speed, the time for calculating the average speed can be shortened, so that the calculated average speed value is closer to the actual speed of the motor at the current moment, and the speed adjustment period is also shorter, thereby increasing the frequency of subsequent duty cycle calculations, improving the dynamic response capability of the motor, improving the accuracy of the motor speed regulation process, and improving the speed regulation performance; and when the motor is in a stable operation state, the time period for the motor speed can be appropriately increased, so that when calculating the average speed value within the time period for calculating the motor speed, the calculation accuracy of the motor speed can be improved, so that the motor speed is better stabilized at a certain speed, speed fluctuations are reduced, speed deviations are reduced, and chip resources are saved when the motor is running stably.

在一些实施例中,若确定速度差值小于或等于预设速度阈值,则计算电机转速的时间周期为第一时间周期;若确定速度差值大于预设速度阈值,则计算电机转速的时间周期为第二时间周期,其中,第二时间周期小于第一时间周期。也就是说,在电机处于加速或减速的过程中,将电机的平均转速值的计算周期减小为第一时间周期,从而使得平均转速值的时间区间缩短,计算的平均转速值更加接近于电机的当前实际转速,提高电机转速的计算准确性,同时也缩短了电机转速的调节周期,使得计算PWM的频率提高,提高电机的动态响应能力,减小电机加速或减速时速度超调的问题,提高整体电机的调速体验。In some embodiments, if it is determined that the speed difference is less than or equal to a preset speed threshold, the time period for calculating the motor speed is a first time period; if it is determined that the speed difference is greater than the preset speed threshold, the time period for calculating the motor speed is a second time period, wherein the second time period is less than the first time period. In other words, when the motor is in the process of accelerating or decelerating, the calculation period of the average speed value of the motor is reduced to the first time period, thereby shortening the time interval of the average speed value, and the calculated average speed value is closer to the current actual speed of the motor, improving the calculation accuracy of the motor speed, and also shortening the adjustment period of the motor speed, so that the frequency of calculating PWM is increased, the dynamic response capability of the motor is improved, the problem of speed overshoot when the motor is accelerating or decelerating is reduced, and the overall motor speed regulation experience is improved.

在一些实施例中,根据计算电机转速的时间周期获得目标调节参数,即对应不同的计算电机转速的时间周期对应有不同的目标调节参数;根据当前目标转速值和平均转速值以及目标调节参数获得对应当前目标转速值的调速占空比。由此,通过以不同运行阶段的当前目标转速值替代最终目标转速值,并在不同的运行阶段采用不同的目标调节参数,可以提高调节环节的准确性、快速性以及稳定性。In some embodiments, the target adjustment parameter is obtained according to the time period of calculating the motor speed, that is, different target adjustment parameters correspond to different time periods of calculating the motor speed; the speed adjustment duty ratio corresponding to the current target speed value is obtained according to the current target speed value, the average speed value and the target adjustment parameter. Therefore, by replacing the final target speed value with the current target speed value at different operation stages and using different target adjustment parameters at different operation stages, the accuracy, rapidity and stability of the adjustment link can be improved.

在一些实施例中,确定计算电机转速的时间周期为第一时间周期,目标调节参数为第一调节参数。以及,确定计算电机转速的时间周期为第二时间周期,则目标调节参数为第二调节参数,其中,第二调节参数与第一调节参数不同。由此,在调节占空比时,通过采用不同的调节参数,可以减少电机加速或减速时速度超调的问题,提高调节环节的准确性、快速性以及稳定性。In some embodiments, the time period for calculating the motor speed is determined to be a first time period, and the target adjustment parameter is the first adjustment parameter. Also, the time period for calculating the motor speed is determined to be a second time period, and the target adjustment parameter is the second adjustment parameter, wherein the second adjustment parameter is different from the first adjustment parameter. Thus, when adjusting the duty cycle, by adopting different adjustment parameters, the problem of speed overshoot during motor acceleration or deceleration can be reduced, and the accuracy, rapidity and stability of the adjustment link can be improved.

在一些实施例中,目标调节参数包括目标比例参数和目标积分参数,根据当前目标转速值和平均转速值以及目标比例参数和目标积分参数进行比例积分计算,以获得调速占空比。也就是说,在调节占空比时,采用PI参数即目标比例参数和目标积分参数来计算,提高调节环节的准确性、快速性以及稳定性。In some embodiments, the target adjustment parameter includes a target proportional parameter and a target integral parameter, and a proportional integral calculation is performed according to the current target speed value and the average speed value as well as the target proportional parameter and the target integral parameter to obtain the speed regulation duty cycle. That is to say, when adjusting the duty cycle, the PI parameter, i.e., the target proportional parameter and the target integral parameter, is used for calculation to improve the accuracy, rapidity and stability of the adjustment link.

在一些实施例中,第一时间周期取值为0.5s~1s。In some embodiments, the first time period is 0.5s to 1s.

下面参考附图2对本发明实施例的直流电机控制方法进行举例说明,具体步骤如下。The DC motor control method according to the embodiment of the present invention is described below by way of example with reference to FIG. 2 , and the specific steps are as follows.

步骤S7,空调器上电。Step S7, power on the air conditioner.

步骤S8,定时器配置,将计算电机转速的时间周期设定为第一时间周期A1秒,配置外部中断为上升下降沿触发。Step S8, timer configuration, setting the time period for calculating the motor speed to the first time period A1 second, and configuring the external interrupt to be triggered by the rising and falling edges.

步骤S9,接收到电机启动指令和电机最终目标转速值spd_aim。Step S9: receiving a motor start instruction and a motor final target speed value spd_aim.

步骤S10,根据速度曲线生成当前目标转速值spd_ref。Step S10, generating a current target speed value spd_ref according to the speed curve.

步骤S11,判断电机最终目标转速值spd_aim与当前目标转速值spd_ref之差是否大于预设速度阈值N。若否,则执行步骤S12;若是,则执行步骤S19。Step S11, determining whether the difference between the final target speed value spd_aim of the motor and the current target speed value spd_ref is greater than a preset speed threshold N. If not, executing step S12; if yes, executing step S19.

步骤S12,将计算电机转速的时间周期恢复为A1秒。Step S12, restoring the time period for calculating the motor speed to A1 seconds.

步骤S13,获得电机反馈脉冲计数值,计算A1秒内的平均转速值。Step S13, obtaining the motor feedback pulse count value, and calculating the average speed value within A1 seconds.

步骤S14,判断定时周期是否达到A1秒。若否,则执行步骤S15;若是,则执行步骤S16。Step S14, determine whether the timing period reaches A1 seconds. If not, execute step S15; if yes, execute step S16.

步骤S15,执行其他逻辑程序,等待定时周期达到A1秒。Step S15, execute other logic programs and wait for the timing cycle to reach A1 seconds.

步骤S16,获得电机反馈脉冲计数值,计算A1秒内的平均转速值spd_fbk1。Step S16, obtaining the motor feedback pulse count value, and calculating the average speed value spd_fbk1 within A1 seconds.

步骤S17,根据spd_ref和spd_fbk1,采用第二调节参数进行PI计算,得到调速占空比。Step S17: According to spd_ref and spd_fbk1, a second regulating parameter is used to perform PI calculation to obtain a speed regulating duty cycle.

步骤S18,根据调速占空比输出高低电平,驱动电机转动。Step S18, outputting high and low levels according to the speed regulation duty cycle to drive the motor to rotate.

步骤S19,将计算电机转速的时间周期缩短为第二时间周期A2秒。Step S19, shortening the time period for calculating the motor speed to a second time period A2 seconds.

步骤S20,判断定时周期是否达到A2秒。若否,则执行步骤S21;若是,则执行步骤S22。Step S20, determine whether the timing period reaches A2 seconds. If not, execute step S21; if yes, execute step S22.

步骤S21,执行其他逻辑程序,等待定时周期达到A1秒。Step S21, execute other logic programs and wait for the timing cycle to reach A1 seconds.

步骤S22,获得电机反馈脉冲计数值,计算A2秒内的平均转速值spd_fbk2。Step S22, obtaining the motor feedback pulse count value, and calculating the average speed value spd_fbk2 within A2 seconds.

步骤S23,根据spd_ref和spd_fbk2,采用第一调节参数进行PI计算,得到调速占空比。Step S23: According to spd_ref and spd_fbk2, a first regulating parameter is used to perform PI calculation to obtain a speed regulating duty cycle.

步骤S24,根据调速占空比输出高低电平,驱动电机转动。Step S24, outputting high and low levels according to the speed regulation duty cycle to drive the motor to rotate.

总之,根据本发明实施例的直流电机控制值方法,对于电机转速启动或要求快速变化时,适当减小计算电机转速的时间周期即采用第二时间周期,从而使得计算平均转速值的时间越小,计算的平均转速值也越接近电机当前时刻的真实转速,达到提高转速计算准确度的作用,且转速调节的周期更短,提高电机的动态响应能力,以及在更高的转速准确度和更小的调节周期下,也提高电机的调速性能;此外,在电机的转速达到稳定后,则将计算电机转速的时间周期由第二时间周期恢复至第一时间周期,从而使得计算平均转速值的时间增长,提高转速计算精度。由此,通过上述方式,有效改善电机转速发生变动时对当前目标转速值以及最终目标转速值的跟踪性,又能同时兼顾电机稳定状态下的速度准确性,提高整体电机的调速体验。In summary, according to the DC motor control value method of the embodiment of the present invention, when the motor speed is started or required to change rapidly, the time period for calculating the motor speed is appropriately reduced, that is, the second time period is adopted, so that the time for calculating the average speed value is smaller, and the calculated average speed value is closer to the actual speed of the motor at the current moment, so as to improve the accuracy of speed calculation, and the speed adjustment period is shorter, the dynamic response capability of the motor is improved, and the speed regulation performance of the motor is also improved under higher speed accuracy and smaller adjustment period; in addition, after the speed of the motor reaches stability, the time period for calculating the motor speed is restored from the second time period to the first time period, so that the time for calculating the average speed value is increased, and the speed calculation accuracy is improved. Thus, through the above method, the tracking of the current target speed value and the final target speed value when the motor speed changes is effectively improved, and the speed accuracy of the motor in the stable state can be taken into account at the same time, and the speed regulation experience of the overall motor is improved.

本发明第二方面实施例提供一种空调器,如图3所示,该空调器10包括至少一个处理器1和与至少一个处理器1通信连接的存储器2。A second aspect of the present invention provides an air conditioner. As shown in FIG. 3 , the air conditioner 10 includes at least one processor 1 and a memory 2 communicatively connected to the at least one processor 1 .

其中,存储器2中存储有可被至少一个处理器1执行的计算机程序,至少一个处理器1执行计算机程序时实现上述实施例提供的直流电机控制方法。The memory 2 stores a computer program that can be executed by at least one processor 1 , and when the at least one processor 1 executes the computer program, the DC motor control method provided in the above embodiment is implemented.

需要说明的是,本发明实施例的空调器10的具体实现方式与本发明上述任意实施例的直流电机控制方法的具体实现方式类似,具体请参见关于方法部分的描述,为了减少冗余,此处不再赘述。It should be noted that the specific implementation method of the air conditioner 10 in the embodiment of the present invention is similar to the specific implementation method of the DC motor control method in any of the above embodiments of the present invention. Please refer to the description of the method part for details. In order to reduce redundancy, it will not be repeated here.

根据本发明实施例的空调器10,通过处理器1执行上述实施例提供的直流电机控制方法,可以提高电机的动态响应能力,提高电机调速过程中的准确性和稳定性。According to the air conditioner 10 of the embodiment of the present invention, the processor 1 executes the DC motor control method provided in the above embodiment, which can improve the dynamic response capability of the motor and improve the accuracy and stability of the motor speed regulation process.

本发明第三方面实施例提供一种计算机可读存储介质,其上存储有计算机程序,其中,计算机程序被处理器执行时实现上述实施例提供的直流电机控制方法。A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the DC motor control method provided in the above embodiment.

在本说明书的描述中,流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现定制逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。In the description of this specification, any process or method description in the flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,"计算机可读介质"可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。如,如果用硬件来实现和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

上述提到的存储介质可以是只读存储器,磁盘或光盘等。尽管上面已经示出和描述了本发明的实施例,可以理解的是,上述实施例是示例性的,不能理解为对本发明的限制,本领域的普通技术人员在本发明的范围内可以对上述实施例进行变化、修改、替换和变型。The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示意性实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.

尽管已经示出和描述了本发明的实施例,本领域的普通技术人员可以理解:在不脱离本发明的原理和宗旨的情况下可以对这些实施例进行多种变化、修改、替换和变型,本发明的范围由权利要求及其等同物限定。Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims (8)

1.A direct current motor control method, characterized by comprising:
S1, receiving a final target rotating speed value of a motor;
S2, obtaining a current target rotating speed value according to a speed curve;
s3, obtaining a time period for calculating the motor rotation speed according to the final target rotation speed value and the current target rotation speed value;
S4, acquiring a motor feedback pulse count value, and acquiring an average rotating speed value of the motor in the time period for calculating the rotating speed of the motor according to the motor feedback pulse count value;
S5, obtaining a speed regulation duty ratio corresponding to the current target rotating speed value according to the current target rotating speed value and the average rotating speed value so as to drive the motor;
s6, determining that the rotating speed of the motor reaches the current target rotating speed value, assigning the current target rotating speed value to the current rotating speed of the motor, and returning to the step S2 until the rotating speed of the motor reaches the final target rotating speed value;
Wherein obtaining a time period for calculating the motor speed according to the final target speed value and the current target speed value includes:
Calculating a speed difference value between the final target rotating speed of the motor and the current target rotating speed value;
obtaining the time period for calculating the rotating speed of the motor according to the speed difference value;
Wherein obtaining the time period for calculating the motor rotation speed according to the speed difference value comprises:
Determining that the speed difference value is smaller than or equal to a preset speed threshold value, wherein the time period for calculating the rotating speed of the motor is a first time period;
And if the speed difference value is larger than the preset speed threshold value, the time period for calculating the rotating speed of the motor is a second time period, wherein the second time period is smaller than the first time period.
2. The direct current motor control method according to claim 1, wherein obtaining a speed regulation duty ratio corresponding to the current target rotational speed value from the current target rotational speed value and the average rotational speed value, comprises:
Obtaining a target regulation parameter according to the time period for calculating the rotating speed of the motor;
and obtaining a speed regulation duty ratio corresponding to the current target rotating speed value according to the current target rotating speed value, the average rotating speed value and the target regulating parameter.
3. The direct current motor control method according to claim 2, wherein obtaining the target adjustment parameter according to the time period of calculating the motor rotation speed includes:
and determining the time period for calculating the rotating speed of the motor as the first time period, and determining the target adjusting parameter as a first adjusting parameter.
4. The direct current motor control method according to claim 3, wherein the target adjustment parameter is obtained from the time period of calculating the motor rotation speed, further comprising:
and determining that the time period for calculating the motor rotating speed is the second time period, and then determining that the target adjusting parameter is a second adjusting parameter, wherein the second adjusting parameter is different from the first adjusting parameter.
5. The direct current motor control method according to claim 2, wherein the target adjustment parameter includes a target proportion parameter and a target integral parameter, and obtaining a speed-adjusting duty ratio corresponding to the current target rotation speed value from the current target rotation speed value and the average rotation speed value and the target adjustment parameter includes:
And performing proportional-integral calculation according to the current target rotating speed value and the average rotating speed value, and the target proportion parameter and the target integral parameter to obtain the speed regulation duty ratio.
6. The method according to any one of claims 1 to 4, wherein the first time period takes a value of 0.5s to 1s.
7. An air conditioner, comprising:
At least one processor;
A memory communicatively coupled to the at least one processor;
Wherein the memory stores a computer program executable by the at least one processor, the at least one processor implementing the direct current motor control method of any of claims 1-6 when the computer program is executed.
8. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the direct current motor control method as claimed in any one of claims 1-6.
CN202111657852.4A 2021-12-30 2021-12-30 DC motor control method, air conditioner and computer readable storage medium Active CN114337404B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111657852.4A CN114337404B (en) 2021-12-30 2021-12-30 DC motor control method, air conditioner and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111657852.4A CN114337404B (en) 2021-12-30 2021-12-30 DC motor control method, air conditioner and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN114337404A CN114337404A (en) 2022-04-12
CN114337404B true CN114337404B (en) 2024-06-18

Family

ID=81019771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111657852.4A Active CN114337404B (en) 2021-12-30 2021-12-30 DC motor control method, air conditioner and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114337404B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478285A (en) * 2009-01-20 2009-07-08 东元总合科技(杭州)有限公司 Motor speed detection method

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0817588B2 (en) * 1988-06-27 1996-02-21 富士電機株式会社 Instantaneous motor speed detection method
JP3859115B2 (en) * 1999-07-26 2006-12-20 セイコーエプソン株式会社 Printer motor control apparatus, control method, and recording medium recording control program
CN101784900B (en) * 2007-09-11 2012-07-18 株式会社安川电机 Velocity detection method and motor control device using the method
JP2009095154A (en) * 2007-10-10 2009-04-30 Yaskawa Electric Corp Motor controller and its speed detection method
CN103308707A (en) * 2013-05-21 2013-09-18 中国科学院自动化研究所 Self-adaptation rotating speed measurement method
CN103995144B (en) * 2014-06-05 2016-05-18 北京航空航天大学 A kind of brshless DC motor high-performance speed-measuring method
CN104569472B (en) * 2015-01-23 2017-11-10 上海大学 A kind of velocity acquiring method based on photoelectric pulse coder
JP6452210B1 (en) * 2017-09-12 2019-01-16 Ckd日機電装株式会社 Speed detection device
CN110843552B (en) * 2019-11-29 2021-05-11 安徽江淮汽车集团股份有限公司 Electric vehicle torque control method, device, equipment and storage medium
CN120009566A (en) * 2021-08-02 2025-05-16 上海联影医疗科技股份有限公司 Motor speed measuring method and device, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101478285A (en) * 2009-01-20 2009-07-08 东元总合科技(杭州)有限公司 Motor speed detection method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于高速脉冲计数器的电机转速测量系统设计;李晓海 等;《微电机》;20120229;第45卷(第2期);第72-74页 *

Also Published As

Publication number Publication date
CN114337404A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
TW200810345A (en) Ramp rate closed-loop control (RRCC) for PC cooling fans
CN109462352B (en) Motor control method, device and computer readable storage medium
CN113932325A (en) Control method, system, electronic device and storage medium for computer room air conditioner
CN114337404B (en) DC motor control method, air conditioner and computer readable storage medium
CN111342733B (en) Method, device and computer storage medium for starting control of inverter compressor
CN110725806A (en) Fan rotating speed control method and device and server
CN106292954A (en) Fan rotational frequency control method and device
CN107800338B (en) Stepping motor speed increasing and decreasing control method based on FPGA
CN113568805B (en) Real-time adjustment method and device for power consumption of server and electronic equipment
CN112611095B (en) Control method and control device for indoor direct current fan in variable frequency air conditioner
CN118912023A (en) Fan rotating speed adjusting method, device, equipment and medium
US10396697B2 (en) Motor operating systems and methods thereof
CN110329272B (en) Vehicle speed adjusting method, device, equipment and computer readable storage medium
CN116054677B (en) Linear motor drive control method and control device
CN111162703B (en) Stepping motor control method, stepping motor control device and storage medium
CN114164313A (en) Converter tilting control method and system
CN113934136A (en) Elevator inverter current loop PI parameter self-learning method, medium and inverter
CN110011575B (en) Motor starting control method and device and air conditioner
CN111441947A (en) Method and device for starting control of variable frequency compressor and computer storage medium
JP6594442B2 (en) Motor control device and motor control method
CN120160241A (en) Air conditioner fan adjusting method, air conditioner and computer readable storage medium
JP2024070048A (en) Motor Control Device
CN109981029B (en) Motor control method and device
CN110098776B (en) Motor controller, motor control method and control device
JP2025012798A (en) Electric oil pump and method for controlling electric oil pump

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant