CN116980575A - Stepping motor control method, stepping motor control device, electronic equipment and storage medium - Google Patents

Stepping motor control method, stepping motor control device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116980575A
CN116980575A CN202210431069.4A CN202210431069A CN116980575A CN 116980575 A CN116980575 A CN 116980575A CN 202210431069 A CN202210431069 A CN 202210431069A CN 116980575 A CN116980575 A CN 116980575A
Authority
CN
China
Prior art keywords
target
step number
difference
return
motor
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210431069.4A
Other languages
Chinese (zh)
Inventor
弓殷强
郭俊佳
高飞
李屹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Appotronics Corp Ltd
Original Assignee
Appotronics Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Appotronics Corp Ltd filed Critical Appotronics Corp Ltd
Priority to CN202210431069.4A priority Critical patent/CN116980575A/en
Publication of CN116980575A publication Critical patent/CN116980575A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/12Picture reproducers
    • H04N9/31Projection devices for colour picture display, e.g. using electronic spatial light modulators [ESLM]
    • H04N9/3141Constructional details thereof
    • H04N9/317Convergence or focusing systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Control Of Stepping Motors (AREA)

Abstract

The application discloses a stepping motor control method, a stepping motor control device, electronic equipment and a storage medium, wherein the stepping motor control method comprises the following steps: acquiring the current movement step number, the current return stroke position, the target movement step number and the target return stroke position of the motor; acquiring 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 return position, the target position is the difference between the target movement step number and the target return position, and the controlled module is connected with a motor through a transmission mechanism; if the current position does not reach the target position, acquiring a target return stroke difference corresponding to the target position in a return stroke table; the first return path is determined according to the current movement steps, the target return position and the target return difference, the motor is controlled to drive the controlled module to move according to the first return path to reach the target position, the return difference caused by motor return can be effectively eliminated, the real state of the controlled module is determined, and the position state of the controlled module can be recorded more accurately.

Description

Stepping motor control method, stepping motor control device, electronic equipment and storage medium
Technical Field
The present application relates to the field of projector technologies, and in particular, to a method and apparatus for controlling a stepper motor, an electronic device, and a storage medium.
Background
In a projector, a controlled module, such as a lens, may be coupled to a motor via a transmission. In the gear mechanism, it is unavoidable that some tolerance margins are reserved, which margins are embodied as gaps between the gear mechanisms. During motor turn-back, a section of idle running is first experienced, and the number of steps of the section of idle running is the return stroke difference.
For focusing, zooming, lens displacement, etc., of the projector, the control of the stepping motor is based. Because of poor return stroke, the position of the controlled module cannot be precisely controlled simply by controlling the step number of the motor, and especially in the occasion of multiple turning back, the real state of the controlled module cannot be determined, so that the current position of the controlled module cannot be precisely recorded.
Disclosure of Invention
In view of the above, the present application provides a method, an apparatus, an electronic device and a storage medium for controlling a stepper motor, so as to solve at least one of the above problems.
In a first aspect, an embodiment of the present application provides a method for controlling a stepper motor, including: acquiring the current movement step number, the current return stroke position, the target movement step number and the target return stroke position of the motor; acquiring 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 return position, the target position is the difference between the target movement step number and the target return position, and 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 stroke difference corresponding to the target position in a return stroke table, wherein the return stroke table comprises a plurality of preset positions and return stroke differences corresponding to each preset position; and determining a first folding path according to the current movement 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 folding path so as to reach the target position.
In a second aspect, an embodiment of the present application provides a control device for a stepper motor, including: the motor state acquisition module is used for acquiring the current moving step number, the current return stroke position, the target moving step number and the target return stroke position of the motor; the system comprises a controlled module state module, a motor, a control module and a control module, wherein the controlled module state module is used for acquiring the current position and the target position of the controlled module, the current position is the difference between the current movement step number and the current return stroke position, the target position is the difference between the target movement step number and the target return stroke position, and the controlled module is connected with the motor through a transmission mechanism; the backhaul difference acquisition module is used for acquiring a target backhaul difference corresponding to the target position in a backhaul table if the current position does not reach the target position, wherein the backhaul table comprises a plurality of preset positions and backhaul differences corresponding to each preset position; and the first return path module is used for determining a first return path according to the current movement 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 so as to reach the target position.
In a third aspect, an embodiment of the present application provides an electronic device, and a processor; and a memory having stored thereon computer readable instructions which, when executed by the processor, implement any of the methods described above.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having program code stored therein, the program code being callable by a processor to perform any of the methods described above.
In the embodiment provided by the application, the first return path is determined by acquiring the corresponding target return difference of the target position in the return table and according to the current moving step number, the target return position and the target return difference, the controlled module is controlled to move according to the first return path so as to reach the target position, the influence of the return difference when the current position and the target position of the controlled module are directly positioned is avoided, and the return difference is caused by motor return, so that the return difference caused by motor return can be effectively eliminated by the first return path provided by the application, the real state of the controlled module is determined, and the position state of the controlled module can be more accurately recorded.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a flowchart of a control method of a stepper motor according to an embodiment of the present application.
FIG. 3 illustrates a flow chart of generating a first return path provided by an embodiment of the present application.
Fig. 4 is a partial flow chart of a control method of a stepper motor according to another embodiment of the present application.
Fig. 5 shows a flowchart for generating a second return path according to another embodiment of the present application.
Fig. 6 is a flowchart of a backhaul table acquisition method according to another embodiment of the present application.
Fig. 7 is a schematic diagram of a backhaul table acquisition method according to another embodiment of the present application.
Fig. 8 shows a block diagram of a control system for a stepper motor according to an embodiment of the present application.
Fig. 9 shows a block diagram of a stepping motor control apparatus provided by an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. However, the exemplary embodiments may be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may 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 application may be practiced without one or more of the specific details, or with other methods, components, devices, steps, etc. In other instances, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the application.
The block diagrams depicted in the figures are merely functional entities and do not necessarily correspond to physically separate entities. That is, the functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow diagrams depicted in the figures are exemplary only, and do not necessarily include all of the elements and operations/steps, nor must they be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the order of actual execution may be changed according to actual situations.
In view of the problems set forth in the background art, the inventor finds that if a specific position of a controlled module is marked as a starting position by adding an optocoupler switch, and the same number of steps are run from the starting position each time to ensure that the position is reliable, more time is required to run to the specific position. If an encoder is used for feedback control, the cost is greatly increased.
Therefore, the inventor proposes the control method, the device and the electronic equipment for the stepping motor, which are provided by the embodiment of the application, by acquiring the corresponding target return stroke difference of the target position in the return stroke table, and then determining the first return path according to the current movement step number, the target return stroke position and the target return stroke difference, and controlling the motor to drive the controlled module to move according to the first return path so as to reach the target position, thereby avoiding the influence of the return stroke difference when the current position and the target position of the controlled module are directly positioned.
Fig. 1 shows a schematic diagram of an electronic device suitable for implementing an embodiment of the application, as shown in fig. 1, in which a memory 1005, which is a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and other electronic programs.
In the electronic device shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device of the present application may be provided in the electronic device, where the electronic device invokes the control device of the stepper motor stored in the memory 1005 through the processor 1001, and executes the control method of the stepper motor provided in the embodiment of the present application respectively.
The processor 1001 may include one or more processing cores. The processor 1001 connects various parts within the entire electronic device using various interfaces and lines, performs various functions of the electronic device and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1005, and invoking data stored in the memory 1005. Alternatively, the processor 1001 may be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA). The processor 1001 may integrate one or a combination of several of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), and a modem, etc. The CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for being responsible for rendering and drawing of display content; the modem is used to handle wireless communications. It will be appreciated that the modem may not be integrated into the processor 1001 and may be implemented solely by a single communication chip.
The Memory 1005 may include a random access Memory (Random Access Memory, RAM) or a Read-Only Memory (Read-Only Memory). The memory 1005 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 1005 may include a stored program area and a stored data area, wherein the stored program area may 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 the various method embodiments described below, etc. The storage data area may also store data created by the electronic device in use (e.g., disguised response commands, acquired process states), etc.
Those skilled in the art will appreciate that the structure shown in fig. 1 is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or may be arranged in different components.
In the embodiment of the application, the electronic device may be an electronic device in the projector, or may be an electronic device independent of the projector, and if the electronic device is an independent electronic device, the electronic device needs to be connected with a motor or a motor controller in the projector.
Fig. 2 is a flowchart illustrating a method of controlling a stepper motor, which may be performed by the above-described electronic device, according to one embodiment of the present application. The voiceprint recognition model comprises a classification layer and a multi-layer cascade feature extraction network layer, and referring to fig. 2, the method at least comprises steps 210 to 240, and the method is described in detail as follows:
step 210, obtaining a current number of steps of movement, a current return position, a target number of steps of movement, and a target return position of the motor.
The motor in the embodiment of the application can be a stepping motor, and accurate movement in steps can be realized. The current moving step number of the motor refers to the step number of the motor when the motor drives the controlled module to move 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 the motor drives the controlled module to reach the current position, the target moving step number of the motor refers to the step number of the motor when the motor drives the controlled module to move to the target position, and the target return position of the motor refers to the motor step number corresponding to the position of the transmission mechanism when the motor drives the controlled module to move to the target position. The step number of the motor is referred to the reference position, and when the motor is positioned at the reference position, the corresponding step number of the motor is 0.
In the embodiment of the application, the current movement steps and the current return stroke position of the motor can be firstly judged whether to initialize or not. In the practical application process, the projector is started for too long, which is likely to cause the motor to be out of step, so that the initialization operation can be performed on the current state.
Step 220, obtaining a current position and a target position of a controlled module, wherein the current position is a difference between a current movement step number and the current return position, the target position is a difference between the target movement step number and the target return position, and the controlled module is connected with the motor through a transmission mechanism.
Because the controlled module is connected with the motor through the transmission mechanism, when the current movement steps are different from the current return position, the current position of the controlled module can be obtained, and the same can be obtained, and the target position of the controlled module is the difference between the target movement steps and the target return position.
And step 230, if the current position does not reach the target position, acquiring a target backhaul difference corresponding to the target position in a backhaul table, wherein the backhaul table comprises a plurality of preset positions and backhaul differences corresponding to each preset position.
The fact that the current position does not reach the target position means that the controlled module moves towards the direction of the target position. The predetermined position is a position set for recording the return difference between the controlled module and the motor, and is not limited, and the predetermined position in the return table corresponds to the return difference one by one and can be obtained in advance.
And step 240, determining a first folding path according to the current movement 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 folding path so as to reach the target position.
After the target return stroke difference is obtained, the distance actually required to be taken by the controlled module can be calculated by combining the target position of the motor and the target return stroke difference, and then the number of forward steps required to be taken and the number of reverse steps required to be taken are calculated according to the actually required distance, the current number of moving steps, the target number of moving steps and the target return stroke difference, so that a first return path is obtained.
In the scheme of the embodiment, the first return path is determined by acquiring the corresponding target return difference of the target position in the return table and according to the current moving step number, the target return position and the target return difference, the controlled module is controlled to move according to the first return path so as to reach the target position, the influence of the return difference when the current position and the target position of the controlled module are directly positioned is avoided, and the return difference is caused by motor return.
In this embodiment, the controlled module reaches the target position in accordance with the retrace path by motor control.
Since the return stroke difference is generated due to the motor turning-back operation, when the controlled module performs the turning-back movement by the motor control, the influence caused by the return stroke difference can be effectively eliminated, thereby accurately reaching the target position.
In some embodiments, the first folding path may include a first forward step number and a first reverse step number, and the determining the first folding path according to the current movement step number, the target return position, and the target return difference, as shown in fig. 3, includes:
and step 310, obtaining the sum of the target position and the target backhaul difference to obtain a target backhaul value.
Because of the existence of the return stroke difference, when the motor reaches the target position, the distance between the controlled module and the target position is a distance of the target return stroke difference, so that the distance actually taken by the controlled module is not the distance from the origin to the target position, but the distance of the target position plus the corresponding return stroke difference of the target position in the return stroke table. Therefore, the target backhaul value is the total distance that the controlled module actually needs to travel from the origin to the target location.
Step 320, obtaining a difference between the target return value and the current motion step number, thereby obtaining a first forward step number.
Since the motor and the controlled module do not start from the origin 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 number of steps of movement, i.e. the first forward number of steps.
Step 330, obtaining a difference between the target backhaul difference and the target movement step number, and obtaining a first backward step number.
For example, let the current number of steps be x0, the current return position y0, the target number of steps be x1, the target return position y1, and the target return difference z1, in this embodiment, the current position does not reach the target position and indicates that x0-y0< x1-y1, at this time, the target position is x1-y1, the target return value is denoted as x1-y1+z1, and further, the first forward number of steps may be denoted as x1-y1+z1-x0. Similarly, the first number of backsteps is denoted as z1-y1.
In this embodiment, since the return stroke difference is generated by the motor turning back movement, the first forward step number only can eliminate the forward return stroke difference generated when the motor moves forward, and in order to enable the controlled module to accurately reach the target position, the controlled module needs to counteract the reverse return stroke difference generated when moving in the reverse direction, so that the controlled module needs to operate the first reverse step number in the reverse direction to ensure that the position reached by the controlled module is the target position.
In this embodiment, the motor is controlled to operate the first forward step number in the forward direction and the first reverse step number in the reverse direction. When the current position does not reach the target position, the forward return difference of the motor is eliminated, and the reverse return difference is eliminated by the retracing movement, so that the controlled module reaches the correct position.
Referring to fig. 4, the method for controlling a stepper motor according to the embodiment of the present application may further include steps 410 to 420, which are described in detail below:
step 410, if the current position exceeds the target position, determining a second return path according to the current movement step number, the target movement step number and the target return position.
And step 420, controlling the motor to drive the controlled module to move according to the second folding path so as to reach the target position.
When the current position exceeds the target position which needs to be reached by the controlled module, the retrace path is different from the first retrace path planning, and the planning is specifically performed through the current movement steps, the target movement steps and the target return position.
Referring to fig. 5, fig. 5 is a schematic diagram of a second return path planning procedure, where the second return path includes a second forward step number and a second reverse step number, and the determining the second return path according to the current movement step number, the target movement step number, and the target return position includes:
step 510, obtaining the target backhaul difference, and obtaining the second forward step number.
The target return difference may be such that the controlled module counteracts the forward return difference caused by the forward direction of the motor.
Step 520, obtaining the difference between the current motion step number and the target motion step number, thereby obtaining a second relative step number.
Since the current position has exceeded the target position, the motor takes more steps than it should take, and so the second relative number of steps is the excess number of steps actually taken by the motor.
Step 530, obtaining the sum of the second reverse relative step number and the target backhaul difference, to obtain the second reverse step number.
The second backward step number is the excessive step number actually taken by the motor and the corresponding return difference value when the motor and the controlled module are at the target position, so that the backward return difference of the motor can be counteracted.
For example, let the current number of steps be x0, the current return position y0, the target number of steps x1, the target return position y1, and the target return difference z1, in this embodiment, the current position does not reach the target position and indicates that x0-y0> x1-y1, at this time, the second forward number of steps is y1, and the second backward number of steps is determined by the current number of steps x0, the target number of steps x1, and the target return difference z1, specifically indicated as x0-x1+z1.
In this embodiment, the controlling the motor to drive the controlled module to move according to the second folding path to reach the target position includes:
and controlling the motor to reversely run the second reverse step number and forward run the second forward step number.
Because the current position exceeds the target position, the reverse return stroke difference needs to be counteracted firstly, so that the controlled module does not reach the target position yet, and then the forward return stroke difference of the motor is counteracted by utilizing the return stroke difference corresponding to the target position in the return stroke table, so that the controlled module can reach the target position accurately.
Referring to fig. 6, fig. 6 is a flowchart of a backhaul table acquisition method in the above embodiment, where the backhaul table acquisition method may include:
step 610, recording the number of steps of the motor when the motor drives the controlled module to move to a preset position in a first direction as a first step number.
And step 620, recording the number of steps of the motor when the motor drives the controlled module to continue to move towards the first direction and then move towards the second direction to reach the preset position, wherein the first direction is opposite to the second direction as the second number of steps.
When the motor drives the controlled module to move continuously in the first direction, the motion path needs to move for a certain distance and then moves in the second direction. The movement of a certain distance is to avoid false triggering caused by vibration or stress generated by accidental situations when the movement distance is too short.
Step 630, calculating the difference between the first step number and the second step number to obtain a backhaul difference.
Step 640, recording a correspondence between the predetermined position and the backhaul difference.
Step 650, changing the predetermined position, and reacquiring the first step number, the second step number, and the corresponding backhaul difference.
Step 660, establishing the backhaul table according to the recorded plurality of corresponding relations.
The return differences corresponding to different positions of the controlled module are recorded to cover all preset positions which need to be passed by the controlled module as much as possible, so that the controlled module is convenient to carry out path planning subsequently.
In order to facilitate understanding of the above-mentioned backhaul difference calculation method, please refer to fig. 7, in which, in the schematic diagram shown in fig. 7, the upper edge line indicates the maximum backhaul difference, the lower edge line indicates the backhaul difference as 0, and the left and right edge lines indicate the positions of the respective feedback modules. In this embodiment, the position of the controlled module is the intersection point between 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 through the preset position for the first time in the first direction, the abscissa of the preset position is recorded as a. After the controlled module reaches the preset position again, the abscissa of the preset position is recorded as b, and the return difference corresponding to the preset position is recorded as a-b. Each point in the graph can be used as a preset position, and the backhaul difference corresponding to the preset position is recorded according to the method through different preset positions, so that a backhaul table is established.
In the present embodiment, the first step number is a count step number performed based on the reference position. The reference position is set by controlling the motor to control the controlled module to move, and the embodiment of the application relates to single reference position setting.
Specifically, the setting of the reference position may be set by: when the motor controls the controlled module to move towards the feedback module, the controlled module triggers the feedback module to generate a feedback signal; the controlled module continues to move along the feedback module direction for a certain step number n1; at the moment, reversely moving until the feedback signal disappears, and recording the number of the moving steps at the moment as n2; the controlled module continues to move along the reverse direction of the feedback module for a certain step number n3, and at this time, the position of the step number n3 is the reference position.
In the embodiment of the application, the controlled module does not stop immediately after the feedback signal is triggered, if the position of the feedback signal is directly set as the reference position, and in fact, the specific position of the controlled module is uncertain, a certain error is brought to the subsequent return difference measurement, and the feedback module is usually set as the edge position, so that the reference position is prevented from being set as the edge position, and therefore, the controlled module moves for a certain step number after the feedback signal disappears and is set as the reference position.
In another embodiment of the present application, for the existence of a plurality of feedback modules, the reference position setting manner may be that one of the feedback modules is selected as a 0-point feedback module, and the 0-point feedback module position is set as a 0-point position; the reference positions are set by taking the 0 point position as a starting point according to the reference position setting mode of the single feedback module, and are not repeated here.
Different from a single feedback module, the relative step number between each feedback module and the 0-point feedback module should be recorded after the reference position is set. The relative step number is recorded to avoid errors caused by motor step out. For example, when the controlled module triggers the first feedback module and then moves in the opposite direction of the first feedback module until the second feedback module is triggered, the number of steps recorded by the motor is 450 steps, but in the reference position setting stage, the relative number of steps between the first feedback module and the second feedback module is 500 steps, and the return position is set to 0, at this time, it can be judged that the motor generates a step-out error, and at this time, the motor step number is directly set to 500 steps, so that the error can be cancelled, and the accuracy of the subsequent step counting of the motor is ensured.
When the controlled module triggers the first feedback module and then moves along the direction of the first feedback module until the second feedback module is triggered, the motor step number at the moment is set as the relative step number between the first feedback module and the second feedback module which is measured in the reference position setting stage, the return position is set as the return difference obtained by the current step number in the return table, and the accuracy of the subsequent step counting of the motor is further ensured.
In the embodiment of the present application, the method for acquiring the backhaul table further includes:
step 710, acquiring a maximum backhaul difference from the plurality of backhaul differences;
step 720, recording the maximum backhaul difference in the backhaul table.
The maximum backhaul difference is a specific value in the backhaul 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 backhaul difference is the maximum backhaul difference in the backhaul table.
The embodiment of the application also provides a control system of the stepping motor, and the reference diagram is a structural block diagram of the control system of the stepping motor, and the control system of the stepping motor comprises:
the active module 810: in this embodiment, the active module is a stepper motor, so that accurate motion in steps can be realized, and there may be a poor return stroke inside the active module.
Controlled module 820: by coupling the transmission with the active module, the movement of the active module will affect a property of the controlled module, i.e. the final control objective. For the present embodiment, the controlled module may be a lens position, a state of a lens focusing module, a state of a lens zooming module, a position of a clear focusing plane of the lens, a field of view (FOV) of the lens, and the like.
Feedback module 830: and triggering signals are generated when the controlled module reaches a specific pose by means of an optical coupler switch and the like. The specific pose refers to a specific action when the feedback module is triggered. For example, in the optocoupler switch, because the level of the optocoupler switch is controlled by light, when the controlled module shields the light of the optocoupler switch, the level of the optocoupler switch becomes low, and the shielded light is in a specific pose.
Storage module 840: the maximum backhaul difference or a reference value of the backhaul difference is stored in a non-volatile storage medium. When the feedback module comprises a plurality of trigger positions, the corresponding step number of each trigger position is recorded.
An operation module (not shown in the figure): the functions of recording internal states, controlling the active module, planning paths and the like are realized.
The active module control module 850: the active module is controlled by means of pulse signals or level changes and the like.
The main control module 860: and recording the current step number and the return state according to the current running condition of the active module and the return information in the storage module. The controlled module is controlled back to the reference position when necessary. And planning a motion path according to the initial position and the target position.
The following describes embodiments of the apparatus of the present application that may be used to perform the methods of the above-described embodiments of the present application. For details not disclosed in the embodiments of the apparatus of the present application, please refer to the above-described method embodiments of the present application.
Fig. 9 is a block diagram of a control device 90 of a stepping motor according to an embodiment of the present application, and as shown in fig. 9, the control device 90 of a stepping motor includes:
a get motor status module 910; the method comprises the steps of obtaining the current movement steps, the current return stroke position, the target movement steps and the target return stroke position of a motor;
the controlled module state obtaining module 920 is configured to obtain a current position and a target position of a controlled module, where the current position is a difference between a current movement step number and the current return position, the target position is a difference between the target movement step number and the target return position, and the controlled module is connected with the motor through a transmission mechanism;
an obtaining backhaul difference module 930, configured to obtain a target backhaul difference corresponding to the target position in a backhaul table if the current position does not reach the target position, where the backhaul table includes a plurality of predetermined positions and backhaul differences corresponding to each predetermined position;
and a first return path module 940, configured to determine a first return path according to the current number of steps, 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 so as to reach the target position.
In some embodiments of the present application, the first return path module 940 includes a target backhaul value obtaining module, configured to obtain a target backhaul value by obtaining a sum of the target position and the target backhaul difference; the first forward step number acquisition module is used for acquiring the difference between the target return stroke value and the current movement step number to obtain a first forward step number; and the first backward step number acquisition module is used for acquiring the difference between the target return stroke difference and the target movement step number, and the first backward step number is obtained.
In some embodiments of the present application, the first foldback path module 940 further includes a first foldback control module for controlling the motor to operate the first forward step number in a forward direction and the first reverse step number in a reverse direction.
In some embodiments of the present application, the control device of the stepping motor further includes a second return path determining module configured to determine a second return path according to the current number of moving steps, the target number of moving steps, and the target return position if the current position exceeds the target position; and the second return path module is used for controlling the motor to drive the controlled module to move according to the second return path so as to reach the target position. The second return path module comprises a second forward step number acquisition module, a second forward step number acquisition module and a second return path module, wherein the second forward step number acquisition module is used for acquiring the target return value to obtain the second forward step number; the second relative step number obtaining module is used for obtaining the difference between the current movement step number and the target movement step number to obtain a second relative step number; and the second backward step number acquisition module is used for acquiring the sum of the second backward relative step number and the target return difference to obtain the second backward step number.
In some embodiments of the application, the second return path module further includes a second return path control module for controlling the motor to run the second number of reverse steps in reverse and the second number of forward steps in forward.
In some embodiments of the present application, the control device of the stepper motor further includes a return difference acquisition module, where the return difference acquisition module includes a first step recording module, configured to record, as a first step, a step number of the motor when the motor drives the controlled module to move in a first direction to reach a predetermined position; the second step number recording module is used for recording the step number of the motor when the motor drives the controlled module to continuously move towards the first direction and then move towards the second direction to reach the preset position, and the first direction is opposite to the second direction as a second step number, and the return stroke difference calculating module is used for calculating the difference between the first step number and the second step number to obtain a return stroke difference; the corresponding relation recording module is used for recording the corresponding relation between the preset position and the return stroke difference; the return stroke difference repetition acquisition module is used for changing the preset position, and re-acquiring the first step number, the second step number and the corresponding return stroke difference until the number of the obtained corresponding relation between the preset position and the return stroke difference reaches a preset number; and the backhaul table establishing module is used for establishing the backhaul table according to the recorded corresponding relations.
In some embodiments of the present application, the backhaul difference acquisition module further includes a maximum backhaul difference acquisition module configured to acquire a maximum backhaul difference from the preset number of backhaul differences; and the maximum backhaul difference recording module is used for recording the maximum backhaul difference in the backhaul table.
It should be noted that, each module in the control device of the stepper motor in this embodiment corresponds to each step in the control method of the stepper motor in the foregoing embodiment, so the specific implementation of this embodiment may refer to the implementation of the control method of the stepper motor and will not be described herein.
It should be understood that the foregoing is merely illustrative, and the technical solution of the present application is not limited in any way, and those skilled in the art may set the technical solution as required in practical applications, and the present application is not limited herein.
The application also provides a computer readable storage medium having stored thereon computer readable instructions which, when executed by a processor, implement the method of any of the method embodiments described above.
The computer readable storage medium may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium comprises a non-volatile computer readable medium (non-transitory computer-readable storage medium). The computer readable storage medium has storage space for computer readable instructions to perform any of the method steps described above. These computer readable instructions may be read from or written to one or more computer program products. The computer readable instructions may be compressed, for example, in a suitable form.
According to an aspect of embodiments of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method of any of the embodiments described above.
It should be noted that although in the above detailed description several modules or units of a device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functions of two or more modules or units described above may be embodied in one module or unit in accordance with embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into a plurality of modules or units to be embodied.
From the above description of embodiments, those skilled in the art will readily appreciate that the example embodiments described herein may be implemented in software, or may be implemented in software in combination with the necessary hardware. Thus, the technical solution according to the embodiments of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.) or on a network, and includes several instructions to cause a computing device (may be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the method according to the embodiments of the present application.
Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the application pertains.
It is to be understood that the application is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (11)

1. A stepping motor control method, comprising:
acquiring the current movement step number, the current return stroke position, the target movement step number and the target return stroke position of the motor;
acquiring 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 return position, the target position is the difference between the target movement step number and the target return position, and 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 stroke difference corresponding to the target position in a return stroke table, wherein the return stroke table comprises a plurality of preset positions and return stroke differences corresponding to each preset position;
and determining a first folding path according to the current movement 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 folding path so as to reach the target position.
2. The method of claim 1, wherein the first return path comprises a first forward step number and a first reverse step number, the determining the first return path based on the current number of steps, a target number of steps, the target backhaul position, and the target backhaul difference comprising:
obtaining the sum of the target position and the target backhaul difference to obtain a target backhaul value;
obtaining the difference between the target return stroke value and the current movement step number to obtain a first forward step number;
and obtaining the difference between the target return stroke difference and the target movement step number, and obtaining a first reverse step number.
3. The method of claim 2, wherein controlling the motor to drive the controlled module to move in the first return path to reach the target position comprises:
controlling the motor to forward run the first forward step number and reverse run the first reverse step number.
4. The method according to claim 1, wherein the method further comprises:
if the current position exceeds the target position, determining a second return path according to the current movement step number, the target movement step number and the target return path difference;
and controlling the motor to drive the controlled module to move according to the second folding path so as to reach the target position.
5. The method of claim 4, wherein the second return path comprises a second forward step number and a second reverse step number, the determining a second return path based on the current number of steps, the target number of steps, and the target backhaul difference comprising:
acquiring the target return stroke difference to obtain the second forward step number;
obtaining the difference between the current movement step number and the target movement step number to obtain a second return relative step number;
and obtaining the sum of the second reverse relative step number and the target return difference to obtain the second reverse step number.
6. The method of claim 5, wherein controlling the motor to drive the controlled module to move in the second return path to reach the target location comprises:
and controlling the motor to reversely run the second reverse step number and forward run the second forward step number.
7. The method according to any one of claims 1 to 6, wherein the backhaul table acquisition method includes:
recording the step number of the motor when the motor drives the controlled module to move to a preset position in a first direction, and taking the step number as a first step number;
recording the step number of the motor when the motor drives the controlled module to continue to move towards a first direction and then move towards a second direction to reach the preset position, wherein the first direction is opposite to the second direction as a second step number;
calculating the difference between the first step number and the second step number to obtain a return stroke difference;
recording a correspondence between the predetermined location and the backhaul difference;
changing the preset position, and re-acquiring the first step number, the second step number and the corresponding return stroke difference;
and establishing the backhaul table according to the recorded corresponding relations.
8. The method of claim 7, wherein the backhaul table acquisition method further comprises:
acquiring a maximum backhaul difference from the preset number of backhaul differences;
the maximum backhaul difference is recorded in the backhaul table.
9. A control device for a stepping motor, comprising:
the motor state acquisition module is used for acquiring the current moving step number, the current return stroke position, the target moving step number and the target return stroke position of the motor;
the system comprises a controlled module state module, a motor, a control module and a control module, wherein the controlled module state module is used for acquiring the current position and the target position of the controlled module, the current position is the difference between the current movement step number and the current return stroke position, the target position is the difference between the target movement step number and the target return stroke position, and the controlled module is connected with the motor through a transmission mechanism;
the backhaul difference acquisition module is used for acquiring a target backhaul difference corresponding to the target position in a backhaul table if the current position does not reach the target position, wherein the backhaul table comprises a plurality of preset positions and backhaul differences corresponding to each preset position;
and the first return path module is used for determining a first return path according to the current movement 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 so as to reach the target position.
10. An electronic device, comprising:
a processor;
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the method of any of claims 1-8.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a program code, which is callable by a processor for executing the method according to any one of claims 1-8.
CN202210431069.4A 2022-04-22 2022-04-22 Stepping motor control method, stepping motor control device, electronic equipment and storage medium Pending CN116980575A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210431069.4A CN116980575A (en) 2022-04-22 2022-04-22 Stepping motor control method, stepping motor control device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210431069.4A CN116980575A (en) 2022-04-22 2022-04-22 Stepping motor control method, stepping motor control device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116980575A true CN116980575A (en) 2023-10-31

Family

ID=88480200

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210431069.4A Pending CN116980575A (en) 2022-04-22 2022-04-22 Stepping motor control method, stepping motor control device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116980575A (en)

Similar Documents

Publication Publication Date Title
CN116450020A (en) Virtual shooting subject control method and device, electronic equipment and storage medium
US20220371581A9 (en) Method and Apparatus for Avoidance Control of Vehicle, Electronic Device and Storage Medium
US11059170B2 (en) Joint limit detection method, and robot with the same
CN111360833B (en) Mechanical arm origin position calibration method and system, control terminal and mechanical arm
US9310226B2 (en) Position detection apparatus, drive control apparatus, and lens apparatus
US20200042005A1 (en) Obstacle avoidance method and system for robot and robot using the same
WO2022034856A1 (en) Information processing device, information processing method, and program
CN110638529B (en) Operation remote control method and device, storage medium and terminal equipment
CN105559782A (en) Method, device and equipment for controlling moving speed of patient&#39;s bed
CN113659889B (en) Control method and system of electric beam limiter, readable storage medium and electric beam limiter
CN111275769B (en) Monocular vision parameter correction method and device
CN116980575A (en) Stepping motor control method, stepping motor control device, electronic equipment and storage medium
CN106950789B (en) Projection device
CN111015658B (en) Method and device for controlling robot
CN110244222B (en) Limit origin positioning method and device of motor, terminal equipment and storage medium
US10564631B2 (en) Servo movement control method, device, and terminal device
CN113776520B (en) Map construction, using method, device, robot and medium
CN111583338A (en) Positioning method and device for unmanned equipment, medium and unmanned equipment
US20200001462A1 (en) Robot distance measuring method, apparatus and robot using the same
CN116204414A (en) Method and device for verifying program function based on data in virtual environment
CN111136689B (en) Self-checking method and device
CN115531875A (en) Virtual scene zooming method and device, storage medium and electronic equipment
US20220296200A1 (en) Remote operation control system, remote operation control method, and non-transitory storage medium
JP7110845B2 (en) Information processing device and information processing method
CN114661038A (en) Robot return sequence origin control method and device and related components

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication