Motor control method and device and analyzer

By calculating and using the number of code teeth, triggering first step and triggering second step in the motor control system, the problem of low motion accuracy and reliability in the traditional motor control method is solved, and high-precision motor motion control is achieved, reducing costs.

CN119891834APending Publication Date: 2025-04-25CHONGQING PUMENCHUANG BIOTECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411994281.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The traditional motor control method is difficult to meet the motion accuracy requirements, low working reliability, and easy to cause "step loss" and "overshoot" problems due to the high cost of high-precision encoder and large fractional number of stepper motors.

Method used

By obtaining the current position of the code disk, calculate the number of code teeth at the target position, the number of triggered steps before triggering, and the number of steps after triggering, and after determining that the motor has completed the number of steps before triggering, control the number of steps after triggering the last code teeth.

Benefits of technology

There is no need to add high-precision encoder, which reduces hardware cost and complexity, improves the accuracy of motor movement, reduces the collision risk caused by "step loss", and improves work reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119891834A_ABST
    Figure CN119891834A_ABST
Patent Text Reader

Abstract

The invention relates to a motor control method and device and an analyzer, and the method comprises the steps: obtaining the current position of a code disc rotating along with the movement of a motor, and obtaining the number of steps of a single code tooth of the code disc according to the current position, and a target position; and calculating the number of code teeth at the target position, the number of steps before triggering when the last code tooth of the code teeth at the target position is triggered and the number of steps after triggering when the last code tooth is triggered, and controlling the motor to move the number of steps after triggering after the last code tooth is triggered under the condition of judging that the motor has finished the number of steps before triggering according to the current position. Therefore, on the basis of an existing hardware structure, through the theoretical step number of the code teeth and the number of the code teeth needing to be triggered in place, compensation can be carried out in the single motion of the motor, a high-precision encoder does not need to be added, the hardware requirement is low, the cost is reduced, and the motor motion accuracy can be effectively improved; and the collision risk caused by motor step loss is greatly reduced, and the working reliability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor technology, and in particular to a motor control method, device and analyzer. Background Art

[0002] As a driving device, the motor can drive the connected devices to move and has been widely used in various devices. The traditional motor control method generally uses the motion curve of start-acceleration-average speed-deceleration-stop to control the motor. However, due to factors such as the high speed and low torque of the motor, the elastic ductility of the synchronous belt, and the heavy frame of the component itself, it is inevitable that there is a difference between the theoretical position of the motor and the actual required position, that is, the "lost step" and "overshoot" problems occur, resulting in the corresponding component being unable to run to the precise position required by the design.

[0003] In order to improve the accuracy of motor movement, the traditional method is to add a high-precision encoder to the motor, convert the motion command into the corresponding theoretical encoder number, and use the encoder to detect the rotation of the stepper motor to determine the corresponding actual encoder number, and correct the motion command according to the actual encoder number and the theoretical encoder number. However, the cost of high-precision encoders is very high. At the same time, when the motion accuracy requirements are very high, it is usually accompanied by a large number of stepper motor subdivisions. The position of the stepper motor movement for each pulse signal sent by the chip is small, resulting in the high-precision encoder being unable to meet the requirements and not being feasible. Therefore, the traditional motor control method has low working reliability. Summary of the invention

[0004] Based on this, it is necessary to provide a motor control method, device and analyzer that can improve the working reliability in order to address the technical problem of low working reliability of traditional motor control methods.

[0005] In a first aspect, the present application provides a motor control method, the method comprising:

[0006] Obtaining the current position of the code disk; the code disk rotates following the movement of the motor;

[0007] According to the current position, the number of steps of a single code tooth of the code disk and the target position, the number of code teeth at the target position, the number of steps before triggering and the number of steps after triggering are calculated; the number of steps before triggering is the number of steps required to trigger the last code tooth of the code teeth at the target position, and the number of steps after triggering is the number of steps required to trigger the last code tooth;

[0008] When it is determined according to the current position that the motor has completed the number of steps before triggering, after the last code tooth is triggered, the motor is controlled to move the number of steps after triggering.

[0009] In one embodiment, when it is determined according to the current position that the motor has completed the number of steps before triggering, after triggering the last code tooth, controlling the motor to move the number of steps after triggering includes:

[0010] When it is determined according to the current position that the motor has completed the number of steps before the trigger, waiting for the sensor to be triggered; the sensor is triggered when it detects that the teeth and the grooves of the code disk are switched, and the teeth and the grooves are spaced apart;

[0011] After the sensor is triggered, the motor is controlled to move the post-triggering step number.

[0012] In one embodiment, after calculating the target position code tooth number, the number of steps before triggering and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk and the target position, when it is determined according to the current position that the motor has completed the number of steps before triggering, after triggering the last code tooth, controlling the motor to move before the number of steps after triggering, the method further includes:

[0013] Determine a first trigger step number according to the single code tooth step number and the pre-trigger step number;

[0014] The first trigger step number is used to update the pre-trigger step number.

[0015] In one embodiment, after updating the pre-trigger step number with the first trigger step number, when it is determined according to the current position that the motor has completed the pre-trigger step number, waiting for the sensor to be triggered includes:

[0016] When it is determined according to the current position that the motor has completed the number of steps before triggering, the encoder is enabled to trigger the sensor, and the sensor is waited to be triggered.

[0017] In one embodiment, before obtaining the current position of the code disk, the method further includes:

[0018] Positioning the code disc.

[0019] In one embodiment, when it is determined according to the current position that the motor has completed the number of steps before triggering, after the last code tooth is triggered, the motor is controlled to move the number of steps after triggering, and the method further includes:

[0020] Comparing the actual code tooth triggering number of the code disc with the preset code tooth triggering number;

[0021] When the actual code tooth trigger number is inconsistent with the preset code tooth trigger number, an error prompt message is issued.

[0022] In one embodiment, after calculating the target position code tooth number, the number of steps before triggering and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk and the target position, when it is determined according to the current position that the motor has completed the number of steps before triggering, after triggering the last code tooth, controlling the motor to move before the number of steps after triggering, the method further includes:

[0023] Calculate the movement speed of the motor according to the number of steps before triggering and the number of steps after triggering;

[0024] The motor movement is controlled according to the movement speed.

[0025] In a second aspect, the present application further provides a motor control device, the device comprising:

[0026] A current position acquisition module, used to acquire the current position of the code disk; the code disk rotates following the movement of the motor;

[0027] A parameter calculation module, used to calculate the target position code tooth number, the number of steps before triggering and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk and the target position; the number of steps before triggering is the number of steps required to trigger the last code tooth of the target position code tooth number, and the number of steps after triggering is the number of steps required to trigger the last code tooth;

[0028] The motion control module is used to control the motor to move the number of steps after the triggering after the last code tooth is triggered, when it is determined that the motor has completed the number of steps before the triggering according to the current position.

[0029] In a third aspect, the present application further provides an analyzer, comprising a motor, a driven component, a code disc, a sensor and a controller, wherein the motor is drivingly connected to the code disc, the code disc or the motor is drivingly connected to the driven component, and the sensor and the motor are connected to the controller;

[0030] The motor is used to drive the driven component to move, the code disk rotates following the movement of the motor, the sensor is used to detect the code disk, and the controller is used to control the motor according to the above method.

[0031] In one embodiment, the sensor is an optical coupler.

[0032] The above motor control method, device and analyzer obtain the current position of the code disk that rotates with the movement of the motor, and then calculate the target position code teeth, the number of pre-trigger steps required to trigger the last code tooth of the target position code teeth, and the number of post-trigger steps required after triggering the last code tooth according to the current position, the number of steps of a single code tooth of the code disk and the target position. When it is judged that the motor has completed the number of pre-trigger steps according to the current position, after triggering the last code tooth, the number of post-trigger steps of the motor movement is controlled. Therefore, based on the existing hardware structure, the single movement of the motor can be compensated through the theoretical number of steps of the code teeth and the number of code teeth that need to be triggered in place, without the need to add a high-precision encoder, with low hardware requirements, reduced costs, and the ability to effectively improve the accuracy of the motor movement, greatly reducing the risk of collision caused by motor step loss, and high working reliability. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 is a flow chart of a motor control method in one embodiment;

[0034] Figure 2 A schematic diagram of the connection relationship of the motors in one embodiment;

[0035] Figure 3 A schematic diagram of the meaning of parameters in an embodiment;

[0036] Figure 4 It is a flowchart of controlling the motor to move the number of steps after triggering the last code tooth in an embodiment when it is determined according to the current position that the motor has completed the number of steps before triggering;

[0037] Figure 5 is a flow chart of a motor control method according to another embodiment;

[0038] Figure 6 is a flow chart of a motor control method according to another embodiment;

[0039] Figure 7 is a flow chart of a motor control method according to another embodiment;

[0040] Figure 8 is a flow chart of a motor control method according to another embodiment;

[0041] Fig. 9 is a detailed flow chart of a motor control method in one embodiment;

[0042] Fig.10 FIG. 4 is a structural block diagram of a motor control device in one embodiment. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0044] The motor control method provided in the embodiment of the present application is used to control the motor, and can be specifically used to control the stepper motor. A stepper motor is an electric motor that converts an electrical pulse signal into a corresponding angular displacement or linear displacement. For each input pulse signal, the rotor of the stepper motor will rotate an angle or move forward one step, and the angular displacement or linear displacement outputted by the stepper motor is proportional to the number of input pulses, and the rotation speed is proportional to the pulse frequency.

[0045] The motor control method can be applied in an analyzer, where the reaction disk, reagent disk, sample suction needle and other devices are usually driven by motors, and the corresponding functions are realized after moving to the accurate position. The analyzer can be, for example, an in vitro diagnostic analyzer, and specifically, for example, a chemiluminescent immunoassay analyzer, a specific protein analyzer, a glycated hemoglobin analyzer, etc. Alternatively, the motor control method can also be applied to other devices, which can be determined according to actual needs.

[0046] The motor control method can be executed by a controller in the analyzer, or by a terminal or server connected to the analyzer. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The server can be implemented as an independent server or a server cluster consisting of multiple servers.

[0047] In an exemplary embodiment, Figure 1 As shown, a motor control method is provided, which is described by taking the method applied to a controller in an analyzer as an example, and includes the following steps 102 to 106. Among them:

[0048] Step 102, obtaining the current position of the code disk.

[0049] The code disc rotates with the movement of the motor. The code disc can be understood as a device in an encoder. An encoder is a device that can measure the speed and position of a motor and is often used to control the movement of a motor. Figure 2 As shown, the encoder generally includes a code disc 1 and a sensor 2. When the motor 3 moves, the code disc 1 rotates with the movement of the motor 3, and the sensor 2 is used to read the coded information on the code disc 1 and record the position information on the code disc 1. The controller can be connected to the encoder, and by reading the signal output by the encoder, the current position and speed of the motor 3 can be determined, and accurate position control and feedback control can be achieved, so that the motor can move accurately according to the predetermined motion trajectory. The type of the code disc 1 is not limited, and it can be an optical code disc or a magnetic code disc, etc.

[0050] The current position of the code disk 1 can be detected by the sensor 2 and sent to the controller, so that the controller can obtain the current position of the code disk 1. The current position of the code disk can be used as a basis for analyzing the current position of the motor.

[0051] Step 104, calculating the number of target position code teeth, the number of steps before triggering, and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk, and the target position.

[0052] The number of steps of a single code tooth of the code disk is a known value and can be determined according to the structure of the code disk. For example, in the analyzer, the number of steps of a single code tooth of the motor is generally about 150 steps.

[0053] The target position may be the target position of the code disk. When the code disk moves to the target position, the motor can theoretically also move to the theoretical position of the motor, so that the device connected to the motor can be driven to move to the required position to perform the corresponding function at the required position. Exemplarily, the motor can be connected to the sampling needle transmission, and when the motor moves, the sampling needle can be driven to move to reach different positions. When the code disk moves to the target position, the motor can drive the sampling needle to move to the reaction disk sample loading position, so that the sampling needle can load samples at the reaction disk sample loading position.

[0054] The target position code teeth number refers to the number of code teeth that need to be triggered when the code disk moves from the current position to the target position. The target position code teeth number can be calculated by calculating the difference between the target position and the current position, and then calculating the quotient of the difference and the number of single code teeth steps. When the quotient is a positive integer, the quotient value is used as the target position code teeth number; when the quotient is a non-positive integer, the smallest positive integer greater than the quotient value is used as the target position code teeth number.

[0055] The number of steps before triggering is the number of steps required to trigger the last code tooth of the target position code tooth number. The method for calculating the number of steps before triggering is not limited. For example, the difference between the target position code tooth number and 1 can be calculated first, and then the product of the difference and the number of steps of a single code tooth can be used as the number of steps before triggering.

[0056] The number of steps after triggering is the number of steps required after triggering the last code tooth. The method for calculating the number of steps after triggering is not limited. For example, the difference between the target position and the number of steps before triggering can be used as the number of steps after triggering.

[0057] by Figure 3 For example, the current position is S curr , the target position is S obj , the number of steps of a single tooth of the code disc is C step Based on these parameters, the target position code number can be calculated as C num , C num= 4 for example. Further, the number of steps before the trigger can be calculated as S1, and the number of steps after the trigger can be calculated as S2.

[0058] Step 106, when it is determined based on the current position that the motor has completed the number of steps before the trigger, after the last code tooth is triggered, the motor is controlled to move the number of steps after the trigger.

[0059] During the movement of the code disk and the motor, the controller continuously obtains the current position of the code disk or obtains it at a preset time interval, and obtains the current position of the motor based on the current position of the code disk. When the controller determines that the motor has completed the number of steps before the trigger according to the current position of the code disk, the controller waits for the feedback signal of the sensor. After receiving the feedback signal indicating that the last code tooth has been triggered, the controller controls the motor to move the number of steps after the trigger to reach the target position.

[0060] In the above motor control method, after obtaining the current position of the code disk that rotates with the movement of the motor, the target position code teeth, the number of pre-trigger steps required to trigger the last code tooth of the target position code teeth, and the number of post-trigger steps required after triggering the last code tooth are calculated according to the current position, the number of steps of a single code tooth of the code disk, and the target position. When it is judged that the motor has completed the number of pre-trigger steps according to the current position, after triggering the last code tooth, the number of post-trigger steps of the motor movement is controlled. Therefore, based on the existing hardware structure, the single movement of the motor can be compensated through the theoretical number of steps of the code teeth and the number of code teeth that need to be triggered in place, without adding a high-precision encoder, with low hardware requirements, reduced costs, and the ability to effectively improve the accuracy of the motor movement, greatly reducing the risk of collision caused by motor step loss, and high working reliability.

[0061] In an exemplary embodiment, Figure 4 As shown, step 106 includes step 402 and step 404 .

[0062] Step 402, when it is determined based on the current position that the motor has completed the number of steps before the trigger, wait for the sensor to be triggered.

[0063] The sensor is triggered when it detects the switching of the teeth and slots of the code disk, and the teeth and slots are arranged at intervals. The edge of the code disk is provided with teeth and slots arranged at intervals. The sensor sends a falling edge signal to the controller at the position where the teeth are switched to the slots, and sends a rising edge signal to the controller at the position where the slots are switched to the teeth. The code disk trigger mode can be rising edge trigger or falling edge trigger, which can be set according to the actual situation.

[0064] Taking the encoder trigger mode as rising edge trigger as an example, when the motor has completed the number of steps before the trigger according to the current position, the controller continues to wait for the feedback signal from the sensor. After receiving the rising edge signal sent by the sensor, it means that the sensor is triggered.

[0065] Step 404, after the sensor is triggered, control the motor to move the number of steps after the trigger.

[0066] After the sensor is determined to be triggered, it means that the last code tooth of the target position code tooth number has been triggered. In this case, the motor is controlled to move the number of steps after the trigger to reach the target position.

[0067] In this embodiment, when it is determined that the motor has completed the number of steps before the trigger according to the current position, the sensor is waited for to be triggered, and after the sensor is triggered, the motor is controlled to move the number of steps after the trigger. Using the sensor trigger as a switching point can correct the number of steps of the motor before the trigger, and after the sensor is triggered, the motor is controlled to move the number of steps after the trigger, so that the motor can move to the target position, thereby improving the movement accuracy of the motor.

[0068] In an exemplary embodiment, Figure 5 As shown, after step 104 and before step 106 , the motor control method further includes steps 502 and 504 .

[0069] Step 502: determine the first trigger step number according to the single code tooth step number and the pre-trigger step number.

[0070] There is no unique way to determine the first trigger step number. For example, the value of half of the single code tooth step number can be calculated first, and then the difference between the step number before triggering and the half value is used as the first trigger step number.

[0071] by Figure 3 For example, the number of steps of a single tooth of the code disc is C step , the number of steps before triggering is S1, then the number of first triggering steps can be calculated as S1-C step / 2.

[0072] Step 504: Update the number of steps before the trigger with the first triggering step number.

[0073] After determining the first trigger step number, the first trigger step number is used to update the pre-trigger step number, and the first trigger step number is used as the pre-trigger step number. Then step 106: in the case where it is determined according to the current position that the motor has completed the pre-trigger step number, after the last code tooth is triggered, the step of controlling the motor to move the post-trigger step number may include the step of: in the case where it is determined according to the current position that the motor has completed the first trigger step number, after the last code tooth is triggered, controlling the motor to move the post-trigger step number.

[0074] Since the triggering mode of the code disk may be rising edge triggering or falling edge triggering, the current position of the code disk may be in a high level state or a low level state, so the end position of the pre-trigger step number may also be in a high level state or a low level state. In this embodiment, the first trigger step number is determined according to the single code tooth step number and the pre-trigger step number, and the pre-trigger step number is updated by the first trigger step number, so that the current position can determine the accurate pre-trigger step number in different states, which is conducive to improving the accuracy of subsequent motor motion control.

[0075] In an exemplary embodiment, after step 504, step 402 includes the steps of: enabling the code disk trigger sensor and waiting for the sensor to be triggered when it is determined based on the current position that the motor has completed the number of steps before triggering.

[0076] After the first trigger step is updated to the number of steps before the trigger, when it is judged that the motor has completed the number of steps before the trigger according to the current position, the code disk trigger sensor can be enabled first, the sensor can detect the code disk, wait for the sensor to be triggered, receive the feedback signal of the sensor, and judge whether the sensor is triggered according to the feedback signal of the sensor. Therefore, after enabling the code disk trigger sensor, wait for the sensor to be triggered, and judge whether it has moved to the last code tooth according to the sensor trigger signal, so that the detection result of the position is more accurate.

[0077] In an exemplary embodiment, Figure 6 As shown, before step 102, the motor control method further includes step 602: positioning the code disk.

[0078] Specifically, the specific steps for positioning the encoder are roughly the same as the steps for controlling the motor. The difference is that the target position is the theoretical absolute position that may need to be obtained from the mechanical drawing, and the current position needs to be the reset 0 position.

[0079] The process of positioning the code disk may include: first moving to the theoretical absolute position, then fine-tuning the theoretical absolute position, and confirming the position accuracy through a fixture. After determining that the position is accurate, the operating software executes the movement to the debugged position again. If the debugged position is qualified, the current debug position is set as the positioning position.

[0080] In this embodiment, before controlling the motor, the code disk is first positioned and debugged, which is beneficial to improving the accuracy of subsequent motor control.

[0081] In an exemplary embodiment, Figure 7 As shown, after step 106 , the motor control method further includes steps 708 and 710 .

[0082] Step 708: Compare the actual code tooth triggering number of the code wheel with the preset code tooth triggering number.

[0083] Step 710: When the actual code tooth triggering number is inconsistent with the preset code tooth triggering number, an error prompt message is issued.

[0084] The preset code tooth trigger number is a theoretical value, for example, the target position code tooth number. After the motor moves to the desired position, check whether the actual code tooth trigger number of the code disk is consistent with the preset code tooth trigger number.

[0085] If the actual code tooth trigger number is inconsistent with the preset code tooth trigger number, it means that the motor has lost more than one code tooth, and the motor may have a serious step loss. In this case, the controller issues an error message to remind the user to pay attention to and deal with the motor's step loss.

[0086] For example, the controller may send the error prompt information to a local information prompt device, so that the information prompt device issues a corresponding prompt information. The information prompt device may be a voice prompt device or a display screen, etc. Alternatively, the controller may send the error prompt information to a terminal with which a communication connection has been established, so that the terminal issues a corresponding prompt information, thereby realizing a remote alarm.

[0087] In this embodiment, the actual code tooth trigger number of the code disk is compared with the preset code tooth trigger number, and an error prompt message is issued when the actual code tooth trigger number and the preset code tooth trigger number are inconsistent. By monitoring the actual motion state of the motor, an error prompt message is issued in time when the motor is abnormal, which is beneficial for the user to understand and deal with the abnormal situation in time, and is beneficial for improving the working performance of the motor.

[0088] In an exemplary embodiment, Figure 8 As shown, after step 104 and before step 106 , the motor control method further includes steps 805 and 806 .

[0089] Step 805, calculating the movement speed of the motor according to the number of steps before the trigger and the number of steps after the trigger.

[0090] Step 806, controlling the motor movement according to the movement speed.

[0091] After obtaining the number of steps before triggering and the number of steps after triggering, the movement speed of the motor corresponding to different number of steps can be calculated according to the speed requirement. Among them, the speed requirement can be set according to the actual situation. Exemplarily, in the number of steps before triggering and the number of steps after triggering, the speed requirement is first uniform acceleration, then uniform speed, and then uniform deceleration. Generally, the speed at the junction of the number of steps before triggering and the number of steps after triggering can be set to the second half of the uniform speed stage. It can be understood that in other embodiments, the movement speed of the motor can also be calculated according to other requirements, which is not limited here.

[0092] After the motor speed is determined, the motor movement is controlled according to the determined motor speed. During the movement of the motor and the encoder, the controller continuously or at a preset time interval obtains the position of the encoder and the number of steps of the motor. When it is determined that the motor has completed the number of steps before the trigger according to the current position, after the last encoder tooth is triggered, the motor movement is controlled to the number of steps after the trigger.

[0093] In this embodiment, the movement speed of the motor is calculated according to the number of steps before triggering and the number of steps after triggering, and the movement of the motor is controlled according to the movement speed, so that the movement speed of the motor can meet the demand.

[0094] In order to better understand the above embodiment, a specific embodiment is explained in detail below. In one embodiment, the motor control method uses a low-precision encoder to solve the problem of "lost step" and "overshoot" in the movement of the analyzer components, which leads to the components not running in place. Based on the existing one-circle 16-tooth motor encoder, an optical coupler is used to detect the code tooth signal, and a solution is proposed based on the low-precision encoder to automatically correct the component collision problem caused by "lost step" and "overshoot" during the movement process, which effectively improves the movement accuracy of each component of the analyzer and greatly reduces the cost. The sensor can be an optical coupler, such as Fig. 9 As shown, the motor control method includes the following steps: first, control the motor and the code disk to start running, then calculate the number of code teeth at the target position, the number of steps before triggering, and the number of steps after triggering, and then detect the current number of steps and the number of code teeth to determine whether the number of steps before triggering has been completed. If the number of steps before triggering has not been completed, return to detect the current number of steps and the number of code teeth until the number of steps before triggering has been completed. If the number of steps before triggering has been completed, start the triggering optocoupler and run the number of steps after triggering, wait for the optocoupler to trigger, correct the current position after triggering, and then run the number of steps after triggering. After the movement is completed, check whether the number of triggered code teeth is consistent with the plan. If not, an alarm will be issued to prompt that the motor has lost steps seriously and the lost steps exceed one code tooth; if they are consistent, the process ends.

[0095] Taking the R-axis rotating motor of the sampling needle to the sample adding position of the reaction disk as an example, the specific method steps of the motor control method include:

[0096] 1. Actual exercise process:

[0097] Before exercising, you need to do the following operations and obtain the corresponding information:

[0098] (1) Configure the encoder trigger mode to rising edge trigger;

[0099] (2) This motion process is used to complete component positioning;

[0100] (3) Given the number of steps of a single code tooth C step (usually about 150 steps);

[0101] When moving, first calculate the absolute position S of the reaction plate obj With the current position S curr The number of teeth required to trigger the motion C Num , the number of steps required to trigger the last code tooth S1, and the number of steps required after triggering the last code tooth S2. After obtaining the data, the motor starts to accelerate and decelerate according to the S1+S2 stroke calculation, and starts to move after the acceleration and deceleration calculation is completed, and moves to S1-C step / 2 position, enable the code disk to trigger the optocoupler, wait for the code disk to be triggered, and then move at the current speed S2 to reach the target position. After moving in place, check whether the code disk trigger times are consistent with the theoretical calculation. If not, an error will be reported.

[0102] Since a general stepper motor will only lose a few or dozens of steps in the entire motion cycle, in this solution, all lost steps in the S1 stage will be compensated by the trigger code teeth. After compensation, the displacement in the subsequent S2 stage is shorter and the number of lost steps can be almost ignored, thereby greatly improving the motion accuracy of the stepper motor, reducing the collision problem of the instrument caused by lost steps, and greatly reducing the cost of the instrument.

[0103] 2. Positioning and debugging process:

[0104] The positioning debugging process is almost the same as the actual motion process, with only the following two differences:

[0105] (1) The theoretical absolute position S of the sample adding position of the reaction plate needs to be obtained from the mechanical drawing obj ;

[0106] (2) The current position needs to be 0 after reset;

[0107] The movement method still adopts the above method, first move to the theoretical position, then make fine adjustments on the theoretical position, and confirm the position accuracy through the fixture. After confirming the position is accurate, the operating software executes the movement to the debugged position again. If the debugged position is qualified, the current debug position is set as the positioning position.

[0108] The motor control method provided in this embodiment uses a low-precision encoder and a specific motion logic to achieve high-precision motion of the stepper motor without changing the current design of the instrument. This effectively avoids the collision problem caused by the inaccurate motion of the stepper motor of the instrument, and does not add additional hardware, effectively controlling the cost.

[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0110] Based on the same inventive concept, the embodiment of the present application also provides a motor control device for implementing the motor control method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more motor control device embodiments provided below can refer to the limitations of the motor control method above, and will not be repeated here.

[0111] In an exemplary embodiment, Fig.10 As shown, a motor control device is provided, including a current position acquisition module 1002, a parameter calculation module 1004 and a motion control module 1006, wherein:

[0112] The current position acquisition module 1002 is used to acquire the current position of the code disk; the code disk rotates following the movement of the motor;

[0113] The parameter calculation module 1004 is used to calculate the target position code tooth number, the number of steps before triggering and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk and the target position; the number of steps before triggering is the number of steps required to trigger the last code tooth of the target position code tooth number, and the number of steps after triggering is the number of steps required to trigger the last code tooth;

[0114] The motion control module 1006 is used to control the motor to move the number of steps after the triggering after the last code tooth is triggered, when it is determined based on the current position that the motor has completed the number of steps before the triggering.

[0115] In an exemplary embodiment, the motion control module is also used to wait for the sensor to be triggered when it is determined that the motor has completed the number of steps before the trigger based on the current position; the sensor is triggered when it detects that the teeth and grooves of the code disk are switched, and the teeth and grooves are set at an interval; after the sensor is triggered, the number of steps after the motor movement trigger is controlled.

[0116] In an exemplary embodiment, the motor control device also includes a step update module, which is used to determine the first trigger step number based on the single code tooth step number and the pre-trigger step number after the motion control module determines that the motor has completed the pre-trigger step number based on the current position, the single code tooth step number of the code disk and the target position, and before the post-trigger step number, after the motion control module triggers the last code tooth and controls the motor to move. The step update module is used to update the pre-trigger step number with the first trigger step number.

[0117] In an exemplary embodiment, after the step update module updates the pre-trigger step number with the first trigger step number, the motion control module is also used to enable the code disk trigger sensor and wait for the sensor to be triggered when it is determined that the motor has completed the pre-trigger step number based on the current position.

[0118] In an exemplary embodiment, the motor control device further includes a positioning control module, and the positioning control module is used to position the code disk before the current position acquisition module acquires the current position of the code disk.

[0119] In an exemplary embodiment, the motor control device also includes an alarm module, which is used to compare the actual code tooth triggering number of the code disk with the preset code tooth triggering number after the motion control module determines that the motor has completed the number of steps before triggering according to the current position, and controls the motor to move the number of steps after triggering the last code tooth; when the actual code tooth triggering number is inconsistent with the preset code tooth triggering number, an error prompt message is issued.

[0120] In an exemplary embodiment, the motor control device also includes a speed determination module, which is used to, after the parameter calculation module calculates the target position code tooth number, the pre-trigger step number and the post-trigger step number based on the current position, the single code tooth step number of the code disk and the target position, the motion control module, when judging from the current position that the motor has completed the pre-trigger step number, controls the motor movement before the post-trigger step number after triggering the last code tooth, calculates the movement speed of the motor based on the pre-trigger step number and the post-trigger step number; and controls the movement of the motor based on the movement speed.

[0121] Each module in the above motor control device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0122] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0123] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0124] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0125] In one embodiment, an analyzer is provided, including a motor, a driven component, a code disk, a sensor and a control, wherein the motor is connected to the code disk in a transmission manner, the code disk or the motor is connected to the driven component in a transmission manner, and the sensor and the motor are connected to a controller. The motor is used to drive the driven component to move, the code disk rotates following the movement of the motor, the sensor is used to detect the code disk, and the controller is used to control the motor according to the method of any of the above embodiments. The analyzer may be, for example, an in vitro diagnostic analyzer, and specifically may be, for example, a chemiluminescent immunoassay analyzer, a specific protein analyzer, a glycated hemoglobin analyzer, and the like. The driven component may be a reaction disk, a reagent disk, a sample suction needle, and other devices in the analyzer.

[0126] The type of sensor is not limited. In an exemplary embodiment, the sensor is an optical coupler. By detecting the code disk through an optical coupler, electrical noise and interference can be reduced, anti-interference ability is strong, and the detection result is accurate.

[0127] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0128] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0129] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A motor control method, characterized in that: The method comprises: Obtaining the current position of the code disk; the code disk rotates following the movement of the motor; According to the current position, the number of steps of a single code tooth of the code disk and the target position, the number of code teeth at the target position, the number of steps before triggering and the number of steps after triggering are calculated; the number of steps before triggering is the number of steps required to trigger the last code tooth of the code teeth at the target position, and the number of steps after triggering is the number of steps required to trigger the last code tooth; When it is determined according to the current position that the motor has completed the number of steps before triggering, after the last code tooth is triggered, the motor is controlled to move the number of steps after triggering.

2. The method according to claim 1, characterized in that In the case where it is determined according to the current position that the motor has completed the number of steps before the trigger, after the last code tooth is triggered, controlling the motor to move the number of steps after the trigger, comprises: When it is determined according to the current position that the motor has completed the number of steps before the trigger, waiting for the sensor to be triggered; the sensor is triggered when it detects that the teeth and the grooves of the code disk are switched, and the teeth and the grooves are spaced apart; After the sensor is triggered, the motor is controlled to move the post-triggering step number.

3. The method according to claim 2, characterized in that After calculating the target position code tooth number, the number of steps before triggering, and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk, and the target position, the method further includes: Determine a first trigger step number according to the single code tooth step number and the pre-trigger step number; The first trigger step number is used to update the pre-trigger step number.

4. The method according to claim 3, characterized in that After the first triggering step number is updated with respect to the pre-triggering step number, when it is determined according to the current position that the motor has completed the pre-triggering step number, waiting for the sensor to be triggered comprises: When it is determined according to the current position that the motor has completed the number of steps before triggering, the encoder is enabled to trigger the sensor, and the sensor is waited to be triggered.

5. The method according to any one of claims 1 to 4, characterized in that: Before obtaining the current position of the code disk, the method further includes: Positioning the code disc.

6. The method according to any one of claims 1 to 4, characterized in that: In the case where it is determined according to the current position that the motor has completed the number of steps before triggering, after the last code tooth is triggered, the motor is controlled to move the number of steps after triggering, the method further includes: Comparing the actual code tooth triggering number of the code disc with the preset code tooth triggering number; When the actual code tooth trigger number is inconsistent with the preset code tooth trigger number, an error prompt message is issued.

7. The method according to any one of claims 1 to 4, characterized in that: After calculating the target position code tooth number, the number of steps before triggering, and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk, and the target position, the method further includes: Calculate the movement speed of the motor according to the number of steps before triggering and the number of steps after triggering; The motor movement is controlled according to the movement speed.

8. A motor control device, characterized in that: The device comprises: A current position acquisition module, used to acquire the current position of the code disk; the code disk rotates following the movement of the motor; A parameter calculation module, used to calculate the target position code tooth number, the number of steps before triggering and the number of steps after triggering according to the current position, the number of steps of a single code tooth of the code disk and the target position; the number of steps before triggering is the number of steps required to trigger the last code tooth of the target position code tooth number, and the number of steps after triggering is the number of steps required to trigger the last code tooth; The motion control module is used to control the motor to move the number of steps after the triggering after the last code tooth is triggered, when it is determined that the motor has completed the number of steps before the triggering according to the current position.

9. An analyzer, characterized in that: It includes a motor, a driven component, a code disc, a sensor and a controller, wherein the motor is drivingly connected to the code disc, the code disc or the motor is drivingly connected to the driven component, and the sensor and the motor are connected to the controller; The motor is used to drive the driven component to move, the code disk rotates following the movement of the motor, the sensor is used to detect the code disk, and the controller is used to control the motor according to the method according to any one of claims 1-7.

10. The analyzer according to claim 9, characterized in that The sensor is an optical coupler.