Method and device for controlling motor, computer readable storage medium and electronic device
By obtaining the running distance and real-time speed of the curtain motor, determining the target speed and adjusting the motor speed, the shortening of service life and noise caused by unstable start and stop of traditional curtain motors is solved, and the stable operation and service life of the motor are achieved.
Patent Information
- Application Number
- CN202411921913.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-15
AI Technical Summary
The start-stop control of traditional curtain motors is not stable enough, resulting in shortening of service life, impact and high noise under inertia.
By obtaining the running distance of the motor, determining the target speed, and determining the target adjustment scheme for the speed based on the real-time speed and target speed, adjusting the speed of the motor to the target speed.
The stable operation of the motor is achieved, avoiding the problem of unsatisfactory start and stop or slow start and stop results, and extending the service life of the motor.
Smart Images

Figure CN119834658A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home control, and more specifically, to a method, device, computer-readable storage medium, and electronic device for controlling a motor. Background Art
[0002] As consumers' requirements for quality of life continue to improve, the scale of the smart home market continues to expand, and smart curtains are increasingly used. The curtains are opened and closed by controlling the operation of the curtain motor. The operation of the motor will affect the noise and stability of the curtain operation. The traditional curtain motor start and stop control is either sudden start and stop or slow start and slow stop, which is not ideal and can easily shorten the service life of the motor, hit the edge under inertia, and make a lot of noise.
[0003] Related art proposes a manual and automatic dual-purpose curtain opening and closing machine system with intelligent voice recognition function, which includes an intelligent voice recognition unit, a curtain movement speed planning unit, a brushless DC motor control unit, a brushless DC motor, a reducer, an overrunning clutch, an output end position detector and a synchronous belt. The curtain movement speed planning unit performs speed curve planning according to the position signal fed back by the output end position detector, and the speed curve planning includes a long-distance mode speed curve, a medium-distance mode speed curve and a short-distance mode speed curve, wherein the speed curve includes a speed-up section, a constant speed section, a speed-down section and a low-speed positioning section, wherein the speed-up section refers to the acceleration process, the constant speed section refers to the uniform speed process, the speed-down section refers to the process in which the speed of the uniform speed section drops to the speed of the low speed section, and the low-speed positioning section refers to a uniform speed moving process with a relatively low speed. The speed planning method can be divided into long positioning spacing, medium positioning spacing and short positioning spacing according to the corresponding position of the curtain detected by the position sensor. In some embodiments, the long positioning spacing refers to the moving spacing of the curtain being greater than half of the total curtain stroke, the medium positioning spacing refers to the moving spacing of the curtain being in the range of one quarter to one half of the total curtain stroke, and the short positioning spacing refers to the moving spacing of the curtain being less than one quarter of the total curtain stroke.
[0004] In the process of implementing the embodiments of the present disclosure, it is found that there are at least the following problems in the related art:
[0005] Although the related technology can plan the running speed of the curtains based on the position of the curtains, such speed control is relatively simple, and the starting and stopping of the motor is not stable enough, which can easily shorten the service life of the motor.
[0006] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0008] Embodiments of the present disclosure provide a method, an apparatus, a computer-readable storage medium, and an electronic device for controlling a motor to improve the service life of the motor.
[0009] In some embodiments, the method for controlling a motor includes: obtaining the running distance of the motor; determining the target speed of the motor based on the running distance of the motor; determining a target speed adjustment scheme based on the real-time speed and the target speed of the motor; and adjusting the speed of the motor to the target speed according to the target adjustment scheme.
[0010] In some embodiments, the device for controlling the motor includes: an acquisition module for acquiring the running distance of the motor; a first determination module for determining the target speed of the motor based on the running distance of the motor; a second determination module for determining the target speed adjustment plan based on the real-time speed and the target speed of the motor; and an adjustment module for adjusting the speed of the motor to the target speed according to the target adjustment plan.
[0011] In some embodiments, the computer-readable storage medium includes a stored program, wherein the program executes the aforementioned method when it is run.
[0012] In some embodiments, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to execute the aforementioned method through the computer program.
[0013] The method, device, computer-readable storage medium, and electronic device for controlling a motor provided by the embodiments of the present disclosure can achieve the following technical effects:
[0014] The running distance of the motor is obtained, and then the target speed of the motor is determined, so that different target speeds are matched when the motor runs to different sections. The target adjustment scheme of the speed is determined based on the real-time speed and the target speed of the motor, and then the speed of the motor is adjusted to the target speed according to the target adjustment scheme. In this way, the speed of the motor is adjusted with a matching target adjustment scheme, and adjusted to a target speed that matches the running distance of the motor, so that the motor can drive the curtain to complete the preset distance at an appropriate speed. In this way, the problem of sudden start and stop of the motor or unsatisfactory slow start and stop can be avoided, and the problems of edge collision and loud noise under the action of motor inertia can be reduced, thereby extending the service life of the motor.
[0015] The above general description and the following description are exemplary and explanatory only and are not intended to limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0018] Figure 1 is a block diagram of a motor drive circuit according to an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of a method for controlling a motor according to an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of another method for controlling a motor according to an embodiment of the present application;
[0021] Figure 4 is a schematic diagram of the entire operation of a motor according to an embodiment of the present application;
[0022] Figure 5 is a schematic diagram of another method for controlling a motor according to an embodiment of the present application;
[0023] Figure 6 is a flow chart of motor speed control according to an embodiment of the present application;
[0024] Figure 7 is a schematic diagram of an electronic device according to an embodiment of the present application;
[0025] Figure 8 is a schematic diagram of a device for controlling a motor according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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 creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims 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 interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. 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 device 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.
[0028] The electric curtain includes a driving system. The driving system includes a motor, a transmission part, a track and a connecting part. The motor is arranged on a wall or a ceiling. The power output shaft of the motor is connected to the transmission part, and the transmission part is connected to the connecting part. The connecting part is slidably arranged on the track, and at the same time, the connecting part is also connected to a side of the curtain. In this way, when the motor rotates, the driving force is transmitted to the connecting part through the transmission part to drive the connecting part to slide along the track, so that the connecting part drives the curtain to run.
[0029] The motor can rotate forward and reverse, which can drive the curtains to open or close.
[0030] The controller is connected to the motor for communication to control the motor's forward rotation, reverse rotation, acceleration, deceleration, speed adjustment, etc.
[0031] Combination Figure 1 As shown, the controller output ports IN1 and IN2 control the operation of the DC motor through the DC brush motor driver chip. The logic functions of the DC brush motor driver chip are detailed in Table 1. This embodiment adopts the three states of "forward PWM, slow decay", "reverse PWM, slow decay" and "brake (stop)" in the motor driver chip logic function table, which respectively represent the driving modes of the three actions of the motor forward, reverse and stop.
[0032] Table 1 Logic functions of DC brushed motor driver chip
[0033]
[0034]
[0035] Optionally, the motor of this embodiment uses a slow decay mode for both forward and reverse rotation, and IN1 and IN2 outputs are high when the motor is stopped. When the motor rotates forward, the controller output port IN1 outputs a high level, and IN2 outputs a PWM waveform. The PWM pulse period is set to 50us. The larger the pulse width, the slower the speed. When the motor is reversed, the controller output port IN2 outputs a high level, and IN1 outputs a PWM waveform. The PWM pulse period is set to 50us. The larger the pulse width, the slower the speed.
[0036] An embodiment of the present disclosure provides a curtain, comprising the above-mentioned driving system.
[0037] Combination Figure 2 As shown, according to one aspect of an embodiment of the present application, a method for controlling a motor is provided, comprising:
[0038] S101, the controller obtains the running distance of the motor.
[0039] S102, the controller determines a target speed of the motor according to the running distance of the motor.
[0040] S103, the controller determines a target speed adjustment scheme according to the real-time speed and the target speed of the motor.
[0041] S104: The controller adjusts the speed of the motor to a target speed according to the target adjustment scheme.
[0042] The controller is connected to the motor in communication to obtain the running distance of the motor. When the curtain switches from the retracted state to the unfolded state, or from the unfolded state to the retracted state, the motor generally runs the acceleration stage first, then the uniform speed stage, and finally the deceleration stage. Here, the speed stages are divided by the running distance of the motor, and the motor needs to complete acceleration, uniform speed and deceleration within the preset distance. Different speed stages correspond to different target speeds. When the speed of the motor does not reach the target speed, the gap between the real-time speed of the motor and the target speed is constantly changing. Therefore, the target adjustment scheme of the speed is determined according to the real-time speed and the target speed of the motor, and the controller then adjusts the speed of the motor to the target speed according to the target adjustment scheme, so that the speed of the motor is adjusted according to the actual situation.
[0043] The method for controlling a motor provided by an embodiment of the present disclosure is used to obtain the running distance of the motor, and then determine the target speed of the motor, so that the motor matches different target speeds when running to different sections. A target adjustment scheme for the speed is determined based on the real-time speed and the target speed of the motor, and then the speed of the motor is adjusted to the target speed according to the target adjustment scheme. In this way, the speed of the motor is adjusted with a matching target adjustment scheme, and adjusted to a target speed that matches the running distance of the motor, so that the motor can drive the curtain to complete the preset distance at an appropriate speed. In this way, the problem of unsatisfactory effects of sudden start and stop or slow start and stop of the motor can be avoided, and problems such as edge collision and loud noise due to the inertia of the motor can be reduced, thereby extending the service life of the motor.
[0044] Combination Figure 3 As shown, according to one aspect of an embodiment of the present application, another method for controlling a motor is provided, comprising:
[0045] S101, the controller obtains the running distance of the motor.
[0046] S112, the controller determines the preset speed distribution section where the motor is located according to the running distance of the motor.
[0047] S122, the controller determines the target speed of the motor according to the preset speed distribution section where the motor is located.
[0048] S103, the controller determines a target speed adjustment scheme according to the real-time speed and the target speed of the motor.
[0049] S104: The controller adjusts the speed of the motor to a target speed according to the target adjustment scheme.
[0050] Different speeds are allocated in advance to the total distance that the motor needs to run. For example, if the total distance is divided into four sections, the running speed of the motor in the four sections will show different change trends to match the opening and closing of the curtains. Based on this, the preset speed distribution section where the motor is currently located is determined according to the running distance of the motor. Then, the target speed of the motor is determined according to the speed distribution section where it is located.
[0051] In this way, the target speed of the motor can be matched with the road section where the motor is located, so that the motor can drive the curtain to complete the corresponding road section at an appropriate speed, thereby achieving stable operation of the motor.
[0052] Optionally, at S112, the controller determines a target speed of the motor according to a preset speed distribution section where the motor is located, including:
[0053] When the running distance of the motor is in the first slow-start section, the controller determines that the target rotation speed of the motor is the first rotation speed.
[0054] When the running distance of the motor is in the second slow-start section or the uniform-speed section, the controller determines that the target speed of the motor is the second speed.
[0055] When the running distance of the motor is in a slow-stop section, the controller determines that the target speed of the motor is the third speed.
[0056] The second rotation speed is greater than the first rotation speed, and greater than the third rotation speed.
[0057] The speed of the motor gradually increases during the process of switching from static to motion, and gradually decreases during the process of switching from motion to static. The uniform speed section is set during the acceleration and deceleration process, which can be used as a buffer between the acceleration and deceleration of the motor, so that the motor runs more smoothly and reduces the life loss of the motor due to the close connection between acceleration and deceleration. Based on this, the preset speed distribution section includes: a first slow-start section, a second slow-start section, a uniform speed section and a slow-stop section. When the running distance of the motor is in the first slow-start section, the target speed of the motor is determined to be the first speed. In the first slow-start section, the motor starts slowly and gradually accelerates to the first speed. When the running section of the motor is in the second slow-start section, the target speed of the motor is determined to be the second speed, and the second speed is greater than the first speed. In the second slow-start section, the motor gradually accelerates from the first speed to the second speed. When the running distance of the motor is in the uniform speed section, the target speed of the motor is determined to be the second speed, and the motor now runs at a uniform speed at the second speed to complete the uniform speed section. When the running distance of the motor is in the slow-stop section, the target speed of the motor is determined to be the third speed, and the third speed is less than the second speed. In the slow stop section, the motor gradually decelerates from the second speed to the third speed.
[0058] In this way, when the motor runs to different sections, the motor corresponds to different target speeds, so that the target speed of the motor matches the running section, thereby making the motor run smoothly and orderly, avoiding sudden starts and stops of the motor, and thus extending the service life of the motor.
[0059] Optionally, the first speed is half of the rated speed of the motor, the second speed is the rated speed of the motor, and the third speed is half of the rated speed of the motor.
[0060] Optionally, the preset speed distribution section is determined in the following manner: the controller divides the running distance into a slow-start section, a uniform-speed section and a slow-stop section according to the full travel distance of the motor and user needs.
[0061] Combination Figure 4 As shown, the normal operation of the motor is divided into four sections, namely the first slow-start section, the second slow-start section, the uniform speed section, and the slow-stop section, which respectively represent the starting acceleration section, the second acceleration section, the middle uniform speed section, and the final deceleration section of a complete operation process. The distance distribution of the four sections can be freely allocated according to the total travel distance and user experience requirements.
[0062] Optionally, the distance of the slow stop section is longer than the distance of the first slow start section, and longer than the distance of the second slow start section. In this way, the slow stop section is longer than the slow start section, and the user experience will be better. For example, the distance of the first slow start section is 16 cm, and the distance of the slow stop section is 32 cm. Before the user knows it, the curtain has slowly started and slowly stopped, completing the opening or closing action. It should be noted that the distance of the slow start section and the slow stop section should not be set too long, otherwise it will take a long time for the curtain to complete an opening or closing action, thereby affecting the user experience.
[0063] Those skilled in the art will appreciate that the uniform speed section is not a uniform speed in the strict sense, but the motor drive power is adjusted according to the feedback of the real-time speed of the motor, thereby causing the speed of the motor to fluctuate above and below the rated speed.
[0064] Optionally, the longer the total running distance of the motor is, the longer the distance of the uniform speed section is. In this way, the longer the uniform speed distance of the motor is in a longer running distance, the longer the stable running time of the motor is. In this way, the loss of the motor caused by frequent speed changes can be reduced.
[0065] Combination Figure 5 As shown, according to one aspect of an embodiment of the present application, another method for controlling a motor is provided, comprising:
[0066] S101, the controller obtains the running distance of the motor.
[0067] S102, the controller determines a target speed of the motor according to the running distance of the motor.
[0068] S113, the controller calculates the speed difference between the real-time speed of the motor and the target speed.
[0069] S123: The controller determines a target speed adjustment scheme according to the speed difference.
[0070] S104: The controller adjusts the speed of the motor to a target speed according to the target adjustment scheme.
[0071] The controller communicates with the speed sensor to obtain the current speed of the motor. Optionally, it is obtained once every 10ms. Then the speed difference diffRPM between the current motor speed and the current target speed of the motor is calculated in real time. The controller determines the target adjustment scheme of the motor speed according to the size of the speed difference.
[0072] In this way, based on the speed difference between the real-time speed of the motor and the corresponding target speed, the operation of the motor is adjusted in real time so as to make the motor run smoothly.
[0073] Optionally, the target adjustment scheme of the speed includes acceleration and deceleration control of the motor. A first set difference range, a second set difference range and a third set difference range are pre-set to define the difference between the real-time speed of the motor and the target speed. The upper limit value of the first set difference range is less than the lower limit value of the second set difference range, and the upper limit value of the second set difference range is less than the lower limit value of the third set difference range.
[0074] When the speed difference is within the first set difference range, the controller determines that the motor is accelerating. Optionally, the first set difference range is (-∞,-targetRPM / 16). At this time, the difference range where the speed difference is located is large, and the speed difference is a negative value, indicating that the real-time speed of the motor is small, and then the motor is controlled to accelerate so that the motor reaches the corresponding target speed. When the speed difference is within the second set difference range, the controller determines that the motor is running at a constant speed. Optionally, the second set difference range is [-targetRPM / 16, targetRPM / 16). At this time, the real-time speed of the motor is within an appropriate range, and the motor is controlled to maintain the current speed unchanged. When the speed difference is within the third set difference range, the controller determines that the motor is decelerating. Optionally, the third set difference range is [targetRPM / 16, +∞). At this time, the difference range where the speed difference is located is large, and the speed difference is a positive value, indicating that the real-time speed of the motor is large, and then the motor is controlled to decelerate so that the motor reaches the corresponding target speed. Wherein, targetRPM is the target speed corresponding to the set difference range. Specifically, the first set difference range corresponds to the motor accelerating, and the running section is in the slow start section, then the targetRPM is the first speed. The second set difference range corresponds to the motor running at a constant speed, and the running section is in the constant speed section, then the targetRPM is the second speed. The third set difference range corresponds to the motor decelerating, and the running section is in the slow stop section, then the targetRPM is the third speed.
[0075] In this way, the acceleration and deceleration of the motor is controlled based on the difference range of the speed difference, so that the speed of the motor is within a suitable speed range, thereby making the motor run smoothly.
[0076] Optionally, the target speed adjustment scheme also includes pulse width adjustment of the motor. The speed of the motor is achieved by changing the duty cycle of the motor control signal. Adjusting the pulse width can change the duty cycle of the control signal, thereby changing the speed of the motor. The larger the pulse width, the greater the motor torque and the faster the speed; the smaller the pulse width, the smaller the motor torque and the slower the speed. Therefore, when it is determined that the motor is accelerating or decelerating, the speed of the motor can be controlled by adjusting the pulse width.
[0077] Optionally, a plurality of sub-setting difference ranges are divided within the first setting difference range. When the upper limit value of the sub-setting difference range is larger, it means that the real-time speed of the motor is closer to the appropriate speed range, so the pulse width regulation is determined to be slower to avoid speed overshoot. Optionally, the pulse width regulation rates corresponding to the plurality of sub-setting difference ranges with upper limits from small to large are reduced in geometric proportion. Specifically, the first setting difference range includes a first sub-setting difference range, a second sub-setting difference range, a third sub-setting difference range and a fourth sub-setting difference range, and the upper limits of the first sub-setting difference range to the fourth sub-setting difference range are increased in sequence. The first sub-setting difference range to the fourth sub-setting difference range correspond to the first pulse width regulation rate, the second pulse width regulation rate, the third pulse width regulation rate and the fourth pulse width regulation rate, respectively. The first pulse width regulation rate to the fourth pulse width regulation rate decrease in sequence and decrease in equal proportion.
[0078] Optionally, the first sub-setting difference range is (-∞, -targetRPM / 2), and the corresponding first pulse width regulation rate is reduced by 1 pulse unit every 20ms. The second sub-setting difference range is [-targetRPM / 2, -targetRPM / 4), and the corresponding second pulse width regulation rate is reduced by 1 pulse unit every 40ms. The third sub-setting difference range is [-targetRPM / 4, -targetRPM / 8), and the corresponding third pulse width regulation rate is reduced by 1 pulse unit every 80ms. The fourth sub-setting difference range is [-targetRPM / 8, -targetRPM / 16), and the corresponding fourth pulse width regulation rate is reduced by 1 pulse unit every 160ms.
[0079] Optionally, a plurality of sub-setting difference ranges are divided within the third setting difference range. When the upper limit value of the sub-setting difference range is smaller, it means that the real-time speed of the motor is closer to the appropriate speed range, so the pulse width regulation is determined to be slower to avoid speed overshoot. Optionally, the pulse width regulation rates corresponding to the plurality of sub-setting difference ranges with upper limits from small to large increase in geometric proportion. Specifically, the third setting difference range includes the fifth sub-setting difference range, the sixth sub-setting difference range, the seventh sub-setting difference range and the eighth sub-setting difference range, and the upper limits of the fifth sub-setting difference range to the eighth sub-setting difference range increase in sequence. The fifth sub-setting difference range to the eighth sub-setting difference range correspond to the fifth pulse width regulation rate, the sixth pulse width regulation rate, the seventh pulse width regulation rate and the eighth pulse width regulation rate, respectively. The fifth pulse width regulation rate to the eighth pulse width regulation rate increase in sequence and increase in equal proportion.
[0080] Optionally, the fifth sub-setting difference range is (targetRPM / 16, targetRPM / 8], and the corresponding fifth pulse width regulation rate is increased by 1 pulse unit every 160ms. The sixth sub-setting difference range is (targetRPM / 8, targetRPM / 4], and the corresponding sixth pulse width regulation rate is increased by 1 pulse unit every 80ms. The seventh sub-setting difference range is (targetRPM / 4, targetRPM / 2], and the corresponding seventh pulse width regulation rate is increased by 1 pulse unit every 40ms. The eighth sub-setting difference range is (targetRPM / 2, +∞), and the corresponding eighth pulse width regulation rate is increased by 1 pulse unit every 20ms.
[0081] For the specific adjustment scheme of the motor pulse width, please refer to Figure 6 .
[0082] In this way, when controlling the motor to accelerate or decelerate, the pulse width is regularly adjusted to make the motor speed transition smoothly, thereby extending the service life of the motor.
[0083] There are two acceleration processes in the motor startup phase. The first acceleration process is the first slow-start section, and the target speed is half of the motor's rated speed. The second acceleration process is the second slow-start section, which is a short distance before the motor's uniform speed stage, and the target speed is the motor's rated speed. There is a deceleration process in the motor slow-stop section, and the target speed is half of the motor's rated speed.
[0084] Combination Figure 7 As shown, an embodiment of the present disclosure provides an electronic device 70, including an acquisition module 71, a first determination module 72, a second determination module 73 and an adjustment module 74. The acquisition module 71 is configured to acquire the running distance of the motor. The first determination module 72 is configured to determine the target speed of the motor according to the running distance of the motor. The second determination module 73 is configured to determine the target speed adjustment scheme according to the real-time speed and the target speed of the motor. The adjustment module 74 is configured to adjust the speed of the motor to the target speed according to the target adjustment scheme.
[0085] The device 70 for controlling the motor provided by the embodiment of the present disclosure is used to obtain the running distance of the motor, and then determine the target speed of the motor, so that the motor matches different target speeds when running to different sections. A target adjustment scheme for the speed is determined based on the real-time speed and the target speed of the motor, and then the speed of the motor is adjusted to the target speed according to the target adjustment scheme. In this way, the speed of the motor is adjusted with a matching target adjustment scheme, and adjusted to a target speed that matches the running distance of the motor, so that the motor can drive the curtain to complete the preset distance at an appropriate speed. In this way, the problem of unsatisfactory effects of sudden start and stop or slow start and stop of the motor can be avoided, and problems such as edge collision and loud noise due to the inertia of the motor can be reduced, thereby extending the service life of the motor.
[0086] Combination Figure 8 As shown, an embodiment of the present disclosure provides a device 80 for controlling a motor, including a processor 81 and a memory 82. Optionally, the device 80 may also include a communication interface 83 and a bus 84. The processor 81, the communication interface 83, and the memory 82 may communicate with each other through the bus 84. The communication interface 83 may be used for information transmission. The processor 81 may call the logic instructions in the memory 82 to execute the method for controlling a motor of the above embodiment.
[0087] In addition, the logic instructions in the memory 82 described above may be implemented in the form of software functional units and when sold or used as independent products, may be stored in a computer-readable storage medium.
[0088] The memory 82 is a computer-readable storage medium that can be used to store software programs and computer executable programs, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor 81 executes the function application and data processing by running the program instructions / modules stored in the memory 82, that is, the method for controlling the motor in the above embodiment is implemented.
[0089] The memory 82 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required for at least one function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 82 may include a high-speed random access memory and may also include a non-volatile memory.
[0090] The disclosed embodiments provide a curtain, comprising: a curtain body, the aforementioned drive system, and the aforementioned electronic device 70 / device for controlling a motor 80. The electronic device 70 / device for controlling a motor 80 is installed on the curtain body. The installation relationship described here is not limited to placement inside the curtain body, but also includes installation connections with other components of the curtain, including but not limited to physical connections, electrical connections, or signal transmission connections. It can be understood by those skilled in the art that the electronic device 70 / device for controlling a motor 80 can be adapted to a feasible device body, thereby realizing other feasible embodiments.
[0091] An embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured to execute the above-mentioned method for controlling a motor.
[0092] The technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiment of the present disclosure. The aforementioned storage medium may be a non-transient storage medium, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes.
[0093] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent only possible changes. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. The parts and features of some embodiments may be included in or replace the parts and features of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0094] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. The technicians may use different methods for each specific application to implement the described functions, but such implementations should not be considered to exceed the scope of the embodiments of the present disclosure. The technicians may clearly understand that, for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above may refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0095] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0096] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for controlling a motor, characterized in that: The method comprises: Get the running distance of the motor; Determine the target speed of the motor according to the running distance of the motor; Determine the target speed adjustment plan based on the real-time speed and target speed of the motor; According to the target adjustment plan, the speed of the motor is adjusted to the target speed.
2. The method for controlling a motor according to claim 1, characterized in that: Determine the target speed of the motor according to the running distance of the motor, including: According to the running distance of the motor, determine the preset speed distribution section where the motor is located; The target speed of the motor is determined according to the preset speed distribution section where the motor is located.
3. The method for controlling a motor according to claim 2, characterized in that: The preset speed distribution section includes: a first slow start section, a second slow start section, a constant speed section and a slow stop section; according to the preset speed distribution section where the motor is located, determining the target speed of the motor includes: When the running distance of the motor is in the first slow-start section, the target speed of the motor is determined to be the first speed; when the running distance of the motor is in the second slow-start section or the uniform speed section, the target speed of the motor is determined to be the second speed; When the running distance of the motor is in a slow-stop section, determining the target speed of the motor to be a third speed; The second rotation speed is greater than the first rotation speed, and greater than the third rotation speed.
4. The method for controlling a motor according to claim 2, characterized in that: The preset speed distribution sections are determined in the following way: The total running distance of the motor is divided into a first slow-start section, a second slow-start section, a uniform speed section and a slow-stop section; among them, the distance of the slow-stop section is longer than the distance of the first slow-start section; the distance of the slow-stop section is longer than the distance of the second slow-start section; the longer the total running distance of the motor is, the longer the distance of the uniform speed section is.
5. The method for controlling a motor according to any one of claims 1 to 4, characterized in that: According to the real-time speed and target speed of the motor, determine the target speed adjustment scheme, including: Calculate the speed difference between the real-time speed of the motor and the target speed; According to the speed difference, the target speed adjustment plan is determined.
6. The method for controlling a motor according to claim 5, characterized in that: According to the speed difference, determine the target speed adjustment plan, including: When the speed difference is within the first set difference range, determining that the motor is accelerating; When the speed difference is within the second set difference range, determining that the motor runs at a constant speed; When the speed difference is within a third set difference range, determining that the motor is running at a reduced speed; The upper limit of the first setting difference range is smaller than the lower limit of the second setting difference range, and the upper limit of the second setting difference range is smaller than the lower limit of the third setting difference range.
7. The method for controlling a motor according to claim 6, characterized in that: When it is determined that the motor is accelerating or decelerating, a target speed adjustment scheme is determined according to the speed difference, which also includes: determining a pulse width adjustment scheme of the motor according to the speed difference.
8. The method for controlling a motor according to claim 7, characterized in that: According to the speed difference, determine the pulse width regulation scheme of the motor, including: When the speed difference is within the first set difference range, the larger the upper limit of the sub-set difference range included in the first set difference range, the slower the corresponding pulse width adjustment; When the rotation speed difference is within the third set difference range, the smaller the upper limit value of the sub-set difference range included in the third set difference range, the slower the corresponding pulse width adjustment.
9. The method for controlling a motor according to claim 8, characterized in that: The first setting difference range includes a plurality of sub-setting difference ranges, and the pulse width modulation rates corresponding to the plurality of sub-setting difference ranges with upper limits from small to large decrease in geometric proportion.
10. The method for controlling a motor according to claim 8, characterized in that: The third setting difference range includes a plurality of sub-setting difference ranges, and the pulse width modulation rates corresponding to the plurality of sub-setting difference ranges with upper limits from small to large increase in geometric proportion.
11. A device for controlling a motor, characterized in that: include: Acquisition module, to obtain the running distance of the motor; A first determination module determines a target speed of the motor according to a running distance of the motor; The second determination module determines a target speed adjustment scheme according to the real-time speed and the target speed of the motor; The regulating module regulates the speed of the motor to the target speed according to the target regulating scheme.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method for controlling a motor according to any one of claims 1 to 10 when executed.
13. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method for controlling a motor according to any one of claims 1 to 10 through the computer program.