Electronic cam device and electronic cam curve generation method
By constructing and training strategy networks, generate electronic cam curves and optimize the knife head motion strategy, solve the problem of low degree of intelligence in the knife head control strategy in the intelligent tracking technology, improve production efficiency and cutting accuracy, reduce equipment wear and operation cost.
Patent Information
- Application Number
- CN202411406817.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The existing intelligent shearing technology has a low degree of intelligence in the tool head control strategy, which causes the tool head return and acceleration and deceleration to consume time and increase mechanical wear, and the response is slow when dealing with complex working conditions or emergencies, which cannot be guaranteed. Continuous and smooth operation process.
By constructing a strategic network, initialization and training parameters are performed, electronic cam curves are generated, the head movement strategy is optimized, the blade head is empty distance, and the electronic cam curve is dynamically adjusted to cope with the uncertainty in the processing process.
Improve the system's adaptability and production flexibility, enhance the cutting accuracy and surface quality, reduce the waste of materials and equipment wear, and reduce maintenance costs and operating costs.
Smart Images

Figure CN119379846A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic cams, and in particular to an electronic cam device and an electronic cam curve generating method. Background Art
[0002] As an important part of material processing, tracking cutting technology plays a vital role in industries such as automobile manufacturing, aerospace, precision instruments, and textiles and clothing. In recent years, with the rapid progress of computer science, artificial intelligence, and machine learning technology, intelligent tracking cutting technology has begun to emerge and gradually replaced the traditional manual operation mode. The application of these technologies has significantly improved cutting accuracy and production efficiency, and reduced labor costs and scrap rates. In particular, the breakthrough progress of deep learning algorithms in image recognition and path planning enables machines to analyze the shape of workpieces in real time and adaptively adjust cutting paths to meet the needs of personalized and diversified production. However, most of the existing intelligent tracking cutting solutions focus on visual guidance and path optimization, and the degree of intelligence of the tool head control strategy is relatively low. Usually, after completing a cut, the tool head needs to return to the initial position to prepare for the next operation. This process not only consumes time, but also may increase mechanical wear due to frequent start and stop, affecting overall production efficiency. In addition, when dealing with continuously changing tasks, the existing system often lacks an effective strategy adjustment mechanism, resulting in slow response when facing complex working conditions or emergencies, and cannot guarantee a continuous and smooth operation process. Frequent cutter head return and acceleration and deceleration processes aggravate equipment wear, increase maintenance costs and equipment downtime, and affect the continuity and stability of the production line.
[0003] Existing electronic cam curve generation technology is generally based on preset mathematical models or fixed curve libraries. These models are often designed for specific materials, speeds and cutting requirements, lacking accurate simulation of actual dynamic processes, and the optimization results may deviate from the actual optimal solution, especially when cutting continuously at high speeds, it is difficult to achieve the best balance between efficiency and accuracy. When dealing with highly complex tracking and shearing tasks, existing calculation methods may encounter problems such as large amount of calculation and long processing time, which not only affects the response speed of the production line, but may also have to sacrifice the accuracy of the curve due to limited computing resources.
[0004] In summary, although the current intelligent shearing technology has made some progress, there is still much room for improvement in terms of improving production efficiency, enhancing system flexibility, deepening intelligent applications, and reducing overall costs. In particular, technological innovation is needed in the intelligentization of the cutter head control strategy and the efficient execution of continuous shearing tasks to meet the growing demand for personalized customization and high-quality production. This requires not only a higher level of autonomous learning and decision-making capabilities at the algorithm level, but also the search for a better integration solution in system design to ensure the efficiency, stability, and intelligence of the entire shearing process.
[0005] For example, a Chinese patent with the authorization announcement number CN105739430B discloses an electronic cam control device and its electronic cam curve generation method. The device includes an information reading unit for reading and analyzing the position setting file of the driven shaft; the electronic cam curve generation unit generates the electronic cam curve according to the restriction conditions set by the user; the electronic cam curve memory unit stores the generated electronic cam curve; the position command generation unit refers to the position feedback of the active shaft, and converts the motion planning of the electronic cam curve into a position command; the command output unit outputs the position command to the driven shaft drive unit, and the driven shaft drive unit acts according to the received position command. When performing motion planning, according to the restriction conditions and the results of the previous solution, a solver that meets the conditions is selected until a solution that meets the restriction conditions is found. When solving, the speed, acceleration, jerk, etc. in the process are considered, which has the function of protecting the machine.
[0006] For example, the patent application with the publication number CN114967590A discloses a control method for a shearing mechanism, which includes an electronic cam. The control method includes: providing a first number of points, and establishing a first straight line segment in a coordinate system through the first number of points; providing a second number of points, and establishing a first cam control curve in the above coordinate system through the second number of points, wherein the first cam control curve includes a first curve segment and a second curve segment, and the longitudinal coordinates of the first curve segments are both 0; multiplying the first cam control curve by -1 and superimposing it with the first straight line segment to obtain a second cam control curve; the second cam control curve includes a third curve segment and a fourth curve segment, and the fourth curve segment of the second cam control curve is translated along the horizontal axis of the above coordinate system until the end point of the fourth curve segment coincides with the starting point of the third curve segment, and the third cam control curve is obtained to control the electronic cam. The technical solution of this invention can make the machine run more smoothly and the shearing more precise.
[0007] The above patents all have the problem raised by this background technology: the generation of the electronic cam curve lacks accurate simulation of the actual dynamic process, and the optimization result may deviate from the actual optimal solution.
[0008] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgement or any form of suggestion that the information constitutes the prior art already known to ordinary technicians in this field. Summary of the invention
[0009] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide an electronic cam device and an electronic cam curve generation method. Through intelligent electronic cam curve generation, the quality and efficiency of the chase shearing process are improved, and the production model is promoted to develop in a smarter, more flexible and more environmentally friendly direction.
[0010] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0011] In one aspect, the present invention provides a method for generating an electronic cam curve, comprising the following steps:
[0012] S1: Construct the state space and action space of the chasing task; construct the policy network and initialize the parameters;
[0013] S2: training the policy network and saving the trained policy network;
[0014] S3: Obtain a list of chasing and shearing tasks, and reset the action space and state space;
[0015] S4: Select an action from the action space through the policy network, and update the action space and the state space;
[0016] S5: Generate a cutter head motion curve for the shearing task included in the selected action;
[0017] S6: Repeat steps S4-S5 until the cutter head motion curves of all the follow-up shearing tasks are generated, and an electronic cam curve composed of the cutter head motion curves of all the follow-up shearing tasks is obtained.
[0018] As a preferred solution of the electronic cam curve generation method of the present invention, wherein: the action space is a set of action components; any action includes a shearing task and a cutter head control strategy;
[0019] Any shearing task contains the length data of a material to be sheared; any cutter head control strategy includes the first cutter head displacement l1, the first material displacement L1, the second cutter head displacement l2, the second material displacement L2, the third material displacement L3, the fourth cutter head displacement l4, and the fourth material displacement L4; the constraints followed by the cutter head control strategy are as follows:
[0020]
[0021] Wherein, L0 represents the length of the material corresponding to the tool head control strategy; y3 represents the ordinate of the third characteristic point in the coordinate axis of the electronic cam curve; v k Indicates the maximum speed of the cutter head; v max Indicates the threshold speed of the cutter head; a k Indicates the maximum acceleration of the cutter head; a max Indicates the threshold acceleration of the tool tip.
[0022] As a preferred solution of the electronic cam curve generation method of the present invention, the tool head control strategy is used to control the work of the tool head in completing the tracking shearing task, and the method is as follows:
[0023] S100: The shearing task starts, the material keeps moving at a constant speed, and the cutter head starts to decelerate; when the shearing task starts, the position of the cutter head is the first feature point;
[0024] S200: When the material moving distance reaches the first material displacement L1, the cutter head speed is reduced to 0 and starts to move in the reverse direction; the position of the cutter head when it stops decelerating is the second characteristic point; during the deceleration process, the moving distance of the cutter head is the first cutter head displacement l1;
[0025] S300: When the material moving distance reaches the second material displacement L2, the cutter head stops moving in the reverse direction and starts to wait in a stationary state; the position of the cutter head when it stops moving in the reverse direction is the third characteristic point; during the reverse movement, the moving distance of the cutter head is the second cutter head displacement l2;
[0026] S400: When the material moving distance reaches the third material displacement L3, the cutter head stops and waits, and starts to catch up with the material; the position where the cutter head stops and waits is the fourth characteristic point;
[0027] S500: When the material movement distance reaches the fourth material displacement L4, the cutter head stops chasing the material, remains relatively still with the material and starts to shear the material; the position of the cutter head when it stops chasing the material is the fifth characteristic point; in the process of chasing the material, the moving distance of the cutter head is the fourth cutter head displacement l4;
[0028] S600: When the cutter head completes shearing of the material, the tracking shearing task is completed; the position of the cutter head when the cutter head completes shearing of the material is the sixth characteristic point; during the process of shearing the material, the moving distance of the cutter head is the fifth cutter head displacement l5.
[0029] As a preferred scheme of the electronic cam curve generation method described in the present invention, wherein: the state space includes the cumulative feeding distance, the cutter head position, the cutter holder shaft length, and the material movement speed; wherein the cumulative feeding distance is the cumulative length of the material transported by the feeding shaft, which is calculated by summing the lengths of all the materials that have completed shearing; the cutter head position is represented by the distance between the real-time position and the initial position of the cutter head; the cutter holder shaft length is the distance between the initial position of the cutter head and the end of the cutter holder shaft; the material movement speed is the speed at which the material moves at a uniform speed during the shearing process.
[0030] As a preferred solution of the electronic cam curve generation method of the present invention, the strategy network includes an input layer, a hidden layer, and an output layer; the input layer is used to input the feature vector of the state space; the hidden layer is used to further extract the features of the state space; the output layer is used to output the selection probability of each action in the action space; the training method of the strategy network is as follows:
[0031] S201: Calculate the selection probability of each action in the action space through the policy network;
[0032] S202: Selecting an action from the action space based on the selection probability;
[0033] S203: Update the state space and action space, and calculate the reward value of the selected action based on the reward function;
[0034] S204: Calculate the cumulative reward value and update the parameters of the policy network according to the cumulative reward value;
[0035] S205: Repeat steps S203 to S204 until the cumulative reward value converges and the training of the policy network is completed.
[0036] As a preferred solution of the electronic cam curve generation method of the present invention, the calculation formula of the reward function is as follows:
[0037] R(s j ,a j )=L j ·(1+w·α j );
[0038] Among them, R(s j ,a j ) means that in the state space s j When selecting action a j The reward value of L j represents the empty row distance of the jth selected action; w represents the weight parameter; α j represents the over-distance penalty factor for the j-th selected action;
[0039] The calculation formula of the empty line distance is as follows:
[0040] L j = l 1j +l 2j +l 4j ;
[0041] Among them, l 1j represents the first tool head displacement in the tool head control strategy included in the j-th selected action; l 2j represents the second tool head displacement in the tool head control strategy included in the action selected for the jth time; l 4j represents the fourth tool head displacement in the tool head control strategy included in the j-th selected action;
[0042] The method for assigning the distance penalty factor is as follows:
[0043]
[0044] Among them, l 0jrepresents the distance between the real-time position and the initial position of the tool head before the jth selection action; l d represents the tool holder axis length; l5 represents the fifth tool head displacement in the tool head control strategy included in any action; l s Indicates a safe reserve distance.
[0045] As a preferred solution of the electronic cam curve generation method described in the present invention, wherein: the shearing task list includes all shearing tasks; the method for resetting the action space and the state space is as follows: M cutter head control strategies are set for each shearing task in the shearing task list; each cutter head control strategy and the corresponding shearing task are combined into an action, and all actions constitute the reset action space; the cumulative feeding distance is set to 0, the cutter head position is initialized, and the initialized cutter head position is 0 distance from the initial position; the actual tool holder shaft length and material movement speed are collected and input into the state space.
[0046] As a preferred solution of the electronic cam curve generation method of the present invention, the method of generating the tool head motion curve is as follows:
[0047] S501: Calculate the coordinates of each feature point in the coordinate axis of the electronic cam curve based on the tool head control strategy; the abscissa of the coordinate axis of the electronic cam curve is the accumulated moving distance of the material, and the ordinate is the distance from the tool head to the starting position;
[0048] S502: constructing an equation of a motion curve segment between any two adjacent feature points, and solving the equation of the motion curve segment by using the coordinates of each feature point and the tool head moving speed;
[0049] S503: Draw a motion curve segment between any two adjacent feature points using the equation of the motion curve segment, and form a cutter head motion curve for the tracking shearing task.
[0050] As a preferred solution of the electronic cam curve generation method of the present invention, the equation of the motion curve segment is a cubic polynomial curve equation, and the solution method is as follows:
[0051] Substitute x=vt into the equation of the motion curve segment to obtain the displacement-time equation of the motion curve segment; where x represents the horizontal coordinate of any characteristic point; t represents time; differentiate the displacement-time equation once to obtain the velocity-time equation of the motion curve segment;
[0052] Substitute the coordinates of two adjacent feature points into the displacement-time equation, and substitute the tool head moving speed of the two adjacent feature points into the speed-time equation to obtain a linear equation group of the motion curve segment; solve the linear equation group to obtain the values of the parameters in the equation of the motion curve segment;
[0053] The tool head moving speed at the first characteristic point is v, where v represents the material moving speed; the tool head moving speed at the second characteristic point is 0, the tool head moving speed at the third characteristic point is 0, the tool head moving speed at the fourth characteristic point is 0, the tool head moving speed at the fifth characteristic point is v, and the tool head moving speed at the sixth characteristic point is v.
[0054] In a second aspect, the present invention provides an electronic cam device, including a task acquisition module, a control strategy module, a reinforcement learning module, a data processing module, a curve generation module, and an output display module;
[0055] The task acquisition module is used to obtain a list of chasing and shearing tasks;
[0056] The control strategy module is used to set the cutter head control strategy for each task in the chasing and shearing task list;
[0057] The reinforcement learning module is used to construct an action space based on the shearing task list and the cutter head control strategy; it is also used to construct a state space, a policy network, and train the policy network;
[0058] The data processing module is used to calculate the coordinates of each feature point after executing each action based on the tool head control strategy;
[0059] The curve generation module is used to generate an electronic cam curve based on the control strategies included in all the chasing and shearing tasks in the chasing and shearing task list;
[0060] The output display module is used to visually display the electronic cam curve and supports the export of the electronic cam curve.
[0061] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:
[0062] By introducing advanced deep reinforcement learning algorithms, the present invention can automatically generate electronic cam curves for different material properties and cutting requirements, improving the system's adaptability. When materials change or processing requirements are adjusted, the system can self-optimize faster, reduce manual intervention, and improve production flexibility.
[0063] The present invention can simulate the cutting process more accurately, and the generated electronic cam curve is more in line with the actual working conditions, which improves the cutting accuracy and surface quality and reduces material waste. The present invention simulates and monitors the interaction state between the cutter head and the material during the cutting process, and dynamically adjusts the electronic cam curve accordingly, effectively dealing with the uncertainty in the processing process and ensuring a stable and efficient cutting process.
[0064] The present invention is based on the guidance of the reward function and reduces the idle travel distance of the cutter head, which not only saves energy consumption, but also reduces equipment wear and extends equipment service life, thereby reducing maintenance costs and operating costs in the long run; at the same time, it shortens the generation time of the electronic cam curve, accelerates the production preparation process, and enhances the responsiveness of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0066] Figure 1 A flow chart of the electronic cam curve generating method provided by the present invention;
[0067] Figure 2 A schematic diagram of the structure of the electronic cam device provided by the present invention;
[0068] Figure 3 A flow chart of a method for controlling the work of a cutter head in a chasing shearing task provided by the present invention;
[0069] Figure 4 A cutter head motion curve diagram for any shearing task provided by the present invention. DETAILED DESCRIPTION
[0070] The technical solution of the present invention is described in detail below through the accompanying drawings and specific embodiments. It should be understood that the embodiments of the present invention and the specific features in the embodiments are detailed descriptions of the technical solution of the present invention, rather than limitations on the technical solution of the present invention. The embodiments of the present invention and the technical features in the embodiments may be combined with each other unless there is a conflict.
[0071] Example 1
[0072] This embodiment introduces a method for generating an electronic cam curve. Figure 1 , the method comprises the following steps:
[0073] S1: Construct the state space and action space of the chasing task; construct the policy network and initialize the parameters;
[0074] The state space includes the cumulative feeding distance, the cutter head position, the cutter holder shaft length, and the material moving speed; wherein the cumulative feeding distance is the cumulative length of the material transported by the feeding shaft, which is calculated by summing the lengths of all the materials that have been sheared; the cutter head position is represented by the distance between the real-time position and the initial position of the cutter head, for example, the cutter head position is 50 cm away from the initial position; the cutter holder shaft length is the distance between the initial position of the cutter head and the end of the cutter holder shaft; the material moving speed v is the speed at which the material moves at a uniform speed during the shearing process.
[0075] The action space is a set of actions; any action includes a shearing task and a cutter head control strategy;
[0076] Any shearing task contains the length data of a material to be sheared. By selecting the action corresponding to the material to be sheared of the appropriate length, it is possible to avoid shearing accidents caused by the material being too long or too short in the next shearing task, such as the shearing of the material is not completed when the cutter head reaches the end of the tool holder shaft.
[0077] Any tool head control strategy includes the first tool head displacement l1, the first material displacement L1, the second tool head displacement l2, the second material displacement L2, the third material displacement L3, the fourth tool head displacement l4, and the fourth material displacement L4; the constraints followed by the tool head control strategy are as follows:
[0078]
[0079] Wherein, L0 represents the length of the material corresponding to the tool head control strategy; y3 represents the ordinate of the third characteristic point in the coordinate axis of the electronic cam curve; v k Indicates the maximum speed of the cutter head; v max represents the threshold speed of the cutter head, which is set by technicians in this field according to actual needs; a k Indicates the maximum acceleration of the cutter head; a max Indicates the threshold acceleration of the cutter head, which is set by technicians in this field according to actual needs;
[0080] Substitute x=vt into the equation of the tool head displacement curve to obtain the tool head displacement-time equation; where x represents the horizontal coordinate of any point in the tool head displacement curve; t represents time;
[0081] Differentiate the displacement-time equation once to get the speed-time equation of the cutter head; differentiate the displacement-time equation twice to get the acceleration-time equation of the cutter head; calculate the maximum speed v of the cutter head through the speed-time equation of the cutter head k ; Calculate the maximum acceleration a of the cutter head through the cutter head acceleration-time equation k ;
[0082] The cutter head control strategy is used to control the work of the cutter head in the chase shearing task. Figure 3 , the steps are as follows:
[0083] S100: The shearing task starts, the material keeps moving at a constant speed, and the cutter head starts to decelerate; when the shearing task starts, the position of the cutter head is the first feature point;
[0084] S200: When the material moving distance reaches the first material displacement L1, the cutter head speed is reduced to 0 and starts to move in the reverse direction; the position of the cutter head when it stops decelerating is the second characteristic point; during the deceleration process, the moving distance of the cutter head is the first cutter head displacement l1;
[0085] S300: When the material moving distance reaches the second material displacement L2, the cutter head stops moving in the reverse direction and starts to wait in a stationary state; the position of the cutter head when it stops moving in the reverse direction is the third characteristic point; during the reverse movement, the moving distance of the cutter head is the second cutter head displacement l2;
[0086] S400: When the material moving distance reaches the third material displacement L3, the cutter head stops waiting and starts to catch up with the material; the position of the cutter head when it stops waiting is the fourth characteristic point; because the moving distance is 0 during the cutter head waiting process, the present embodiment no longer sets the "third cutter head displacement" corresponding to the third material displacement.
[0087] S500: When the material movement distance reaches the fourth material displacement L4, the cutter head stops chasing the material, remains relatively still with the material and starts to shear the material; the position of the cutter head when it stops chasing the material is the fifth characteristic point; in the process of chasing the material, the moving distance of the cutter head is the fourth cutter head displacement l4;
[0088] S600: When the cutter head completes shearing of the material, the tracking shearing task is completed; the position of the cutter head when the cutter head completes shearing of the material is the sixth characteristic point; during the process of shearing the material, the moving distance of the cutter head is the fifth cutter head displacement l5.
[0089] For the same material, the shearing process time is fixed and the moving speed of the material is constant, so the fifth blade displacement l5 is a fixed value obtained by the technicians in this field through experiments. For a series of continuous chasing shearing tasks, in the first chasing shearing task, the values of L1, L2, l1, and l2 are all 0, and the coordinates of the first feature point are (0,0), and the cumulative feeding distance is also 0.
[0090] The strategy network includes an input layer, a hidden layer, and an output layer; wherein the input layer is used to input the feature vector of the state space; the hidden layer is used to further extract the features of the state space; and the output layer is used to output the selection probability of each action in the action space;
[0091] S2: training the policy network and saving the trained policy network;
[0092] The training method of the policy network is as follows:
[0093] S201: Calculate the selection probability of each action in the action space through the policy network;
[0094] S202: Based on the selection probability, select an action from the action space; the method is as follows:
[0095] Set a threshold parameter ε, with a value range of (0, 0.2];
[0096] Generate a random number r in the range of (0, 1]; if r is greater than or equal to ε, the action selected is the action with the highest selection probability; if r is less than ε, a random action is selected from the action space;
[0097] S203: Update the state space and action space, and calculate the reward value of the selected action based on the reward function;
[0098] The calculation formula of the reward function is as follows:
[0099] R(s j ,a j )=L j ·(1+w·α j );
[0100] Among them, R(s j ,a j ) means that in the state space s j When selecting action a j The reward value of L j represents the empty line distance of the jth selection action; w represents the weight parameter, which is set by technicians in this field according to actual needs; α j represents the over-distance penalty factor for the j-th selected action;
[0101] The calculation formula of the empty line distance is as follows:
[0102] L j = l 1j +l 2j +l 4j ;
[0103] Among them, l 1j represents the first tool head displacement in the tool head control strategy included in the j-th selected action; l 2j represents the second tool head displacement in the tool head control strategy included in the action selected for the jth time; l 4j represents the fourth tool head displacement in the tool head control strategy included in the j-th selected action;
[0104] The method for assigning the distance penalty factor is as follows:
[0105]
[0106] Among them, l 0j represents the distance between the real-time position and the initial position of the tool head before the jth selection action; l d represents the tool holder axis length; l5 represents the fifth tool head displacement in the tool head control strategy included in any action; l s It indicates the safety reserved distance, which is set by technicians in this field according to actual needs.
[0107] Through the above reward function, the policy network can select the action with the smallest empty distance and the lowest penalty for crossing the distance, which not only reduces unnecessary energy loss, but also avoids the risk of shearing failure caused by improper position of the cutter head. s The position is the shearing cut-off point; when the cutter head moves to the shearing cut-off point, the shearing of the material is stopped immediately and the next chasing shearing task is started.
[0108] S204: Calculate the cumulative reward value and update the parameters of the policy network according to the cumulative reward value;
[0109] The calculation formula of the cumulative reward value is as follows:
[0110]
[0111] Among them, R N represents the cumulative reward value; N represents the number of actions that have been selected; β represents the discount factor, which ranges from (0, 1], β j represents the jth power of the discount factor β;
[0112] The method for updating the parameters of the policy network is as follows:
[0113] The calculation formula for updating the parameters of the policy network is as follows:
[0114] δ=δ+η·▽ δ (L SN );
[0115] Where δ represents any parameter in the policy network; ▽ δ (·) indicates that the function in the brackets is used to find the gradient of δ; η is the learning rate; L SN is the loss function, and the calculation formula is as follows:
[0116]
[0117] Among them, p(s j,a j ) means that in the state space s j Action j The probability of selection;
[0118] After the above parameter updates, the policy network will assign a greater selection probability to actions with shorter empty line distances; this update process is repeated continuously, and the policy network will gradually learn the optimal probability distribution of all selectable actions in different state spaces.
[0119] S205: Repeat steps S203 to S204 until the cumulative reward value converges and the training of the policy network is completed;
[0120] After repeating steps S203 to S204 for many times, the accumulated reward value tends to be stable and no longer fluctuates significantly, that is, it is considered that the accumulated reward value converges and the strategy network is able to make a decision that minimizes the distance of the cutter head.
[0121] S3: Obtain a list of chasing and shearing tasks, and reset the action space and state space;
[0122] The shearing task list includes all shearing tasks; the method for resetting the action space and the state space is as follows: set M cutter head control strategies for each shearing task in the shearing task list; form an action with each cutter head control strategy and the corresponding shearing task, and all actions constitute the reset action space; set the accumulated feeding distance to 0, initialize the cutter head position, and the initialized cutter head position is 0 distance from the initial position; collect the actual tool holder shaft length and material movement speed and input them into the state space.
[0123] S4: Select an action from the action space through the policy network and execute it, and update the action space and state space; the method is as follows:
[0124] Encode the state space into a feature vector and input it into the policy network, output the selection probability of each action in the action space, and execute the action with the highest selection probability;
[0125] Mark the material to be sheared corresponding to the selected action as the material that has been sheared, and recalculate the accumulated feeding distance; calculate the position of the sixth characteristic point as the current position of the cutter head based on the cutter head control strategy included in the selected action, and recalculate the cutter head position;
[0126] The chasing and cutting tasks included in the selected action are extracted as tasks to be removed, and all actions including the tasks to be removed are removed from the action space.
[0127] S5: Generate a cutter head motion curve for the shearing task included in the selected action; the method is as follows:
[0128] S501: Calculate the coordinates of each feature point in the coordinate axis of the electronic cam curve based on the tool head control strategy; the abscissa of the coordinate axis of the electronic cam curve is the accumulated moving distance of the material, and the ordinate is the distance from the tool head to the starting position;
[0129] The calculation formula of the horizontal coordinate x1 of the first feature point is as follows:
[0130] x1=x′6;
[0131] Among them, x′6 represents the horizontal coordinate of the sixth feature point of the last chasing and shearing task;
[0132] The calculation formula of the ordinate y1 of the first feature point is as follows:
[0133] y1=y′6;
[0134] Where y′6 represents the ordinate of the sixth feature point of the last shearing task;
[0135] The calculation formula of the horizontal coordinate x2 of the second feature point is as follows:
[0136] x2=y1+∑L+L1;
[0137] Among them, ∑L represents the cumulative feeding distance before the execution of the action selected this time;
[0138] The calculation formula of the ordinate y2 of the second feature point is as follows:
[0139] y2=y1+l1;
[0140] The calculation formula of the abscissa x3 of the third feature point is as follows:
[0141] x3=y1+∑L+L2;
[0142] The calculation formula of the ordinate y3 of the third feature point is as follows:
[0143] y3=y2-l2;
[0144] The calculation formula of the abscissa x4 of the fourth feature point is as follows:
[0145] x4=y1+ΣL+L3;
[0146] The calculation formula of the ordinate y4 of the fourth feature point is as follows:
[0147] y4=y3;
[0148] The calculation formula of the abscissa x5 of the fifth feature point is as follows:
[0149] x5=y1+ΣL+L4;
[0150] The calculation formula of the ordinate y5 of the fifth feature point is as follows:
[0151] y5=y4+l4;
[0152] The calculation formula of the horizontal coordinate x6 of the sixth feature point is as follows:
[0153] x6=x5+l5;
[0154] The calculation formula of the ordinate y6 of the sixth feature point is as follows:
[0155] y6=y5+l5;
[0156] S502: constructing an equation of a motion curve segment between any two adjacent feature points, and solving the equation of the motion curve segment by using the coordinates of each feature point and the tool head moving speed;
[0157] The equation of the motion curve segment is a cubic polynomial curve equation, and the solution method is as follows:
[0158] Substitute x=vt into the equation of the motion curve segment to obtain the displacement-time equation of the motion curve segment; where x represents the horizontal coordinate of any characteristic point; t represents time; differentiate the displacement-time equation once to obtain the velocity-time equation of the motion curve segment;
[0159] Substitute the coordinates of two adjacent feature points into the displacement-time equation, and substitute the tool head movement speed of the two adjacent feature points into the speed-time equation to obtain a linear equation group of the motion curve segment; solve the linear equation group by Gaussian elimination method and other methods to obtain the values of the parameters in the equation of the motion curve segment.
[0160] The tool head moving speed at the first characteristic point is v, where v represents the material moving speed; the tool head moving speed at the second characteristic point is 0, the tool head moving speed at the third characteristic point is 0, the tool head moving speed at the fourth characteristic point is 0, the tool head moving speed at the fifth characteristic point is v, and the tool head moving speed at the sixth characteristic point is v.
[0161] The motion curve of the cutter head for any shearing task is as follows: Figure 4 shown.
[0162] By fitting the motion curve segment between any two adjacent feature points with a cubic polynomial curve, the continuity and smoothness of the displacement-time curve, velocity-time curve, and acceleration-time curve of the tool head are guaranteed. This ensures that the movement of the tool head meets production requirements while maintaining smoothness and continuity, avoiding mechanical shock and energy consumption caused by rapid acceleration or deceleration.
[0163] S503: Draw a motion curve segment between any two adjacent feature points using the equation of the motion curve segment, and form a cutter head motion curve for the tracking shearing task.
[0164] S6: Repeat steps S4-S5 until the cutter head motion curves of all the follow-up shearing tasks are generated, and an electronic cam curve composed of the cutter head motion curves of all the follow-up shearing tasks is obtained.
[0165] The electronic cam curve intuitively shows the connection between the cutter head movement and the feeding process, making the entire movement trajectory of the cutter head clear at a glance. Through the precise control of the electronic cam curve, it is possible to reduce shearing waste caused by mechanical wear, speed mismatch and other factors, improve shearing accuracy, and maintain continuous operation of the production line, greatly improving the efficiency and product quality of follow-up shearing production.
[0166] Example 2
[0167] This embodiment is the second embodiment of the present invention; it is based on the same inventive concept as embodiment 1, Figure 2 ,This embodiment introduces an electronic cam device, including a task acquisition module, a control strategy module, a reinforcement learning module, a data processing module, a curve generation module, and an output display module;
[0168] The task acquisition module is used to obtain the chasing and cutting task list; the module can also automatically simulate and generate the chasing and cutting task list, and transmit the chasing and cutting task list to the reinforcement learning module;
[0169] The control strategy module is used to set the cutter head control strategy for each task in the chasing and shearing task list;
[0170] The reinforcement learning module is used to construct an action space based on the shearing task list and the cutter head control strategy; it is also used to construct a state space and a policy network, and to train the policy network; the module is also used to update the state space and the action space, and to calculate the selection probability of each action in the action space through the policy network and select the action;
[0171] The data processing module is used to calculate the coordinates of each feature point after each action is executed based on the tool head control strategy; the module is also used to calculate the empty line distance and the over-distance penalty factor during the training process of the strategy network, and calculate the cumulative feeding distance;
[0172] The curve generation module is used to generate an electronic cam curve based on the control strategies included in all the chasing and cutting tasks in the chasing and cutting task list; first, the equation of the motion curve segment between any two adjacent feature points is constructed and solved, and the motion curve segment between any two adjacent feature points is drawn. The motion curve segments constitute a cutter head motion curve of a chasing and cutting task, and the cutter head motion curves of all chasing and cutting tasks together constitute the electronic cam curve.
[0173] The output display module is used to visually display the electronic cam curve and provide an export function for the electronic cam curve; it allows the user to export the electronic cam curve diagram into a common image or vector graphics format, and supports the export of related data reports, such as the cam table and the name or number of the cam table, and the curve key point data such as the coordinates of the feature points and the speed and acceleration of the tool head.
[0174] The specific functions of the above modules are realized by referring to the relevant contents of the electronic cam curve generation method described in Example 1, which will not be elaborated here.
[0175] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0176] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the purpose and scope of protection of the present invention, which are all within the protection of the present invention.
Claims
1. A method for generating an electronic cam curve, characterized in that: The following steps are involved: S1: Construct the state space and action space of the chasing task; construct the policy network and initialize the parameters; S2: training the policy network and saving the trained policy network; S3: Obtain a list of chasing and shearing tasks, and reset the action space and state space; S4: Select an action from the action space through the policy network, and update the action space and the state space; S5: Generate a cutter head motion curve for the shearing task included in the selected action; S6: Repeat steps S4-S5 until the cutter head motion curves of all the follow-up shearing tasks are generated, and an electronic cam curve composed of the cutter head motion curves of all the follow-up shearing tasks is obtained.
2. The method for generating an electronic cam curve according to claim 1, characterized in that: The action space is a set of actions; any action includes a shearing task and a cutter head control strategy; Any shearing task contains the length data of a material to be sheared; any cutter head control strategy includes the first cutter head displacement l1, the first material displacement L1, the second cutter head displacement l2, the second material displacement L2, the third material displacement L3, the fourth cutter head displacement l4, and the fourth material displacement L4; the constraints followed by the cutter head control strategy are as follows: Wherein, L0 represents the length of the material corresponding to the tool head control strategy; y3 represents the ordinate of the third characteristic point in the coordinate axis of the electronic cam curve; v k Indicates the maximum speed of the cutter head; v max Indicates the threshold speed of the cutter head; a k Indicates the maximum acceleration of the cutter head; a max Indicates the threshold acceleration of the tool tip.
3. The method for generating an electronic cam curve according to claim 2, characterized in that: The cutter head control strategy is used to control the work of the cutter head in the chase shearing task, and the method is as follows: S100: The shearing task starts, the material keeps moving at a constant speed, and the cutter head starts to decelerate; when the shearing task starts, the position of the cutter head is the first feature point; S200: When the material moving distance reaches the first material displacement L1, the cutter head speed is reduced to 0 and starts to move in the reverse direction; the position of the cutter head when it stops decelerating is the second characteristic point; during the deceleration process, the moving distance of the cutter head is the first cutter head displacement l1; S300: When the material moving distance reaches the second material displacement L2, the cutter head stops moving in the reverse direction and starts to wait in a stationary state; the position of the cutter head when it stops moving in the reverse direction is the third characteristic point; during the reverse movement, the moving distance of the cutter head is the second cutter head displacement l2; S400: When the material moving distance reaches the third material displacement L3, the cutter head stops and waits, and starts to catch up with the material; the position where the cutter head stops and waits is the fourth characteristic point; S500: When the material movement distance reaches the fourth material displacement L4, the cutter head stops chasing the material, remains relatively still with the material and starts to shear the material; the position of the cutter head when it stops chasing the material is the fifth characteristic point; in the process of chasing the material, the moving distance of the cutter head is the fourth cutter head displacement l4; S600: When the cutter head completes shearing of the material, the tracking shearing task is completed; the position of the cutter head when the cutter head completes shearing of the material is the sixth characteristic point; during the process of shearing the material, the moving distance of the cutter head is the fifth cutter head displacement l5.
4. The method for generating an electronic cam curve according to claim 3, characterized in that: The state space includes the cumulative feeding distance, the cutter head position, the cutter holder shaft length, and the material moving speed; wherein the cumulative feeding distance is the cumulative length of the material transported by the feeding shaft, which is calculated by summing the lengths of all the materials that have been sheared; the cutter head position is represented by the distance between the real-time position and the initial position of the cutter head; the cutter holder shaft length is the distance between the initial position of the cutter head and the end of the cutter holder shaft; the material moving speed is the speed at which the material moves at a uniform speed during the shearing process.
5. The method for generating an electronic cam curve according to claim 4, characterized in that: The strategy network includes an input layer, a hidden layer, and an output layer; wherein the input layer is used to input the feature vector of the state space; the hidden layer is used to further extract the features of the state space; the output layer is used to output the selection probability of each action in the action space; the training method of the strategy network is as follows: S201: Calculate the selection probability of each action in the action space through the policy network; S202: Selecting an action from the action space based on the selection probability; S203: Update the state space and action space, and calculate the reward value of the selected action based on the reward function; S204: Calculate the cumulative reward value and update the parameters of the policy network according to the cumulative reward value; S205: Repeat steps S203 to S204 until the cumulative reward value converges and the training of the policy network is completed.
6. The method for generating an electronic cam curve according to claim 5, characterized in that: The calculation formula of the reward function is as follows: R(s j ,a j )=L j ·(1+w·α j ); Among them, R(s j ,a j ) means that in the state space s j When selecting action a j The reward value of L j represents the empty row distance of the jth selected action; w represents the weight parameter; α j represents the over-distance penalty factor for the j-th selected action; The calculation formula of the empty line distance is as follows: L j =l 1j +l 2j +l 4j ; Among them, l 1j represents the first tool head displacement in the tool head control strategy included in the j-th selected action; l 2j represents the second tool head displacement in the tool head control strategy included in the action selected for the jth time; l 4j represents the fourth tool head displacement in the tool head control strategy included in the j-th selected action; The method for assigning the distance penalty factor is as follows: Among them, l 0j represents the distance between the real-time position and the initial position of the tool head before the jth selection action; l d represents the tool holder axis length; l5 represents the fifth tool head displacement in the tool head control strategy included in any action; l s Indicates a safe reserved distance.
7. The method for generating an electronic cam curve according to claim 6, characterized in that: The shearing task list includes all shearing tasks; the method for resetting the action space and the state space is as follows: set M cutter head control strategies for each shearing task in the shearing task list; form an action with each cutter head control strategy and the corresponding shearing task, and all actions constitute the reset action space; set the accumulated feeding distance to 0, initialize the cutter head position, and the initialized cutter head position is 0 distance from the initial position; collect the actual tool holder shaft length and material movement speed and input them into the state space.
8. The method for generating an electronic cam curve according to claim 7, characterized in that: The method for generating the tool head motion curve is as follows: S501: Calculate the coordinates of each feature point in the coordinate axis of the electronic cam curve based on the tool head control strategy; the abscissa of the coordinate axis of the electronic cam curve is the accumulated moving distance of the material, and the ordinate is the distance between the tool head and the starting position; S502: constructing an equation of a motion curve segment between any two adjacent feature points, and solving the equation of the motion curve segment by using the coordinates of each feature point and the tool head moving speed; S503: Draw a motion curve segment between any two adjacent feature points using the equation of the motion curve segment, and form a cutter head motion curve for the tracking shearing task.
9. The method for generating an electronic cam curve according to claim 8, characterized in that: The equation of the motion curve segment is a cubic polynomial curve equation, and the solution method is as follows: Substitute x=vt into the equation of the motion curve segment to obtain the displacement-time equation of the motion curve segment; where x represents the horizontal coordinate of any characteristic point; t represents time; differentiate the displacement-time equation once to obtain the velocity-time equation of the motion curve segment; Substitute the coordinates of two adjacent feature points into the displacement-time equation, and substitute the tool head moving speed of the two adjacent feature points into the speed-time equation to obtain a linear equation group of the motion curve segment; solve the linear equation group to obtain the values of the parameters in the equation of the motion curve segment; The tool head moving speed at the first characteristic point is v, where v represents the material moving speed; the tool head moving speed at the second characteristic point is 0, the tool head moving speed at the third characteristic point is 0, the tool head moving speed at the fourth characteristic point is 0, the tool head moving speed at the fifth characteristic point is v, and the tool head moving speed at the sixth characteristic point is v.
10. An electronic cam device, used to implement an electronic cam curve generation method according to any one of claims 1 to 9, characterized in that: It includes task acquisition module, control strategy module, reinforcement learning module, data processing module, curve generation module and output display module; The task acquisition module is used to obtain a list of chasing and shearing tasks; The control strategy module is used to set the cutter head control strategy for each task in the chasing and shearing task list; The reinforcement learning module is used to construct an action space based on the shearing task list and the cutter head control strategy; It is also used to construct state space,policy networks, and train policy networks; The data processing module is used to calculate the coordinates of each feature point after executing each action based on the tool head control strategy; The curve generation module is used to generate an electronic cam curve based on the control strategies included in all the chasing and shearing tasks in the chasing and shearing task list; The output display module is used to visually display the electronic cam curve and supports the export of the electronic cam curve.
Citation Information
Patent Citations
Electronic cam control device and method for generating electronic cam curve
CN105739430B
Electrical control device and method of four-knife roll printing dicer
CN112305991A
Control method of topdressing shearing mechanism
CN114967590A
Multi-agent collaborative pursuit confrontation method based on P3C-MADDPG algorithm
CN117131770A
rotating SHEARS FOR ROLLER BARS
DD153859A1
Cited By
Self-adaptive electronic cam shearing motion control method and device, electronic equipment and storage medium
CN121900288A