Virtual debugging method and system, electronic equipment and storage medium

By setting a primary motion control model and a secondary motion control model in the visual interface, the problems of motion control complexity and coupling difficulty in the prior art are solved, and high flexibility and high efficiency motion control and debugging are achieved.

CN119512624APending Publication Date: 2025-02-25CONTEMPORARY AMPEREX TECHNOLOGY CO LTD +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510077276.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The existing motion control based on logic blocks is difficult to achieve complex logic control, and the coupling function between shafts is difficult to achieve, the wiring is complex and error-prone, and the motion stroke has a maximum stroke limit, which is inconvenient to control the conveyor belt, resulting in complex debugging.

Method used

By setting up a primary motion control model and a secondary motion control model in the visual interface, the control increment is calculated and the motion body movement is controlled in response to the motion instructions, and the motion control logic is separated to improve debugging flexibility.

Benefits of technology

It realizes the simplification of complex logic control and moving body coupling, reduces wiring complexity and error rate, expands the flexibility of motion stroke control, and improves debugging flexibility and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512624A_ABST
    Figure CN119512624A_ABST
Patent Text Reader

Abstract

The invention discloses a virtual debugging method and system, electronic equipment and a storage medium, and the virtual debugging method comprises the steps: responding to a setting operation of a user, and setting a first moving body and a first-stage motion control model and a second-stage motion control model of the first moving body in a visual interface; calculating a first control increment in response to the first motion instruction by a first-stage motion control model of the first motion body; and controlling the first moving body to move based on the first control increment by a secondary motion control model of the first moving body. In the scheme, the motion control of the first motion body is divided into the first-stage motion control model and the second-stage motion control model, and the first-stage motion control model and the second-stage motion control model are independently set, so that the debugging flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a virtual debugging method, system, electronic device and storage medium. Background Art

[0002] At present, the motion control of the axis is realized by using logic blocks, that is, the control logic of the axis is developed based on the logic blocks. Specifically, the defined logic blocks receive the control instructions of the PLC (Programmable Logic Controller), the logic blocks implement signal exchange inside, and output the control instructions to the servo axis. After the servo axis completes the motion action, the feedback signal is sent to the logic block, and after the signal exchange, it is returned to the PLC.

[0003] However, this kind of axis motion control based on logic blocks is difficult to achieve complex logic control, and it is very difficult to achieve the coupling function between axes. The wiring is very complicated and prone to errors. In addition, the axis motion stroke that can be defined in the logic block has a maximum stroke limit, which is not convenient for controlling the conveyor belt, making the debugging of the axis very complicated. Summary of the invention

[0004] In view of this, the present application at least provides a virtual debugging method, system, electronic device and storage medium to divide the motion control of the first moving body into a primary motion control model and a secondary motion control model, and set them separately to improve the flexibility of debugging, thereby solving the above problems.

[0005] The present application provides a virtual debugging method, which includes: in response to a user's setting operation, setting a first moving body and a primary motion control model and a secondary motion control model of the first moving body in a visual interface; the primary motion control model of the first moving body calculates a first control increment in response to a first motion instruction; and the secondary motion control model of the first moving body controls the first moving body to move based on the first control increment.

[0006] In the above scheme, the first moving body and the primary motion control model and the secondary motion control model of the first moving body are set in the visual interface, so that the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into the primary motion control model and the secondary motion control model, and they are set separately, thereby improving the flexibility of debugging.

[0007] In some embodiments, calculating the first control increment in response to the first motion instruction includes: selecting a corresponding speed-time graph from a plurality of candidate speed-time graphs based on the motion parameters of the first motion body at the current moment; and obtaining the first control increment at the next moment based on the selected speed-time graph using a preset time step.

[0008] In the above scheme, a corresponding speed-time graph is selected from a plurality of candidate speed-time graphs based on the motion parameters of the first moving body at the current moment, and a first control increment at the next moment is obtained based on the selected speed-time graph using a preset time step, so that the speed-time graph is reselected before each calculation of the first control increment, thereby improving the flexibility of debugging.

[0009] In some embodiments, the first-level motion control model of the first moving body has multiple position difference intervals and multiple speed intervals, and the multiple candidate speed-time diagrams respectively correspond to data pairs formed by the position difference intervals and the speed intervals, and the first motion instruction includes the target position of the first moving body; the selection of the corresponding speed-time diagram from the multiple candidate speed-time diagrams based on the motion parameters of the first moving body at the current moment includes: determining the position difference interval into which the difference between the target position and the current position of the first moving body falls; determining the speed interval into which the current speed of the first moving body falls; and selecting the corresponding speed-time diagram based on the fallen position difference interval and the fallen speed interval.

[0010] In the above scheme, the position difference interval into which the difference between the target position and the current position of the first moving body falls is determined by using data pairs formed by multiple candidate speed-time diagrams corresponding to the position difference interval and the speed interval respectively; the speed interval into which the current speed of the first moving body falls is determined, and then the corresponding speed-time diagram is selected based on the position difference interval and the speed interval, so as to realize rapid selection of the corresponding speed-time diagram from multiple candidate speed-time diagrams, and facilitate reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0011] In some embodiments, the first motion instruction includes the current acceleration of the first moving body; the determination of the position difference interval into which the difference between the target position and the current position of the first moving body falls includes: obtaining an expected value based on the square of the current speed of the first moving body divided by twice the current acceleration; in response to the difference between the target position and the current position of the first moving body being less than the expected value, determining that the position difference interval into which it falls is the first position difference interval; in response to the difference between the target position and the current position of the first moving body being equal to the expected value, determining that the position difference interval into which it falls is the second position difference interval; in response to the difference between the target position and the current position of the first moving body being greater than the expected value, determining that the position difference interval into which it falls is the third position difference interval.

[0012] In the above scheme, an expected value is obtained according to the square of the current speed of the first moving body divided by twice the current acceleration, and then the difference between the target position and the current position of the first moving body is compared with the expected value to determine the intervals of each position difference, so as to quickly select the corresponding speed-time diagram from multiple candidate speed-time diagrams, so as to facilitate reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0013] In some embodiments, determining the speed interval into which the current speed of the first moving body falls includes: in response to the current speed of the first moving body being less than a negative speed threshold, determining that the speed interval into which the speed falls is a first speed interval; in response to the current speed of the first moving body being greater than or equal to the negative speed threshold and less than zero, determining that the speed interval into which the speed falls is a second speed interval; in response to the current speed of the first moving body being greater than or equal to zero and less than a positive speed threshold, determining that the speed interval into which the speed falls is a third speed interval; in response to the current speed of the first moving body being greater than or equal to the positive speed threshold, determining that the speed interval into which the speed falls is a fourth speed interval.

[0014] In the above scheme, by comparing the current speed of the first moving body with the negative speed threshold, the positive speed threshold and zero, the speed intervals it falls into are determined, and the corresponding speed-time diagram is quickly selected from multiple candidate speed-time diagrams, which facilitates reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0015] In some embodiments, the first control increment includes a position increment, and obtaining the first control increment at the next moment based on the selected speed-time diagram using a preset time step includes: determining a first time point corresponding to the current moment in the speed-time diagram; determining a second time point in the speed-time diagram based on the first time point and the time step; and determining the position increment at the next moment in the speed-time diagram using the first time point and the second time point.

[0016] In the above scheme, by determining the first time point corresponding to the current moment in the speed-time diagram, determining the second time point in the speed-time diagram based on the first time point and the time step, and then using the first time point and the second time point in the speed-time diagram to determine the position increment at the next moment, the speed-time diagram is reselected before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0017] In some embodiments, in response to the user's setting operation, setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visualization interface further includes: setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visualization interface; the method also includes: in response to the first moving body and the second moving body being in a coupled state, the secondary motion control model of the second moving body controls the movement of the second moving body based on the first control increment.

[0018] In the above scheme, by setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visual interface, when the first moving body and the second moving body are in a coupled state, the secondary motion control model of the second moving body controls the movement of the second moving body based on the first control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0019] In some embodiments, the method also includes: in response to the first moving body and the second moving body being in a decoupled state, a primary motion control model of the second moving body calculates a second control increment in response to a second motion instruction; and a secondary motion control model of the second moving body controls the movement of the second moving body based on the second control increment.

[0020] In the above scheme, in response to the first moving body and the second moving body being in a decoupled state, the first-level motion control model of the second moving body calculates the second control increment in response to the second motion instruction, so that the second-level motion control model of the second moving body controls the movement of the second moving body based on the second control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection simple and easy to operate, and easy to implement complex control logic.

[0021] In some embodiments, the method further includes: in response to a user's operation on a specific visualization option in the visualization interface, setting the first moving body and the second moving body to the coupled state or the decoupled state.

[0022] In the above scheme, by responding to the user's operation on a specific visualization option in the visualization interface, the first moving body and the second moving body are set to a coupled state or a decoupled state, so that the two moving bodies can be decoupled at any time, thereby improving the flexibility of debugging.

[0023] In some embodiments, in response to the first moving body and the second moving body being in a decoupled state, calculating the second control increment by the first-level motion control model of the second moving body in response to the second motion instruction includes: calculating the motion state of the second moving body based on the first control increment by the first-level motion control model of the second moving body; generating the second control increment based on the motion state of the second moving body and the second motion instruction.

[0024] In the above scheme, when the first moving body and the second moving body are in a decoupled state, the first-level motion control model of the second moving body calculates the motion state of the second moving body based on the first control increment, so that the first-level motion control model of the second moving body generates a second control increment based on the motion state of the second moving body and the second motion instruction, thereby simplifying the coupling method of the two moving bodies, making the coupling connection simple and easy to operate, and easy to implement complex control logic.

[0025] The present application provides a virtual debugging system, which includes: a setting module, which is used to set a first moving body and a primary motion control model and a secondary motion control model of the first moving body in a visual interface in response to a user's setting operation; a primary motion control module, which is used to calculate a first control increment in response to a first motion instruction by the primary motion control model of the first moving body; and a secondary motion control module, which is used to control the movement of the first moving body based on the first control increment by the secondary motion control model of the first moving body.

[0026] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned virtual debugging method.

[0027] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned virtual debugging method is implemented.

[0028] In the above scheme, the first moving body and the primary motion control model and the secondary motion control model of the first moving body are set in the visual interface, so that the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into the primary motion control model and the secondary motion control model, and they are set separately, thereby improving the flexibility of debugging.

[0029] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0031] Figure 1 is a flowchart of a virtual debugging method provided by some embodiments of the present application; Figure 2 is a schematic diagram of a visualization interface involved in a virtual debugging method provided in some embodiments of the present application; Figure 3 It is a virtual connection diagram of a primary motion control model and a secondary motion control model involved in a virtual debugging method provided in some embodiments of the present application; Figure 4 is a schematic diagram of multiple candidate speed-time diagrams involved in the virtual debugging method provided in some embodiments of the present application; Figure 5 It is a partial flowchart of the virtual debugging method provided by some embodiments of the present application; Figure 6 is a schematic diagram of obtaining a first control increment at a next moment provided by some embodiments of the present application; Figure 7 Some embodiments of the present application provide Figure 2 Schematic diagram of the visualization interface; Figure 8 It is a virtual connection diagram of the primary motion control model and the secondary motion control model of multiple moving bodies involved in the virtual debugging method provided in some embodiments of the present application; Fig. 9 is a schematic diagram of a virtual commissioning process provided by some embodiments of the present application; Fig.10 is another schematic diagram of a virtual commissioning process provided by some embodiments of the present application; Fig.11 is a schematic diagram of the structure of a virtual debugging system provided in some embodiments of the present application; Fig.12 is a schematic diagram of the structure of an electronic device provided by some embodiments of the present application; Fig.13 It is a schematic diagram of the structure of a computer-readable storage medium provided in some embodiments of the present application. DETAILED DESCRIPTION

[0032] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0033] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0034] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0035] It is difficult to realize complex logic control based on logic blocks to realize axis motion control. It is very difficult to realize the coupling function between axes. The wiring is very complicated and prone to errors. In addition, the axis motion stroke that can be defined in the logic block has a maximum stroke limit, which is not convenient for controlling the conveyor belt, making the debugging of the axis very complicated.

[0036] To this end, the present application sets the first moving body and the primary motion control model and the secondary motion control model of the first moving body in a visual interface, so that the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into a primary motion control model and a secondary motion control model, and they are set separately to improve the flexibility of debugging.

[0037] See also Figure 1 , Figure 1: is a flowchart of a virtual debugging method provided by some embodiments of the present application. The virtual debugging method includes: step S11: in response to the user's setting operation, the first moving body and the primary motion control model and the secondary motion control model of the first moving body are set in the visual interface. Step S12: the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction. Step S13: the secondary motion control model of the first moving body controls the first moving body to move based on the first control increment.

[0038] See also Figure 2 , Figure 2 2 is a schematic diagram of a visualization interface involved in a virtual debugging method provided in some embodiments of the present application. The visualization interface 20 includes a motion area 21 and a model area 22, wherein the motion area 21 is used to set and display a motion body, such as an axis, and the motion body can move in the motion area 21. The model area 22 is used to set and display a primary motion control model 221a and a secondary motion control model 221b corresponding to the motion body on the motion area 21. For example, the motion body can be Figure 2 The first moving body 211 in.

[0039] The user's setting operation may at least include the following operations: In the motion area 21, the user may establish the first motion body 211 in the motion area 21, so that the first motion body 211 is displayed on the motion area 21. The user may set the connection relationship between the primary motion control model 221a and the secondary motion control model 221b of the first motion body 211, for example, in the model area 22, click the secondary motion control model 221b, and a corresponding setting window pops up, so as to connect the output of the primary motion control model 221a with the input of the secondary motion control model 221b. The user may set the program code of the primary motion control model 221a of the first motion body 211, for example, in the model area 22, click the primary motion control model 221a, and a corresponding program code window pops up, so as to set the program code of the primary motion control model 221a. Similarly, the user may set the program code of the secondary motion control model 221b of the first motion body 211, for example, in the model area 22, click the secondary motion control model 221b, and a corresponding program code window pops up, so as to set the program code of the secondary motion control model 221b. The user can set the program code of the primary motion control model 221a and the secondary motion control model 221b of the first moving body 211 together. For example, in the model area 22, click the secondary motion control model 221b, and the corresponding program code window pops up, thereby setting the program code of the primary motion control model 221a and the secondary motion control model 221b. The user can add a first motion instruction. For example, in the model area 22, click the primary motion control model 221a, and the corresponding instruction adding window pops up, thereby setting and adding the first motion instruction as the input of the primary motion control model 221a. The first motion instruction may include the motion parameters of the first moving body 211, for example, the motion parameters of the first moving body 211 at the current moment, so that when adding the first motion instruction, the user also sets the motion parameters of the first moving body 211.

[0040] After the user's setup operation, refer to Figure 3 , Figure 3 It is a virtual connection diagram of the primary motion control model and the secondary motion control model involved in the virtual debugging method provided by some embodiments of the present application. The first motion instruction set by the user is used as the input of the primary motion control model 221a of the first moving body 211, and the output of the primary motion control model 221a is connected to the input of the secondary motion control model 221b, that is, the first control increment output by the primary motion control model 221a is input to the secondary motion control model 221b, so that the secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the first control increment.

[0041] The first control increment may include a position increment ΔS for the first moving body 211 to move. When the setting is completed in the visualization interface 20, in response to the first movement instruction, the primary motion control model 221a of the first moving body 211 calculates and outputs the first control increment to the secondary motion control model 221b of the first moving body 211. The secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move according to the first control increment.

[0042] In this embodiment, by setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visualization interface, the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into the primary motion control model and the secondary motion control model, and they are set separately, thereby improving the flexibility of debugging.

[0043] In some embodiments, in step S12, calculating the first control increment in response to the first motion instruction includes: selecting a corresponding speed-time graph from multiple candidate speed-time graphs based on the motion parameters of the first motion body at the current moment; and obtaining the first control increment at the next moment based on the selected speed-time graph using a preset time step.

[0044] The first motion instruction may include motion parameters of the first moving body 211, for example, the motion parameters of the first moving body 211 at the current moment and the target position S of the first moving body 211. 目标 The motion parameters of the first moving body 211 at the current moment may include the current speed V of the first moving body 211 c , the current acceleration a of the first moving body 211 and the current position S of the first moving body 211 当前 .

[0045] like Figure 4 As shown, there are multiple candidate speed-time graphs. Each of the multiple candidate speed-time graphs corresponds to a data pair formed by a position difference interval and a speed interval.

[0046] The primary motion control model 221a of the first moving body 211 selects a corresponding speed-time graph from a plurality of candidate speed-time graphs according to the motion parameters of the first moving body 211 at the current moment. For example, the primary motion control model 221a of the first moving body 211 selects a corresponding speed-time graph according to the current motion parameters of the first moving body 211 at the current moment. 当前 and the target position S of the first moving body 211 目标, select the corresponding speed-time diagram from multiple candidate speed-time diagrams. At this time, Figure 4 The position difference interval and speed interval corresponding to each speed-time diagram in the first moving body 211 are compared with the current speed V c , the current acceleration a of the first moving body 211, the current position S of the first moving body 211 当前 and the target position S of the first moving body 211 目标 For example, the position difference interval corresponding to each speed-time diagram is related to the current speed V of the first moving body 211. c , the current acceleration a of the first moving body 211, the current position S of the first moving body 211 当前 and the target position S of the first moving body 211 目标 The position difference interval corresponding to each speed-time diagram is related to the current speed V of the first moving body 211. c Related.

[0047] In the selected speed-time diagram, based on the current speed V of the first moving body 211 c With the current acceleration a and the preset time step △t, the first control increment at the next moment, such as the position increment △S, can be obtained.

[0048] In this embodiment, a corresponding speed-time graph is selected from a plurality of candidate speed-time graphs based on the motion parameters of the first moving body at the current moment, and a first control increment at the next moment is obtained based on the selected speed-time graph using a preset time step, so that the speed-time graph is reselected before each calculation of the first control increment, thereby improving the flexibility of debugging.

[0049] In some embodiments, a first-level motion control model of a first moving body has multiple position difference intervals and multiple speed intervals, and multiple candidate speed-time diagrams respectively correspond to data pairs formed by the position difference intervals and the speed intervals, and a first motion instruction includes a target position of the first moving body; selecting a corresponding speed-time diagram from multiple candidate speed-time diagrams based on the motion parameters of the first moving body at a current moment includes: determining the position difference interval into which the difference between the target position and the current position of the first moving body falls; determining the speed interval into which the current speed of the first moving body falls; and selecting a corresponding speed-time diagram based on the position difference interval and the speed interval.

[0050] In the primary motion control model 221a of the first moving body 211, the plurality of position difference intervals are based on the current speed V of the first moving body 211. c , the current acceleration a of the first moving body 211, the current position S of the first moving body 211 当前 and the target position S of the first moving body 211目标 Specifically, compare the target position S 目标 The current position S of the first moving body 211 当前 The difference between the current speed V of the first moving body 211 c The square of is divided by twice the value of the current acceleration a, thereby dividing into multiple position difference intervals.

[0051] In the primary motion control model 221a of the first moving body 211, there is a preset speed threshold V max , multiple speed intervals are based on the preset speed threshold V max Specifically, the preset speed threshold V max and zero and the current speed of the first moving body 211, thereby dividing a plurality of speed intervals.

[0052] Each speed-time graph among the plurality of candidate speed-time graphs corresponds to a data pair formed by a position difference interval and a speed interval, that is, each speed-time graph corresponds to a position difference interval and a speed interval.

[0053] In the process of selecting a corresponding speed-time diagram from a plurality of candidate speed-time diagrams, the target position S of the first moving body 211 is determined. 目标 The current position S of the first moving body 211 当前 The current speed V of the first moving body 211 is determined by the position difference interval into which the difference falls. c The speed interval falls into, so that since multiple candidate speed-time diagrams correspond to data pairs formed by the position difference interval and the speed interval respectively, selection is made from the multiple candidate speed-time diagrams according to the position difference interval and the speed interval.

[0054] In this embodiment, the position difference interval into which the difference between the target position and the current position of the first moving body falls is determined by using data pairs formed by multiple candidate speed-time graphs corresponding to position difference intervals and speed intervals respectively; the speed interval into which the current speed of the first moving body falls is determined, and then the corresponding speed-time graph is selected based on the position difference interval and the speed interval, so as to quickly select the corresponding speed-time graph from multiple candidate speed-time graphs, facilitate reselection of the speed-time graph before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0055] In some embodiments, the first motion instruction includes the current acceleration of the first moving body; determining the position difference interval into which the difference between the target position and the current position of the first moving body falls includes: obtaining an expected value based on the square of the current speed of the first moving body divided by twice the current acceleration; in response to the difference between the target position and the current position of the first moving body being less than the expected value, determining that the position difference interval into which it falls is the first position difference interval; in response to the difference between the target position and the current position of the first moving body being equal to the expected value, determining that the position difference interval into which it falls is the second position difference interval; in response to the difference between the target position and the current position of the first moving body being greater than the expected value, determining that the position difference interval into which it falls is the third position difference interval.

[0056] The expected value is the square of the current velocity of the first moving body 211 divided by twice the current acceleration, that is, V c 2 / 2a.

[0057] In the primary motion control model 221a of the first moving body 211, a plurality of position difference intervals are divided according to the current speed of the first moving body 211, the current acceleration of the first moving body 211, the current position of the first moving body 211, and the target position of the first moving body 211. Specifically, the difference between the target position and the current position of the first moving body 211 is compared with the expected value, thereby dividing a plurality of position difference intervals.

[0058] like Figure 4 As shown in FIG. 1 , when the difference between the target position and the current position of the first moving body 211 is less than the expected value, the corresponding position difference interval is the first position difference interval, that is, S 目标 -S 当前 <V c 2 / 2a, that is, the first position difference interval is S 目标 -S 当前 <V c 2 / 2a. When the difference between the target position and the current position of the first moving body 211 is equal to the expected value, the corresponding position difference interval is the second position difference interval, that is, S 目标 -S 当前 = V c 2 / 2a, that is, the second position difference interval is S 目标 -S 当前 = V c 2 / 2a. When the difference between the target position and the current position of the first moving body 211 is greater than the expected value, the corresponding position difference interval is the third position difference interval, that is, S 目标 -S 当前 >Vc 2 / 2a, that is, the third position difference interval is S 目标 -S 当前 >V c 2 / 2a.

[0059] Accordingly, when determining the position difference interval into which the difference between the target position and the current position of the first moving body 211 falls, when the difference between the target position and the current position of the first moving body 211 is less than the expected value, the position difference interval into which it falls is the first position difference interval, that is, S 目标 -S 当前 <V c 2 / 2a. When the difference between the target position and the current position of the first moving body 211 is equal to the expected value, the position difference interval falls into is the second position difference interval, that is, S 目标 -S 当前 = V c 2 When the difference between the target position and the current position of the first moving body 211 is greater than the expected value, the position difference interval falls into the third position difference interval, that is, S 目标 -S 当前 >V c 2 / 2a.

[0060] In this embodiment, an expected value is obtained based on the square of the current speed of the first moving body divided by twice the current acceleration, and then the difference between the target position and the current position of the first moving body is compared with the expected value to determine the intervals of each position difference, so as to quickly select the corresponding speed-time diagram from multiple candidate speed-time diagrams, so as to facilitate reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0061] In some embodiments, determining the speed interval into which the current speed of the first moving body falls includes: in response to the current speed of the first moving body being less than a negative speed threshold, determining that the speed interval into which it falls is the first speed interval; in response to the current speed of the first moving body being greater than or equal to a negative speed threshold and less than zero, determining that the speed interval into which it falls is the second speed interval; in response to the current speed of the first moving body being greater than or equal to zero and less than a positive speed threshold, determining that the speed interval into which it falls is the third speed interval; in response to the current speed of the first moving body being greater than or equal to a positive speed threshold, determining that the speed interval into which it falls is the fourth speed interval.

[0062] In the primary motion control model 221a of the first moving body 211, there is a preset speed threshold V max , multiple speed intervals are based on the preset speed threshold V maxSpecifically, the preset speed threshold V max and 0 and the current speed V of the first moving body 211 c , thus dividing the speed range into multiple ranges.

[0063] In the primary motion control model 221a of the first moving body 211, a moving direction of the first moving body 211 is a positive direction, and the opposite direction of the moving direction is a negative direction. For example, Figure 2 The moving direction of the first moving body 211 marked by the arrow is the positive direction, and the opposite direction indicated by the arrow is the negative direction. Accordingly, the speed of the first moving body 211 moving in the positive direction is the positive speed, and the speed of the first moving body 211 moving in the negative direction is the negative speed. Similarly, in the primary motion control model 221a of the first moving body 211, the speed threshold V max That is the positive speed threshold V max , also has a negative speed threshold -V max , positive speed threshold V max The corresponding direction is the positive direction of the first moving body 211 , and the direction corresponding to the negative speed threshold −Vmax is the negative direction of the first moving body 211 .

[0064] like Figure 4 As shown, when the current speed V of the first moving body 211 is c Less than negative speed threshold -V max When , the corresponding speed interval is the first speed interval, that is, V c <-V max , that is, the first speed interval is V c <-V max When the current speed V of the first moving body 211 is c Greater than or equal to negative speed threshold -V max and is less than zero, the corresponding speed interval is the second speed interval, i.e. -V max ≤V c <0, that is, the second speed range is -V max ≤V c <0. When the current speed Vc of the first moving body 211 is greater than or equal to zero and less than the positive speed threshold V max When , the corresponding speed interval is the third speed interval, that is, 0≤V c <V max , that is, the third speed range is 0≤V c <V max When the current speed V of the first moving body 211 is c Greater than or equal to the positive speed threshold V max , the corresponding speed interval is the fourth speed interval, namely V max ≤V c, that is, the fourth speed interval is V max ≤V c .

[0065] Accordingly, the current speed V of the first moving body 211 is determined c When the current speed V of the first moving body 211 falls into the speed interval, c Less than negative speed threshold -V max When , the speed interval falls into the first speed interval, that is, V c <-V max When the current speed V of the first moving body 211 is c Greater than or equal to negative speed threshold -V max When it is less than zero, the speed interval it falls into is the second speed interval, i.e. -V max ≤V c <0. When the current speed V of the first moving body 211 c Greater than or equal to zero and less than the positive speed threshold V max When , the speed interval falls into the third speed interval, that is, 0≤V c <V max When the current speed V of the first moving body 211 is c Greater than or equal to the positive speed threshold V max , the speed interval it falls into is the fourth speed interval, that is, V max ≤V c .

[0066] In this embodiment, by comparing the current speed of the first moving body with the negative speed threshold, the positive speed threshold and zero, the speed intervals it falls into are determined, and a corresponding speed-time diagram is quickly selected from multiple candidate speed-time diagrams, which facilitates reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0067] In some embodiments, the first control increment comprises a position increment. Figure 5 , Figure 5 It is a partial flow chart of the virtual debugging method provided by some embodiments of the present application. Using the preset time step to obtain the first control increment at the next moment based on the selected speed-time diagram includes: step S51: determining the first time point corresponding to the current moment in the speed-time diagram. Step S52: determining the second time point in the speed-time diagram based on the first time point and the time step. Step S53: determining the position increment at the next moment in the speed-time diagram using the first time point and the second time point.

[0068] Assume that the difference between the target position and the current position of the first moving body 211 is greater than the expected value, and the current speed V of the first moving body 211 is c Less than negative speed threshold -Vmax When , the position difference interval falls into the third position difference interval, that is, S 目标 -S 当前 >V c 2 / 2a, the speed interval it falls into is the first speed interval, that is, V c <-V max , at this time, if Figure 4 As shown, the selected speed-time diagram is the speed-time diagram on the upper left, that is, Figure 6 The speed-time diagram shown in .

[0069] like Figure 6 As shown, the speed-time diagram selected is used as an example to illustrate obtaining the first control increment at the next moment. First, according to the motion parameters of the first moving body 211 at the current moment, for example, the current speed V c , from the selected speed-time graph, determine the first time point corresponding to the current moment, that is, T1, that is, the current moment is the first time point T1. Subsequently, in the selected speed-time graph, based on the first time point T1 and the time step △t, determine the second time point T2, that is, T2=T1+△t. Subsequently, the first time point T1 and the second time point T2 are used to determine the position increment at the next moment in the selected speed-time graph, that is, in the selected speed-time graph, the coordinate values ​​corresponding to the first time point T1 and the second time point T2 are used to calculate the corresponding area as the position increment at the next moment.

[0070] In this embodiment, by determining the first time point corresponding to the current moment in the speed-time graph, determining the second time point in the speed-time graph based on the first time point and the time step, and then using the first time point and the second time point in the speed-time graph to determine the position increment at the next moment, the speed-time graph is reselected before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0071] In some embodiments, in step S11, in response to the user's setting operation, setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visualization interface further includes: setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visualization interface. The virtual debugging method also includes: in response to the first moving body and the second moving body being in a coupled state, the secondary motion control model of the second moving body controls the second moving body to move based on the first control increment.

[0072] See also Figure 7 , Figure 7 Some embodiments of the present application provide Figure 2The model area 22 is also used to set and display the association status between multiple moving bodies on the motion area 21. For example, the model area 22 includes a specific visualization option 223 for setting the association status between multiple moving bodies on the motion area 21.

[0073] The user's setting operation may further include at least the following operations: In the motion area 21, the user may establish the second motion body 212 in the motion area 21, so that the second motion body 212 is displayed on the motion area 21. The user may set the connection relationship between the primary motion control model 222a and the secondary motion control model 222b of the second motion body 212, for example, in the model area 22, click the secondary motion control model 222b of the second motion body 212, and a corresponding setting window pops up, so as to connect the output of the primary motion control model 222a of the second motion body 212 with the input of the secondary motion control model 222b of the second motion body 212. The user may set the program code of the primary motion control model 222a of the second motion body 212, for example, in the model area 22, click the primary motion control model 222a of the second motion body 212, and a corresponding program code window pops up, so as to set the program code of the primary motion control model 222a of the second motion body 212. Similarly, the user can set the program code of the secondary motion control model 222b of the second moving body 212, for example, in the model area 22, click the secondary motion control model 222b of the second moving body 212, and a corresponding program code window pops up, thereby setting the program code of the secondary motion control model 222b of the second moving body 212. The user can set the program code of the primary motion control model 222a and the secondary motion control model 222b of the second moving body 212 together, for example, in the model area 22, click the secondary motion control model 222b of the second moving body 212, and a corresponding program code window pops up, thereby setting the program code of the primary motion control model 222a and the secondary motion control model of the second moving body 212. The user can set the association state between the first moving body 211 and the second moving body 212, for example, in the model area 22, click the specific visualization option 223, thereby generating a coupling instruction for indicating the association state between the first moving body 211 and the second moving body 212.

[0074] After the user's setup operation, see Figure 8 , Figure 8It is a virtual connection diagram of the primary motion control model and the secondary motion control model of two moving bodies involved in the virtual debugging method provided by some embodiments of the present application. The first motion instruction set by the user is used as the input of the primary motion control model 221a of the first moving body 211, and the output of the primary motion control model 221a of the first moving body 211 is connected with the input of the secondary motion control model 221b of the first moving body 211, that is, the first control increment output by the primary motion control model 221a of the first moving body 211 is input to the secondary motion control model 221b of the first moving body 211, so that the secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the first control increment.

[0075] The output of the primary motion control model 221a of the first moving body 211 is also connected to the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212, that is, the output of the primary motion control model 221a of the first moving body 211 is used as the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. At the same time, the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212 also includes a coupling instruction, that is, the coupling instruction is input to the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212.

[0076] The association state between the first moving body 211 and the second moving body 212 includes that the first moving body 211 and the second moving body 212 are in a coupled state. When the coupling instruction indicates that the first moving body 211 and the second moving body 212 are in a coupled state, the first control increment output by the primary motion control model 221a of the first moving body 211 is input to the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. At this time, the secondary motion control model 222b of the second moving body 212 controls the second moving body 212 to move or move based on the first control increment.

[0077] In this embodiment, by setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visualization interface, when the first moving body and the second moving body are in a coupled state, the secondary motion control model of the second moving body controls the movement of the second moving body based on the first control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0078] In some embodiments, the virtual debugging method also includes: in response to the first moving body and the second moving body being in a decoupled state, the first-level motion control model of the second moving body calculates a second control increment in response to the second motion instruction; and the second-level motion control model of the second moving body controls the movement of the second moving body based on the second control increment.

[0079] The association state between the first moving body 211 and the second moving body 212 includes that the first moving body 211 and the second moving body 212 are in a decoupled state. When the coupling instruction indicates that the first moving body 211 and the second moving body 212 are in a decoupled state, the first control increment output by the primary motion control model of the first moving body 211 is not input into the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. At this time, the second moving body 212 is independent of the first moving body 211. The primary motion control model of the first moving body 211 calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body 211 controls the first moving body 211 to move based on the first control increment. Similarly, in response to the coupling instruction, the primary motion control model 222a of the second moving body 212 calculates the second control increment in response to the second motion instruction, and the secondary motion control model 222b of the second moving body 212 controls the second moving body 212 to move based on the second control increment.

[0080] The second control increment may include a position increment ΔS of the second moving body 212. If the first moving body 211 and the second moving body 212 are in a decoupled state from the beginning, the process of calculating the second control increment in response to the second motion instruction is the same or similar to the process of calculating the first control increment in response to the first motion instruction, and will not be described here.

[0081] In the present embodiment, in response to the first moving body and the second moving body being in a decoupled state, the first-level motion control model of the second moving body calculates the second control increment in response to the second motion instruction, so that the second-level motion control model of the second moving body controls the movement of the second moving body based on the second control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0082] In some embodiments, the virtual debugging method further includes: in response to a user's operation on a specific visualization option in the visualization interface, setting the first moving body and the second moving body to a coupled state or a decoupled state.

[0083] like Figure 8As shown, the model area 22 is also used to set and display the association status between multiple moving bodies on the motion area 21. For example, the model area 22 includes a specific visualization option 223, and the specific visualization option 223 is operated to generate a coupling instruction, thereby indicating the association status between multiple moving bodies on the motion area 21.

[0084] The user can set the association state between the first moving body 211 and the second moving body 212, for example, in the model area 22, click the specific visualization option 223, so as to set the association state between the first moving body 211 and the second moving body 212. The association state between the first moving body 211 and the second moving body 212 includes the first moving body 211 and the second moving body 212 being in a coupled state and the first moving body 211 and the second moving body 212 being in a decoupled state. That is, the user's operation on the specific visualization option 223 in the visualization interface 20, i.e., clicking, sets the first moving body 211 and the second moving body 212 to a coupled state or a decoupled state.

[0085] In this embodiment, by responding to the user's operation on a specific visualization option in the visualization interface, the first moving body and the second moving body are set to a coupled state or a decoupled state, so that the two moving bodies can be decoupled at any time, thereby improving the flexibility of debugging.

[0086] In some embodiments, in response to the first moving body and the second moving body being in a decoupled state, calculating the second control increment by the first-level motion control model of the second moving body in response to the second motion instruction includes: calculating the motion state of the second moving body based on the first control increment by the first-level motion control model of the second moving body; generating the second control increment based on the motion state of the second moving body and the second motion instruction.

[0087] like Figure 8 As shown, the specific visualization option 223 of the model area 22 is operated to generate a coupling instruction, indicating that the first moving body 211 and the second moving body 212 are in a coupled state. At this time, the primary motion control model 221a of the first moving body 211 calculates the first control increment in response to the first motion instruction, the secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the first control increment, and the secondary motion control model 222b of the second moving body 212 controls the second moving body 212 to move based on the first control increment.

[0088] At this time, the specific visualization option 223 of the model area 22 is operated again to generate a coupling instruction, indicating that the first moving body 211 and the second moving body 212 are in a decoupled state. At this time, the primary motion control model 221a of the first moving body 211 continues to calculate the first control increment in response to the first motion instruction, and the secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the first control increment. The primary motion control model 222a of the second moving body 212 calculates the motion state of the second moving body 212 based on the first control increment, and generates a second control increment based on the motion state of the second moving body 212 and the second motion instruction.

[0089] That is, when the specific visualization option 223 of the model area 22 is operated so that the association state between the first moving body 211 and the second moving body 212 is switched from a coupled state to a decoupled state, the first-level motion control model 222a of the second moving body 212 calculates the motion state of the second moving body 212 based on the first control increment, and generates a second control increment based on the motion state of the second moving body 212 and the second motion instruction.

[0090] The motion state of the second moving body 212 may include relevant motion parameters of the second moving body 212 controlled by the secondary motion control model 222 b of the second moving body 212 based on the first control increment, for example, including the current displacement of the second moving body 212 .

[0091] In the present embodiment, when the first moving body and the second moving body are in a decoupled state, the first-level motion control model of the second moving body calculates the motion state of the second moving body based on the first control increment, so that the first-level motion control model of the second moving body generates a second control increment based on the motion state of the second moving body and the second motion instruction, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0092] In some embodiments, see Fig. 9 , Fig. 9 Schematic diagram of a virtual commissioning process provided by some embodiments of the present application. The virtual commissioning process includes the following steps: Step S91: Setting the first moving body 211 and its primary motion control model 221a and secondary motion control model 221b.

[0093] like Figure 2 As shown, the user can set the first moving body 211 and the primary motion control model 221 a and the secondary motion control model 221 b of the first moving body 211 in the visualization interface 20 .

[0094] Specifically, in the motion area 21, the user can establish the first motion body 211 in the motion area 21, so that the first motion body 211 is displayed on the motion area 21. The user can set the connection relationship between the primary motion control model 221a and the secondary motion control model 221b of the first motion body 211, for example, in the model area 22, click the secondary motion control model 221b, and the corresponding setting window pops up, so as to connect the output of the primary motion control model 221a with the input of the secondary motion control model 221b. The user can set the program code of the primary motion control model 221a, for example, in the model area 22, click the primary motion control model 221a, and the corresponding program code window pops up, so as to set the program code of the primary motion control model 221a. Similarly, the user can set the program code of the secondary motion control model 221b, for example, in the model area 22, click the secondary motion control model 221b, and the corresponding program code window pops up, so as to set the program code of the secondary motion control model 221b. The user can set the program code of the primary motion control model 221a and the secondary motion control model 221b together. For example, in the model area 22, click on the secondary motion control model 221b, and a corresponding program code window pops up, thereby setting the program code of the primary motion control model 221a and the secondary motion control model 221b. The user can add a first motion instruction. For example, in the model area 22, click on the primary motion control model 221a, and a corresponding instruction adding window pops up, thereby setting and adding the first motion instruction as the input of the primary motion control model 221a. The first motion instruction may include the motion parameters of the first moving body 211, for example, the motion parameters of the first moving body 211 at the current moment, so that when adding the first motion instruction, the user also sets the motion parameters of the first moving body 211.

[0095] Accordingly, if Figure 3 As shown, the first motion instruction set by the user is used as the input of the primary motion control model 221a, and the output of the primary motion control model 221a is connected to the input of the secondary motion control model 221b. At the same time, the state synchronization instruction is used as the input of the primary motion control model 221a to indicate that in the initial state, the initial state of the first moving body 211 output by the secondary motion control model 221b is synchronized to the primary motion control model 221a, thereby realizing the synchronization of the primary motion control model 221a and the secondary motion control model 221b with respect to the initial state. For example, the state synchronization instruction indicates that the position of the first moving body 211 in the initial state output by the secondary motion control model 221b is synchronized to the primary motion control model 221a.

[0096] Step S92: The primary motion control model 221 a of the first moving body 211 calculates the position increment ΔS.

[0097] The primary motion control model 221a of the first moving body 211 calculates the position increment ΔS in response to the first motion instruction. Specifically, in the primary motion control model 221a of the first moving body 211, based on the motion parameters of the first moving body 211 at the current moment, Figure 4 Select a corresponding speed-time diagram from the multiple candidate speed-time diagrams shown. Assume that the selected speed-time diagram is Figure 4 The speed-time diagram in the upper left of the figure. Figure 6 As shown, according to the motion parameters of the first moving body 211 at the current moment, for example, the current speed, the first time point corresponding to the current moment is determined from the selected speed-time diagram, that is, T1. Subsequently, in the selected speed-time diagram, based on the first time point T1 and the time step △t, the second time point T2 is determined, that is, T2=T1+△t. Subsequently, the position increment at the next moment is determined using the first time point T1 and the second time point T2 in the selected speed-time diagram, that is, in the selected speed-time diagram, the corresponding coordinate values ​​corresponding to the first time point T1 and the second time point T2 are used to calculate the corresponding area as the position increment at the next moment. Furthermore, the primary motion control model 221a of the first moving body 211 inputs the position increment at the next moment into the secondary motion control model 221b of the first moving body 211.

[0098] Step S93: The secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the position increment ΔS.

[0099] The secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the position increment ΔS. Thus, the secondary motion control model 221b of the first moving body 211 obtains the position of the first moving body 211 at the next moment, and inputs the position at the next moment into the primary motion control model 221a of the first moving body 211, so that the primary motion control model 221a of the first moving body 211 calculates the subsequent position increment.

[0100] See also Fig.10 , Fig.10 1 is another schematic diagram of a virtual debugging process provided by some embodiments of the present application. The virtual debugging process includes the following steps: Step S101: setting the first moving body 211 and its primary motion control model 221a and secondary motion control model 221b and the second moving body 212 and its primary motion control model 222a and secondary motion control model 222b.

[0101] Relative to Fig. 9The setting of step S91 in step S101 also includes setting the second moving body 212 and the primary motion control model 222a and the secondary motion control model 222b of the second moving body 212 in the visualization interface 20.

[0102] Specifically, Figure 7 As shown, in the motion area 21, the user can establish the second motion body 212 in the motion area 21, so that the second motion body 212 is displayed on the motion area 21. The user can set the connection relationship between the primary motion control model 222a and the secondary motion control model 222b of the second motion body 212, for example, in the model area 22, click the secondary motion control model 222b, and the corresponding setting window pops up, so as to connect the output of the primary motion control model 222a with the input of the secondary motion control model 222b. The user can set the program code of the primary motion control model 222a, for example, in the model area 22, click the primary motion control model 222a, and the corresponding program code window pops up, so as to set the program code of the primary motion control model 222a. Similarly, the user can set the program code of the secondary motion control model 222b, for example, in the model area 22, click the secondary motion control model 222b, and the corresponding program code window pops up, so as to set the program code of the secondary motion control model 222b. The user can set the program code of the primary motion control model 222a and the secondary motion control model 222b together, for example, in the model area 22, click the secondary motion control model 222b, and pop up the corresponding program code window, so as to set the program code of the primary motion control model 222a and the secondary motion control model 222b. The user can set the association state between the first moving body 211 and the second moving body 212, for example, in the model area 22, click the specific visualization option 223, so as to generate a coupling instruction for indicating the association state between the first moving body 211 and the second moving body 212.

[0103] Accordingly, if Figure 8As shown, the first motion instruction set by the user is used as the input of the primary motion control model 221a of the first moving body 211, and the output of the primary motion control model 221a of the first moving body 211 is connected to the input of the secondary motion control model 221b of the first moving body 211. At the same time, the state synchronization instruction is used as the input of the primary motion control model 221a of the first moving body 211, which is used to indicate that in the initial state, the initial state of the first moving body 211 output by the secondary motion control model 221b of the first moving body 211 is synchronized to the primary motion control model 221a of the first moving body 211, so as to achieve synchronization of the primary motion control model 221a of the first moving body 211 and the secondary motion control model 221b of the first moving body 211 with respect to the initial state. For example, the state synchronization instruction indicates that the position of the first moving body 211 in the initial state output by the secondary motion control model 221b of the first moving body 211 is synchronized to the primary motion control model 221a of the first moving body 211. Similarly, the output of the primary motion control model 222a of the second moving body 212 is connected to the input of the secondary motion control model 222b of the second moving body 212. At the same time, the state synchronization instruction is used as the input of the primary motion control model 222a of the second moving body 212, which is used to indicate that in the initial state, the initial state of the second moving body 212 output by the secondary motion control model 222b of the second moving body 212 is synchronized to the primary motion control model 222a of the second moving body 212, thereby realizing the synchronization of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212 with respect to the initial state. For example, the state synchronization instruction indicates that the position of the second moving body 212 in the initial state output by the secondary motion control model 222b of the second moving body 212 is synchronized to the primary motion control model 222a of the second moving body 212.

[0104] The output of the primary motion control model 221a of the first moving body 211 is also connected to the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212, that is, the output of the primary motion control model 221a of the first moving body 211 is used as the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. At the same time, the input of the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212 also includes a coupling instruction, that is, the coupling instruction is input to the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. It should be noted that when the first moving body 211 needs to be coupled with other moving bodies, although not shown in the figure, the input of the first-level motion control model 221a of the first moving body 211 and the second-level motion control model 221b of the first moving body 211 may also include coupling instructions, which is the same as or similar to the input of the first-level motion control model 222a of the second moving body 212 and the second-level motion control model 222b of the second moving body 212 also including coupling instructions, and will not be explained here.

[0105] Step S102 : The primary motion control model 221 a of the first moving body 211 calculates the position increment ΔS.

[0106] The process of calculating the position increment ΔS by the primary motion control model 221 a of the first moving body 211 in step S102 is the same as the process of calculating the position increment ΔS by the primary motion control model 221 a of the first moving body 211 in step S92 , and will not be described again.

[0107] Step S103: The secondary motion control model 221b of the first moving body 211 controls the movement of the first moving body 211 based on the position increment △S, and in response to the coupling instruction indicating that the first moving body 211 and the second moving body 212 are in a coupled state, the secondary control model of the second moving body 212 controls the movement of the second moving body 212 based on the position increment.

[0108] The secondary motion control model 221b of the first moving body 211 controls the first moving body 211 to move based on the position increment ΔS. Thus, the secondary motion control model 221b of the first moving body 211 obtains the position of the first moving body 211 at the next moment, and inputs the position at the next moment into the primary motion control model 221a of the first moving body 211, so that the primary motion control model 221a of the first moving body 211 calculates the subsequent position increment.

[0109] like Figure 8As shown, since the output of the first-level motion control model 221a of the first moving body 211 is also connected with the input of the first-level motion control model 222a of the second moving body 212 and the second-level motion control model 222b of the second moving body 212, that is, the output of the first-level motion control model 221a of the first moving body 211 is used as the input of the first-level motion control model 222a of the second moving body 212 and the second-level motion control model 222b of the second moving body 212, the input of the first-level motion control model 222a of the second moving body 212 and the second-level motion control model 222b of the second moving body 212 also includes coupling instructions, that is, the coupling instructions are input into the first-level motion control model 222a of the second moving body 212 and the second-level motion control model 222b of the second moving body 212. When the coupling instruction indicates that the first moving body 211 and the second moving body 212 are in a coupling state, the position increment △S output by the primary motion control model 221a of the first moving body 211 is input to the primary motion control model 222a of the second moving body 212 and the secondary motion control model 222b of the second moving body 212. At this time, the secondary motion control model 222b of the second moving body 212 controls the second moving body 212 to move or move based on the position increment. Thus, the secondary motion control model 222b of the second moving body 212 obtains the position of the second moving body 212 at the next moment, and inputs the position at the next moment to the primary motion control model 222a of the second moving body 212.

[0110] See also Fig.11 , Fig.11 1 is a schematic diagram of the structure of a virtual debugging system provided by some embodiments of the present application. The virtual debugging system 110 includes a setting module 111, a primary motion control module 112, and a secondary motion control module 113. Among them, the setting module 111 is used to set the first moving body and the primary motion control model and the secondary motion control model of the first moving body in a visual interface in response to the user's setting operation. The primary motion control module 112 is used to calculate the first control increment by the primary motion control model of the first moving body in response to the first motion instruction. The secondary motion control module 113 is used to control the first moving body to move based on the first control increment by the secondary motion control model of the first moving body. In this embodiment, by setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visualization interface, the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into the primary motion control model and the secondary motion control model, and they are set separately, thereby improving the flexibility of debugging.

[0111] In some embodiments, the first-level motion control module 112 is used to select a corresponding speed-time graph from multiple candidate speed-time graphs based on the motion parameters of the first moving body at the current moment; and obtain the first control increment at the next moment based on the selected speed-time graph using a preset time step.

[0112] In this embodiment, a corresponding speed-time graph is selected from a plurality of candidate speed-time graphs based on the motion parameters of the first moving body at the current moment, and a first control increment at the next moment is obtained based on the selected speed-time graph using a preset time step, so that the speed-time graph is reselected before each calculation of the first control increment, thereby improving the flexibility of debugging.

[0113] In some embodiments, the first-level motion control model of the first moving body has multiple position difference intervals and multiple speed intervals, and the multiple candidate speed-time diagrams respectively correspond to the data pairs formed by the position difference intervals and the speed intervals, and the first motion instruction includes the target position of the first moving body; the first-level motion control module 112 is used to: determine the position difference interval into which the difference between the target position and the current position of the first moving body falls; determine the speed interval into which the current speed of the first moving body falls; and select the corresponding speed-time diagram based on the position difference interval and the speed interval.

[0114] In this embodiment, the position difference interval into which the difference between the target position and the current position of the first moving body falls is determined by using data pairs formed by multiple candidate speed-time graphs corresponding to position difference intervals and speed intervals respectively; the speed interval into which the current speed of the first moving body falls is determined, and then the corresponding speed-time graph is selected based on the position difference interval and the speed interval, so as to quickly select the corresponding speed-time graph from multiple candidate speed-time graphs, facilitate reselection of the speed-time graph before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0115] In some embodiments, the first motion instruction includes the current acceleration of the first moving body; the first-level motion control module 112 is used to: obtain an expected value based on the square of the current speed of the first moving body divided by twice the current acceleration; in response to the difference between the target position and the current position of the first moving body being less than the expected value, determine that the position difference interval falls into is the first position difference interval; in response to the difference between the target position and the current position of the first moving body being equal to the expected value, determine that the position difference interval falls into is the second position difference interval; in response to the difference between the target position and the current position of the first moving body being greater than the expected value, determine that the position difference interval falls into is the third position difference interval.

[0116] In this embodiment, an expected value is obtained based on the square of the current speed of the first moving body divided by twice the current acceleration, and then the difference between the target position and the current position of the first moving body is compared with the expected value to determine the intervals of each position difference, so as to quickly select the corresponding speed-time diagram from multiple candidate speed-time diagrams, so as to facilitate reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0117] In some embodiments, the first-level motion control module 112 is used to: in response to the current speed of the first moving body being less than a negative speed threshold, determine that the speed interval into which it falls is a first speed interval; in response to the current speed of the first moving body being greater than or equal to the negative speed threshold and less than zero, determine that the speed interval into which it falls is a second speed interval; in response to the current speed of the first moving body being greater than or equal to zero and less than a positive speed threshold, determine that the speed interval into which it falls is a third speed interval; in response to the current speed of the first moving body being greater than or equal to the positive speed threshold, determine that the speed interval into which it falls is a fourth speed interval.

[0118] In this embodiment, by comparing the current speed of the first moving body with the negative speed threshold, the positive speed threshold and zero, the speed intervals it falls into are determined, and a corresponding speed-time diagram is quickly selected from multiple candidate speed-time diagrams, which facilitates reselection of the speed-time diagram before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0119] In some embodiments, the first control increment includes a position increment, and the first-level motion control module 112 is used to: determine a first time point corresponding to the current moment in the speed-time graph; determine a second time point in the speed-time graph based on the first time point and the time step; and determine the position increment at the next moment in the speed-time graph using the first time point and the second time point.

[0120] In this embodiment, by determining the first time point corresponding to the current moment in the speed-time graph, determining the second time point in the speed-time graph based on the first time point and the time step, and then using the first time point and the second time point in the speed-time graph to determine the position increment at the next moment, the speed-time graph is reselected before calculating the first control increment each time, thereby improving the flexibility of debugging.

[0121] In some embodiments, the setting module 111 is also used to set the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visual interface. The virtual debugging system 110 also includes a secondary motion control module of the second moving body (not shown in the figure), which is used to control the second moving body to move based on the first control increment in response to the first moving body and the second moving body being in a coupled state.

[0122] In this embodiment, by setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visualization interface, when the first moving body and the second moving body are in a coupled state, the secondary motion control model of the second moving body controls the movement of the second moving body based on the first control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0123] In some embodiments, the virtual debugging system 110 further includes a primary motion control module (not shown) of a second moving body, which is used to calculate a second control increment in response to the second motion instruction in response to the first moving body and the second moving body being in a decoupled state. The primary motion control model module of the second moving body is used to control the second moving body to move based on the second control increment.

[0124] In the present embodiment, in response to the first moving body and the second moving body being in a decoupled state, the first-level motion control model of the second moving body calculates the second control increment in response to the second motion instruction, so that the second-level motion control model of the second moving body controls the movement of the second moving body based on the second control increment, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0125] In some embodiments, the setting module 111 is further configured to set the first moving body and the second moving body to the coupled state or the decoupled state in response to a user's operation on a specific visualization option in the visualization interface.

[0126] In this embodiment, by responding to the user's operation on a specific visualization option in the visualization interface, the first moving body and the second moving body are set to a coupled state or a decoupled state, so that the two moving bodies can be decoupled at any time, thereby improving the flexibility of debugging.

[0127] In some embodiments, the first-level motion control model module of the second moving body is used to: calculate the motion state of the second moving body based on the first control increment by the first-level motion control model of the second moving body; and generate the second control increment based on the motion state of the second moving body and the second motion instruction.

[0128] In the present embodiment, when the first moving body and the second moving body are in a decoupled state, the first-level motion control model of the second moving body calculates the motion state of the second moving body based on the first control increment, so that the first-level motion control model of the second moving body generates a second control increment based on the motion state of the second moving body and the second motion instruction, thereby simplifying the coupling method of the two moving bodies, making the coupling connection concise, easy to operate, and easy to implement complex control logic.

[0129] See also Fig.12 , Fig.12 1 is a schematic diagram of the structure of an electronic device provided in some embodiments of the present application. The electronic device 120 includes a memory 121 and a processor 122, and the processor 122 is used to execute program instructions stored in the memory 121 to implement the steps in any of the above virtual debugging method embodiments. In a specific implementation scenario, the electronic device 120 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 120 may also include a carrier device such as a laptop computer and a tablet computer, which is not limited here.

[0130] Specifically, the processor 122 is used to control itself and the memory 121 to implement the steps in any of the above-mentioned virtual debugging method embodiments. The processor 122 can also be called a CPU (Central Processing Unit). The processor 122 may be an integrated circuit chip with signal processing capabilities. The processor 122 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 122 can be implemented by an integrated circuit chip.

[0131] See also Fig.13 , Fig.13 The computer-readable storage medium 130 stores program instructions 131, which implement the steps in any of the above virtual debugging method embodiments when executed by a processor.

[0132] In this embodiment, by setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visualization interface, the primary motion control model of the first moving body calculates the first control increment in response to the first motion instruction, and the secondary motion control model of the first moving body controls the movement of the first moving body based on the first control increment. The motion control of the first moving body is divided into the primary motion control model and the secondary motion control model, and they are set separately, thereby improving the flexibility of debugging.

[0133] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0134] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0135] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, units or components can be combined or integrated into another system, or some features can be ignored or not executed. In another image position, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0136] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A virtual debugging method, characterized in that: The virtual debugging method comprises: In response to a setting operation of a user, setting a first moving body and a primary motion control model and a secondary motion control model of the first moving body in a visual interface; Calculating a first control increment by a primary motion control model of the first moving body in response to a first motion instruction; The second-level motion control model of the first motion body controls the first motion body to move based on the first control increment.

2. The method according to claim 1, characterized in that The calculating the first control increment in response to the first motion instruction comprises: Selecting a corresponding speed-time graph from a plurality of candidate speed-time graphs based on the motion parameters of the first moving body at a current moment; The first control increment at the next moment is obtained based on the selected speed-time diagram using a preset time step.

3. The method according to claim 2, characterized in that The primary motion control model of the first moving body has a plurality of position difference intervals and a plurality of speed intervals, the plurality of candidate speed-time diagrams respectively correspond to data pairs formed by the position difference intervals and the speed intervals, and the first motion instruction includes a target position of the first moving body; The selecting a corresponding speed-time graph from a plurality of candidate speed-time graphs based on the motion parameter of the first moving body at the current moment comprises: Determine a position difference interval within which a difference between the target position and the current position of the first moving body falls; determining a speed interval into which a current speed of the first moving body falls; The corresponding speed-time diagram is selected based on the position difference interval and the speed interval.

4. The method according to claim 3, characterized in that The first motion instruction includes the current acceleration of the first moving body; Determining the position difference interval into which the difference between the target position and the current position of the first moving body falls includes: Obtaining an expected value according to the square of the current speed of the first moving body divided by twice the current acceleration; In response to a difference between the target position and the current position of the first moving body being smaller than the expected value, determining the position difference interval into which the position difference interval falls as a first position difference interval; In response to a difference between the target position and the current position of the first moving body being equal to the expected value, determining the position difference interval into which the position difference interval falls as a second position difference interval; In response to the difference between the target position and the current position of the first moving body being greater than the expected value, the position difference interval is determined to be a third position difference interval.

5. The method according to claim 4, characterized in that Determining the speed interval into which the current speed of the first moving body falls includes: In response to the current speed of the first moving body being less than a negative speed threshold, determining the speed interval into which the moving body falls is a first speed interval; In response to the current speed of the first moving body being greater than or equal to the negative speed threshold and less than zero, determining the speed interval into which the speed falls is a second speed interval; In response to the current speed of the first moving body being greater than or equal to zero and less than a positive speed threshold, determining that the speed interval falls into is a third speed interval; In response to the current speed of the first moving body being greater than or equal to the positive speed threshold, the speed interval is determined to be a fourth speed interval.

6. The method according to claim 2, characterized in that The first control increment includes a position increment, and the obtaining the first control increment at the next moment based on the selected speed-time diagram using a preset time step includes: Determining a first time point corresponding to the current moment in the speed-time graph; determining a second time point in the speed-time graph based on the first time point and the time step; The position increment at a next time is determined in the speed-time diagram using the first time point and the second time point.

7. The method according to claim 1, characterized in that In response to the setting operation of the user, setting the first moving body and the primary motion control model and the secondary motion control model of the first moving body in the visual interface further includes: Setting the second moving body and the primary motion control model and the secondary motion control model of the second moving body in the visualization interface; The method further comprises: In response to the first moving body and the second moving body being in a coupled state, the second moving body is controlled to move based on the first control increment by a secondary motion control model of the second moving body.

8. The method according to claim 7, characterized in that The method further comprises: In response to the first moving body and the second moving body being in a decoupled state, a primary motion control model of the second moving body calculates a second control increment in response to a second motion instruction; The second moving body is controlled to move based on the second control increment by the secondary motion control model of the second moving body.

9. The method according to claim 8, characterized in that The method further comprises: In response to a user's operation on a specific visualization option in the visualization interface, the first moving body and the second moving body are set to the coupled state or the decoupled state.

10. The method according to claim 8, characterized in that In response to the first moving body and the second moving body being in a decoupled state, calculating a second control increment in response to a second motion instruction by a primary motion control model of the second moving body comprises: calculating the motion state of the second motion body based on the first control increment by a primary motion control model of the second motion body; The second control increment is generated based on the motion state of the second moving body and the second motion command.

11. A virtual debugging system, characterized in that: The virtual commissioning system comprises: A setting module, configured to set the first moving body and the primary motion control model and the secondary motion control model of the first moving body in a visual interface in response to a setting operation of a user; A primary motion control module, configured to calculate a first control increment in response to a first motion instruction by a primary motion control model of the first moving body; The secondary motion control module is used to control the first moving body to move based on the first control increment by using the secondary motion control model of the first moving body.

12. An electronic device, characterized in that: The invention comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the virtual debugging method according to any one of claims 1 to 10.

13. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the virtual debugging method according to any one of claims 1 to 10 is implemented.

Citation Information

Patent Citations

  • Control method of multi-stage parallel operation mechanical arm and multi-stage parallel operation mechanical arm

    CN112894802A

  • Debugging method, device and equipment of servo equipment and readable storage medium

    CN116009404A

  • Virtual debugging method and device for battery production equipment, equipment, medium and product

    CN118171414A

  • System, apparatus, and method for controlling a device based on motion

    US20230145587A1