Stepping motor control method and device, electronic equipment and storage medium

By obtaining the target backlash difference and determining the return path, the problem of inaccurate positioning caused by the backlash difference of the stepper motor in the projector is solved, and accurate positioning and status recording of the controlled module are realized.

CN116980575BActive Publication Date: 2025-11-25APPOTRONICS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210431069.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2025-11-25
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

In projectors, the backlash of stepper motors makes it impossible to precisely control the position of the controlled module, especially in cases of multiple backlashes, making it impossible to determine the true state of the controlled module.

Method used

By obtaining the target return difference corresponding to the target position in the return table, and determining the first return path based on the current number of steps, the target number of steps, the target return position, and the target return difference, the motor drives the controlled module to move along the first return path to reach the target position.

Benefits of technology

It effectively eliminates the backlash caused by motor reversal, ensures accurate recording of the position status of the controlled module, and achieves precise positioning of the controlled module.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116980575B_ABST
    Figure CN116980575B_ABST
Patent Text Reader

Abstract

The application discloses a stepping motor control method and device, electronic equipment and storage medium, and relates to the technical field of motor control. The method comprises the following steps: acquiring the current motion step number, the current return position, the target motion step number and the target return position of the motor; acquiring the current position and the target position of the controlled module, wherein the current position is the difference between the current motion step number and the current return position, the target position is the difference between the target motion step number and the target return position, the controlled module is connected with the motor through a transmission mechanism; if the current position does not reach the target position, acquiring the target return difference corresponding to the target position in the return table; determining the first return path according to the current motion step number, the target motion step number, the target return position and the target return difference, and controlling the motor to drive the controlled module to move according to the first return path to reach the target position, so that the return difference caused by the motor return can be effectively eliminated, the real state of the controlled module can be determined, and the position state of the controlled module can be more accurately recorded.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of projectors, and more particularly, to a stepping motor control method and device, an electronic device, and a storage medium. BACKGROUND

[0002] In a projector, a controlled module, such as a lens, can be connected to a motor through a transmission mechanism. In the transmission mechanism, some tolerance margins are inevitably reserved, which are manifested as gaps between the transmission mechanisms. In the process of motor backfolding, a certain number of steps of idling will be experienced first, and the number of steps of idling is the backfolding difference.

[0003] For focusing, zooming, lens displacement, and other operations of a projector, control of a stepping motor is used. Due to the backfolding difference, the position of the controlled module cannot be accurately controlled by simply controlling the number of steps of the motor, especially in the case of multiple backfolding, the real state of the controlled module cannot be determined, which leads to the fact that the current position of the controlled module cannot be accurately recorded. SUMMARY

[0004] In view of this, the present application provides a stepping motor control method and device, an electronic device, and a storage medium to at least solve one of the above technical problems.

[0005] In a first aspect, an embodiment of the present application provides a stepping motor control method, which includes: obtaining a current movement step number, a current backfolding position, a target movement step number, and a target backfolding position of a motor; obtaining a current position and a target position of a controlled module, wherein the current position is the difference between the current movement step number and the current backfolding position, the target position is the difference between the target movement step number and the target backfolding position, the controlled module is connected to the motor through a transmission mechanism; if the current position has not reached the target position, obtaining a target backfolding difference corresponding to the target position in a backfolding table, wherein the backfolding table includes a plurality of predetermined positions and a backfolding difference corresponding to each predetermined position; determining a first backfolding path according to the current movement step number, the target movement step number, the target backfolding position, and the target backfolding difference; and controlling the motor to drive the controlled module to move according to the first backfolding path to reach the target position.

[0006] In a second aspect, the embodiment of the present application provides a control device of a stepper motor, which comprises: a motor state acquisition module, configured to acquire a current motion step number, a current return position, a target motion step number and a target return position of the motor; a controlled module state acquisition module, configured to acquire a current position and a target position of a controlled module, wherein the current position is a difference between the current motion step number and the current return position, the target position is a difference between the target motion step number and the target return position, and the controlled module is connected to the motor through a transmission mechanism; a return difference acquisition module, configured to acquire a target return difference corresponding to the target position in a return table if the current position does not reach the target position, wherein the return table comprises a plurality of predetermined positions and a return difference corresponding to each predetermined position; and a first return path module, configured to determine a first return path according to the current motion step number, the target motion step number, the target return position and the target return difference, and control the motor to drive the controlled module to move according to the first return path to reach the target position.

[0007] In a third aspect, the embodiment of the present application provides an electronic device, a processor and a memory, wherein the memory stores computer readable instructions, and the computer readable instructions are executed by the processor to implement any of the above methods.

[0008] In a fourth aspect, the embodiment of the present application provides a computer readable storage medium, which stores program codes, and the program codes can be invoked by a processor to execute any of the above methods.

[0009] In the embodiment of the present application, the target return difference corresponding to the target position in the return table is acquired, and then the first return path is determined according to the current motion step number, the target motion step number, the target return position and the target return difference, and the motor is controlled to drive the controlled module to move according to the first return path to reach the target position, thereby avoiding the influence of the return difference when directly positioning the current position and the target position of the controlled module. Moreover, since the return difference is caused by the motor return, the first return path proposed in the present application can effectively eliminate the return difference caused by the motor return, so as to determine the real state of the controlled module and more accurately record the position state of the controlled module. BRIEF DESCRIPTION OF DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.

[0011] Figure 1A structural schematic diagram of an electronic device is shown.

[0012] Figure 2 A flow chart of a step motor control method is shown.

[0013] Figure 3 A flow chart of generating a first return path is shown.

[0014] Figure 4 A partial flow chart of a step motor control method is shown.

[0015] Figure 5 A flow chart of generating a second return path is shown.

[0016] Figure 6 A flow chart of a return table acquisition method is shown.

[0017] Figure 7 A schematic diagram of a return table acquisition method is shown.

[0018] Figure 8 A block diagram of a control system of a step motor is shown.

[0019] Figure 9 A block diagram of a step motor control device is shown. DETAILED DESCRIPTION

[0020] Example implementations are now described with reference to the following drawings. The example implementations, however, can be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these implementations are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example implementations to those skilled in the art.

[0021] Moreover, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the

[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0023] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0024] In response to the problems raised in the background technology, the inventors discovered through research that if a specific position of the controlled module is marked as the starting position by adding an optocoupler switch, and the same number of steps are run each time from the starting position to ensure position reliability, the time required to reach the specific position will be excessive. Using an encoder for feedback control would significantly increase costs.

[0025] Therefore, the inventors have proposed a stepper motor control method, device, and electronic device provided in the embodiments of this application. By obtaining the target retrace difference corresponding to the target position in the retrace table, and then determining the first turnaround path based on the current number of steps, the target number of steps, the target retrace position, and the target retrace difference, the motor is controlled to drive the controlled module to move along the first turnaround path to reach the target position, thus avoiding the influence of the retrace difference when directly locating the current position and target position of the controlled module.

[0026] Figure 1 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of this application is shown, such as... Figure 1 As shown, the memory 1005, which serves as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and other electronic programs.

[0027] exist Figure 1 In the electronic device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the electronic device of the present invention can be set in the electronic device, and the electronic device calls the stepper motor control device stored in the memory 1005 through the processor 1001, and executes the stepper motor control method provided in the embodiments of this application respectively.

[0028] The processor 1001 can include one or more processing cores. The processor 1001 connects various parts within the entire electronic device by various interfaces and lines, performs various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 1005, and calling data stored in the memory 1005. Alternatively, the processor 1001 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), a programmable logic array (PLA). The processor 1001 can integrate a combination of one or several of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes an operating system, a user interface, and an application program; the GPU is responsible for rendering and drawing display content; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1001, but can be realized by a separate communication chip.

[0029] The memory 1005 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 1005 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 1005 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, an alarm function, etc.), instructions for implementing each of the methods described below, etc. The data storage area can also store data created by the electronic device in use (such as a disguised response command, an obtained process state), etc.

[0030] Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the electronic device, and can include more or fewer components than the drawings, or combine certain components, or different component arrangements. Figure 1 The structure shown in the above embodiments does not constitute a limitation on the electronic device, and can include more or fewer components than the drawings, or combine certain components, or different component arrangements.

[0031] In the embodiments of the present application, the electronic device can be an electronic device in a projector, or an electronic device independent of the projector. If it is an independent electronic device, it needs to be connected with the motor or motor controller in the projector.

[0032] Figure 2is a flow chart of a stepping motor control method according to an embodiment of the present application, which can be executed by the electronic device described above. The voiceprint recognition model comprises a classification layer and a multi-layer cascaded feature extraction network layer, as shown in Figure 2 The method comprises at least steps 210 to 240, which are described in detail as follows.

[0033] In step 210, the current motion step number, the current return position, the target motion step number and the target return position of the motor are obtained.

[0034] The motor in the embodiment of the present application can be a stepping motor, which can realize precise motion in steps. The current motion step number of the motor refers to the step number of the motor when driving the controlled module to the current position. The current return position of the motor refers to the motor step number corresponding to the position of the transmission mechanism between the motor and the controlled module when driving the controlled module to the current position. The target motion step number of the motor refers to the step number of the motor when driving the controlled module to the target position. The target return position of the motor refers to the motor step number corresponding to the position of the transmission mechanism when driving the controlled module to the target position. The step number of the motor above is referred to the reference position, and the corresponding motion step number is 0 when the motor is at the reference position.

[0035] In the embodiment of the present application, whether the current motion step number and the current return position of the motor are initialized can be determined first. In actual application, the projector may be turned on for a long time, which may cause the motor to lose steps. Therefore, the current state can be initialized.

[0036] In step 220, the current position and the target position of the controlled module are obtained, wherein the current position is the difference between the current motion step number and the current return position, and the target position is the difference between the target motion step number and the target return position. The controlled module is connected to the motor through a transmission mechanism.

[0037] Since the controlled module is connected to the motor through a transmission mechanism, the current position of the controlled module can be obtained by subtracting the current motion step number from the current return position. Similarly, the target position of the controlled module is the difference between the target motion step number and the target return position.

[0038] In step 230, if the current position has not reached the target position, the target return difference corresponding to the target position in the return table is obtained, wherein the return table comprises a plurality of predetermined positions and a return difference corresponding to each predetermined position.

[0039] The current position not reaching the target position is specifically that the controlled module moves towards the target position. The predetermined position is a position set by a human recording the back-and-forth difference between the controlled module and the motor. The predetermined position is not limited, and the predetermined position in the back-and-forth table corresponds to the back-and-forth difference one by one, which can be obtained in advance.

[0040] In step 240, a first return path is determined according to the current movement step number, the target movement step number, the target back-and-forth position, and the target back-and-forth difference, and the motor is controlled to drive the controlled module to move according to the first return path to reach the target position.

[0041] After obtaining the target back-and-forth difference, the actual distance that the controlled module needs to walk can be calculated in combination with the target position of the motor and the target back-and-forth difference. Then, the forward walking step number and the reverse walking step number are calculated according to the actual distance to be walked, the current movement step number, the target movement step number, and the target back-and-forth difference, and the first return path is obtained.

[0042] In the scheme of the embodiment, the target back-and-forth difference corresponding to the target position in the back-and-forth table is obtained, and then the first return path is determined according to the current movement step number, the target movement step number, the target back-and-forth position, and the target back-and-forth difference, and the motor is controlled to drive the controlled module to move according to the first return path to reach the target position. The influence of the back-and-forth difference when directly positioning the current position and the target position of the controlled module is avoided. Moreover, since the back-and-forth difference is caused by the motor return, the first return path proposed in the present application can effectively eliminate the back-and-forth difference caused by the motor return, so as to determine the real state of the controlled module and more accurately record the position state of the controlled module.

[0043] In the embodiment, the controlled module reaches the target position through the motor control according to the return path.

[0044] Since the back-and-forth difference is caused by the motor return operation, when the controlled module is controlled to move by the motor, the influence of the back-and-forth difference can be effectively eliminated, so as to accurately reach the target position.

[0045] In some embodiments, the first return path can include a first forward step number and a first reverse step number, and the first return path is determined according to the current movement step number, the target movement step number, the target back-and-forth position, and the target back-and-forth difference, as shown in Figure 3 The first return path includes:

[0046] In step 310, the sum of the target position and the target back-and-forth difference is obtained to obtain a target back-and-forth value.

[0047] Due to the existence of the return difference, in fact, when the motor reaches the target position, the controlled module is still away from the target position by a distance of the target return difference. Therefore, the actual distance traveled by the controlled module is not the distance from the original point to the target position of the motor, but the target position plus the distance of the target return difference corresponding to the target position in the return table. Therefore, the target return value is the total distance that the controlled module actually needs to travel from the original point to the target position.

[0048] In step 320, a difference between the target return value and the current motion step number is obtained to obtain a first forward step number.

[0049] Since the motor and the controlled module do not start from the original point, but start from the current position, the distance that the controlled module needs to move at this time is the difference between the target return value and the current motion step number, that is, the first forward step number.

[0050] In step 330, a difference between the target return difference and the target motion step number is obtained to obtain a first reverse step number.

[0051] For example, assuming that the current motion step number is x0, the current return position is y0, the target motion step number is x1, the target return position is y1, and the target return difference is z1, in the embodiment, the current position has not reached the target position, that is, x0-y0

[0052] In the embodiment, since the return difference is generated by the return movement of the motor, the first forward step number can only eliminate the forward return difference generated by the forward movement of the motor. In order to make the controlled module accurately reach the target position, the reverse return difference generated by the reverse movement also needs to be offset, so the controlled module needs to move in the reverse direction by the first reverse step number, so as to ensure that the position reached by the controlled module is the target position.

[0053] In the embodiment, the motor is controlled to move forward by the first forward step number and move in the reverse direction by the first reverse step number. When the current position has not reached the target position, the forward return difference of the motor is first eliminated, and then the reverse return difference is eliminated by return movement, so that the controlled module reaches the correct position.

[0054] Referring to Figure 4 As shown in FIG. 4, the step-by-step motor control method provided in the embodiment of the present application can further include steps 410 to 420, which are described in detail as follows.

[0055] If the current position exceeds the target position, a second U-turn path is determined according to the current motion step number, the target motion step number and the target return position.

[0056] In step 420, the motor is controlled to drive the controlled module to move along the second U-turn path to reach the target position.

[0057] When the current position has exceeded the target position that the controlled module needs to reach, the U-turn path is different from the first U-turn path described above, and is planned by the current motion step number, the target motion step number and the target return position.

[0058] Referring to Figure 5 as shown, Figure 5 FIG. 2 is a flowchart of a second U-turn path planning process, the second U-turn path including a second forward step number and a second reverse step number, the second U-turn path being determined according to the current motion step number, the target motion step number and the target return position, including:

[0059] In step 510, the target return difference is obtained to obtain the second forward step number.

[0060] The target return difference can make the controlled module offset the forward return difference caused by the motor forward.

[0061] In step 520, the difference between the current motion step number and the target motion step number is obtained to obtain a second U-turn relative step number.

[0062] Since the current position has exceeded the target position, at this time, the step number of the motor is more than the step number that should be taken, and therefore, the second U-turn relative step number is the extra step number actually taken by the motor.

[0063] In step 530, the sum of the second U-turn relative step number and the target return difference is obtained to obtain the second reverse step number.

[0064] The second reverse step number is the extra step number actually taken by the motor plus the return difference value corresponding to the motor and the controlled module at the target position, which can offset the reverse return difference of the motor.

[0065] For example, assuming that the current motion step number is x0, the current return position is y0, the target motion step number is x1, the target return position is y1, and the target return difference is z1, in this embodiment, the current position has not reached the target position, which means that x0-y0>x1-y1, at this time, the second forward step number is the target position y1, and the second reverse step number is determined by the current motion step number x0, the target motion step number x1 and the target return difference z1, and is specifically represented as x0-x1+z1.

[0066] In the embodiment, the control of the motor to drive the controlled module to move along the second return path to the target position comprises:

[0067] The motor is controlled to run reversely for the second reverse step number and to run forwardly for the second forward step number.

[0068] Since the current position has exceeded the target position, the reverse return difference needs to be offset first, so that the controlled module has not reached the target position, and then the target position in the return table is used to offset the motor forward return difference, so that the controlled module accurately reaches the target position.

[0069] Referring to Figure 6 , Figure 6 The flowchart of the method for obtaining the return table in the above embodiment can include:

[0070] Step 610: record the step number of the motor when the motor drives the controlled module to move to a predetermined position in a first direction as a first step number.

[0071] Step 620: record the step number of the motor when the motor drives the controlled module to continue to move in the first direction and then to move in a second direction to the predetermined position as a second step number, the first direction being opposite to the second direction.

[0072] When the motor drives the controlled module to continue to move in the first direction, the movement path needs to move a certain distance and then move in the second direction. The certain distance is to avoid that the short distance will be triggered by accidental vibration or stress.

[0073] Step 630: calculate the difference between the first step number and the second step number to obtain a return difference.

[0074] Step 640: record the corresponding relationship between the predetermined position and the return difference.

[0075] Step 650: change the predetermined position and reacquire the first step number, the second step number, and the corresponding return difference.

[0076] Step 660: establish the return table according to the recorded plurality of corresponding relationships.

[0077] The return difference corresponding to different positions of the controlled module is recorded to cover all preset positions of the controlled module as much as possible, so as to facilitate subsequent path planning of the controlled module.

[0078] In order to facilitate understanding of the above return difference calculation method, please refer to Figure 7 , in Figure 7In the schematic diagram shown, the upper edge line in the diagram represents the maximum return difference, the lower edge line represents the return difference of 0, and the left and right edge lines represent the positions of the respective feedback modules. In this embodiment, the position of the controlled module is determined by the intersection of the extension line of the current return position and the x-axis, and the angle between the extension line of the current return difference and the x-axis is 45°. When the controlled module starts from the starting point and passes the predetermined position for the first time in the first direction, the horizontal coordinate of the predetermined position at this time is recorded as a. After passing the predetermined position, the controlled module needs to run a certain number of steps in the first direction, at which time the folding movement is performed according to the folding path in this embodiment. When the controlled module reaches the predetermined position again, the horizontal coordinate of the predetermined position at this time is recorded as b, and the return difference corresponding to the predetermined position is recorded as a-b. Each point in the diagram can be used as a predetermined position. By using different predetermined positions, the return difference corresponding to the predetermined position is recorded according to the above method, thereby establishing a return table.

[0079] In this embodiment, the first number of steps is the counted number of steps based on the reference position. The setting of the reference position is set by the motor controlling the movement of the controlled module. The present embodiment involves the setting of a single reference position.

[0080] Specifically, the setting of the reference position can be set by the following steps: when the motor controls the controlled module to move in the direction of the feedback module until the controlled module triggers the feedback module to generate a feedback signal; the controlled module continues to move in the direction of the feedback module for a certain number of steps n1; at this time, the movement is reversed until the feedback signal disappears, and the number of steps n2 at this time is recorded; the controlled module continues to move in the direction opposite to the feedback module for a certain number of steps n3, at this time, the position of the number of steps n3 is the reference position.

[0081] In the present embodiment, the controlled module does not stop immediately after triggering the feedback signal. If the position where the feedback signal is triggered is directly set as the reference position, the actual position of the controlled module is uncertain, which will cause certain errors in the subsequent return difference measurement. In addition, the feedback module is usually set at the edge position, so as to prevent the reference position from being set at the edge position. Therefore, a certain number of steps are moved after the feedback signal disappears, and the position is set as the reference position.

[0082] In another embodiment of the present application, for the existence of multiple feedback modules, the reference position setting method can be to select one of the feedback modules as a 0-point feedback module, and set the position of the 0-point feedback module as a 0-point position. The 0-point position is taken as the starting point, and the reference position is set according to the above-mentioned reference position setting method for a single feedback module. Details are not repeated here.

[0083] Different from the single feedback module, the relative step number between each feedback module and the 0-point feedback module should also be recorded after setting the reference position. The relative step number is recorded to avoid the error caused by the motor out of step. For example, when the controlled module triggers the first feedback module and then moves in the opposite direction of the first feedback module until triggering the second feedback module, the motor records the step number as 450 steps. However, in the reference position setting stage, it has been measured that the relative step number between the first feedback module and the second feedback module is 500 steps, and the return position is set as 0. At this time, it can be judged that the motor has generated an out-of-step error. At this time, the motor step number is directly set as 500 steps, so as to cancel the error and ensure the accuracy of subsequent motor step counting.

[0084] When the controlled module triggers the first feedback module and then moves in the direction of the first feedback module until triggering the second feedback module, the motor step number at this time is set as the relative step number between the first feedback module and the second feedback module which has been measured in the reference position setting stage, and the return position is set as the return difference obtained in the return table, so as to further ensure the accuracy of subsequent motor step counting.

[0085] In the embodiment of the present application, the method for obtaining the return table further comprises:

[0086] Step 710, in the plurality of return differences, a maximum return difference is obtained;

[0087] Step 720, the maximum return difference is recorded in the return table.

[0088] The maximum return difference is a special value in the return table, and is the maximum value of the difference between the first step number and the second step number obtained by changing a plurality of predetermined positions. In the actual application process, when the first step number is 0, the corresponding return difference at this time is the maximum return difference in the return table.

[0089] In the embodiment of the present application, a control system of a stepper motor is further provided. Referring to the figure, the figure is a structural block diagram of the control system of the stepper motor. The control system of the stepper motor comprises:

[0090] The active module 810: in the embodiment, the active module is a stepper motor, which can realize accurate movement in steps. The active module can have a return difference inside.

[0091] The controlled module 820: coupled with the active module through a transmission mechanism, the movement of the active module will affect a certain property of the controlled module, which is the final control target. For the embodiment, the controlled module can be a lens position, a state of a lens focusing module, a state of a lens zoom module, a position of a clear focusing plane of a lens, a field of view (FOV) of a lens, etc.

[0092] The feedback module 830 generates a trigger signal when the controlled module reaches a specific pose by means of an optocoupler switch or the like. The specific pose refers to a specific action when the feedback module is triggered. For example, the optocoupler switch, because the level of the optocoupler switch is controlled by light, when the controlled module blocks the light of the optocoupler switch, the level of the optocoupler switch becomes low, and the specific pose is the blocking of the light at this time.

[0093] The storage module 840 stores the maximum return difference or the reference value of the return difference in a non-volatile storage medium. When the feedback module contains multiple trigger positions, the number of steps corresponding to each trigger position is recorded.

[0094] The operation module (not shown in the figure) realizes the functions of recording the internal state, controlling the active module, path planning, and the like.

[0095] The active module control module 850 controls the active module by means of a pulse signal or a level change or the like.

[0096] The main control module 860 records the current number of steps and the return state according to the current operation of the active module and the return information in the storage module, and controls the controlled module to return to the reference position when necessary. The motion path is planned according to the initial position and the target position.

[0097] The device embodiment of the present application is introduced below, which can be used to execute the method in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above-mentioned method embodiment of the present application.

[0098] Figure 9 is a block diagram of a control device 90 of a stepper motor according to an embodiment of the present application, as shown in Figure 9 The control device 90 of the stepper motor includes:

[0099] The motor state acquisition module 910 is configured to acquire the current motion step number, the current return position, the target motion step number, and the target return position of the motor.

[0100] The controlled module state acquisition module 920 is configured to acquire the current position and the target position of the controlled module, wherein the current position is the difference between the current motion step number and the current return position, and the target position is the difference between the target motion step number and the target return position, and the controlled module is connected to the motor through a transmission mechanism.

[0101] The return difference acquisition module 930 is configured to acquire the target return difference corresponding to the target position in a return table if the current position does not reach the target position, wherein the return table includes a plurality of predetermined positions and a return difference corresponding to each predetermined position.

[0102] The first return path module 940 is configured to determine a first return path according to the current motion step number, the target motion step number, the target return position and the target return difference, and control the motor to drive the controlled module to move along the first return path to reach the target position.

[0103] In some embodiments of the present application, the first return path module 940 includes a target return value acquisition module configured to obtain a sum of the target position and the target return difference to obtain a target return value; a first forward step number acquisition module configured to obtain a difference between the target return value and the current motion step number to obtain a first forward step number; and a first reverse step number acquisition module configured to obtain a difference between the target return difference and the target motion step number to obtain a first reverse step number.

[0104] In some embodiments of the present application, the first return path module 940 further includes a first return control module configured to control the motor to run forward by the first forward step number and run reverse by the first reverse step number.

[0105] In some embodiments of the present application, the control device of the stepper motor further includes a second return path determination module configured to determine a second return path according to the current motion step number, the target motion step number and the target return position if the current position exceeds the target position; and a second return path module configured to control the motor to drive the controlled module to move along the second return path to reach the target position. The second return path module includes a second forward step number acquisition module configured to obtain the target return value to obtain the second forward step number; a second return relative step number acquisition module configured to obtain a difference between the current motion step number and the target motion step number to obtain a second return relative step number; and a second reverse step number acquisition module configured to obtain a sum of the second return relative step number and the target return difference to obtain the second reverse step number.

[0106] In some embodiments of the present application, the second return path module further includes a second return path control module configured to control the motor to run reverse by the second reverse step number and run forward by the second forward step number.

[0107] In some embodiments of the present application, the control device of the stepper motor further comprises a return stroke difference obtaining module, which comprises: a first step number recording module, configured to record the step number of the motor when the motor drive controlled module moves to a predetermined position in a first direction as a first step number; a second step number recording module, configured to record the step number of the motor when the motor drive controlled module continues to move in the first direction and then moves in a second direction to the predetermined position as a second step number, the first direction being opposite to the second direction; a return stroke difference calculating module, configured to calculate the difference between the first step number and the second step number to obtain a return stroke difference; a corresponding relationship recording module, configured to record the corresponding relationship between the predetermined position and the return stroke difference; a return stroke difference repeatedly obtaining module, configured to change the predetermined position, and re-obtain the first step number, the second step number and the corresponding return stroke difference until the number of the corresponding relationships between the predetermined positions and the return stroke differences reaches a preset number; and a return stroke table establishing module, configured to establish the return stroke table according to the recorded multiple corresponding relationships.

[0108] In some embodiments of the present application, the return stroke difference obtaining module further comprises: a maximum return stroke difference obtaining module, configured to obtain a maximum return stroke difference from the preset number of return stroke differences; and a maximum return stroke difference recording module, configured to record the maximum return stroke difference in the return stroke table.

[0109] It should be noted that the modules in the control device of the stepper motor in the present embodiment are one-to-one corresponding to the steps in the control method of the stepper motor in the foregoing embodiments, and therefore the specific embodiments of the present embodiment can refer to the embodiments of the control method of the stepper motor, which will not be described herein again.

[0110] It should be understood that the above is only for illustration, and does not constitute any limitation on the technical solutions of the present application, and those skilled in the art can make settings based on needs in actual applications, which are not limited herein.

[0111] The present application also provides a computer readable storage medium having computer readable instructions stored thereon, when the computer readable instructions are executed by a processor, the method in any of the method embodiments described above is implemented.

[0112] The computer-readable storage medium can be an electronic, magnetic, optical, or other physical storage device that stores executable computer program instructions. Examples of computer-readable storage media include, but are not limited to, a floppy disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), a flash memory, or any other suitable memory(s). The computer-readable storage medium can be non-transitory. The computer-readable storage medium can be tangible. The computer-readable storage medium can be non-transitory and tangible. The computer-readable storage medium can have stored thereon the computer program instructions.

[0113] According to an aspect of the embodiments of the present application, a computer program product or computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device performs the method in any of the above embodiments.

[0114] It should be noted that although several modules or units of devices for action execution are mentioned in the above detailed description, the division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into a plurality of modules or units.

[0115] From the above description of the embodiments, those skilled in the art will readily appreciate that the example embodiments described herein can be implemented by software and / or by hardware. Accordingly, the technical solutions of the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) execute the methods according to the embodiments of the present application.

[0116] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the application following the general principles thereof and including such departures from the present disclosure as come within known use or custom in the art.

[0117] It is to be understood that the application is not limited to the precise construction already described above and shown in the drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application should only be limited by the claims appended hereto.

Claims

1. A method of controlling a stepper motor, characterized by, The method comprises the following steps: acquiring a current motion step number, a current return position, a target motion step number and a target return position of a motor; acquiring a current position and a target position of a controlled module, wherein the current position is a difference between the current motion step number and the current return position, the target position is a difference between the target motion step number and the target return position, the controlled module is connected with the motor through a transmission mechanism; if the current position does not reach the target position, acquiring a target return difference corresponding to the target position in a return table, wherein the return table comprises a plurality of predetermined positions and a return difference corresponding to each predetermined position; determining a first U-turn path according to the current motion step number, the target motion step number, the target return position and the target return difference, and controlling the motor to drive the controlled module to move according to the first U-turn path to reach the target position.

2. The method of claim 1, wherein, The first U-turn path comprises a first forward step number and a first reverse step number, and the determination of the first U-turn path according to the current motion step number, the target motion step number, the target return position and the target return difference comprises the following steps: acquiring a sum of the target position and the target return difference to obtain a target return value; acquiring a difference between the target return value and the current motion step number to obtain the first forward step number; acquiring a difference between the target return difference and the target motion step number to obtain the first reverse step number.

3. The method of claim 2, wherein, The control of the motor to drive the controlled module to move according to the first U-turn path to reach the target position comprises the following steps: controlling the motor to run forward by the first forward step number and to run reverse by the first reverse step number.

4. The method of claim 1, wherein, The method further comprises the following steps: if the current position exceeds the target position, determining a second U-turn path according to the current motion step number, the target motion step number and the target return difference; controlling the motor to drive the controlled module to move according to the second U-turn path to reach the target position.

5. The method of claim 4, wherein, The second U-turn path comprises a second forward step number and a second reverse step number, and the determination of the second U-turn path according to the current motion step number, the target motion step number and the target return difference comprises the following steps: acquiring the target return difference to obtain the second forward step number; acquiring a difference between the current motion step number and the target motion step number to obtain a second U-turn relative step number; acquiring a sum of the second U-turn relative step number and the target return difference to obtain the second reverse step number.

6. The method of claim 5, wherein, The control of the motor to drive the controlled module to move according to the second U-turn path to reach the target position comprises the following steps: controlling the motor to run reverse by the second reverse step number and to run forward by the second forward step number.

7. The method according to any one of claims 1 to 6, characterized in that, The method for acquiring the return table comprises the following steps: recording a step number of the motor when the motor drives a controlled module to move to a predetermined position in a first direction as a first step number; recording a step number of the motor when the motor drives the controlled module to continue to move in the first direction and then to move in a second direction to reach the predetermined position as a second step number, wherein the first direction is opposite to the second direction; calculating a difference between the first step number and the second step number to obtain a return difference. record the correspondence between the predetermined position and the return difference; change the predetermined position, reacquire the first step number, the second step number and the corresponding return difference; establish the return table according to the recorded multiple correspondences.

8. The method of claim 7, wherein, The method for obtaining the return table further comprises: acquire the maximum return difference in the preset number of return differences; record the maximum return difference in the return table.

9. A control device for a stepping motor, characterized by comprising: comprise: an acquisition module of motor state, configured to acquire a current motion step number, a current return position, a target motion step number and a target return position of a motor; an acquisition module of controlled module state, configured to acquire a current position and a target position of a controlled module, wherein the current position is a difference between the current motion step number and the current return position, the target position is a difference between the target motion step number and the target return position, the controlled module is connected with the motor through a transmission mechanism; an acquisition module of return difference, configured to acquire a target return difference corresponding to the target position in a return table if the current position does not reach the target position, wherein the return table comprises multiple predetermined positions and return differences corresponding to each predetermined position; a first return path module, configured to determine a first return path according to the current motion step number, the target motion step number, the target return position and the target return difference, and control the motor to drive the controlled module to move according to the first return path to reach the target position.

10. An electronic device, comprising: comprise: a processor; a memory, wherein the memory has computer readable instructions stored thereon, and the computer readable instructions are executed by the processor to implement the method according to any one of claims 1-8.

11. A computer readable storage medium, characterized in that, The computer readable storage medium has program code stored therein, and the program code can be called and executed by the processor to implement the method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Backhaul difference eliminating method and device

    CN109963067A

  • Driving method and device for eliminating backlash of driving apparatus, apparatus, and storage medium

    WO2021056978A1