Method, apparatus and system for controlling stepping electric motor
By using registers and correspondence tables in the stepper motor's subdivision controller, the carrier frequency is automatically calculated and adjusted, which solves the problem that the stepper motor's subdivision mode cannot be changed, achieves high-precision automatic control, and simplifies the operation process. .
Patent Information
- Application Number
- PCT/CN2023/126288
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-23
- Filing Date
- 2023-10-24
- Publication Date
- 2024-10-31
AI Technical Summary
Once the subdivision mode of the stepper motor is set, it cannot be changed. It requires manual calculation of the debugging gear, which is cumbersome and error-prone.
By introducing the first register and the corresponding relationship table into the subdivision controller of the stepper motor, it receives the adjustment instructions from the main control circuit, calculates and modifies the register value to automatically adjust the carrier frequency, and realizes the automatic calculation and adjustment of the target subdivision mode.
It reduces errors in manual calculation and adjustment, improves control accuracy, simplifies the operating process, reduces error rates, and improves control stability and convenience.
Smart Images

Figure CN2023126288_31102024_PF_FP_ABST
Abstract
Description
A stepping motor control method, device and system
[0001] This disclosure claims priority to the Chinese patent application filed with the China Patent Office on April 23, 2023, with application number 202310445406X and invention name “A stepper motor control method, device and system”, the entire contents of which are incorporated by reference into this disclosure. Technical Field
[0002] The present disclosure relates to the technical field of stepper motor control, and in particular to a stepper motor control method, device, and system. Background Art
[0003] A stepper motor is a control stepper motor that directly converts digital information into angular displacement or linear displacement. It is the main executive element in modern digital program control systems and is widely used due to its simple control, fast start and stop, and precise stepping.
[0004] At present, there are many subdivision options in the stepper control system. The larger the subdivision number, the closer the stepper motor current waveform is to a sine wave, and the smoother the stepper motor runs.
[0005] However, in the process of applying related technologies, there are previous technical defects: once the subdivision mode of the stepper motor is set, it cannot be changed, and manual calculation and debugging of the gear position is required, which is cumbersome and error-prone.
[0006] Summary of the Invention
[0007] In view of this, an object of the present disclosure is to provide a stepper motor control method, device and system.
[0008] In a first aspect, an embodiment of the present disclosure provides a stepper motor control method, which is applied to a subdivision controller corresponding to the stepper motor, wherein the subdivision controller is connected to a main control circuit; the subdivision controller is connected to the stepper motor, and the subdivision controller includes a first register, and the subdivision controller controls the carrier frequency output to the stepper motor according to the current value of the first register, thereby controlling the current operating state of the stepper motor, and the subdivision controller stores a first correspondence between the operating state of the stepper motor and the carrier frequency, the first register includes a first subunit, and the subdivision controller also stores a second correspondence between the subdivision gear and the value of the first subunit; the method The method includes: receiving an adjustment instruction sent by a main control circuit, wherein the instruction carries the target operating state of the stepper motor; searching for a target carrier frequency corresponding to the target operating state from the first corresponding relationship; obtaining the current subdivision gear and the current carrier frequency of the stepper motor; calculating the target subdivision gear according to the current subdivision gear, the current carrier frequency and the target carrier frequency; searching for a target value of a first subunit corresponding to the target subdivision gear from the second corresponding relationship; determining a target value of the first register according to the target value of the first subunit; and modifying the current value in the first register to the target value to drive the stepper motor to operate according to the target operating state.
[0009] In the second aspect, the present disclosure provides a stepper motor control device, which is applied to a subdivision controller corresponding to the stepper motor, and the subdivision controller is connected to the main control circuit; the subdivision controller is connected to the stepper motor, and the subdivision controller includes a first register, and the subdivision controller controls the current operating state of the stepper motor according to the current value of the first register; the subdivision controller stores a first correspondence between the operating state of the stepper motor and the carrier frequency, and the first register includes a first subunit, and the subdivision controller also stores a second correspondence between the subdivision gear and the value of the first subunit; the device includes: a receiving module, which is configured to receive an adjustment instruction sent by the main control circuit, and the instruction carries the stepper motor Target operating state; a first search module, configured to search for a target carrier frequency corresponding to the target operating state from the first correspondence; an acquisition module, configured to obtain a current subdivision gear and a current carrier frequency of the stepper motor; a calculation module, configured to calculate the target subdivision gear based on the current subdivision gear, the current carrier frequency and the target carrier frequency; a second search module, configured to search for a target value of a first subunit corresponding to the target subdivision gear from the second correspondence; a determination module, configured to determine a target value of the first register based on the target value of the first subunit; a modification module, configured to modify the current value in the first register to the target value, so as to drive the stepper motor to operate according to the target operating state.
[0010] In a third aspect, the present disclosure provides a stepper motor control system, comprising the above-mentioned device.
[0011] The embodiments of the present disclosure bring the following beneficial effects: The present disclosure provides a stepper motor control method, device and system, the method is applied to a subdivision controller corresponding to the stepper motor, the subdivision controller is connected to the main control circuit; the subdivision controller is connected to the stepper motor, the subdivision controller includes a first register, the subdivision controller controls the carrier frequency output to the stepper motor according to the current value of the first register, and thus controls the current operating state of the stepper motor, the subdivision controller stores a first correspondence between the operating state of the stepper motor and the carrier frequency, the first register includes a first subunit, and the subdivision controller also stores a first correspondence between the subdivision gear and the value of the first subunit. Two correspondences; the method includes: receiving an adjustment instruction sent by a main control circuit, wherein the instruction carries the target operating state of the stepper motor; searching for a target carrier frequency corresponding to the target operating state from the first correspondence; obtaining the current subdivision gear and the current carrier frequency of the stepper motor; calculating the target subdivision gear according to the current subdivision gear, the current carrier frequency and the target carrier frequency; searching for a target value of the first subunit corresponding to the target subdivision gear from the second correspondence; determining the target value of the first register according to the target value of the first subunit; and modifying the current value in the first register to the target value to drive the stepper motor to operate according to the target operating state.
[0012] The present disclosure calculates and modifies the value of the first register to provide a carrier frequency corresponding to the value of the first register, and outputs the carrier frequency to the stepper motor to achieve the target subdivision mode, thereby realizing automatic calculation and adjustment, thereby reducing the error of manual calculation and adjustment and improving control accuracy.
[0013] Other features and advantages of the present disclosure will be described in the following description, and in part will become apparent from the description, or understood by practicing the present disclosure. The objectives and other advantages of the present disclosure are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0014] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0016] FIG1 is a flow chart of a stepper motor control method provided by an embodiment of the present disclosure;
[0017] FIG2 is a flow chart of another stepping motor control method provided by an embodiment of the present disclosure;
[0018] FIG3 is a flow chart of another stepping motor control method provided by an embodiment of the present disclosure;
[0019] FIG4 is a structural diagram of a stepping motor control device provided by an embodiment of the present disclosure;
[0020] FIG5 is a schematic diagram of a connection structure in a stepper motor control system provided in an embodiment of the present disclosure.
[0021] Reference numerals: 10 - receiving module, 20 - first searching module, 30 - acquiring module, 40 - calculating module, 50 - second searching module, 60 - determining module, 70 - modifying module. DETAILED DESCRIPTION
[0022] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0023] To facilitate understanding of this embodiment, the following briefly introduces the technical terms used in the disclosed design.
[0024] A stepper motor can convert electrical pulse signals into corresponding angular or linear displacements. Each time a pulse signal is input, the rotor rotates one degree or moves one step forward. The output angular or linear displacement is proportional to the number of input pulses, and the speed is proportional to the pulse frequency. Therefore, a stepper motor is also called a pulse motor.
[0025] After introducing the technical terms involved in the present disclosure, the application scenarios and design concepts of the embodiments of the present disclosure are briefly introduced.
[0026] In actual manufacturing, stepper control systems offer multiple subdivision options. The larger the number of subdivisions, the closer the stepper motor current waveform approaches a sine wave, and the smoother the stepper motor's operation. However, in practical applications, once the stepper motor's subdivision mode is set, it cannot be changed. Manual calculation and adjustment of the gear position are required, which is cumbersome and prone to errors.
[0027] Based on this, an embodiment of the present disclosure provides a stepper motor control method, which is applied to a subdivision controller corresponding to the stepper motor. The subdivision controller is connected to a main control circuit; the subdivision controller is connected to the stepper motor, and the subdivision controller includes a first register. The subdivision controller controls the carrier frequency output to the stepper motor based on the current value of the first register, thereby controlling the current operating state of the stepper motor. The subdivision controller stores a first correspondence between the operating state of the stepper motor and the carrier frequency. The first register includes a first subunit. The subdivision controller also stores a second correspondence between the subdivision gear and the value of the first subunit. The subdivision controller also includes a processor and a memory. The memory stores a computer program. The processor executes the computer program in the memory to implement the method provided in this embodiment.
[0028] 1 , the stepper motor control method provided in this embodiment includes:
[0029] S110: The processor receives an adjustment instruction sent by the main control circuit, where the instruction carries a target operating state of the stepping motor.
[0030] S120: The processor searches for a target carrier frequency corresponding to the target operating state from the first corresponding relationship.
[0031] S130: The processor obtains the current subdivision gear and the current carrier frequency of the stepper motor.
[0032] S140: The processor calculates a target subdivided gear position according to the current subdivided gear position, the current carrier frequency, and the target carrier frequency.
[0033] S150: The processor searches the second corresponding relationship for the target value of the first subunit corresponding to the target sub-gear position.
[0034] S160: The processor determines a target value of the first register according to the target value of the first subunit.
[0035] S170: The processor modifies the current value in the first register to a target value to drive the stepper motor to operate according to the target operating state.
[0036] Specifically, the stepper motor control method provided in this embodiment includes receiving an instruction to adjust the stepper motor, searching for the target carrier frequency corresponding to the target operating state carried by the instruction, calculating the target subdivision gear required to output the target carrier frequency and the corresponding target value of the first subunit, and determining the final target value of the first register, thereby modifying the current value of the first register to the target value to drive the stepper motor to operate according to the target stepper motor operating state, thereby realizing the function of automatic conversion of the stepper motor motion state, reducing the difficulty of manual debugging, reducing the error rate, and improving control stability and convenience.
[0037] Specifically, in step S110, during the operation of the stepper motor, due to the required rotation angle, a subdivision is required to reduce vibration and lag caused by a single large rotation angle. For example, a target rotation angle of 90° is subdivided into three steps, each with a rotation angle of 30°. If parameters such as the subdivision gear position and number of steps need to be modified during the operation or debugging of the stepper motor, the main control circuit sends an adjustment command to the subdivision controller. The subdivision controller receives the adjustment command from the main control circuit and obtains the target operating state of the stepper motor contained in the command.
[0038] In step S120, the current operating state of the stepper motor is obtained, specifically the current subdivision gear and the current carrier frequency of the stepper motor are obtained.
[0039] In step S130, after the current subdivision gear and the current carrier frequency of the stepper motor are obtained in step S120, the processor calculates the target subdivision gear according to the following formula based on the current subdivision gear, the current carrier frequency and the target carrier frequency: Pn = (fx × Px) / fn;
[0040] Among them, Pn is the target subdivision gear, Px is the current subdivision gear; fx is the current carrier frequency; fn is the target carrier frequency.
[0041] After the target sub-gear position Pn is calculated in step S130 , the target value of the first sub-unit corresponding to the target sub-gear position Pn is searched from the second corresponding relationship.
[0042] In step S140, the target value of the first register is determined according to the target value of the first subunit and the current value of the first register is modified to the target value in step S150, and the corresponding target carrier frequency is output, thereby driving the stepper motor to operate in the target operating state.
[0043] The following are some examples:
[0044] In this embodiment, it is assumed that after receiving the target stepper motor operating state sent by the client, the target carrier frequency fn=26.88KHz corresponding to the target stepper motor operating state is found from the first corresponding relationship pre-stored in the subdivider;
[0045] The current subdivision gear is obtained as 2 subdivisions, and the current carrier frequency is f2 = 53.76KHz;
[0046] At this time, substitute the above data into the formula Pn=(fx*Px) / fn; wherein Pn is the target subdivision gear, Px is the current subdivision gear; fx is the current carrier frequency; and fn is the target carrier frequency.
[0047] Calculation yields Pn=(2*53.76) / 26.88=4.
[0048] After obtaining that the target subdivision gear is 4, the target value of the first subunit corresponding to the subdivision gear is 0010, which is found from the second corresponding relationship pre-stored in the subdivision controller.
[0049] The second correspondence between the value of the first subunit in the subdivision controller and the subdivision gear position is shown in Table 1:
[0050] Table 1 is a table showing the correspondence between the values of the first subunit and the subdivided gears.
[0051] In combination with the above example, when the target gear is 4 subdivisions, the corresponding target value of the first subunit should be 0010.
[0052] The current value of the first register is modified according to the target value of the first sub-unit. Normally, the first register includes two sub-units. The value of the first sub-unit is used to represent the subdivision gear of the stepper motor, and the value of the second sub-unit is used to represent the running action or direction of the stepper motor. In this embodiment, without considering the action conversion or direction conversion of the stepper motor, the value of the first register is modified to 0010 according to the value of the first sub-unit, so that the target carrier frequency is output to the stepper motor, thereby controlling the stepper motor to work according to the target operating state, simplifying the adjustment operation, and automating the entire process, thereby reducing manual operation errors.
[0053] In this embodiment, the subdivided gears correspond to information such as the subdivided steps, such as 1 subdivision, 2 steps; 2 subdivisions, 4 steps, and so on.
[0054] As an implementable method, referring to Table 1, a correspondence between the value in the first register, the subdivision gear of the stepper motor, the carrier frequency, and the operating state of the stepper motor can be established. In this embodiment, the target subdivision gear is determined by the known target operating state of the stepper motor, the current subdivision gear, and the current carrier frequency, and the value of the first subunit is determined, thereby determining the target value of the first register. In this way, manual adjustment errors are reduced through automated search, calculation, determination, and modification operations.
[0055] This embodiment provides another stepper motor control method, which is also applied to a subdivision controller. The subdivision controller is connected to a main control circuit. As shown in FIG2 , the method provided in this embodiment includes:
[0056] S210: The processor selects one of the multiple subdivision gears in the first register as a test subdivision gear.
[0057] S220: The processor determines the carrier frequency under the test fine gear as the test carrier frequency and stores the corresponding relationship between the test carrier frequency and the test fine gear in the subdivision controller.
[0058] S230: The processor receives a stepper motor adjustment instruction sent by the main control circuit, where the instruction carries a target operating state.
[0059] S240: The processor searches for a target carrier frequency corresponding to the target operating state from the first corresponding relationship.
[0060] S250: The processor obtains the current subdivision gear and the current carrier frequency of the stepper motor.
[0061] S260: The processor calculates a target subdivided gear position according to the current subdivided gear position, the current carrier frequency, and the target carrier frequency.
[0062] S270: Search the second corresponding relationship for the target value of the first subunit corresponding to the target sub-gear position.
[0063] S280: The processor determines a target value of the first register according to the target value of the first subunit.
[0064] S290: The processor modifies the current value in the first register to a target value to drive the stepper motor to operate according to the target operating state.
[0065] In this embodiment, only the test subdivision gear and test carrier frequency are pre-stored. After the current carrier frequency is obtained, the pre-stored test subdivision gear and test carrier frequency are brought into the preset calculation formula to calculate the current subdivision gear, thereby reducing manual calculation errors and improving control accuracy.
[0066] In step S260, the step of obtaining the current gear position of the stepper motor includes:
[0067] S261, the processor searches for a current carrier frequency corresponding to the current operating state from the first corresponding relationship;
[0068] S262, calculate the current subdivision gear according to the following formula: Px = (f0 × P0) / fx;
[0069] Among them, P0 is the test subdivision gear, Px is the current subdivision gear; fx is the current carrier frequency; f0 is the test carrier frequency.
[0070] In this embodiment, one of the multiple subdivision gears is used as the test gear, and the test carrier frequency under the test gear is obtained, and the two are associated and stored. Afterwards, during the operation of the stepper motor, it is necessary to adjust the subdivision gear according to the working conditions, receive the adjustment stepper motor instruction sent by the client, determine the target carrier frequency, and determine the target subdivision gear and the corresponding target value of the first register according to the current carrier frequency and the current subdivision gear. Among them, the current subdivision gear is calculated based on the test subdivision gear, test carrier frequency and current frequency pre-stored in the subdivision controller. In this way, the current carrier frequency is obtained by actual detection, and other data are automatically calculated based on the data pre-stored in the subdivision controller, with a low error rate and high automatic adjustment accuracy.
[0071] In the stepper motor control method provided by the disclosed embodiment, the first register further includes a second subunit, and the current value of the first register is composed of the current value of the second subunit and the current value of the first subunit. The subdivision controller stores a third correspondence between the current value of the second subunit and the current action command. The action commands include at least: start, stop, clockwise rotation, and counterclockwise rotation.
[0072] As shown in FIG3 , in this embodiment, the instruction further includes a target action instruction; the method includes:
[0073] S310: The processor receives an adjustment instruction sent by the main control circuit, where the instruction carries a target operating state of the stepping motor.
[0074] S320: The processor searches for a target carrier frequency corresponding to the target operating state from the first corresponding relationship.
[0075] S330: The processor obtains the current subdivision gear and the current carrier frequency of the stepper motor.
[0076] S340: The processor calculates a target subdivided gear position according to the current subdivided gear position, the current carrier frequency, and the target carrier frequency.
[0077] S350: The processor searches the second corresponding relationship for the target value of the first subunit corresponding to the target sub-gear position.
[0078] S360: The processor determines a target value of the first register according to the target value of the first subunit.
[0079] S370: The processor searches the third corresponding relationship for the target value of the second subunit corresponding to the target action instruction.
[0080] S380: The processor determines a target value of the first register according to the target value of the first subunit and the target value of the second subunit to drive the stepping motor to operate in a target operating state.
[0081] In this embodiment, the value in the second subunit corresponds one-to-one to the stepper motor action instruction. After receiving the subdivided gear adjustment in the adjustment instruction, the value of the second subunit corresponding to the target working mode action is found, and the target value of the first register is determined based on the value of the first subunit and the value of the second subunit, so as to modify the value of the first register to drive the stepper motor to operate in the target operating state.
[0082] For example, the corresponding relationship between the value in the second subunit and the action of the stepper motor is shown in Table 2.
[0083] Table 2 is a table showing the correspondence between the values in the second subunit and the actions of the stepper motor.
[0084] Receive the adjustment instruction sent by the main control circuit, the target operating state of the stepper motor in the instruction includes the action and the target carrier frequency, determine the value of the first sub-unit (for example, 0010) according to the target carrier frequency combined with the stepper motor control method, and determine the value of the second sub-unit from the third corresponding relationship according to the target action, for example: the target action is: "counterclockwise rotation"; then find the value of the second sub-unit corresponding to "counterclockwise rotation" is "1010"; then combine the target value of the second sub-unit and the target value of the first sub-unit to determine the target value of the first register: then the target value is: 10100010.
[0085] Modify the current value of the first register to the target value: 10100010 to drive the stepper motor to rotate counterclockwise and run at 4 subdivision gears.
[0086] This embodiment provides another stepper motor control method, which is also applicable to a subdivision controller. The subdivision controller also includes a second register, and the subdivision controller stores a fourth correspondence relationship between the current value of the first register and the current value of the second register. After the step of modifying the current value in the first register to the target value, the method further includes:
[0087] searching, from the fourth corresponding relationship, a target value of the second register corresponding to the target value of the first register;
[0088] The current value in the second register is modified to the target value to drive the stepper motor to operate according to the target stepper motor operating state.
[0089] As an implementable manner, the second register includes a third subunit and a fourth subunit, the value of the third subunit is used to represent the clock division, and the value of the fourth subunit is used to represent the clock source division; the value of the second register is composed of the value of the third subunit and the value of the fourth subunit.
[0090] The corresponding relationship between the value of the third subunit and the clock frequency division is shown in Table 3, and the corresponding relationship between the value of the fourth unit and the clock source frequency division is shown in Table 4.
[0091] Table 3 is a table showing the correspondence between the sub-unit values and the clock frequency division.
[0092] Table 4 is a table showing the correspondence between the sub-unit values and the clock frequency division.
[0093] In this embodiment, the first register is driven to output a target carrier frequency by modifying the value of the second register to drive the stepping motor to operate in a target operating state.
[0094] In a second aspect, the disclosed embodiments further provide a stepper motor control device, which is applied to a subdivision controller corresponding to the stepper motor, the subdivision controller being connected to a main control circuit; the subdivision controller including a first register, which controls the carrier frequency output to the stepper motor according to the current value of the first register, thereby controlling the current operating state of the stepper motor; the subdivision controller stores a first correspondence between the operating state of the stepper motor and the carrier frequency; the first register includes a first subunit; the subdivision controller also stores a second correspondence between the subdivision gear and the value of the first subunit; the subdivision controller stores a one-to-one correspondence between multiple carrier frequencies and multiple stepper motor subdivision modes. In conjunction with FIG4 , the device includes: a receiving module 10, a first search module 20, an acquisition module 30, a calculation module 40, a second search module 50, a determination module 60, and a modification module 70.
[0095] The receiving module 10 is configured to receive an adjustment instruction sent by the main control circuit, wherein the instruction carries the target operating state of the stepping motor.
[0096] The first search module 20 is configured to search for a target carrier frequency corresponding to the target operating state from the first corresponding relationship.
[0097] The acquisition module 30 is configured to acquire the current subdivision gear and the current carrier frequency of the stepping motor.
[0098] The calculation module 40 is configured to calculate a target subdivided gear position according to a current subdivided gear position, a current carrier frequency and a target carrier frequency.
[0099] The second search module 50 is configured to search for the target value of the first subunit corresponding to the target sub-gear position from the second corresponding relationship.
[0100] The determination module 60 is configured to determine a target value of the first register according to a target value of the first subunit.
[0101] The modifying module 70 is configured to modify the current value in the first register to a target value, so as to drive the stepping motor to operate according to the target operating state.
[0102] In a third aspect, an embodiment of the present disclosure provides a stepper motor control system, including the above-mentioned subdivision controller. As shown in FIG5 , the input end of the subdivision controller is connected to the interface of the main control circuit (SPI interface), and the output end is connected to the stepper motor.
[0103] As shown in Figure 5, the main control circuit is also connected to other devices through different interfaces, such as information interaction with the Hall circuit through the GPI0 interface, or information interaction with the imaging circuit through the MIPI interface, and connection with the indication circuit, key circuit, pickup circuit, pronunciation circuit, etc.
[0104] Adopt interface connection, the connection method is simple and easy to operate.
[0105] For the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0106] In addition, in the description of the embodiments of the present disclosure, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in the present disclosure based on the specific circumstances.
[0107] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0108] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are intended solely to facilitate the description of this disclosure and simplify the description. They do not indicate or imply that the devices or components referred to must have a specific orientation, be constructed, or operate in a specific orientation. Therefore, they should not be construed as limitations on this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0109] Finally, it should be noted that the above embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.
Claims
1. A stepper motor control method, applied to a subdivision controller corresponding to the stepper motor, the subdivision controller is connected to a main control circuit; the subdivision controller is connected to the stepper motor, the subdivision controller includes a first register, the subdivision controller controls the carrier frequency output to the stepper motor according to the current value of the first register, and then controls the current operating state of the stepper motor, the subdivision controller stores a first correspondence relationship between the operating state of the stepper motor and the carrier frequency, the first register includes a first subunit, and the subdivision controller also stores a second correspondence relationship between the subdivision gear and the value of the first subunit; the method includes: Receiving an adjustment instruction sent by a main control circuit, wherein the instruction carries a target operating state of the stepper motor; Searching for a target carrier frequency corresponding to the target operating state from the first corresponding relationship; Obtaining the current subdivision gear and current carrier frequency of the stepper motor; Calculate a target subdivision gear position according to the current subdivision gear position, the current carrier frequency and the target carrier frequency; Searching for a target value of the first subunit corresponding to the target subdivided gear from the second corresponding relationship; determining a target value of the first register according to a target value of the first subunit; The current value in the first register is modified to a target value to drive the stepper motor to operate according to the target operating state.
2. The method according to claim 1, wherein: The step of calculating the target subdivision gear position according to the current subdivision gear position, the current carrier frequency and the target carrier frequency comprises: Calculate according to the following formula: Pn=(fx*Px) / fn; Among them, Pn is the target subdivision gear, Px is the current subdivision gear; fx is the current carrier frequency; fn is the target carrier frequency.
3. The method according to claim 1, wherein: Before the step of receiving the stepper motor adjustment request sent by the main control circuit, the method further includes: Selecting one of the multiple subdivision gears of the first register as a test subdivision gear; Determine the carrier frequency under the test subdivision gear as the test carrier frequency; The corresponding relationship between the test carrier frequency and the test subdivision gear is stored in the subdivision controller.
4. The method according to claim 3, wherein: The step of obtaining the current gear position of the stepper motor comprises: Searching for a current carrier frequency corresponding to the current operating state from the first corresponding relationship; The current subdivision gear is calculated according to the following formula: Px=(f0×P0) / fx; Among them, P0 is the test subdivision gear, Px is the current subdivision gear; fx is the current carrier frequency; f0 is the test carrier frequency.
5. The method according to claim 1, wherein: The first register also includes a second subunit, and the current value of the first register is composed of the current value of the second subunit and the current value of the first subunit; the subdivision controller stores a third correspondence between the current value of the second subunit and the current action instruction, and the action instruction includes at least: start, stop, clockwise rotation and counterclockwise rotation.
6. The method according to claim 5, wherein: The instruction also includes a target action instruction; after the step of searching the target value of the first subunit corresponding to the target subdivided gear from the second corresponding relationship, the step further includes: Searching for a target value of the second subunit corresponding to the target action instruction from the third corresponding relationship; A target value of the first register is determined according to a target value of the first subunit and a target value of the second subunit.
7. The method according to claim 1, wherein: The subdivision controller further includes a second register, in which a fourth correspondence relationship between a current value of the first register and a current value of the second register is stored in the subdivision controller. After the step of modifying the current value in the first register to the target value, the step further includes: Searching for a target value of the second register corresponding to the target value of the first register from a fourth corresponding relationship; The current value in the second register is modified to a target value to drive the stepper motor to operate according to a target stepper motor operating state.
8. The method according to claim 7, wherein: The second register includes a third subunit and a fourth subunit, the value of the third subunit is used to represent the clock frequency division, and the value of the fourth subunit is used to represent the clock source frequency division; the value of the second register is composed of the value of the third subunit and the value of the fourth subunit.
9. A stepper motor control device, wherein: A subdivision controller corresponding to a stepper motor is applied, the subdivision controller is connected to a main control circuit; the subdivision controller is connected to the stepper motor, the subdivision controller includes a first register, and the subdivision controller controls the current operating state of the stepper motor according to the current value of the first register; the subdivision controller stores a first corresponding relationship between the operating state of the stepper motor and the carrier frequency, the first register includes a first subunit, and the subdivision controller also stores a second corresponding relationship between the subdivision gear and the value of the first subunit; the device includes: An instruction receiving module, configured to receive an adjustment request sent by a main control circuit, wherein the instruction carries a target operating state of the stepping motor; A first search module, configured to search for a target carrier frequency corresponding to the target operating state from the first corresponding relationship; An acquisition module, configured to acquire the current subdivision gear and the current carrier frequency of the stepping motor; A calculation module, configured to calculate a target subdivision gear position according to the current subdivision gear position, the current carrier frequency and the target carrier frequency; A second search module, configured to search the target value of the first subunit corresponding to the target subdivided gear from the second corresponding relationship; a determination module, configured to determine a target value of the first register according to a target value of the first subunit; The modification module is configured to modify the current value in the first register to a target value, so as to drive the stepper motor to operate according to the target operating state.
10. A stepper motor control system, comprising the device according to claim 9.
Citation Information
Patent Citations
High subdivided integration type stepper motor driver
CN101119092A
Motor driving method and system
CN111030526A
Stepping motor control method, device and system
CN116436352A
Stepping motor driver, paper carrier, stepping motor driving method, computer program, and storage medium
JP2004140890A
Micro-step driving method of stepping motor and electrically-driven device using stepping motor
US20090001920A1
