Motion control method and device, electronic equipment and storage medium
By synchronously acquiring and updating virtual model state data in physical mode, motion control parameters are generated, solving the problems of long time consumption and high cost in switching from physical mode to virtual mode in existing technologies, and realizing efficient and accurate motion control of physical devices.
Patent Information
- Application Number
- CN202511615455.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-06
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies require switching from physical mode to virtual mode in motion control systems, which leads to extended debugging cycles, high costs, and difficulty in meeting high-precision real-time requirements.
By acquiring the status data of the target physical device and the virtual model, control commands are executed synchronously and the historical status data of the virtual model is updated to generate motion control parameters, avoiding physical mode switching and directly controlling the physical device in physical mode.
It improves the efficiency and accuracy of motion control, reduces equipment wear and tear and debugging time, and lowers costs.
Smart Images

Figure CN121578693A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of motion control technology, and in particular to a motion control method, device, electronic device, and storage medium. Background Technology
[0002] In fields such as industrial automation, intelligent manufacturing, and robotics research and development, the efficient development, testing, and maintenance of motion control systems rely heavily on virtual-physical interaction technology. This technology, by building a bridge between the virtual environment and the physical system, can improve the efficiency of system debugging and troubleshooting while reducing physical equipment wear and tear and shortening the development cycle.
[0003] In existing technologies, three main technical solutions are typically used: dual-system parallel architecture, software simulator, and hardware-in-the-loop testing system. These solutions generate motion control parameters corresponding to the target physical device, and then perform motion control on the physical device based on these motion control parameters.
[0004] However, the dual-system parallel architecture requires re-initialization of the control state during mode switching, such as resetting all axis positions. It also fails to retain dynamic parameters from runtime, such as the integral term of the proportional-integral-derivative controller and key data like feedforward compensation. This necessitates the system re-entering a stable operating state after switching, extending the debugging cycle and increasing the risk of damage during equipment start-up and shutdown. Secondly, software simulator solutions, relying on software-level data processing and simulation calculations, typically incur additional latency exceeding 100 microseconds, making it difficult to meet the real-time requirements of high-precision motion control scenarios. Finally, while hardware-in-the-loop testing solutions can ensure fast signal processing speeds through dedicated hardware, the overall system architecture includes multiple components such as signal acquisition modules, real-time computing units, and dedicated software platforms, resulting in complex structures and high R&D and maintenance costs. The market price of a single standard configuration is generally high, and the need for professional technicians for system debugging and maintenance further increases the application costs for enterprises. Summary of the Invention
[0005] This invention provides a motion control method, device, electronic device, and storage medium, which can accurately determine the motion control parameters corresponding to physical devices without switching from physical mode to virtual mode, thereby improving the efficiency and accuracy of motion control of physical devices.
[0006] In a first aspect, embodiments of the present invention provide a motion control method, comprising:
[0007] Obtain the target physical equipment in the target mechanical system and construct a target virtual model corresponding to the target physical equipment;
[0008] Control commands are issued to the target physical device and the target virtual model respectively. When the target physical device and the target virtual model execute the corresponding control commands synchronously, the current status data of the target physical device and the current status data of the target virtual model are obtained.
[0009] Update the historical status data of the device that has been recorded in the target virtual model based on the current status data of the device, and generate motion control parameters corresponding to the target physical device based on the current status data of the device and the current status data of the model.
[0010] Motion control commands are generated based on motion control parameters and sent to the target physical device to control the target physical device to execute the motion control commands.
[0011] Secondly, embodiments of the present invention also provide a motion control device, comprising:
[0012] The virtual model building module is used to acquire the target physical equipment in the target mechanical system and build a target virtual model corresponding to the target physical equipment;
[0013] The status data acquisition module is used to send control commands to the target physical device and the target virtual model respectively, and to acquire the current status data of the target physical device and the current status data of the target virtual model when the target physical device and the target virtual model execute the corresponding control commands synchronously.
[0014] The control parameter generation module is used to update the historical status data of the device that has been recorded in the target virtual model based on the current status data of the device, and to generate motion control parameters corresponding to the target physical device based on the current status data of the device and the current status data of the model.
[0015] The device motion control module is used to generate motion control commands based on motion control parameters and send the motion control commands to the target physical device to control the target physical device to execute the motion control commands.
[0016] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the motion control method provided in any embodiment of the present invention.
[0017] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing computer instructions that are used to cause a processor to execute and implement the motion control method of any embodiment of the present invention.
[0018] The technical solution of this invention addresses the problem in existing technologies where determining motion control parameters requires switching from physical mode to virtual mode, which is time-consuming and costly. This allows for accurate determination of motion control parameters without switching from physical mode to virtual mode, thereby improving the efficiency and accuracy of motion control of physical devices. The solution involves issuing control commands to both the target physical device and the target virtual model, and simultaneously executing these commands. The invention also achieves this by acquiring current device status data and current model status data, updating historical device status data recorded in the target virtual model based on the current device status data, updating historical device status data based on the current device status data, updating historical device status data based on the current device status data and current model status data, generating motion control parameters corresponding to the target physical device, and sending the motion control commands to the target physical device.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart of a motion control method provided according to Embodiment 1 of the present invention;
[0022] Figure 2 This is a flowchart of another motion control method provided according to Embodiment 2 of the present invention;
[0023] Figure 3 This is a schematic diagram of the structure of a motion control device according to Embodiment 3 of the present invention;
[0024] Figure 4 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0025] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0027] Example 1
[0028] Figure 1 This is a flowchart of a motion control method according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of motion control of target physical equipment in a target mechanical system. The method can be executed by a motion control device, which can be implemented in hardware and / or software and can be configured in an electronic device such as a computer.
[0029] like Figure 1 As shown, this embodiment discloses a motion control method, including:
[0030] S110. Obtain the target physical equipment in the target mechanical system and construct a target virtual model corresponding to the target physical equipment.
[0031] In this embodiment, the target mechanical system can be understood as a mechanical system whose physical devices need to be simulated in order to accurately control the motion of those devices. The target physical device can be understood as the physical device in the target mechanical system whose control parameters need to be determined through simulation. The target virtual model can be understood as a digital twin model corresponding to the target physical device.
[0032] In this step, specifically, a 3D model and dynamic parameter file of the target mechanical system can be obtained. Based on the aforementioned 3D model and dynamic parameter file, all physical devices in the target mechanical system can be identified. The dynamic parameter file may include information such as mass, inertia, and joint limitations. The physical devices in the target mechanical system can be of various types, such as Ethernet-controlled automation technology slave stations, servo drives, and input / output devices.
[0033] Then, in response to the user's selection of a physical device, the target physical device can be identified from all physical devices in the target mechanical system. Next, a target virtual model corresponding to the target physical device can be constructed using digital twin technology. The initial state of the target virtual model and the target physical device is identical, and they share a memory region. Finally, a dual-control thread synchronization mechanism for the target virtual model and the target physical device can be initialized.
[0034] S120: Send control commands to the target physical device and the target virtual model respectively, and when the target physical device and the target virtual model execute the corresponding control commands synchronously, obtain the current status data of the target physical device and the current status data of the target virtual model.
[0035] In this embodiment, the current state data of the device can be used to reflect various state parameters of the target physical device during the execution of control commands, such as the current actual position, current actual torque, current actual current, and current actual temperature. The current state data of the model can be used to reflect various state parameters of the target physical device during the execution of control commands, such as the current virtual position, current virtual torque, current virtual current, and current virtual temperature.
[0036] In this step, specifically, the same or different control commands can be issued to the target physical device and the target virtual model respectively. When the target physical device and the target virtual model execute the corresponding control commands synchronously, the current status data of the target physical device and the current status data of the target virtual model can be obtained.
[0037] S130. Update the historical status data of the device that has been recorded in the target virtual model according to the current status data of the device, and generate motion control parameters corresponding to the target physical device according to the current status data of the device and the current status data of the model.
[0038] In this step, specifically, the historical device status data already recorded in the target virtual model can be updated directly based on the current device status data. Alternatively, the status data change value can be determined based on the current and historical device status data, and the historical device status data already recorded in the target virtual model can be updated based on the status data change value.
[0039] Then, artificial intelligence technology can be used to directly generate motion control parameters corresponding to the target physical device based on the current state data of the device and the current state data of the model. Alternatively, after determining that the target virtual model is stable based on methods such as Lyapunov stability theory, eigenvalue analysis, or frequency domain stability criteria, artificial intelligence technology can be used to generate motion control parameters corresponding to the target physical device based on the current state data of the device and the current state data of the model.
[0040] S140. Generate motion control commands based on motion control parameters and send the motion control commands to the target physical device to control the target physical device to execute the motion control commands.
[0041] In this step, specifically, after sending motion control commands to the target physical device, the target physical device and the target virtual model can be switched from virtual mode to physical mode, so that the target physical device can be controlled to execute motion control commands in physical mode.
[0042] The technical solution of this embodiment solves the problem that existing technologies require switching from physical mode to virtual mode when determining motion control parameters, which is time-consuming and costly. It achieves accurate determination of motion control parameters corresponding to physical devices without switching from physical mode to virtual mode, thereby improving the efficiency and accuracy of motion control of physical devices. This is achieved by acquiring the target physical device's physical equipment and the target virtual model's virtual state data while the physical device and virtual model execute the corresponding control commands synchronously. The solution also addresses the need to acquire the target physical device's physical equipment and construct a corresponding virtual model based on the current device status data. Furthermore, it addresses the issue of time-consuming and costly switching from physical mode to virtual mode when determining motion control parameters, enabling accurate determination of motion control parameters without switching from physical mode to virtual mode.
[0043] Example 2
[0044] Figure 2 This is a flowchart of another motion control method provided by Embodiment 2 of the present invention. This embodiment is a further optimization and extension based on the above embodiments and can be combined with various optional technical solutions in the above embodiments.
[0045] like Figure 2 As shown, this embodiment discloses a motion control method, including:
[0046] S210. Obtain the target physical equipment in the target mechanical system and construct a target virtual model corresponding to the target physical equipment.
[0047] Optionally, after constructing a target virtual model corresponding to the target physical device, a least squares parameter identification method can be used to address the differences in dynamic characteristics between the target virtual model and the target physical device. Based on the input and output data of the target physical device and a preset linear or weakly nonlinear model structure, unknown key parameters in the target virtual model can be inferred, thereby controlling the linear dynamic deviation between the target virtual model and the target physical device within a preset range. Furthermore, a neural network-based nonlinear compensation method is employed to dynamically offset the impact of nonlinear disturbances on the control accuracy of the target physical device, ultimately achieving high-precision coordination between the target virtual model and the target physical device.
[0048] S220: Issue control commands to the target physical device and the target virtual model respectively, and when the target physical device and the target virtual model execute the corresponding control commands synchronously, obtain the current status data of the target physical device and the current status data of the target virtual model.
[0049] S230. Obtain the historical status data of the device corresponding to the target physical device, and determine the status data change value corresponding to the target physical device based on the historical status data and the current status data of the device.
[0050] In this embodiment, the status data change value can be used to reflect the changes in various status parameters of the target physical device before and after executing control commands.
[0051] Specifically, this step involves acquiring various historical state parameters from the device's historical state data and various current state parameters from the device's current state data. The differences between each historical state parameter and its corresponding current state parameter are then calculated to obtain multiple state data differences. Next, a 32-bit Cyclic Redundancy Check (CRC32) checksum is generated corresponding to each state data difference. Based on the state data differences and the CRC32 checksum, multiple state data change values corresponding to the target physical device are generated to ensure the integrity of the state data change values.
[0052] For example, assuming the device's historical status data includes historical actual position, historical actual current, and historical actual temperature, and the device's current status data includes current actual position, current actual current, and current actual temperature, then the position difference between the historical and current actual positions, the current difference between the historical and current actual currents, and the temperature difference between the historical and current actual temperatures can be calculated. Then, CRC32 checksums corresponding to the position difference, current difference, and temperature difference can be generated respectively. A position change value is generated based on the position difference and its corresponding CRC32 checksum; a current change value is generated based on the current difference and its corresponding CRC32 checksum; and a temperature change value is generated based on the temperature difference and its corresponding CRC32 checksum.
[0053] S240. Update the historical device status data that has been recorded in the target virtual model based on the status data change value.
[0054] Specifically, in this step, the status data change value containing the CRC32 checksum can be verified, and after successful verification, the status data difference in the status data change value can be obtained. Then, if it is determined that the status data difference does not exceed a predefined difference range, the historical status data of the device recorded in the target virtual model can be updated based on the status data difference. If it is determined that the status data difference exceeds the predefined difference range, an alarm message indicating that the status data difference exceeds the difference range is fed back to the user, so that the user can reissue control commands or repair the target physical device.
[0055] S250. Based on the current status data of the equipment and the current status data of the model, determine whether the target virtual model is stable.
[0056] In this step, specifically, based on Lyapunov stability theory, the stability of the target virtual model can be determined according to the current state data of the equipment and the current state data of the model.
[0057] Optionally, when the current state data of the device includes the current actual position and the current actual torque, and the current state data of the model includes the current virtual position and the current virtual torque, based on Lyapunov stability theory, the stability of the target virtual model is determined according to the current state data of the device and the current state data of the model. This includes: determining the positional error between the target physical device and the target virtual model based on the current actual position and the current virtual position; determining the torque error between the target physical device and the target virtual model based on the current actual torque and the current virtual torque; and determining the stability of the target virtual model based on Lyapunov stability theory, using the positional error and the torque error.
[0058] For example, based on Lyapunov stability theory, the following Lyapunov function can be constructed: .in, This represents the positional error between the target physical device and the target virtual model. This represents the torque error between the target physical device and the target virtual model. Then, the derivative of the Lyapunov function can be taken, resulting in the following: .
[0059] After that, it can be done through the formula This determines the positional error between the target physical device and the target virtual model. This is the current actual location. This is the current virtual location. (Using the formula...) This determines the torque error between the target physical device and the target virtual model. This is the current actual torque. This represents the current virtual torque.
[0060] Finally, the calculated position error and torque error can be substituted into the differentiated Lyapunov function to obtain the stability evaluation value (i.e., If the stability assessment value is less than 0, the target virtual model is determined to be stable; if the stability assessment value is greater than or equal to 0, the target virtual model is determined to be unstable.
[0061] Furthermore, if, based on Lyapunov stability theory, the target virtual model is determined to be unstable according to position and torque errors, then updated inertia and damping parameters corresponding to the target virtual model are determined. If the updated inertia and damping parameters do not exceed their corresponding threshold ranges, the target virtual model is run based on these parameters to obtain updated virtual position and updated virtual torque. Based on Lyapunov stability theory, the stability of the target virtual model is determined using the updated virtual position and updated virtual torque. If the target virtual model is determined to be unstable, the process returns to determining the updated inertia and damping parameters until the target virtual model is determined to be stable, at which point the updated model state data corresponding to the target virtual model is obtained. Based on the current equipment state data and the updated model state data, motion control parameters corresponding to the target physical equipment are generated.
[0062] Specifically, it can be done according to the formula Determine the inertia parameter correction amount corresponding to the target virtual model. Among them, This is the correction amount for the inertia parameter. For adaptive gain coefficients, The current actual torque measured for the target physical device. The current virtual torque calculated for the target virtual model. ω represents angular acceleration. It should be noted that the adaptive gain coefficient is a dimensionless scalar constant used to control the update rate and stability of the inertia parameter; it is greater than 0 and less than 1.
[0063] Based on the predefined adaptive learning rate and the inertia parameter correction amount corresponding to the target virtual model, the updated inertia parameters corresponding to the target virtual model are determined. For example, this can be achieved through the formula... The updated inertia parameters corresponding to the target virtual model are determined. To update the inertia parameters, For adaptive learning rate, This is the correction amount for the inertia parameter.
[0064] Based on a predefined adaptive learning rate and the damping coefficient correction amount corresponding to the target virtual model, the updated damping parameters corresponding to the target virtual model are determined. For example, this can be achieved through a formula. Determine the update damping parameters corresponding to the target virtual model. Among them, To update the damping parameters, For adaptive learning rate, This represents the damping parameter correction amount. It should be noted that the adaptive learning rate can be understood as any value greater than 0 and less than 1, determined based on historical experience.
[0065] Then, it can be determined whether the updated inertia parameter and the updated damping parameter exceed the corresponding threshold range. If the updated inertia parameter exceeds the corresponding threshold range, the process returns to executing the operation based on the predefined adaptive learning rate and the inertia parameter correction amount corresponding to the target virtual model, until the updated inertia parameter does not exceed the corresponding threshold range. If the updated damping parameter exceeds the corresponding threshold range, the process returns to executing the operation based on the predefined adaptive learning rate and the damping coefficient correction amount corresponding to the target virtual model, until the updated damping parameter does not exceed the corresponding threshold range. If neither the updated inertia parameter nor the updated damping parameter exceeds the corresponding threshold range, the target virtual model is run according to the updated inertia parameter and the updated damping parameter to obtain the updated virtual position and updated virtual torque corresponding to the target virtual model.
[0066] Finally, the update position error between the target physical device and the target virtual model can be determined based on the current actual position and the updated virtual position. The update torque error between the target physical device and the target virtual model can be determined based on the current actual torque and the updated virtual torque. Based on Lyapunov stability theory, the stability of the target virtual model can be determined using the update position error and the update torque error.
[0067] S260. When the target virtual model is determined to be stable, motion control parameters corresponding to the target physical device are generated based on the current state data of the device and the current state data of the model.
[0068] S270. Generate motion control commands based on motion control parameters and send the motion control commands to the target physical device to control the target physical device to execute the motion control commands.
[0069] Optionally, the method further includes: acquiring the device output result of the target physical device during the process of controlling the target physical device to execute motion control commands; comparing the device output result with the model output result when the target virtual model executes motion control commands to obtain the output result error; and sending a prompt message to the user that the model parameter settings are unreasonable when the output result error does not meet the preset error requirements, so as to reconfigure the parameters of the target virtual model.
[0070] Specifically, if the output error does not meet the preset error requirements, that is, if the output error is large, a prompt message indicating that the model parameter settings are unreasonable can be sent to the user.
[0071] The technical solution of this embodiment acquires historical device status data corresponding to the target physical device, and determines the status data change value corresponding to the target physical device based on the historical device status data and the current device status data. It then updates the historical device status data recorded in the target virtual model based on the status data change value. This approach enables compressed transmission of the current device status data, improving data synchronization efficiency. Furthermore, it determines whether the target virtual model is stable based on the current device status data and the current model status data. Only when the target virtual model is determined to be stable are motion control parameters corresponding to the target physical device generated based on the current device status data and the current model status data, thus improving the accuracy of the determined motion control parameters.
[0072] To illustrate the motion control method and its effects in this invention in detail, an example of an operational control system applying the motion control method of this invention is provided below: A motion control system based on a dual-mode fusion architecture can be constructed. This motion control system can be applied to scenarios such as virtual-real machining verification of CNC machine tools, virtual-real operation verification of automated equipment, online switching of offline programming for automated equipment, online switching of offline programming for robots, and preventative maintenance of automated equipment. The motion control system can include a unified device abstraction layer, a state synchronization engine, a lossless switching controller, and a virtual-real consistency verification module. Specifically, the unified device abstraction layer contains a bidirectional adapter, which can provide a standardized control interface independent of the operating mode. The state synchronization engine can be used to mirror the dynamic state of the target physical device to the virtual environment in real time using incremental snapshot technology, thereby reducing data transmission while achieving state data synchronization. The lossless switching controller can complete the transfer of control within 1 millisecond, thus maintaining the continuity of all control parameters. These control parameters can include axis position, speed, acceleration, intermediate states of the control algorithm, and communication protocol stack context, etc. The virtual-physical consistency verification module can be used to compare the differences between the target physical device and the target virtual model output online, and automatically calibrate virtual model parameters, such as friction coefficient and inertia.
[0073] Furthermore, the motion control process through the aforementioned operation control system can be as follows: Step 1: Obtain the target physical equipment in the target mechanical system through the unified equipment abstraction layer, and construct a target virtual model corresponding to the target physical equipment. Step 2: Issue control commands to the target physical equipment and the target virtual model respectively through the unified equipment abstraction layer, and obtain the current state data of the target physical equipment and the current state data of the target virtual model when the target physical equipment and the target virtual model execute the corresponding control commands synchronously. Step 3: Update the historical state data of the equipment recorded in the target virtual model according to the current state data of the equipment through the state synchronization engine, and correct the current state data of the model using a feedforward compensation algorithm. For example, when the current state data of the model includes the current virtual torque, it can be corrected using the formula... Determine the feedforward compensation torque. Among them, For feedforward compensation torque, For rotational inertia, Angular acceleration, The damping coefficient is... Angular velocity, This is the friction torque. Then, the current virtual torque can be corrected based on the feedforward compensation torque.
[0074] Step 4: Using the virtual-physical consistency verification module, determine whether the target virtual model is stable based on the current state data of the equipment and the current state data of the model. If the target virtual model is determined to be stable, generate motion control parameters corresponding to the target physical equipment based on the current state data of the equipment and the current state data of the model. If the target virtual model is determined to be unstable, determine the updated inertia parameters and updated damping parameters corresponding to the target virtual model. If the updated inertia parameters and updated damping parameters are determined to be within the corresponding threshold range, run the target virtual model based on the updated inertia parameters and updated damping parameters to obtain the updated virtual position and updated virtual torque corresponding to the target virtual model. Based on Lyapunov stability theory, determine whether the target virtual model is stable based on the updated virtual position and updated virtual torque. If the target virtual model is determined to be unstable, return to the operation of determining the updated inertia parameters and updated damping parameters corresponding to the target virtual model until the target virtual model is determined to be stable, and obtain the model updated state data corresponding to the target virtual model. Generate motion control parameters corresponding to the target physical equipment based on the current state data of the equipment and the updated state data of the model.
[0075] Step 5: Send motion control commands to the target physical device through the lossless switching controller, and control the target physical device and the target virtual model to switch from virtual mode to physical mode, so as to control the target physical device to execute motion control commands in physical mode.
[0076] The advantage of this setup is that by setting up a bidirectional adapter in the unified device abstraction layer of the motion control system, the same interface can be configured for both the virtual and physical environments. This allows the same set of control code to run in both modes without modification, avoiding the need to write separate control code for the virtual and physical environments due to their different interfaces. Secondly, by enabling the target physical device and the target virtual model to execute corresponding control commands synchronously, motion control parameters corresponding to the target physical device can be generated without switching from physical mode to virtual mode, improving the efficiency and accuracy of motion control of the physical device.
[0077] Example 3
[0078] Figure 3 This is a schematic diagram of a motion control device according to Embodiment 3 of the present invention. This embodiment is applicable to the situation of motion control of target physical equipment in a target mechanical system. The motion control device can be implemented in hardware and / or software and can be configured in electronic devices such as computers.
[0079] like Figure 3 As shown, the motion control device disclosed in this embodiment includes:
[0080] The virtual model construction module 31 is used to acquire the target physical equipment in the target mechanical system and construct a target virtual model corresponding to the target physical equipment;
[0081] The status data acquisition module 32 is used to send control commands to the target physical device and the target virtual model respectively, and to acquire the current status data of the target physical device and the current status data of the target virtual model when the target physical device and the target virtual model execute the corresponding control commands synchronously.
[0082] The control parameter generation module 33 is used to update the historical status data of the device that has been recorded in the target virtual model according to the current status data of the device, and to generate motion control parameters corresponding to the target physical device according to the current status data of the device and the current status data of the model.
[0083] The device motion control module 34 is used to generate motion control commands based on motion control parameters and send the motion control commands to the target physical device to control the target physical device to execute the motion control commands.
[0084] The technical solution in this embodiment, through the cooperation of the virtual model construction module 31, the state data acquisition module 32, the control parameter generation module 33, and the device motion control module 34, solves the problem that the prior art requires switching from physical mode to virtual mode when determining motion control parameters, and that the switching from physical mode to virtual mode is time-consuming and costly. It can accurately determine the motion control parameters corresponding to the physical device without switching from physical mode to virtual mode, thereby improving the efficiency and accuracy of motion control of the physical device.
[0085] Optionally, the control parameter generation module 33 includes:
[0086] The historical data acquisition unit is used to acquire historical status data of the device corresponding to the target physical device;
[0087] The data change value determination unit is used to determine the status data change value corresponding to the target physical device based on the device's historical status data and current status data.
[0088] The historical data update unit is used to update the historical status data of the device that has been recorded in the target virtual model based on the change value of the status data;
[0089] The model stability determination unit is used to determine whether the target virtual model is stable based on the current state data of the device and the current state data of the model.
[0090] The control parameter generation unit is used to generate motion control parameters corresponding to the target physical device based on the current state data of the device and the current state data of the model when the target virtual model is determined to be stable.
[0091] Optionally, the current status data of the device includes the current actual position and the current actual torque, and the current status data of the model includes the current virtual position and the current virtual torque.
[0092] Optionally, the model stability determination unit is specifically used to: determine the position error between the target physical device and the target virtual model based on the current actual position and the current virtual position; determine the torque error between the target physical device and the target virtual model based on the current actual torque and the current virtual torque; and determine whether the target virtual model is stable based on the Lyapunov stability theory, according to the position error and torque error.
[0093] Optionally, the device further includes a model parameter adjustment module, which is used to: determine the updated inertia parameters and updated damping parameters corresponding to the target virtual model when the target virtual model is determined to be unstable; run the target virtual model according to the updated inertia parameters and updated damping parameters when the updated inertia parameters and updated damping parameters are determined to be within the corresponding threshold range, and obtain the updated virtual position and updated virtual torque corresponding to the target virtual model; determine whether the target virtual model is stable based on the updated virtual position and updated virtual torque according to the Lyapunov stability theory; when the target virtual model is determined to be unstable, return to the operation of determining the updated inertia parameters and updated damping parameters corresponding to the target virtual model until the target virtual model is determined to be stable, and obtain the model update state data corresponding to the target virtual model; and generate motion control parameters corresponding to the target physical device according to the current state data of the device and the model update state data.
[0094] Optionally, the device also includes a virtual model verification module, which is used to: acquire the device output results of the target physical device during the execution of motion control commands; compare the device output results with the model output results of the target virtual model when executing motion control commands to obtain the output result error; and send a prompt message to the user that the model parameter settings are unreasonable when the output result error does not meet the preset error requirements, so as to reconfigure the parameters of the target virtual model.
[0095] The motion control device provided in this embodiment of the invention can execute the motion control method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method execution. Content not described in detail in this embodiment can be referred to the description in any method embodiment of this application.
[0096] Example 4
[0097] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement embodiments of the present invention is shown. For example... Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0098] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0099] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as motion control methods.
[0100] In some embodiments, the motion control method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the motion control method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the motion control method by any other suitable means (e.g., by means of firmware).
[0101] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0103] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0105] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0106] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0107] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A motion control method characterized by, The method comprises: acquiring a target physical device in a target mechanical system, and constructing a target virtual model corresponding to the target physical device; issuing control instructions to the target physical device and the target virtual model respectively, and acquiring device current state data of the target physical device and model current state data of the target virtual model when the target physical device and the target virtual model synchronously execute corresponding control instructions; updating device historical state data recorded in the target virtual model according to the device current state data, and generating motion control parameters corresponding to the target physical device according to the device current state data and the model current state data; generating motion control instructions according to the motion control parameters, and sending the motion control instructions to the target physical device to control the target physical device to execute the motion control instructions.
2. The method of claim 1, wherein, The updating of the device historical state data recorded in the target virtual model according to the device current state data comprises: acquiring device historical state data corresponding to the target physical device; determining state data change values corresponding to the target physical device according to the device historical state data and the device current state data; updating the device historical state data recorded in the target virtual model according to the state data change values.
3. The method of claim 1, wherein, The generation of the motion control parameters corresponding to the target physical device according to the device current state data and the model current state data comprises: determining whether the target virtual model is stable according to the device current state data and the model current state data; when it is determined that the target virtual model is stable, generating the motion control parameters corresponding to the target physical device according to the device current state data and the model current state data.
4. The method of claim 3, wherein, The device current state data comprises a current actual position and a current actual torque, and the model current state data comprises a current virtual position and a current virtual torque; The determination of whether the target virtual model is stable according to the device current state data and the model current state data comprises: determining a position error between the target physical device and the target virtual model according to the current actual position and the current virtual position; determining a torque error between the target physical device and the target virtual model according to the current actual torque and the current virtual torque; determining whether the target virtual model is stable according to the position error and the torque error based on Lyapunov stability theory.
5. The method of claim 4, wherein, After determining whether the target virtual model is stable according to the position error and the torque error based on Lyapunov stability theory, the method further comprises: when it is determined that the target virtual model is unstable, determining an updated inertia parameter and an updated damping parameter corresponding to the target virtual model; when it is determined that the updated inertia parameter and the updated damping parameter do not exceed corresponding threshold ranges, running the target virtual model according to the updated inertia parameter and the updated damping parameter to obtain an updated virtual position and an updated virtual torque corresponding to the target virtual model; determine, based on the Lyapunov stability theory, whether the target virtual model is stable according to the updated virtual position and the updated virtual torque; when it is determined that the target virtual model is unstable, return to perform the operation of determining the updated inertia parameter and the updated damping parameter corresponding to the target virtual model until it is determined that the target virtual model is stable, and obtain model update state data corresponding to the target virtual model; generate the motion control parameter corresponding to the target physical device according to the device current state data and the model update state data.
6. The method of claim 1, wherein, The method further includes: during the process of controlling the target physical device to execute the motion control instruction, obtain a device output result of the target physical device; compare the device output result with a model output result when the target virtual model executes the motion control instruction to obtain an output result error; when the output result error does not meet a preset error requirement, send a prompt information that the model parameter setting is unreasonable to a user to reconfigure the parameters of the target virtual model.
7. A motion control apparatus characterized by comprising: The apparatus includes: a virtual model construction module configured to obtain a target physical device in a target mechanical system and construct a target virtual model corresponding to the target physical device; a state data acquisition module configured to issue control instructions to the target physical device and the target virtual model respectively, and acquire device current state data of the target physical device and model current state data of the target virtual model when the target physical device and the target virtual model synchronously execute corresponding control instructions; a control parameter generation module configured to update device historical state data recorded in the target virtual model according to the device current state data, and generate a motion control parameter corresponding to the target physical device according to the device current state data and the model current state data; a device motion control module configured to generate a motion control instruction according to the motion control parameter, and send the motion control instruction to the target physical device to control the target physical device to execute the motion control instruction.
8. The apparatus of claim 7, wherein, The control parameter generation module includes: a historical data acquisition unit configured to acquire device historical state data corresponding to the target physical device; a data change value determination unit configured to determine a state data change value corresponding to the target physical device according to the device historical state data and the device current state data; a historical data update unit configured to update the device historical state data recorded in the target virtual model according to the state data change value.
9. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the motion control method in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions for causing the processor to implement the motion control method of any one of claims 1-6 when executed.