Turntable control method, turntable control device, and non-volatile storage medium
Patent Information
- Application Number
- CN202211420856.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2042-11-11
AI Technical Summary
[0004]本发明的主要目的在于提供一种转盘控制方法、转盘控制装置以及非易失性存储介质,以解决现有技术中对转盘的定位易受到转盘转速的影响的技术问题
[0016] By applying the technical solution of this invention, since the placement positions on the turntable are sequentially numbered according to a predetermined order, when the turntable needs to rotate from its current position to the target position, it is only necessary to understand the relationship between the target position and the current position. The actual rotation amount of the turntable can be calculated and deduced based on this relationship. This process is not affected by the turntable's rotational speed, thus ensuring consistent operational accuracy and enabling the turntable to move precisely from its current position to the target position. Furthermore, this method can also find the shortest path based on the relationship between the target position and the current position, and achieve forward or reverse rotation of the turntable based on the shortest path. This invention also has the following advantages: The positioning function is achieved using a turntable, encoder, sensor, and stepper motor, reducing the time spent on the encoder and saving space occupied by the encoder. The hardware structure is simple, easy to assemble, debug, and produce, greatly reducing costs. Each revolution of the turntable can achieve self-calibration, ensuring the accuracy of the turntable rotation; each target position is set with an independent offset, and the instrument automatically calculates the rotation amount based on the offset. When the turntable is uneven, accurate positioning can be achieved by adjusting the deviation, reducing processing difficulty.
Smart Images

Figure CN115753050B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of in vitro diagnostic equipment technology, and more specifically, to a turntable control method, a turntable control device, and a non-volatile storage medium. Background Technology
[0002] Currently, rotary table technology is widely used in in vitro diagnostics, but the challenge lies in positioning. In in vitro diagnostic equipment, reagents are often transported to designated locations via a rotary table. During rotation, the table is typically positioned using a code disk, which usually determines its position by measuring slits. To achieve precise positioning, the code disk's diameter is often required to be as close as possible to the rotary table's diameter. A slit is provided along the circumference of the code disk, dividing its outer perimeter into several equal parts. A photoelectric switch determines the code disk's position by sensing these slits, thus calculating the rotary table's position.
[0003] However, due to the small slits of the code disk and the potential delays in the response and signal transmission of the photoelectric switch (sensor), inaccurate positioning is easily caused when the code disk rotates at a high speed, and the accuracy of positioning is often limited by speed. Summary of the Invention
[0004] The main objective of this invention is to provide a turntable control method, a turntable control device, and a non-volatile storage medium to solve the technical problem in the prior art that the positioning of the turntable is easily affected by the turntable rotation speed.
[0005] To achieve the above objectives, according to one aspect of the present invention, a turntable control method is provided, wherein the turntable is provided with M 总 Placement positions, and for M 总 The placement positions are numbered sequentially according to a predetermined order; the turntable control method includes: acquiring the target position of the turntable; when the target position of the turntable is the same as the current position of the turntable, controlling the turntable to stop running; when the target position of the turntable is different from the current position of the turntable, comparing the number of the target position with the number of the current position to obtain a first comparison result, and multiplying the absolute value of the difference between the number of the target position and the number of the current position by M. 总 / 2 is compared to obtain a second comparison result; the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position.
[0006] Further, determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position includes: obtaining the rotation deviation N2 of the current position and the rotation deviation N3 of the target position; and determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position.
[0007] Further, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: when the first comparison result is that the number of the target position is greater than the number of the current position, and the second comparison result is that the absolute value of the difference between the number of the target position and the number of the current position is greater than M. 总 When the value is 2, the actual rotation of the turntable is: N4 = N1 - S - N2 + N3; where S is the rotation of the turntable in one revolution.
[0008] Furthermore, determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position further includes: when the first comparison result is that the number of the target position is greater than the number of the current position, and the second comparison result is that the absolute value of the difference between the number of the target position and the number of the current position is less than M... 总 When the target position is / 2, determine whether the target position is the origin of the turntable; control the actual rotation of the turntable based on whether the target position is the origin of the turntable; when the target position is the origin of the turntable, initialize the turntable; when the target position is not the origin of the turntable, the actual rotation of the turntable is: N4 = N1 - N2 + N3.
[0009] Further, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: when the first comparison result is that the number of the target position is less than the number of the current position, and the second comparison result is that the absolute value of the difference between the number of the target position and the number of the current position is greater than M. 总 When the target position is / 2, determine whether the target position is the origin of the turntable; control the actual rotation of the turntable based on whether the target position is the origin of the turntable; when the target position is the origin of the turntable, initialize the turntable; when the target position is not the origin of the turntable, the actual rotation of the turntable is: N4=N1+S-N2+N3.
[0010] Further, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: when the first comparison result is that the number of the target position is less than the number of the current position, and the second comparison result is that the absolute value of the difference between the number of the target position and the number of the current position is less than M. 总 When the value is 2, the actual rotation of the turntable is: N4 = N1 - N2 + N3.
[0011] Furthermore, a sensor is installed on the turntable, and a sensor that cooperates with the sensor is installed along the movement path of the sensor. The turntable is initialized by: detecting whether the sensor is within the sensor's sensing range; when the sensor is within the sensor's sensing range, controlling the turntable to rotate a preset number of steps S1, so that the sensor moves beyond the sensor's sensing range; subsequently, controlling the turntable to rotate a preset number of steps S2, where S2 is greater than or equal to S1, and S2 moves in the opposite direction to S1; during the turntable's rotation according to the preset number of steps S2, detecting whether the sensor enters the sensor's sensing range; when the sensor is detected to have entered the sensor's sensing range... When the sensing range is reached, the turntable is controlled to rotate for initialization deviation steps S3. Then, it is determined whether the sensing part is within the sensor's sensing range. When the sensing part is within the sensor's sensing range, the turntable completes the initialization operation. When the sensing part is not within the sensor's sensing range, the turntable is controlled to rotate for maximum stroke steps S4. During the maximum stroke steps S4, when it is detected whether the sensing part has entered the sensor's reaction range, the turntable stops rotating. Then, the turntable is controlled to rotate for initialization deviation steps S3, and it is determined whether the sensing part is within the sensor's sensing range. When the sensing part is within the sensor's sensing range, the turntable completes the initialization operation.
[0012] Furthermore, the turntable control method also includes: calculating the rotation interval N1 between the target position and the current position; the total number of steps for one revolution of the turntable is S, and the target position is numbered M. n1 The current location is numbered M. n0 Where, N1 = (S / M 总 )×(M n1 -M n0 ).
[0013] Furthermore, the turntable control method also includes: controlling the turntable to rotate from its origin, and controlling the turntable according to the rotation interval N between the placement position corresponding to any number on the turntable and the placement position corresponding to the origin of the turntable. n The rotation proceeds sequentially; when the turntable completes its rotation interval N... nThen, it checks whether the corresponding numbered placement position has been reached; when the corresponding numbered placement position has been reached, it determines that the rotation deviation of the corresponding numbered placement position is 0; when the corresponding numbered placement position has not been reached, it obtains the deviation of the corresponding numbered placement position.
[0014] According to another aspect of the present invention, a turntable control device is provided, comprising: an acquisition module configured to acquire a target position of the turntable; a first judgment module configured to control the turntable to stop operation when the target position of the turntable is the same as the current position of the turntable; and a second judgment module configured to compare the number of the target position with the number of the current position to obtain a first comparison result when the target position of the turntable is different from the current position of the turntable, and to determine the absolute value of the difference between the number of the target position and the number of the current position and M. 总 / 2 is compared to obtain a second comparison result; the calculation module is set to determine the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position.
[0015] According to another aspect of the present invention, a non-volatile storage medium is provided, the non-volatile storage medium including a program, the program employing the turntable control method provided above.
[0016] By applying the technical solution of this invention, since the placement positions on the turntable are sequentially numbered according to a predetermined order, when the turntable needs to rotate from its current position to the target position, it is only necessary to understand the relationship between the target position and the current position. The actual rotation amount of the turntable can be calculated and deduced based on this relationship. This process is not affected by the turntable's rotational speed, thus ensuring consistent operational accuracy and enabling the turntable to move precisely from its current position to the target position. Furthermore, this method can also find the shortest path based on the relationship between the target position and the current position, and achieve forward or reverse rotation of the turntable based on the shortest path. This invention also has the following advantages: The positioning function is achieved using a turntable, encoder, sensor, and stepper motor, reducing the time spent on the encoder and saving space occupied by the encoder. The hardware structure is simple, easy to assemble, debug, and produce, greatly reducing costs. Each revolution of the turntable can achieve self-calibration, ensuring the accuracy of the turntable rotation; each target position is set with an independent offset, and the instrument automatically calculates the rotation amount based on the offset. When the turntable is uneven, accurate positioning can be achieved by adjusting the deviation, reducing processing difficulty. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0018] Figure 1 A flowchart illustrating the initialization operation provided according to an embodiment of the present invention is shown;
[0019] Figure 2 A flowchart illustrating the determination of the origin offset according to an embodiment of the present invention is shown.
[0020] Figure 3 A schematic diagram of the process for adjusting the offset of each placement position according to an embodiment of the present invention is shown;
[0021] Figure 4 A schematic diagram illustrating the process of a control turntable rotating from its current position to a target position according to an embodiment of the present invention is shown.
[0022] Figure 5 A schematic diagram showing a turntable with multiple placement positions provided according to an embodiment of the present invention is shown. Detailed Implementation
[0023] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0024] Embodiment 1 of the present invention provides a turntable control method, wherein the turntable is provided with M 总 One placement position, for M 总 The placement positions are numbered sequentially according to a predetermined order. The turntable control method includes: acquiring the target position of the turntable; when the target position of the turntable is the same as the current position of the turntable, controlling the turntable to stop running; when the target position of the turntable is different from the current position of the turntable, comparing the number of the target position with the number of the current position to obtain a first comparison result, and multiplying the absolute value of the difference between the number of the target position and the number of the current position by M. 总 / 2 is compared to obtain a second comparison result; the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position.
[0025] The turntable control method provided in this embodiment, by sequentially numbering the placement positions on the turntable according to a predetermined order, allows for precise rotation of the turntable from its current position to a target position only by understanding the relationship between the target and current positions. This relationship enables the calculation of the actual rotation amount of the turntable, unaffected by the turntable's rotational speed, thus ensuring consistent operational accuracy and enabling the turntable to move accurately from its current position to the target position. Furthermore, this method can also find the shortest path based on the relationship between the target and current positions, and then control the turntable's forward or reverse rotation accordingly. Specifically, forward rotation can be understood as clockwise rotation, and reverse rotation as counter-clockwise rotation.
[0026] Specifically, determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position includes: determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position. By considering the rotation deviation N2 of the current position and the rotation deviation N3 of the target position, the accuracy of the actual rotation amount N4 of the turntable can be improved, thereby facilitating further improvement in rotation precision.
[0027] In this embodiment, determining the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position includes: when the first comparison result is that the number of the target position is greater than the number of the current position, and the second comparison result is that the absolute value of the difference between the number of the target position and the number of the current position is greater than M... 总 When the rotation is 2 / 3, the actual rotation of the turntable is: N4 = N1 - S - N2 + N3; where S is the rotation of the turntable in one revolution. This allows for accurate determination of the actual rotation of the turntable, ensuring that it can move smoothly to the target position.
[0028] Specifically, in this embodiment, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position. The method further includes: when the first comparison result indicates that the number of the target position is greater than the number of the current position, and the second comparison result indicates that the absolute value of the difference between the number of the target position and the number of the current position is less than M... 总When the target position is 2, determine whether it is the origin of the turntable; control the actual rotation of the turntable based on whether the target position is the origin. This allows for adaptive adjustments when the target position is the origin, thus simplifying the calculation process to some extent.
[0029] In this embodiment, controlling the actual rotation amount of the turntable based on whether the target position is the origin position of the turntable includes: when the target position is the origin position of the turntable, initializing the turntable; when the target position is not the origin position of the turntable, the actual rotation amount of the turntable is: N4 = N1 - N2 + N3. This method facilitates accurate determination of the actual rotation amount of the turntable in this situation, enabling the turntable to smoothly move to the target position.
[0030] Specifically, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position. This includes determining the actual rotation amount N4 of the turntable when the first comparison result indicates that the number of the target position is less than the number of the current position, and the second comparison result indicates that the absolute value of the difference between the number of the target position and the number of the current position is greater than M. 总 When the target position is 2, determine whether it is the origin of the turntable; control the actual rotation of the turntable based on whether the target position is the origin. This allows for adaptive adjustments when the target position is the origin, thus simplifying the calculation process to some extent.
[0031] In this embodiment, controlling the actual rotation of the turntable based on whether the target position is the origin position of the turntable includes: when the target position is the origin position of the turntable, initializing the turntable; when the target position is not the origin position of the turntable, the actual rotation of the turntable is: N4 = N1 + S - N2 + N3. This method facilitates accurate determination of the actual rotation of the turntable in this situation, enabling the turntable to move smoothly to the target position.
[0032] Specifically, the actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position. This includes determining the actual rotation amount N4 of the turntable when the first comparison result indicates that the number of the target position is less than the number of the current position, and the second comparison result indicates that the absolute value of the difference between the number of the target position and the number of the current position is less than M. 总 When the rotation is 2 / 3, the actual rotation of the turntable is: N4 = N1 - N2 + N3. Using this method, the actual rotation of the turntable can be accurately calculated under these conditions, ensuring that the turntable can smoothly move to the target position.
[0033] In this embodiment, a sensor is mounted on the turntable, and a sensor cooperating with the sensor is mounted on the movement path of the sensor. The turntable is initialized by: detecting whether the sensor is within the sensor's sensing range; when the sensor is within the sensor's sensing range, controlling the turntable to rotate a preset number of steps S1, so that the sensor can move beyond the sensor's sensing range; subsequently, controlling the turntable to rotate a preset number of steps S2, where S2 is greater than or equal to S1, and S2 moves in the opposite direction to S1; during the turntable's rotation according to the preset number of steps S2, detecting whether the sensor enters the sensor's sensing range; when the sensor is detected to have entered the sensor's sensing range... When the sensor's sensing range is reached, the control turntable rotates to initialize the deviation step S3. Then, it is determined whether the sensing element is within the sensor's sensing range. If the sensing element is within the sensor's sensing range, the turntable completes the initialization operation. If the sensing element is not within the sensor's sensing range, the control turntable rotates to its maximum stroke step S4. During this maximum stroke step S4, the turntable stops rotating when it detects whether the sensing element has entered the sensor's detection range. Then, the control turntable rotates to initialize the deviation step S3 again, and it is determined whether the sensing element is within the sensor's sensing range. If the sensing element is within the sensor's sensing range, the turntable completes the initialization operation. This initialization method allows for easy adjustment based on actual needs, ensuring a smooth initialization process.
[0034] Specifically, the sensing element can be a baffle, and the sensor can be a photoelectric switch or a Hall sensor. In this embodiment, positioning can be achieved using only one sensing element and a first sensor.
[0035] Specifically, the turntable control method also includes: calculating the rotation interval N1 between the target position and the current position; the total number of steps for one revolution of the turntable is S, and the target position is numbered M. n1 The current location is numbered M. n0 Where, N1 = (S / M 总 )×(M n1 -M n0 Using this method, it is easy to accurately calculate the rotation interval N1 between the target position and the current position, thereby ensuring the accuracy of positioning and rotation.
[0036] In this embodiment, the turntable control method further includes: controlling the turntable to rotate from its origin, and controlling the turntable to rotate according to the rotation interval N between the placement position corresponding to any number on the turntable and the placement position corresponding to the origin of the turntable. n The rotation proceeds sequentially; when the turntable completes its rotation interval N... nThen, it checks whether the corresponding numbered placement position has been reached; if the corresponding numbered placement position has been reached, it determines that the rotation deviation of the corresponding numbered placement position is 0; if the corresponding numbered placement position has not been reached, it obtains the deviation of the corresponding numbered placement position. Using this method, it is convenient to obtain the deviation of the placement positions corresponding to all numbers on the turntable in sequence.
[0037] Specifically, in this embodiment, the structure that drives the turntable to rotate can be a motor, and the number of rotation steps of the turntable can be understood as the number of driving steps of the motor that drives the turntable to rotate.
[0038] To facilitate understanding of this embodiment, the turntable control method disclosed in the embodiment of the present invention will be described in detail.
[0039] like Figure 1 As shown, after the equipment is powered on, the control system can also perform initialization operations on the equipment parameters. The specific steps of the initialization operation are as follows:
[0040] Step 101: Determine whether an instruction has been received. If an instruction has been received, proceed to step 102; otherwise, continue to determine whether an instruction has been received.
[0041] Step 102: Determine whether the received instruction is a motor initialization instruction. If it is a motor initialization instruction, proceed to step 103; otherwise, proceed to step 108.
[0042] Step 103: The motor receives the initialization command and begins initialization operation; first, it checks whether the baffle (i.e., the sensing part) is inside the photoelectric switch (i.e., the sensor). If it is, then execute step 130; otherwise, execute step 134.
[0043] Step 130: Assign a step S1 to the motor (the requirement of S1 is to ensure that the baffle can move out of the photoelectric switch), and continue to execute step 131;
[0044] Step 131: Check if the motor has stopped (or check if it has completed step S1). If it has not stopped, continue with step 131. Otherwise, check if the photoelectric switch is detected (whether the baffle is still inside the photoelectric switch). If so, upload an initialization failure command to the host computer with the failure code "initialization failed inside the baffle" and return to step 101. Otherwise, assign the motor a step S2 (S2 must be greater than or equal to S1). The direction of S2 is opposite to that of step 130, and execute step 132.
[0045] Step 132: Detect whether there is a change in the level of the photoelectric switch (the level will change when the baffle initially enters the sensing range of the photoelectric switch) (detect whether the baffle has entered the photoelectric switch). If yes, assign the motor initialization offset step number S3 (S3 can be manually set) and execute step 133. Otherwise, continue to step 132.
[0046] Step 133: Check if the motor has stopped (or check if S3 has been completed). If it has not stopped, continue to step 133. If it has stopped, check if the baffle is within the range of the photoelectric switch. If it is, the initialization is complete, and the successful initialization command is uploaded to the host computer (i.e., the calculation module). Otherwise, the initialization failure command is uploaded to the host computer, and the failure code is that the baffle is outside the photoelectric switch. Then return to step 101.
[0047] Step 134: Assign the motor a maximum stroke step S4 (the maximum stroke step S4 is set according to the actual situation. The range of movement of a motor is different, and the maximum stroke that needs to be traveled in terms of structure is one full circle), and execute step 135.
[0048] Step 135: Check if the motor has stopped (or check if step S4 has been completed). If it has stopped, upload an initialization failure command to the host computer with the failure code "initialization failed outside the photoelectric switch" and return to step 101. Otherwise, check if the photoelectric switch is sensed (the baffle moves into the photoelectric switch). If so, stop the motor, assign the offset step number S3, and execute step 133. Otherwise, continue to step 135.
[0049] Step 108: Determine if the received instruction is a non-initialization instruction. If so, proceed to step 109; otherwise, proceed to step 101.
[0050] Step 109: Determine whether the motor has completed initialization. If it has, proceed to step 110; otherwise, return to step 101 and upload the execution failure error code, which is "Instruction execution failed".
[0051] Step 110: Execute the corresponding instruction and jump to step 111;
[0052] Step 111: Determine whether the motor has completed its movement. If not, continue to step 111; if it has, proceed to step 112.
[0053] Step 112: Determine if the difference between the logical position of the motor movement and the encoder counting position is within the range (this range can be set). If it is within the range, the upload is successful and the action is assigned to the host computer. Otherwise, increment the error correction count parameter Cnt by 1, and determine if the error correction count Cnt is greater than the set count. If it is, the upload command execution fails and is sent to the host computer with the error code "Encoder correction failed". Otherwise, perform the error correction movement and jump to step 111.
[0054] like Figure 2As shown, after the device is powered on and initialization is performed, the device parameters need to be initialized, the initial position needs to be found, and it needs to be determined whether the initial position coincides with the set origin position. If they coincide, the initialization is completed; otherwise, the offset between the initial position and the set origin position is adjusted. The initial position is adjusted according to the offset to make the initial position coincide with the set origin position.
[0055] In Example 1: Twenty placement positions are set on the turntable of the in vitro analysis device, each position corresponding to a position scale, and sequentially numbered 1-20 along the rotation direction of the turntable. After determining the initial position, the initial position number is recorded as 1. The turntable rotates one full circle, and the number of steps taken in one full circle is recorded. For example, if the turntable requires 500 steps to rotate one full circle, the displacement of each placement position relative to the initial position is (the placement position number - 1) * 25. The displacement amount for each position is then determined sequentially according to the numbering. The turntable is moved sequentially to each position, and it is checked whether it coincides with the corresponding position scale. If it coincides, the next position number is checked. Otherwise, the offset between the current position and the corresponding position scale is adjusted. The offset can be positive or negative and is calculated based on actual measurements. The offset is recorded and saved to the hardware parameters (it can be saved even if power is lost, meaning it only needs to be set once before leaving the factory and does not need to be set repeatedly). Subsequent turntable movements are the sum of the offset of the target position and the displacement of the target position relative to the initial position to obtain the actual displacement.
[0056] Specifically, one revolution of the turntable refers to the number of steps taken from when the photoelectric switch detects the baffle (the first time the baffle enters the photoelectric switch during its movement) until the baffle leaves the photoelectric switch and moves back into the photoelectric switch (the second time the baffle enters the photoelectric switch during its movement).
[0057] like Figure 3 The diagram shows a method for adjusting the offset of each placement position.
[0058] like Figure 4 As shown, the turntable operates as follows:
[0059] Step 201: Upon receiving the command to move the location, determine the target location;
[0060] Step 202: Determine if the target position is the same as the current position. If they are the same, end the process and upload the successful completion instruction to the host computer. Otherwise, proceed to step 203.
[0061] Step 203: Determine whether the target location number is greater than the current location number. If it is greater than the current location number, proceed to step 204; otherwise, proceed to step 210.
[0062] Step 204: Determine if the absolute value of the difference between the target location number and the current location number is greater than 1 / 2 of the total number of grids; that is, |M 目标 -M 当前 |>M 总 If the value is greater than 2, proceed to step 205; otherwise, proceed to step 206.
[0063] Step 205: The displacement is equal to the displacement of the target position minus the displacement of one revolution of the turntable, plus the offset of the target position;
[0064] Step 206: Determine if the target position is the origin position. If it is the origin position, proceed to step 207; otherwise, proceed to step 209.
[0065] Step 207: Perform turntable initialization;
[0066] Step 208: Determine whether the turntable movement is complete. If it is complete, end the process and check the encoder to see if the position is correct. See step 112 for details. Otherwise, continue to execute step 208.
[0067] Step 209: The target position movement offset equals the target position displacement plus the target position offset; then proceed to step 208;
[0068] Step 210: Determine if the absolute value of the difference between the target location number and the current location number is greater than 1 / 2 of the total number of grids; that is, |M 目标 -M 当前 |>M 总 If the value is greater than 2, proceed to step 211; otherwise, proceed to step 212.
[0069] Step 211: Determine if the target position is the origin position. If it is the origin position, proceed to step 207; otherwise, proceed to step 213.
[0070] Step 212: The target position movement offset equals the target position displacement plus the target position offset, then proceed to step 208;
[0071] Step 213: The displacement is equal to the displacement of the target position plus the displacement of one revolution of the turntable, plus the offset of the target position.
[0072] like Figure 5As shown in Embodiment 2 of the present invention, there are 18 placement positions on the turntable. The number of steps required for one rotation of the turntable is 360. The displacement of each placement position is the displacement of that position relative to the origin position (position number 1), and the offset is the deviation of that position from the standard displacement of that position. For example, the 18 placement positions are equidistant. If the sample specifications placed on the placement positions are different, the distance between the placement positions can be unequal, but the displacement of each placement position is still determined based on the origin position. The positive rotation direction of the turntable is clockwise. Each placement position corresponding to each position number needs to be rotated to the origin position, which is position number 1 in the current figure, before performing the required operation (it is necessary to rotate to the origin position for ease of illustration, but it can also be rotated to other positions for operation); the displacement and offset of each position relative to the origin position are shown in the following table:
[0073] 1 0 0 2 20 0 3 40 +3 4 60 0 5 80 -4 6 100 0 7 120 +5 8 140 -3 9 160 -2 10 180 0 11 200 0 12 220 0 13 240 +3 14 260 0 15 280 -1 16 300 +1 17 320 0 18 340 -2
[0074] In the first case, when the current placement position at the origin is placement position number 3, and the target position is placement position number 9;
[0075] Step 301: Received the move command for target position 9: Rotate the placement position of target position 9 to the origin position;
[0076] Step 302: Determine that the target position 9 and the current position 3 are not the same position;
[0077] Step 303: Determine if the number of target position 9 is greater than the number of current position 3;
[0078] Step 304: |Target position 9 number - Current position 3 number| < Total number / 2, that is: |9 - 3| < 18 / 2;
[0079] Step 305: Displacement = 160 - 2 = 158, displacement is 158 steps relative to position 1 in the positive direction;
[0080] Step 306: Rotate the turntable clockwise 158-43=115 steps; (Because the current position 3 has already rotated 43 steps relative to position 1, when rotating to the target position 9, it needs to take 158 steps relative to position 1, so the 43 steps already taken should be subtracted).
[0081] Alternatively, instead of using position 1 as the reference for calculation, we can use N4 = N1 - N2 + N3 to calculate based on the corresponding conditions. N4 = (9 - 3) × 20 - 3 + (-2) = 115 steps. If the number of steps is positive, it means clockwise rotation.
[0082] In the second case, the current placement position at the origin is placement position number 3; the target position is placement position number 13.
[0083] Step 401: Received the move command for target position 13: Rotate the placement position of target position 13 to the origin position;
[0084] Step 402: Determine that target position 13 and current position 3 are not the same position;
[0085] Step 403: Determine if the number of target position 13 is greater than the number of current position 3;
[0086] Step 404: |Target position 13 number - Current position 3 number| > Total number / 2, that is: |13-3| > 18 / 2;
[0087] Step 405: Displacement = Number of steps moved - Total number of steps for one rotation + Offset; that is, displacement = 240 - 360 + 3 = -117, the displacement is 117 steps in the opposite direction of position 1;
[0088] Step 406: Rotate the turntable counterclockwise -117 - 43 = -160 steps; (Because the current position 3 has already rotated 43 steps relative to position 1, when rotating to the target position 13, it needs to take 117 steps relative to position 1, so the 43 steps already taken relative to position 1 need to be subtracted).
[0089] Alternatively, instead of using position 1 as the reference for calculation, we can use N4 = N1 - S - N2 + N3 to calculate based on the corresponding conditions. N4 = (13 - 3) × 20 - 360 - 3 + 3 = -160 steps. If the number of steps is negative, it means the rotation is counterclockwise.
[0090] In the third case, the current placement position at the origin is placement position number 3; the target position is placement position number 1.
[0091] Step 501: Received the move command for target position 1: Rotate the placement position of target position 1 to the origin position;
[0092] Step 502: Determine that target position 1 and current position 3 are not the same position;
[0093] Step 503: Determine if the number of target position 1 is less than the number of current position 3;
[0094] Step 504: |Target position 1 number - Current position 3 number| < Total number / 2, that is: |1-3| < 18 / 2;
[0095] Step 505: Displacement = Number of steps + Offset; that is, displacement = 0 + 0 = 0, the displacement is 0 steps in the opposite direction of position 1;
[0096] Step 506: Rotate the turntable counterclockwise by 0 - 43 = -43 steps (because the current position 3 has already rotated 43 steps relative to position 1, when rotating to the target position 1, it needs to move 0 steps relative to position 1, so the 43 steps already moved relative to position 1 need to be subtracted).
[0097] In the fourth case, the current placement position at the origin is placement position number 13; the target position is placement position number 1.
[0098] Step 601: Upon receiving the move command for target position 1, rotate the placement position of target position 1 to the origin position;
[0099] Step 602: Determine that target position 13 and current position 1 are not the same position;
[0100] Step 603: Determine if the number of target position 1 is less than the number of current position 13;
[0101] Step 604: |Target position 13 number - Current position 1 number| > Total number / 2, that is: |13-1| > 18 / 2;
[0102] Step 605: Determine the target position as position 1, and instruct the device to perform origin position initialization settings;
[0103] It should be noted that when the target position is position 1, there are two processing methods: The first processing method is to directly perform the origin position initialization operation as long as the target position is position 1; The second processing method is to determine whether to rotate back to the origin position in the forward direction or in the reverse direction when the target position is position 1. If it is to rotate back to the origin position in the forward direction, the origin position initialization operation is performed directly. If it is to rotate back to the origin position in the reverse direction, the number of steps to return to the origin is calculated, and the rotation and movement are performed according to the calculated number of steps and direction.
[0104] In the fifth case, the current placement position at the origin is placement position number 8; the target position is placement position number 5.
[0105] Step 701: Received the move command for target position 5: Rotate the placement position of target position 5 to the origin position;
[0106] Step 702: Determine that target position 5 and current position 8 are not the same position;
[0107] Step 703: Determine if the number of target position 5 is less than the number of current position 8;
[0108] Step 704: |Target position 5 number - Current position 8 number| < Total number / 2, that is: |5-8| < 18 / 2;
[0109] Step 705: Movement displacement = Number of movement steps + Offset; that is, movement displacement = 80 - 4 = 76, the movement displacement is 76 steps relative to position 1.
[0110] Step 706: Rotate the turntable counterclockwise by 76-137=-61 steps (because the current position 8 has already rotated 137 steps relative to position 1. When rotating to the target position 1, it needs to take 137 steps relative to position 1. The 137 steps already taken relative to position 1 should be subtracted).
[0111] Embodiment 3 of the present invention provides a turntable control device, which includes an acquisition module, a first judgment module, a second judgment module, and a calculation module. The acquisition module is configured to acquire the target position of the turntable. The first judgment module is configured to control the turntable to stop running when the target position of the turntable is the same as the current position of the turntable. The second judgment module is configured to compare the number of the target position with the number of the current position to obtain a first comparison result when the target position is different from the current position, and to compare the absolute value of the difference between the number of the target position and the number of the current position with M_total / 2 to obtain a second comparison result. The calculation module is configured to determine the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position.
[0112] Embodiment 4 of the present invention provides a non-volatile storage medium, which includes a program that employs the turntable control method described above.
[0113] From the above description, it can be seen that the embodiments of the present invention achieve the following technical effects: simple and effective, space-saving (no code disk required), easy to manufacture (only one photoelectric sensor is needed for positioning), and fast (no need to find gaps during movement); each position has its own independent offset, so the precision requirements of the structure are not high; it can self-calibrate, and errors do not accumulate; it can rotate forward or backward, automatically finding the shortest route, saving time; it can automatically calculate the position, and the host computer only needs to send one position (number of grids), reducing the burden on the host computer. The hardware structure is simple, easy to assemble, debug, and manufacture. Only one stepper motor, one encoder, and one sensor are needed to realize the function, saving costs. It can rotate forward and backward, saving time. It has a self-calibration function after each revolution, ensuring long-term accuracy; it calculates grids (each corresponding to a number) for positioning, and the host computer only needs to send the command of the target grid to achieve precise positioning, greatly reducing the burden on the host computer. Each numbered position has an independent offset, which can be positive or negative, which can solve the problem of adjusting the offset to align the position when the turntable is uneven. Furthermore, this solution utilizes a turntable, encoder, sensor, and stepper motor for positioning, reducing the time spent on the encoder, saving space, and making it easier to assemble, debug, and produce, thus effectively reducing costs. The self-calibration function also ensures the accuracy of the turntable rotation. In addition, each target position is set with an independent offset, and the instrument automatically calculates the rotation amount based on the offset. When the turntable is uneven, accurate positioning can be achieved by adjusting the deviation, reducing processing difficulty.
[0114] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this application. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0115] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of this application. It should also be understood that, for ease of description, the dimensions of the various parts shown in the drawings are not drawn to actual scale. Techniques, methods, and devices known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and devices should be considered part of the specification. In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following drawings denote similar items; therefore, once an item is defined in one drawing, it need not be further discussed in subsequent drawings.
[0116] In the description of this application, it should be understood that the orientation or positional relationship indicated by directional terms such as "front, back, up, down, left, right", "horizontal, vertical, horizontal" and "top, bottom" is usually based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing this application and simplifying the description. Unless otherwise stated, these directional terms do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the scope of protection of this application; the directional terms "inner" and "outer" refer to the inner and outer contours relative to the outline of each component itself.
[0117] For ease of description, spatial relative terms such as "above," "on top of," "on the upper surface of," "above," etc., are used herein to describe the spatial positional relationship of a device or feature as shown in the figures to other devices or features. It should be understood that spatial relative terms are intended to encompass different orientations in use or operation beyond the orientation of the device as described in the figures. For example, if the device in the figures were inverted, a device described as "above" or "on top of" other devices or structures would subsequently be positioned as "below" or "under" other devices or structures. Thus, the exemplary term "above" can include both "above" and "below." The device may also be positioned in other different ways (rotated 90 degrees or in other orientations), and the spatial relative descriptions used herein will be interpreted accordingly.
[0118] Furthermore, it should be noted that the use of terms such as "first" and "second" to define components is merely for the purpose of distinguishing the corresponding components. Unless otherwise stated, the above terms have no special meaning and therefore cannot be construed as limiting the scope of protection of this application.
[0119] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A turntable control method, characterized in that, M 总 placement positions are arranged on the turntable, and the M 总 placement positions are numbered in a predetermined order; the turntable control method comprises: Obtain the target position of the turntable; When the target position of the turntable is the same as the current position of the turntable, control the turntable to stop running; When the target position of the turntable is different from the current position of the turntable, the number of the target position is compared with the number of the current position to obtain a first comparison result, and the absolute value of the difference between the number of the target position and the number of the current position is compared with M 总 / 2 to obtain a second comparison result; The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position; A sensor is mounted on the turntable, and a sensor that cooperates with the sensor is mounted on the movement path of the sensor; the turntable is initialized, including: Detect whether the sensing element is within the sensing range of the sensor; When the sensing element is within the sensing range of the sensor, the turntable is controlled to rotate a preset number of steps S1, causing the sensing element to move beyond the sensing range of the sensor; subsequently, the turntable is controlled to rotate a preset number of steps S2, where S2 is greater than or equal to S1, and the directions of movement of S2 and S1 are opposite; during the rotation of the turntable according to the preset number of steps S2, it is detected whether the sensing element enters the sensing range of the sensor; when it is detected that the sensing element has entered the sensing range of the sensor, the turntable is controlled to rotate an initialization deviation step S3, and then it is determined whether the sensing element is within the sensing range of the sensor; when the sensing element is within the sensing range of the sensor, the turntable completes the initialization operation; When the sensing element is not within the sensing range of the sensor, the turntable is controlled to rotate for a maximum stroke step S4. During the rotation of the turntable for the maximum stroke step S4, when the sensing element is detected to have entered the sensing range of the sensor, the turntable stops rotating. Subsequently, the turntable is controlled to rotate for an initialization deviation step S3, and it is determined whether the sensing element is within the sensing range of the sensor. When the sensing element is within the sensing range of the sensor, the turntable completes the initialization operation.
2. The turntable control method according to claim 1, characterized in that, The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, and the rotation interval N1 between the target position and the current position, including: Obtain the rotation deviation N2 at the current position and the rotation deviation N3 at the target position; The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position.
3. The turntable control method according to claim 2, characterized in that, The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: When the first comparison result is that the number of the target location is greater than the number of the current location, and the second comparison result is that the absolute value of the difference between the number of the target location and the number of the current location is greater than M... 总 At / 2, the actual rotation of the turntable is: N4 = N1 - S - N2 + N3; Where S is the amount of rotation of the turntable in one revolution.
4. The turntable control method according to claim 2, characterized in that, The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, and further includes: When the first comparison result is that the number of the target location is greater than the number of the current location, and the second comparison result is that the absolute value of the difference between the number of the target location and the number of the current location is less than M... 总 When / 2, determine whether the target position is the origin position of the turntable; The actual rotation amount of the turntable is controlled based on whether the target position is the origin position of the turntable; When the target position is the origin position of the turntable, the turntable is initialized. When the target position is not the origin position of the turntable, the actual rotation amount of the turntable is: N4 = N1 - N2 + N3.
5. The turntable control method according to claim 2, characterized in that, The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: When the first comparison result is that the number of the target location is less than the number of the current location, and the second comparison result is that the absolute value of the difference between the number of the target location and the number of the current location is greater than M... 总 When / 2, determine whether the target position is the origin position of the turntable; The actual rotation amount of the turntable is controlled based on whether the target position is the origin position of the turntable; When the target position is the origin position of the turntable, the turntable is initialized. When the target position is not the origin position of the turntable, the actual rotation amount of the turntable is: N4 = N1 + S - N2 + N3.
6. The turntable control method according to claim 2, characterized in that, The actual rotation amount N4 of the turntable is determined based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position, including: When the first comparison result is that the number of the target location is less than the number of the current location, and the second comparison result is that the absolute value of the difference between the number of the target location and the number of the current location is less than M... 总 At / 2, the actual rotation of the turntable is: N4 = N1 - N2 + N3.
7. The turntable control method according to claim 1, characterized in that, The turntable control method further includes: Calculate the rotation interval N1 between the target position and the current position; the rotation amount of one revolution of the turntable is S, and the target position is numbered M. n1 The current location is numbered M. n0 ; Where N1 = (S / M) 总 )×(M n1 -M n0 ).
8. The turntable control method according to claim 1, characterized in that, The turntable control method further includes: The turntable is controlled to rotate from its origin, and the rotation interval N between any numbered placement position on the turntable and the placement position corresponding to the origin of the turntable is also controlled. n Rotate sequentially; When the turntable has rotated the rotation interval N n Then, check whether the corresponding numbered placement position has been reached; When the detection reaches the placement position with the corresponding number, it is determined that the rotation deviation of the placement position with the corresponding number is 0; When the detection fails to reach the placement position with the corresponding number, the deviation of the placement position with the corresponding number is obtained.
9. A turntable control device, characterized in that, include: The acquisition module is configured to acquire the target position of the turntable; The first judgment module is configured to control the turntable to stop running when the target position of the turntable is the same as the current position of the turntable. The second judgment module is configured to, when the target position of the turntable is different from the current position of the turntable, compare the number of the target position with the number of the current position to obtain a first comparison result, and determine the absolute value of the difference between the number of the target position and the number of the current position and M. 总 Compare / 2 to obtain a second comparison result; The calculation module is configured to determine the actual rotation amount N4 of the turntable based on the first comparison result, the second comparison result, the rotation interval N1 between the target position and the current position, the rotation deviation N2 of the current position, and the rotation deviation N3 of the target position. A sensing element is installed on the turntable, and a sensor that cooperates with the sensing element is installed on the movement path of the sensing element. The initialization operation for the turntable includes: Detect whether the sensing element is within the sensing range of the sensor; When the sensing element is within the sensing range of the sensor, the turntable is controlled to rotate a preset number of steps S1, causing the sensing element to move beyond the sensing range of the sensor; subsequently, the turntable is controlled to rotate a preset number of steps S2, where S2 is greater than or equal to S1, and the directions of movement of S2 and S1 are opposite; during the rotation of the turntable according to the preset number of steps S2, it is detected whether the sensing element enters the sensing range of the sensor; when it is detected that the sensing element has entered the sensing range of the sensor, the turntable is controlled to rotate an initialization deviation step S3, and then it is determined whether the sensing element is within the sensing range of the sensor; when the sensing element is within the sensing range of the sensor, the turntable completes the initialization operation; When the sensing element is not within the sensing range of the sensor, the turntable is controlled to rotate for a maximum stroke step S4. During the rotation of the turntable for the maximum stroke step S4, when the sensing element is detected to have entered the sensing range of the sensor, the turntable stops rotating. Subsequently, the turntable is controlled to rotate for an initialization deviation step S3, and it is determined whether the sensing element is within the sensing range of the sensor. When the sensing element is within the sensing range of the sensor, the turntable completes the initialization operation.
10. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a program that employs the turntable control method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Accurate positioning method and system based on large-load turntable
CN111854656A
Adjusting method and adjusting system of electric control knob
CN112180990A