Tool turret control method, electronic equipment and storage medium
The encoder controls the rotation of the motor drive cutter plate and calculates the target position based on different tool seat numbers, which solves the problem of insufficient versatility of the existing CNC turret index positioning scheme, and achieves high-precision and efficient turret control.
Patent Information
- Application Number
- CN202411222590.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-31
AI Technical Summary
The indexing positioning scheme of existing CNC turrets is not very versatile and cannot be applied to turrets with different number of tool seats, resulting in low control accuracy and efficiency.
The encoder + general indexing positioning scheme is adopted, and the motor drives the cutting wheel rotation is controlled by the encoder, and the target position is calculated based on different number of tool seats to achieve accurate positioning and tool search of the turret.
It improves the control accuracy and efficiency of the turret, ensures the accurate positioning and tool search ability of the turret under different number of tool seats, and enhances versatility.
Smart Images

Figure CN119217141A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of turret control, and in particular to a turret control method, electronic equipment and storage medium. Background Art
[0002] With the popularization of industrial automation, the market has put forward higher requirements for CNC machining in terms of precision, performance and efficiency. Most CNC turrets on the market are still "absolute encoder + customized indexing positioning" solutions. However, this solution faces the problem that the indexing positioning solution can only be applied to turrets with a specific number of tool holders, resulting in the problem that the turret indexing positioning solution is not universal.
[0003] Therefore, how to realize a turret control method with strong versatility is a problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of this application is to provide a turret control method, an electronic device and a storage medium, aiming to solve the technical problem of how to implement a turret control method with strong versatility.
[0005] To achieve the above purpose, the present application proposes a turret control method, which is applied to a turret control system. The turret control system includes a motor and a turret. The motor has an encoder built in. The motor is used to drive a tool disc of the turret to rotate. An origin switch is provided on the tool disc. The turret control method includes:
[0006] After the turret control system triggers the tool search task, the number of single-turn pulses of the cutter disc is determined, and based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of tool seats of the cutter disc, the positions of the indexing points on the cutter disc are calibrated, wherein the number of single-turn pulses of the cutter disc is the number of pulses fed back by the encoder when the cutter disc rotates one circle;
[0007] Obtaining the actual pulse number accumulated from the origin position in the encoder, and determining the origin tool holder starting position where the origin switch on the tool disc is located based on the actual pulse number and the single-turn pulse number of the tool disc;
[0008] Based on the target tool number of the tool-seeking task, determining the target position of the origin tool holder in each indexing point position, wherein the target position of the origin tool holder is the position of the tool holder position corresponding to the target tool number relative to the origin position;
[0009] The working tool number of the turret is determined according to the starting position of the origin tool holder. When the working tool number is not the target tool number, the execution pulse number of the motor is determined based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc to search for the tool based on the execution pulse number.
[0010] In one embodiment, the step of calibrating the positions of the indexing points on the cutter disc based on the origin position of the cutter disc, the number of pulses of the cutter disc in a single turn, and the number of cutter seats of the cutter disc comprises:
[0011] Divide the number of pulses in a single turn of the cutter disc by the number of cutter seats to obtain the number of indexing pulses between indexing points on the cutter disc;
[0012] Based on the number of indexing pulses and the origin position, the position of each indexing point is calibrated.
[0013] In one embodiment, the step of determining the starting position of the origin tool holder where the origin switch is located on the tool disc based on the actual pulse number and the single-turn pulse number of the tool disc comprises:
[0014] When the actual pulse number is less than zero, take the first remainder of the actual pulse number divided by the single-turn pulse number of the cutter disc, and add the first remainder to the single-turn pulse number of the cutter disc to obtain the origin tool holder starting position;
[0015] When the actual number of pulses is greater than or equal to zero, the second remainder of dividing the actual number of pulses by the number of pulses of the cutter disc in a single revolution is taken to obtain the origin tool holder starting position.
[0016] In one embodiment, the step of determining the target position of the origin tool holder in each indexing point position based on the target tool number of the tool-finding task comprises:
[0017] When the tool number arrangement of the tool disk is counterclockwise, determining the index value of the indexing point position based on the target tool number and the tool holder number;
[0018] When the tool number arrangement of the tool disk is clockwise, the target tool number is used as the index value of the indexing point position;
[0019] The target position of the origin tool holder in each of the indexing point positions is obtained according to the index value.
[0020] In one embodiment, the step of determining the working tool number of the turret according to the starting position of the origin tool holder comprises:
[0021] Based on the single-turn pulse number of the cutter disc and the number of the cutter seats, the cutter disc is divided into position areas to obtain a plurality of sub-position areas;
[0022] Determine a target sub-position area among multiple sub-position areas based on the starting position of the origin tool holder, and use the preset tool number corresponding to the target sub-position area as the working tool number
[0023] In one embodiment, the step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position comprises:
[0024] When the tool-seeking mode of the tool-seeking task is forward tool-seeking and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number;
[0025] When the tool-seeking mode of the tool-seeking task is forward tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the first pulse number is subtracted from the second pulse number to obtain a first pulse subtraction result, and the first pulse subtraction result is subtracted from the single-turn pulse number of the tool disc to obtain the execution pulse number;
[0026] When the tool-seeking mode of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the second pulse number is subtracted from the first pulse number to obtain a second pulse subtraction result, and the single-turn pulse number of the tool disc is subtracted from the second pulse subtraction result to obtain the execution pulse number;
[0027] When the tool-seeking method of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number.
[0028] In one embodiment, the step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position further includes:
[0029] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the absolute value is used as the execution pulse number;
[0030] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the negative of the absolute value is used as the execution pulse number;
[0031] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-turn pulse number of the tool disc, the single-turn pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number;
[0032] When the tool-seeking method of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-circle pulse number of the tool disc, the single-circle pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number.
[0033] In one embodiment, before the step of determining the number of pulses per single turn of the cutter disc, the step further includes:
[0034] The motor is used to rotate the cutter disc to start origin calibration, and a control signal generated by the origin switch during the rotation process is monitored, wherein the control signal is generated when the origin switch is rotated to a working cutter position corresponding to the cutter disc;
[0035] When the control signal is detected, the motor is used to control the cutter disc to decelerate and reverse, so that the origin switch stops at the working cutter position, and the position of the origin switch is used as the origin position.
[0036] In addition, to achieve the above purpose, the present application also proposes a turret control device, which is applied to a turret control system. The turret control system includes a motor and a turret. The motor has an encoder built in. The motor is used to drive the tool disc of the turret to rotate. The tool disc is provided with an origin switch. The turret control device includes:
[0037] a calibration module, for determining the number of single-turn pulses of the cutter disc after the turret control system triggers a tool-seeking task, and calibrating the positions of the indexing points on the cutter disc based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of tool seats of the cutter disc, wherein the number of single-turn pulses of the cutter disc is the number of pulses fed back by the encoder when the cutter disc rotates one circle;
[0038] A counting module, used for obtaining the actual pulse number accumulated from the origin position in the encoder, and determining the origin tool holder starting position where the origin switch on the tool disc is located based on the actual pulse number and the single-turn pulse number of the tool disc;
[0039] A determination module, for determining the target position of the origin tool holder in each indexing point position based on the target tool number of the tool search task, wherein the target position of the origin tool holder is the position of the tool holder position corresponding to the target tool number relative to the origin position;
[0040] The tool-seeking module is used to determine the working tool number of the turret according to the starting position of the origin tool holder. When the working tool number is not the target tool number, the execution pulse number of the motor is determined based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc for tool-seeking based on the execution pulse number.
[0041] In addition, to achieve the above-mentioned purpose, the present application also proposes an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the turret control method as described above.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the turret control method described above are implemented.
[0043] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the turret control method described above are implemented.
[0044] The present application proposes a turret control method. The present application first determines the number of single-circle pulses of the tool disc after the turret control system triggers a tool search task, and calibrates the positions of each graduation point on the tool disc based on the origin position of the tool disc, the single-circle pulse number of the tool disc and the number of tool seats of the tool disc, so that by determining the number of pulses fed back by the encoder when the tool disc rotates one circle, an accurate number of pulses can be assigned to each tool seat, thereby calibrating the exact position of each tool seat on the tool disc, ensuring the accuracy of the turret when performing the tool search task; obtaining the actual number of pulses accumulated from the origin position in the encoder, and determining the starting position of the origin tool seat where the origin switch on the tool disc is located based on the actual number of pulses and the single-circle pulse number of the tool disc, so as to accurately know the specific starting position of the tool seat where the origin switch on the current tool disc is located. The position provides a reference point for the subsequent turret control system, ensuring that the tool disc can rotate from the correct position when performing the tool search task; based on the target tool number of the tool search task, the target position of the origin tool holder in each indexing point position is determined to obtain the specific position to be reached, providing necessary information for achieving accurate tool search; the working tool number of the turret is determined according to the origin tool holder starting position, and when the working tool number is not the target tool number, the execution pulse number of the motor is determined based on the origin tool holder starting position and the origin tool holder target position, so as to control the motor to rotate the tool disc for tool search based on the execution pulse number, ensuring that the turret can accurately find the target tool number, improving the accuracy of tool search, while also protecting the motor and the turret and avoiding unnecessary over-operation.
[0045] In summary, the present application proposes an "encoder + universal indexing positioning" solution, which controls the motor through the encoder to drive the motor to rotate the cutter disc to search for the tool, and in the process of searching for the tool, the target position that the cutter disc needs to rotate to reach can be calculated based on the different number of tool seats, thereby realizing a highly universal turret control method. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0048] Figure 1 A schematic diagram of a process flow provided for the first embodiment of the turret control method of the present application;
[0049] Figure 2 A flow chart of the second embodiment of the turret control method of the present application;
[0050] Figure 3 A schematic diagram of a servo turret provided in Example 2 of the turret control method of the present application;
[0051] Figure 4 A schematic diagram of a brief flow chart of a turret control method provided in Embodiment 2 of the present application;
[0052] Figure 5 A schematic diagram of the origin calibration process of the turret control method provided in Example 2 of the present application;
[0053] Figure 6 A schematic diagram of the control flow of the turret control method provided in the second embodiment of the present application;
[0054] Figure 7 This is a schematic diagram of the module structure of the turret control device according to an embodiment of the present application;
[0055] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the turret control method in the embodiment of the present application.
[0056] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0057] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0058] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0059] The main solution of the embodiment of the present application is: after the turret control system triggers the tool search task, the single-turn pulse number of the cutter disc is determined, and based on the origin position of the cutter disc, the single-turn pulse number of the cutter disc and the number of tool seats of the cutter disc, the positions of the various graduation points on the cutter disc are calibrated, wherein the single-turn pulse number of the cutter disc is the number of pulses fed back by the encoder when the cutter disc rotates one circle; the actual number of pulses accumulated from the origin position in the encoder is obtained, and based on the actual number of pulses and the single-turn pulse number of the cutter disc, the origin tool seat where the origin switch on the cutter disc is located is determined. Starting position; based on the target tool number of the tool-seeking task, determining the target position of the origin tool holder in each of the indexing point positions, wherein the target position of the origin tool holder is the position of the tool holder position corresponding to the target tool number relative to the origin position; determining the working tool number of the turret according to the starting position of the origin tool holder, and when the working tool number is not the target tool number, determining the execution pulse number of the motor based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc for tool-seeking based on the execution pulse number.
[0060] Since most of the existing CNC turrets on the market are still "absolute encoder + customized indexing positioning" solutions, however, this solution faces the problem that the indexing positioning solution can only be applied to turrets with a specific number of tool holders, resulting in the problem that the turret indexing positioning solution is not very universal. Therefore, how to achieve a highly universal turret control method is a problem that needs to be solved urgently.
[0061] The present application provides a solution by proposing an "encoder + universal indexing positioning" solution, which controls the motor through the encoder to drive the motor to rotate the cutter disc to search for the tool, and in the process of searching for the tool, the target position that the cutter disc needs to rotate to reach can be calculated based on the different number of tool seats, thereby realizing a highly universal turret control method.
[0062] It should be noted that the execution subject of this embodiment may be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. The following takes an electronic device as an example to illustrate this embodiment and the following embodiments.
[0063] Based on this, the present application embodiment provides a turret control method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the turret control method of the present application.
[0064] In this embodiment, it is applied to a turret control system, the turret control system includes a motor and a turret, the motor has a built-in encoder, the motor is used to drive the knife disc of the turret to rotate, the knife disc is provided with an origin switch, and the turret control method includes steps S10 to S40:
[0065] Step S10, after the turret control system triggers the tool search task, the number of pulses of the cutter disc in a single circle is determined, and based on the origin position of the cutter disc, the number of pulses of the cutter disc in a single circle and the number of tool seats of the cutter disc, the position of each indexing point on the cutter disc is calibrated, wherein the number of pulses of the cutter disc in a single circle is the number of pulses fed back by the encoder when the cutter disc rotates one circle;
[0066] It should be noted that the tool-seeking task refers to the task of switching the tool used in the turret; the number of pulses in a single circle of the tool disc refers to the cumulative number of pulses fed back by the encoder when the tool disc of the turret rotates one complete circle; the origin position refers to the starting point of the tool positioning on the turret, which is the reference point of the turret control system, and all tool positions are determined relative to this reference point; the number of tool seats refers to the total number of tool seats on which the tools are installed on the tool disc; the indexing point position refers to the number of pulses generated by the encoder corresponding to the angular offset of each tool seat on the tool disc relative to the origin position.
[0067] In addition, it should be noted that the motor can be a servo motor or a hydraulic motor. Since the servo motor has higher precision than the hydraulic motor, the preferred type of motor in this embodiment is the servo motor.
[0068] It is understandable that, since it is difficult to accurately determine the specific position of each tool seat on the cutter disc in the traditional process of using an encoder to control the turret, step S10 is performed to calibrate the indexing point position of each tool seat on the cutter disc based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of tool seats on the cutter disc, thereby achieving precise positioning of the cutter disc tool seats.
[0069] For example, after the turret control system triggers the tool search task, the number of pulses per turn of the tool disc cir is calculated by the following formula:
[0070] cir=R*G
[0071] Among them, R is the resolution of the encoder, G is the transmission ratio between the encoder and the cutter disc, where the resolution refers to the number of pulses corresponding to the encoder when the motor rotates one circle, and the transmission ratio refers to the proportional relationship between the number of pulses fed back by the encoder and the rotation angle of the cutter disc. Then, based on the origin position of the cutter disc, the number of pulses per turn of the cutter disc cir, and the number of tool holders num of the cutter disc, the positions of each indexing point on the cutter disc Arr[i] are calibrated, where i is the calibration index value of the origin tool holder corresponding to the target tool number.
[0072] In a feasible implementation manner, the step of calibrating the positions of the indexing points on the cutter disc based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of cutter seats of the cutter disc in step S10 may include steps S11 to S12:
[0073] Step S11, dividing the number of pulses of a single turn of the cutter disc by the number of cutter seats to obtain the number of indexing pulses between indexing points on the cutter disc;
[0074] Exemplarily, the number of division pulses div is calculated by the following formula:
[0075] div=cir / num
[0076] Among them, cir is the number of pulses in a single circle of the cutter disc, and num is the number of tool holders of the cutter disc.
[0077] Step S12, calibrating the position of each of the indexing points based on the number of indexing pulses and the origin position.
[0078] For example, the position of each indexing point Arr[i] is calibrated by the following formula:
[0079] Arr[i]=(i-1)*div i∈[1,num]
[0080] Among them, i is the calibration index value of the origin tool holder corresponding to the target tool number, div is the number of indexing pulses between the indexing points on the tool disk, and num is the number of tool holders on the tool disk.
[0081] In this embodiment, the number of indexing pulses is obtained by dividing the number of single-turn pulses of the tool disc by the number of tool seats, and the position of each indexing point is calibrated based on the number of indexing pulses. This ensures that the turret control system can accurately position each tool seat on the tool disc, improves the accuracy and reliability of the turret when performing tool finding tasks, and enables the turret to quickly and accurately position itself at each tool seat, thereby improving the efficiency of the turret control process.
[0082] Step S20, obtaining the actual pulse number accumulated from the origin position in the encoder, and determining the origin tool holder starting position where the origin switch on the tool disc is located based on the actual pulse number and the single-turn pulse number of the tool disc;
[0083] It should be noted that the actual number of pulses refers to the number of pulses recorded and accumulated by the encoder after the tool disc of the turret reaches the origin position as the tool disc rotates; the origin tool holder starting position refers to the specific position of the tool holder on which the origin switch is installed on the tool disc, and this specific position is calculated relative to the origin position.
[0084] It is understandable that since it is difficult to accurately track the specific position of the origin tool holder on the tool disc during the traditional use of an encoder to control the turret, step S20 is performed to determine the starting position of the origin tool holder on the tool disc based on the actual number of pulses accumulated by the encoder and the number of single-turn pulses of the tool disc, thereby achieving precise positioning of the origin tool holder on the tool disc.
[0085] In a feasible implementation manner, the step of determining the starting position of the origin tool holder where the origin switch is located on the tool disc based on the actual pulse number and the single-turn pulse number of the tool disc in step S20 may include step A201:
[0086] Step A201, when the actual pulse number is less than zero, take the first remainder of the actual pulse number divided by the single-turn pulse number of the cutter disc, and add the first remainder to the single-turn pulse number of the cutter disc to obtain the origin tool holder starting position;
[0087] It is understandable that during the actual operation of the turret, the tool disc may have two different rotation modes, forward and reverse, and the accumulated pulse number of the encoder usually overflows, so step A201 is performed to provide a method for tracking the actual position of the origin tool holder on the tool disc when the tool disc is reversed, and the number of pulses corresponding to the starting position of the origin tool holder is limited to zero to the number of pulses of a single circle of the tool disc.
[0088] Exemplarily, when the actual pulse number fp is less than zero, the first remainder fp%cir of the actual pulse number fp divided by the single-turn pulse number cir of the cutter disc is taken, and the first remainder fp%cir is added to the single-turn pulse number cir of the cutter disc to obtain the origin tool holder starting position fp%cir+cir.
[0089] In another feasible implementation manner, the step of determining the starting position of the origin tool holder where the origin switch is located on the tool disc based on the actual pulse number and the single-turn pulse number of the tool disc in step S20 may include step B201:
[0090] Step B201, when the actual pulse number is greater than or equal to zero, take the second remainder of dividing the actual pulse number by the single-turn pulse number of the cutter disc to obtain the origin tool holder starting position.
[0091] It is understandable that during the actual operation of the turret, the cutter disc may have two different rotation modes, forward and reverse, and the accumulated pulse number of the encoder usually overflows, so step B201 is performed to provide a method for tracking the actual position of the origin tool holder on the cutter disc when the cutter disc rotates forward, and the number of pulses corresponding to the starting position of the origin tool holder is limited to zero to the number of pulses of a single circle of the cutter disc.
[0092] Exemplarily, when the actual pulse number fp is greater than or equal to zero, the second remainder fp%cir of the actual pulse number fp divided by the number of pulses cir of a single turn of the cutter disc is taken to obtain the origin tool holder starting position fp%cir.
[0093] Step S30, based on the target tool number of the tool-seeking task, determining the origin tool holder target position in each indexing point position, wherein the origin tool holder target position is the position of the tool holder position corresponding to the target tool number relative to the origin position;
[0094] It should be noted that the origin tool holder target position refers to the number of pulses generated by the encoder corresponding to the angular offset of the position of a specific tool holder determined according to the target tool number relative to the origin position.
[0095] It is understandable that since the traditional turret control scheme cannot adapt to tool discs with different numbers of tool holders, continuous stepping and detection are required when determining the position of the required tool holder. Therefore, step S30 is performed to obtain the position of the required switching tool holder based on the target tool number of the tool search task, thereby enhancing the versatility and accuracy of the indexing positioning scheme for determining the required replacement position of the tool holder.
[0096] In a feasible implementation, step S30 may include steps S31 to S33:
[0097] Step S31, when the tool number arrangement of the tool disk is counterclockwise, determining the index value of the indexing point position based on the target tool number and the tool holder number;
[0098] It should be noted that the tool number arrangement method refers to the order in which the preset tool numbers are numbered in the tool disk. The counterclockwise arrangement means that the preset tool numbers are numbered in counterclockwise order starting from number one and increasing in value. The index value refers to the index value of the index point array corresponding to the target position of the origin tool holder when the working tool position is the target tool number.
[0099] For example, when the tool number arrangement of the tool disk is counterclockwise, the index value index of the indexing point position is determined by the following formula:
[0100]
[0101] Among them, tar is the target tool number and num is the number of tool holders on the tool disk.
[0102] Step S32, when the tool number arrangement of the tool disk is clockwise, using the target tool number as the index value of the indexing point position;
[0103] It should be noted that the clockwise arrangement means that the preset tool numbers are numbered in a clockwise order starting from number one and increasing in value.
[0104] Exemplarily, when the tool numbers of the tool disk are arranged in a clockwise manner, the target tool number tar is used as the index value index of the indexing point position, that is, index=tar.
[0105] Step S33, obtaining the origin tool holder target position in each of the indexing point positions according to the index value.
[0106] It is understandable that since it is difficult to flexibly and accurately determine the target position of the origin tool holder in the traditional turret control method, step S33 is performed to accurately know the target position of the origin tool holder in each indexing point position on the tool disc based on the obtained index value, thereby achieving the ability to accurately determine the target position of the origin tool holder when different numbers of tool holders are configured on the tool disc.
[0107] Exemplarily, by substituting the index value index into each calibrated indexing point position Arr[i], the origin tool holder target position tar_abs_pos=Arr[index] is obtained.
[0108] In this embodiment, by introducing the index value, the target position of the origin tool holder is accurately determined at each indexing point position, thereby achieving the effect of efficiently determining the accurate target position that the tool disc needs to switch to.
[0109] Step S40, determining the working tool number of the turret according to the starting position of the origin tool holder, and when the working tool number is not the target tool number, determining the execution pulse number of the motor based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc to search for the tool based on the execution pulse number.
[0110] It should be noted that the working tool number refers to the number of the tool being used at the working tool position of the current turret; the number of execution pulses refers to the total number of pulses that the motor needs to receive and execute in order to switch the working tool number at the working tool position on the tool disc to the target tool number, thereby driving the tool disc to rotate.
[0111] It is understandable that since the efficiency of using an encoder to control the motor to rotate the tool disc for tool searching in the traditional turret control method is low, step S40 is performed. The number of execution pulses of the motor is calculated based on the origin tool holder starting position and the origin tool holder target position, thereby avoiding the trial and error link in the traditional tool searching process, reducing the tool searching time in the tool searching process, and improving the tool searching efficiency during the operation of the servo turret.
[0112] In a feasible implementation manner, the step of determining the working tool number of the turret according to the starting position of the origin tool holder in step S40 may include steps S41 to S42:
[0113] Step S41, dividing the cutter disc into position areas based on the number of single-turn pulses of the cutter disc and the number of cutter seats to obtain a plurality of sub-position areas;
[0114] It should be noted that the sub-position area refers to the position range corresponding to a specific interval on the cutter head.
[0115] Exemplarily, based on the number of pulses in a single circle of the cutter disc cir and the number of tool seats num on the cutter disc, the number of division pulses div = cir / num between the division points on the cutter disc is determined, and according to the number of division pulses div and the number of pulses in a single circle of the cutter disc cir, the cutter disc is divided into position areas to obtain multiple sub-position areas [0, div / 2], [cir-div / 2, cir], [div / 2+i*div, div / 2+(i+1)*div], where i∈[1, num].
[0116] Step S42, determining a target sub-position area among a plurality of sub-position areas based on the origin tool holder starting position, and using a preset tool number corresponding to the target sub-position area as the working tool number.
[0117] It should be noted that the target sub-area refers to the sub-position area where the starting position of the origin tool holder is located.
[0118] Exemplarily, the working tool number cur is determined by the following formula:
[0119]
[0120] Among them, abs_pos is the starting position of the origin tool holder, div is the number of indexing pulses, cir is the number of pulses in a single circle of the tool disc, i is the calibration index value of the origin tool holder corresponding to the target tool number, and 1 and num-i are the preset tool numbers.
[0121] In this embodiment, the positioning method of the turret control system is optimized by dividing the tool disc into multiple sub-areas, so that the turret can more quickly determine the current area where the origin tool holder is located when performing a tool-seeking task, thereby improving the tool-seeking efficiency of the turret and the smoothness of the entire machining process.
[0122] In a feasible implementation manner, the step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position in step S40 may include steps A401 to A402:
[0123] Step A401, when the tool-seeking mode of the tool-seeking task is forward tool-seeking and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, determine the execution pulse number based on the difference between the first pulse number and the second pulse number;
[0124] It should be noted that the first pulse number refers to the number of pulses required to rotate the tool disc to the tool holder where the target tool is located, and the second pulse refers to the pulse difference between the current position of the tool disc and the origin tool holder position.
[0125] Exemplarily, when the tool seeking mode of the tool seeking task is forward tool seeking, and the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder of the required switching tool holder is greater than the second pulse number abs_pos corresponding to the starting position of the origin tool holder, based on the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos, the execution pulse number exp=tar_abs_pos-abs_pos is determined.
[0126] Step A402, when the tool-seeking mode of the tool-seeking task is forward tool-seeking and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the first pulse number is subtracted from the second pulse number to obtain a first pulse subtraction result, and the single-turn pulse number of the tool disc is subtracted from the first pulse subtraction result to obtain the execution pulse number;
[0127] Exemplarily, when the tool seeking mode of the tool seeking task is forward tool seeking, and the first pulse number tar_abs_pos corresponding to the target position of the origin tool seat of the tool seat to be switched is less than or equal to the second pulse number abs_pos corresponding to the starting position of the origin tool seat, the second pulse number abs_pos is subtracted from the first pulse number tar_abs_pos to obtain the first pulse subtraction result tar_abs_pos-abs_pos, and the first pulse subtraction result tar_abs_pos-abs_pos is subtracted from the single-turn pulse number cir of the encoder when the tool disc of the turret rotates one circle to obtain the execution pulse number exp=cir-(tar_abs_pos-abs_pos).
[0128] In this embodiment, by calculating the number of execution pulses of the encoder based on the received forward tool search mode, the target position of the origin tool holder to be switched to, and the starting position of the origin tool holder of the current tool disc, a method of how to control the motor to rotate the tool disc for forward tool search based on the encoder is provided.
[0129] In another feasible implementation manner, the step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position in step S40 may further include steps B401 to B402:
[0130] Step B401, when the tool-seeking mode of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the second pulse number is subtracted from the first pulse number to obtain a second pulse subtraction result, and the single-turn pulse number of the tool disc is subtracted from the second pulse subtraction result to obtain the execution pulse number;
[0131] Exemplarily, when the tool seeking method of the tool seeking task is reverse tool seeking, and the first pulse number tar_abs_pos corresponding to the target position of the origin tool seat of the required switching tool seat is greater than the second pulse number abs_pos corresponding to the starting position of the origin tool seat, the first pulse number tar_abs_pos is subtracted from the second pulse number abs_pos to obtain the second pulse subtraction result tar_abs_pos-abs_pos, and the second pulse subtraction result tar_abs_pos-abs_pos is subtracted from the encoder's tool disc single-turn pulse number cir to obtain the motor's execution pulse number tar_abs_pos-abs_pos-cir.
[0132] Step B32, when the tool searching method of the tool searching task is reverse tool searching, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, determine the execution pulse number based on the difference between the first pulse number and the second pulse number.
[0133] Exemplarily, when the tool seeking method of the tool seeking task is reverse tool seeking, and the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder of the required switching tool holder is less than or equal to the second pulse number abs_pos corresponding to the starting position of the origin tool holder, based on the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos, the execution pulse number of the motor exp=tar_abs_pos-abs_pos is determined.
[0134] In this embodiment, by calculating the number of execution pulses of the encoder based on the received reverse tool search mode, the target position of the origin tool holder to be switched to, and the starting position of the origin tool holder of the current tool disc, a method of how to control the motor to rotate the tool disc for reverse tool search based on the encoder is provided.
[0135] In another feasible implementation manner, the step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position in step S40 may further include steps C401 to C404:
[0136] Step C401, when the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the absolute value is used as the execution pulse number;
[0137] It should be noted that the shortest distance tool search means that the cutter disc can search for the tool in the forward direction or in the reverse direction. This tool search method requires the cutter disc to rotate the shortest distance.
[0138] Exemplarily, when the tool searching method of the tool searching task is the shortest distance tool searching, the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder is greater than the second pulse number abs_pos corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos is less than half of the single-turn pulse number cir of the tool disc, the execution pulse number of the motor is determined to be exp=|abs_pos-tar_abs_pos|.
[0139] Step C402, when the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the negative of the absolute value is used as the execution pulse number;
[0140] Exemplarily, when the tool searching method of the tool searching task is the shortest distance tool searching, the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder is less than or equal to the second pulse number abs_pos corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos is less than half of the single-turn pulse number cir of the tool disc, the execution pulse number exp of the motor is determined to be -|abs_pos-tar_abs_pos|.
[0141] Step C403, when the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-turn pulse number of the tool disc, the single-turn pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number;
[0142] Exemplarily, when the tool searching method of the tool searching task is the shortest distance tool searching, the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder is greater than the second pulse number abs_pos corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos is greater than or equal to half of the single-turn pulse number cir of the tool disc, the execution pulse number of the motor is determined to be exp=|abs_pos-tar_abs_pos|-cir.
[0143] Step C404, when the tool searching method of the tool searching task is the shortest distance tool searching, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-circle pulse number of the tool disc, subtract the absolute value from the single-circle pulse number of the tool disc to obtain the execution pulse number.
[0144] Exemplarily, when the tool searching method of the tool searching task is the shortest distance tool searching, the first pulse number tar_abs_pos corresponding to the target position of the origin tool holder is less than or equal to the second pulse number abs_pos corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number tar_abs_pos and the second pulse number abs_pos is greater than or equal to half of the single-turn pulse number cir of the tool disc, the execution pulse number of the motor is determined to be exp=cir-|abs_pos-tar_abs_pos|.
[0145] In this embodiment, by calculating the number of execution pulses of the encoder based on the received shortest distance tool search method, the target position of the origin tool holder to be switched to, and the starting position of the origin tool holder of the current tool disc, a method of how to control the motor to rotate the tool disc for shortest distance tool search based on the encoder is provided.
[0146] This embodiment provides a turret control method, namely, an "encoder + universal indexing positioning" solution, which controls the motor through the encoder to drive the tool disc to rotate and search for the tool, and in the tool search process, the target position that the tool disc needs to rotate to reach can be calculated based on the different number of tool seats, thereby realizing a highly universal turret control method.
[0147] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2 This is a flow chart of the second embodiment of the turret control method of the present application.
[0148] Before the step of determining the number of pulses of the cutter disc in a single revolution in step S10, steps S100 to S200 may be included:
[0149] Step S100, the motor is used to rotate the cutter disc to start calibration, and a control signal generated by the origin switch during the rotation process is monitored, wherein the control signal is generated when the origin switch is rotated to a working cutter position corresponding to the cutter disc;
[0150] It should be noted that the origin switch is a device for detecting the position of the cutter disc, which is installed on the working position of the cutter disc; the control signal refers to the signal generated when the origin switch detects that the turret reaches the working position corresponding to the cutter disc.
[0151] It is understandable that since the positioning and tool changing operations of the tool in the turret control system rely on an accurate and repeatable starting point in the system, namely the origin position, and in the traditional method, when the turret is used for the first time or the first tool position of the turret is recalibrated, manual shifting is required to calibrate the origin position, which poses a safety hazard. Therefore, step S100 is performed to calibrate the origin position based on the control signal generated by the origin switch. Each time the turret is powered on, the self-calibrated origin position replaces the original manually calibrated origin position, thereby improving the safety of the turret origin position calibration.
[0152] Step S200, when the control signal is detected, the cutter disc is controlled by the motor to decelerate and reverse, so that the origin switch stops at the working cutter position, and the position of the origin switch is used as the origin position.
[0153] It is understandable that in the process of rapid rotation of the cutter disc for origin position calibration, inaccurate positioning may occur due to overshoot caused by inertia, so step S200 is performed to control the cutter disc to decelerate and reverse by generating a control signal based on the origin switch, and the cutter disc is stopped by controlling the motor when the control signal is generated a preset number of times, so as to reduce the overshoot during the deceleration of the cutter disc and cause a decrease in positioning accuracy, thereby improving the calibration accuracy of the turret origin position.
[0154] For example, please refer to Figure 3 , Figure 3A schematic diagram of a servo turret of a turret control method is provided. In the figure, a combination of "encoder + servo motor" is used to construct a motor M, and the motor M is connected to the tool disk of the turret through a transmission mechanism. The tool disk is equipped with four evenly distributed tool seats, namely tool seat 1, tool seat 2, tool seat 3 and tool seat 4, wherein an origin switch baffle, i.e., an origin switch, is provided on tool seat 1. When the origin switch is rotated to a fixed working tool position, the origin switch generates a control signal for controlling the tool disk to decelerate and reverse, so that the tool disk stops at the working tool position, and the position where the origin switch is located is used as the origin position.
[0155] In this embodiment, the turret origin position is calibrated before the turret control system performs indexing positioning and tool changing operations, and a double deceleration strategy is adopted for calibration, thereby avoiding manual calibration operations and overshoot during the origin position calibration process. At the same time, it is ensured that when calibrating the origin position, the tool disc stops on the same side of the origin switch baffle, thereby improving the accuracy of the turret origin position calibration.
[0156] For example, in order to help understand the implementation process of the turret control method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 4 , Figure 4 A brief flow chart of a turret control method is provided, specifically:
[0157] In the indexing and positioning process of the servo turret, i.e. the turret equipped with a servo motor, the first thing to do is to power on and calibrate the origin as the first tool position, i.e. determine the origin position. After the origin position is determined, the indexing positioning is performed to determine the positions of the indexing points on the tool disc of the turret, thereby completing the indexing and positioning of the turret.
[0158] For further information, please refer to Figure 5 , Figure 5 A schematic diagram of the origin calibration process of a turret control method is provided, specifically:
[0159] During the self-calibration of the origin, the servo motor first rotates the cutter disc at high speed to find the rising edge of the origin switch. When the cutter disc encounters the rising edge of the origin switch, the origin switch generates a first deceleration signal. Based on the first deceleration signal, the cutter disc is controlled to decelerate to a low speed in the reverse direction to find the falling edge of the origin switch. When the cutter disc encounters the falling edge of the origin switch during the reversal process, the origin switch generates a second deceleration signal to stop the cutter disc from rotating based on the second deceleration signal. If there is no need to offset the tool position, the current position of the cutter disc is used as the origin position to complete the origin calibration; if the tool position needs to be offset, the turret is rotated to the position of the target tool number, and the position is used as the origin position to complete the origin calibration.
[0160] For further information, please refer to Figure 6 , Figure 6 A control flow diagram of a turret control method is provided, specifically:
[0161] After completing the calibration of the turret origin, determine the turret single-circle pulse number cir, the total number of tools, i.e., the total number of tool seats on the tool disk num, and the number of single indexing pulses div, and determine the positions of all calibrated fixed indexing points, i.e., the indexing positions of each tool position Arr[i]. Receive the target tool number tar of the given fixed mechanical tool change point, and determine the tool number corresponding to the fixed mechanical tool change point, i.e., the working tool number cur, based on a certain mapping of the position of tool No. 1, i.e., the starting position of the origin tool seat abs_pos. When the target tool number tar is inconsistent with the working tool number cur, determine the displacement x to be moved, i.e., the number of execution pulses exp, through the received tool search method, to rotate the turret to the target tool number.
[0162] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the turret control method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0163] This application also provides a turret control device, please refer to Figure 7 , applied to a turret control system, the turret control system includes a motor and a turret, the motor has an encoder built in, the motor is used to drive the knife disc of the turret to rotate, the knife disc is provided with an origin switch, and the turret control device includes:
[0164] The calibration module 10 is used to determine the number of pulses of the cutter disc in a single circle after the turret control system triggers the tool search task, and calibrate the positions of the indexing points on the cutter disc based on the origin position of the cutter disc, the number of pulses of the cutter disc in a single circle and the number of tool seats of the cutter disc, wherein the number of pulses of the cutter disc in a single circle is the number of pulses fed back by the encoder when the cutter disc rotates one circle;
[0165] The counting module 20 is used to obtain the actual pulse number accumulated from the origin position in the encoder, and determine the origin tool holder starting position where the origin switch on the tool disc is located based on the actual pulse number and the single-turn pulse number of the tool disc;
[0166] A determination module 30 is used to determine the origin tool holder target position in each indexing point position based on the target tool number of the tool search task, wherein the origin tool holder target position is the position of the tool holder position corresponding to the target tool number relative to the origin position;
[0167] The tool-seeking module 40 is used to determine the working tool number of the turret according to the starting position of the origin tool holder. When the working tool number is not the target tool number, the execution pulse number of the motor is determined based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc for tool-seeking based on the execution pulse number.
[0168] Optionally, the calibration module 10 is further used for:
[0169] Divide the number of pulses in a single turn of the cutter disc by the number of cutter seats to obtain the number of indexing pulses between indexing points on the cutter disc;
[0170] Based on the number of indexing pulses and the origin position, the position of each indexing point is calibrated.
[0171] Optionally, the counting module 20 is further used for:
[0172] When the actual pulse number is less than zero, take the first remainder of the actual pulse number divided by the single-turn pulse number of the cutter disc, and add the first remainder to the single-turn pulse number of the cutter disc to obtain the origin tool holder starting position;
[0173] When the actual number of pulses is greater than or equal to zero, the second remainder of dividing the actual number of pulses by the number of pulses of the cutter disc in a single revolution is taken to obtain the origin tool holder starting position.
[0174] Optionally, the determining module 30 is further configured to:
[0175] When the tool number arrangement of the tool disk is counterclockwise, determining the index value of the indexing point position based on the target tool number and the tool holder number;
[0176] When the tool number arrangement of the tool disk is clockwise, the target tool number is used as the index value of the indexing point position;
[0177] The target position of the origin tool holder in each of the indexing point positions is obtained according to the index value.
[0178] Optionally, the tool-finding module 40 is further used for:
[0179] Based on the single-turn pulse number of the cutter disc and the number of the cutter seats, the cutter disc is divided into position areas to obtain a plurality of sub-position areas;
[0180] A target sub-position area among multiple sub-position areas is determined based on the origin tool holder starting position, and a preset tool number corresponding to the target sub-position area is used as the working tool number.
[0181] Optionally, the tool-finding module 40 is further used for:
[0182] When the tool-seeking mode of the tool-seeking task is forward tool-seeking and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number;
[0183] When the tool-seeking mode of the tool-seeking task is forward tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the first pulse number is subtracted from the second pulse number to obtain a first pulse subtraction result, and the first pulse subtraction result is subtracted from the single-turn pulse number of the tool disc to obtain the execution pulse number;
[0184] When the tool-seeking mode of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the second pulse number is subtracted from the first pulse number to obtain a second pulse subtraction result, and the single-turn pulse number of the tool disc is subtracted from the second pulse subtraction result to obtain the execution pulse number;
[0185] When the tool-seeking method of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number.
[0186] Optionally, the tool-finding module 40 is further used for:
[0187] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the absolute value is used as the execution pulse number;
[0188] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the negative of the absolute value is used as the execution pulse number;
[0189] When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-turn pulse number of the tool disc, the single-turn pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number;
[0190] When the tool-seeking method of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-circle pulse number of the tool disc, the single-circle pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number.
[0191] Optionally, the return module 50 in the turret control device is used to:
[0192] The motor is used to rotate the cutter disc to start origin calibration, and a control signal generated by the origin switch during the rotation process is monitored, wherein the control signal is generated when the origin switch is rotated to a working cutter position corresponding to the cutter disc;
[0193] When the control signal is detected, the motor is used to control the cutter disc to decelerate and reverse, so that the origin switch stops at the working cutter position, and the position of the origin switch is used as the origin position.
[0194] The turret control device provided by the present application adopts the turret control method in the above embodiment, which can solve the technical problem of how to realize a turret control method with strong versatility. Compared with the prior art, the beneficial effects of the turret control device provided by the present application are the same as the beneficial effects of the turret control method provided by the above embodiment, and other technical features in the turret control device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0195] The present application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the turret control method in the above-mentioned embodiment one.
[0196] Reference below Figure 8, which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic devices in the embodiments of the present application may include but are not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0197] like Figure 8 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0198] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0199] The electronic device provided by the present application adopts the turret control method in the above embodiment, which can solve the technical problem of how to realize a turret control method with strong versatility. Compared with the prior art, the beneficial effects of the electronic device provided by the present application are the same as the beneficial effects of the turret control method provided by the above embodiment, and the other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0200] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0201] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the turret control method in the above-mentioned embodiment.
[0202] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system or device.
[0203] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0204] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines the number of single-turn pulses of the cutter disc after the turret control system triggers the tool search task, and calibrates the positions of each dividing point on the cutter disc based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of tool seats of the cutter disc, wherein the number of single-turn pulses of the cutter disc is the number of pulses fed back by the encoder when the cutter disc rotates one circle; obtains the actual number of pulses accumulated in the encoder starting from the origin position, and determines based on the actual number of pulses and the number of single-turn pulses of the cutter disc the origin tool holder starting position where the origin switch is located on the tool disc; based on the target tool number of the tool search task, determining the origin tool holder target position in each indexing point position, wherein the origin tool holder target position is the position of the tool holder position corresponding to the target tool number relative to the origin position; determining the working tool number of the turret according to the origin tool holder starting position, and when the working tool number is not the target tool number, determining the execution pulse number of the motor based on the origin tool holder starting position and the origin tool holder target position, so as to control the motor to rotate the tool disc for tool search based on the execution pulse number.
[0205] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0206] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0207] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0208] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned turret control method, and can solve the technical problem of how to implement a turret control method with strong versatility. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the turret control method provided by the above-mentioned embodiment, and will not be elaborated here.
[0209] The present application also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the turret control method as described above are implemented.
[0210] The computer program product provided by the present application can solve the technical problem of how to implement a turret control method with high versatility. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the turret control method provided by the above embodiment, which will not be elaborated here.
[0211] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A turret control method, characterized in that: Applied to a turret control system, the turret control system includes a motor and a turret, the motor has a built-in encoder, the motor is used to drive the knife disc of the turret to rotate, and the knife disc is provided with an origin switch, the turret control method includes: After the turret control system triggers the tool search task, the number of single-turn pulses of the cutter disc is determined, and based on the origin position of the cutter disc, the number of single-turn pulses of the cutter disc and the number of tool seats of the cutter disc, the positions of the indexing points on the cutter disc are calibrated, wherein the number of single-turn pulses of the cutter disc is the number of pulses fed back by the encoder when the cutter disc rotates one circle; Obtaining the actual pulse number accumulated from the origin position in the encoder, and determining the origin tool holder starting position where the origin switch on the tool disc is located based on the actual pulse number and the single-turn pulse number of the tool disc; Based on the target tool number of the tool-seeking task, determining the target position of the origin tool holder in each indexing point position, wherein the target position of the origin tool holder is the position of the tool holder position corresponding to the target tool number relative to the origin position; The working tool number of the turret is determined according to the starting position of the origin tool holder. When the working tool number is not the target tool number, the execution pulse number of the motor is determined based on the starting position of the origin tool holder and the target position of the origin tool holder, so as to control the motor to rotate the tool disc to search for the tool based on the execution pulse number.
2. The turret control method according to claim 1, characterized in that: The step of calibrating the positions of the indexing points on the cutter disc based on the origin position of the cutter disc, the number of pulses of the cutter disc in a single turn, and the number of cutter seats of the cutter disc comprises: Divide the number of pulses in a single turn of the cutter disc by the number of cutter seats to obtain the number of indexing pulses between indexing points on the cutter disc; Based on the number of indexing pulses and the origin position, the position of each indexing point is calibrated.
3. The turret control method according to claim 1, characterized in that: The step of determining the starting position of the origin tool holder where the origin switch is located on the tool disc based on the actual pulse number and the single-turn pulse number of the tool disc comprises: When the actual pulse number is less than zero, take the first remainder of the actual pulse number divided by the single-turn pulse number of the cutter disc, and add the first remainder to the single-turn pulse number of the cutter disc to obtain the origin tool holder starting position; When the actual number of pulses is greater than or equal to zero, the second remainder of dividing the actual number of pulses by the number of pulses of the cutter disc in a single revolution is taken to obtain the origin tool holder starting position.
4. The turret control method according to claim 1, characterized in that: The step of determining the target position of the origin tool holder in each indexing point position based on the target tool number of the tool-seeking task comprises: When the tool number arrangement of the tool disk is counterclockwise, determining the index value of the indexing point position based on the target tool number and the tool holder number; When the tool number arrangement of the tool disk is clockwise, the target tool number is used as the index value of the indexing point position; The target position of the origin tool holder in each of the indexing point positions is obtained according to the index value.
5. The turret control method according to claim 1, characterized in that: The step of determining the working tool number of the turret according to the starting position of the origin tool holder comprises: Based on the single-turn pulse number of the cutter disc and the number of the cutter seats, the cutter disc is divided into position areas to obtain a plurality of sub-position areas; A target sub-position area among multiple sub-position areas is determined based on the origin tool holder starting position, and a preset tool number corresponding to the target sub-position area is used as the working tool number.
6. The turret control method according to claim 1, characterized in that: The step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position comprises: When the tool-seeking mode of the tool-seeking task is forward tool-seeking and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number; When the tool-seeking mode of the tool-seeking task is forward tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the first pulse number is subtracted from the second pulse number to obtain a first pulse subtraction result, and the first pulse subtraction result is subtracted from the single-turn pulse number of the tool disc to obtain the execution pulse number; When the tool-seeking mode of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, the second pulse number is subtracted from the first pulse number to obtain a second pulse subtraction result, and the single-turn pulse number of the tool disc is subtracted from the second pulse subtraction result to obtain the execution pulse number; When the tool-seeking method of the tool-seeking task is reverse tool-seeking, and the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, the execution pulse number is determined based on the difference between the first pulse number and the second pulse number.
7. The turret control method according to claim 1, characterized in that: The step of determining the number of execution pulses of the motor based on the origin tool holder starting position and the origin tool holder target position also includes: When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the absolute value is used as the execution pulse number; When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is less than half of the single-turn pulse number of the tool disc, the negative of the absolute value is used as the execution pulse number; When the tool-seeking mode of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is greater than the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-turn pulse number of the tool disc, the single-turn pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number; When the tool-seeking method of the tool-seeking task is the shortest distance tool-seeking, the first pulse number corresponding to the target position of the origin tool holder is less than or equal to the second pulse number corresponding to the starting position of the origin tool holder, and the absolute value of the difference between the first pulse number and the second pulse number is greater than or equal to half of the single-circle pulse number of the tool disc, the single-circle pulse number of the tool disc is subtracted from the absolute value to obtain the execution pulse number.
8. The turret control method according to claim 1, characterized in that: The step of determining the number of pulses per single turn of the cutter disc also includes: The motor is used to rotate the cutter disc to start origin calibration, and a control signal generated by the origin switch during the rotation process is monitored, wherein the control signal is generated when the origin switch is rotated to a working cutter position corresponding to the cutter disc; When the control signal is detected, the motor is used to control the cutter disc to decelerate and reverse, so that the origin switch stops at the working cutter position, and the position of the origin switch is used as the origin position.
9. An electronic device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the turret control method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the turret control method according to any one of claims 1 to 8 are implemented.