Python / QT / C software-hardware-in-loop-based underwater vehicle semi-physical simulation method

Through the Python/QT/C software and hardware system in the ring, a six-degree-of-freedom kinematics and dynamics model of underwater vehicles was established, and control algorithms and communication protocols were designed, the problem of failing to effectively consider dynamics and kinematics models in the existing technology was solved, and the full closed-loop simulation and depth simulation of underwater vehicles were realized.

CN120178698APending Publication Date: 2025-06-20NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510260937.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-06
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

The existing semi-physical simulation system of underwater vehicles fails to effectively consider the dynamic and kinematic models of the vehicle, and lacks full closed-loop simulation tests, making it difficult to deeply simulate the combined navigation of underwater vehicles.

Method used

Using the software and hardware in-loop method based on Python/QT/C, a six-degree-of-freedom kinematics and dynamics model of underwater vehicles is established, and a control algorithm is designed. By designing communication protocols, including network communication, CAN bus communication and serial port 422 communication, a semi-physical simulation system and control system are built to form a closed-loop simulation system.

Benefits of technology

It realizes closed-loop testing of underwater vehicle control algorithm and software logic, and can solve the model in real time and feedback simulation data, improving the authenticity and effectiveness of the simulation system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120178698A_ABST
    Figure CN120178698A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of ocean engineering. The invention provides an underwater vehicle semi-physical simulation method based on Python / QT / C software and hardware in-the-loop. The embodiment of the invention can be realized. According to the underwater vehicle semi-physical simulation method based on Python / QT / C software-hardware-in-the-loop, a control system, a semi-physical simulation system and an upper computer are constructed, the control system, the semi-physical simulation system, the upper computer, an execution mechanism and a sensor are connected through a network cable, a CAN bus and a serial port 422 to form a closed-loop simulation system, a task instruction is issued through the upper computer, and the control system, the execution mechanism and the sensor are connected through the network cable, the CAN bus and the serial port 422 to form the closed-loop simulation system. And the control system generates a control signal to drive the execution mechanism, and the semi-physical simulation system solves the model in real time and feeds back simulation data, so that closed-loop testing of an underwater vehicle control algorithm and software logic is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of ocean engineering technologies, and particularly to a hardware-in-the-loop simulation method for an underwater vehicle based on Python / QT / C. Background Art

[0002] The design, manufacture, processing, and testing of an underwater vehicle are a long-term process. Among them, the testing of the control system requires a large amount of time and funds for lake and sea trials to test and improve the control algorithm and simultaneously perfect the software of the control system. Therefore, with the help of hardware-in-the-loop simulation, the test cycle can be greatly shortened. By combining the mathematical model, the actual actuator (physical object), and the simulated sensor (physical model) for simulation, with hardware-in-the-loop simulation, the testing of the control system and the control algorithm can be carried out in the laboratory. Based on the control algorithm designed based on the model and mathematical simulation, hardware-in-the-loop simulation considering the characteristics of the actuator is carried out to improve the control algorithm; and the logic of the control software can be tested, and loopholes in the software can be found and perfected, thereby reducing the risk of actual tests, saving research and development funds, and efficiently promoting the research and development process.

[0003] Compared with the navigation technologies of aircraft, missiles and other aircraft, the navigation technology of underwater vehicles has the characteristics of long working hours, complex environment, few information sources, and high concealment requirements. Therefore, underwater navigation is more difficult. In the research on the hardware-in-the-loop simulation technology of underwater vehicle navigation and control systems, the real-time simulation system of the autonomous underwater vehicle (AUV) SINS / DVL integrated navigation proposed by Lu Shujuan et al. in "Design and Implementation of the Integrated Navigation Simulation System for Underwater Vehicles" consists of a vehicle computer and a navigation computer. Among them, the AUV model calculation is mainly completed by the vehicle computer, and the navigation computer is responsible for calculating the navigation parameters of the AUV navigation system. The simulation system established by Yan Weisheng in the article "Real-time Simulation System for Underwater Vehicle Navigation and Control" consists of two parts: the navigation and control real-time simulation system and the navigation control computer of the autopilot. Among them, the real-time simulation system consists of two networked computers and two interface converters to simulate the information of peripheral devices such as Doppler velocity log, gyrocompass, and depth sensor, and provide the simulated information parameters to the navigation control computer. The above simulation systems are all computer-based digital simulations, using the computer to simulate the sensor device to provide virtual signals for the control system, without accessing real navigation and control components.

[0004] Patent 200610011580.X proposed a SINS / CNS / GPS integrated navigation hardware-in-the-loop simulation system, and Patent 200610089437.2 proposed a strapdown inertial navigation / astronomical integrated navigation hardware-in-the-loop simulation system. These two hardware-in-the-loop simulation systems use a trajectory generator to generate nominal trajectory data, and then superimpose error data of devices such as SINS, CNS, and GPS to study the dynamic performance of the integrated navigation system. However, these two hardware-in-the-loop simulation systems do not consider the dynamic and kinematic models of the vehicle, and these two hardware-in-the-loop simulation systems do not constitute a full-closed-loop simulation test of the navigation control system, nor do they have a depth simulation device, which is not suitable for the integrated navigation of underwater vehicles.

[0005] Therefore, it is necessary to improve one or more problems existing in the above-mentioned related technical solutions.

[0006] It should be noted that this part aims to provide background or context for the technical solutions of the present disclosure stated in the claims. The description herein is not admitted to be prior art merely because it is included in this part. Summary of the Invention

[0007] The purpose of the embodiments of the present disclosure is to provide a hardware-in-the-loop simulation method for an underwater vehicle based on Python / QT / C, so as to overcome at least to some extent one or more problems caused by the limitations and defects of the related technologies.

[0008] According to the embodiments of the present disclosure, a hardware-in-the-loop simulation method for an underwater vehicle based on Python / QT / C is provided. The method includes: Establish a six-degree-of-freedom kinematic and dynamic model of the underwater vehicle, and design an underwater vehicle control algorithm; Design a communication protocol; wherein, the communication protocol includes network communication, CAN bus communication, and serial port 422 communication; Based on the six-degree-of-freedom model and the communication protocol, use the Python language to construct a hardware-in-the-loop simulation system; wherein, the hardware-in-the-loop simulation system includes an underwater vehicle dynamic model, a sensor simulation module, and a data communication module; Based on the underwater vehicle control algorithm and the communication protocol, use the C language to construct a control system; wherein, the control system is used to generate control instructions and realize data interaction with the actuator; Use QT to construct a host computer for task parameter distribution and simulation monitoring; Connect the control system, the hardware-in-the-loop simulation system, the host computer, the actuators, and the sensors through Ethernet cables, CAN buses, and serial port 422 to form a closed-loop simulation system. The host computer issues task instructions, the control system generates control signals to drive the actuators, and the hardware-in-the-loop simulation system calculates the model in real time and feeds back simulation data to achieve the closed-loop testing of the underwater vehicle control algorithm and software logic.

[0009] Furthermore, in the steps of establishing the six-degree-of-freedom kinematic and dynamic model of the underwater vehicle and designing the underwater vehicle control algorithm, it includes: Based on Newton's law and the rigid body kinematic analysis method, construct the six-degree-of-freedom kinematic and dynamic model; among them, the six-degree-of-freedom kinematic and dynamic model includes the inertia matrix, the Coriolis force and centripetal force matrix, the damping force matrix, the restoring force matrix, and the velocity vector parameters; Design the underwater vehicle control algorithm to achieve closed-loop regulation of depth, heading, roll, and speed; among them, the underwater vehicle control algorithm includes a depth control algorithm, a heading control algorithm, a roll control algorithm, and a speed control algorithm.

[0010] Furthermore, the communication protocol specifically includes: Adopt a network communication protocol between the host computer and the control system; Adopt a CAN bus communication protocol between the control system and the steering gear, thruster, variable buoyancy adjustment device, and depth sensor; Adopt a serial port 422 communication protocol between the control system and the inertial navigation device.

[0011] Furthermore, the hardware-in-the-loop simulation system also includes: The physical simulation module of the inertial navigation device, which is used to generate attitude, angular velocity, and linear velocity simulation data; The physical simulation module of the depth sensor, which is used to generate depth simulation data; The actuator status feedback receiving module, which is used for closed-loop simulation iteration.

[0012] Furthermore, the control system includes: The control algorithm module, which is used to generate control instructions for the steering gear, thruster, and variable buoyancy adjustment device according to the simulation data; The data parsing module, which is used to process the communication data from the sensors and the simulation computer.

[0013] Furthermore, the operation process of the closed-loop simulation system includes: The hardware-in-the-loop simulation system receives the control instructions and calculates the model, and outputs attitude, speed, and depth simulation data; The simulation data is converted into analog signals through the sensor simulation module and fed back to the control system; The control system generates new control instructions based on the feedback data to drive the actuator to complete the closed-loop response.

[0014] Furthermore, the actuator includes bow and stern rudders, thrusters, and heavy buoyancy adjustment devices, and the sensors include depth sensors and inertial navigation devices.

[0015] Furthermore, the upper computer supports task parameter configuration, including waypoint coordinates, target depth, task duration, and safety threshold.

[0016] The technical solutions provided by the embodiments of the present disclosure may include the following beneficial effects: In the embodiments of the present disclosure, through the above-mentioned underwater vehicle hardware-in-the-loop simulation method based on Python / QT / C, a control system, a hardware-in-the-loop simulation system, and an upper computer are constructed, and the control system, the hardware-in-the-loop simulation system, and the upper computer are connected through a network cable, a CAN box, and a serial port 422. The upper computer issues tasks, the control system generates control instructions according to the task instructions, and the hardware-in-the-loop simulation system performs model calculation after receiving the control instructions and outputs the depth, attitude, position, and velocity angular velocity information of the underwater vehicle. The attitude and velocity angular velocity obtained from the model calculation are transmitted to the simulated inertial navigation device for inertial navigation device simulation and then the simulated inertial navigation data is output, and then the simulated inertial navigation data is sent to the control system through the serial port 422; the depth information obtained from the model calculation is transmitted to the depth sensor simulation device, and then the simulated depth is output and sent to the control system through the CAN bus. After receiving the simulated inertial navigation data and the simulated depth data, the control system generates control instructions and sends them to the rudders, thrusters, and heavy buoyancy adjustment devices. The actuator responds to the instructions and sends the actuator state to the hardware-in-the-loop simulation system in real time, thus forming a hardware-in-the-loop simulation closed loop. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0018] Figure 1 A flowchart showing the steps of a method for hardware-in-the-loop simulation of an underwater vehicle based on Python / QT / C in an exemplary embodiment of the present disclosure; Figure 2 A block diagram showing the hardware-in-the-loop simulation test of an underwater vehicle in an exemplary embodiment of the present disclosure; Figure 3 A trajectory diagram showing the hardware-in-the-loop simulation of waypoint tracking in an exemplary embodiment of the present disclosure; Figure 4 Shows the depth change diagram of the in-the-loop simulation of waypoint tracking for an underwater vehicle in an exemplary embodiment of the present disclosure; Figure 5 Shows the X-type stern rudder change diagram of the in-the-loop simulation of waypoint tracking for an underwater vehicle in an exemplary embodiment of the present disclosure; Figure 6 Shows the attitude angle change diagram of the in-the-loop simulation of waypoint tracking for an underwater vehicle in an exemplary embodiment of the present disclosure; Figure 7 Shows the attitude angular velocity change diagram of the in-the-loop simulation of waypoint tracking for an underwater vehicle in an exemplary embodiment of the present disclosure; Figure 8 Shows the linear velocity change diagram of the in-the-loop simulation of waypoint tracking for an underwater vehicle in an exemplary embodiment of the present disclosure. Detailed implementation manners

[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments.

[0020] In addition, the accompanying drawings are only schematic illustrations of the embodiments of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities.

[0021] In this example embodiment, a hardware-in-the-loop simulation method for an underwater vehicle based on Python / QT / C is provided. Referring to Figure 1 as shown in, the hardware-in-the-loop simulation method for an underwater vehicle based on Python / QT / C may include: steps S101 to S106.

[0022] Step S101: Establish a six-degree-of-freedom kinematic and dynamic model of the underwater vehicle and design an underwater vehicle control algorithm; Step S102: Design a communication protocol; wherein, the communication protocol includes network communication, CAN bus communication, and serial port 422 communication; Step S103: Based on the six-degree-of-freedom model and the communication protocol, construct a hardware-in-the-loop simulation system using the Python language; wherein, the hardware-in-the-loop simulation system includes an underwater vehicle dynamics model, a sensor simulation module, and a data communication module; Step S104: Based on the underwater vehicle control algorithm and communication protocol, build a control system using C language; wherein, the control system is used to generate control instructions and realize data interaction with the actuators; Step S105: Build a host computer using QT for task parameter distribution and simulation monitoring; Step S106: Connect the control system, hardware-in-the-loop simulation system, host computer, actuators, and sensors through network cables, CAN bus, and serial port 422 to form a closed-loop simulation system. Send task instructions through the host computer, the control system generates control signals to drive the actuators, and the hardware-in-the-loop simulation system calculates the model in real time and feeds back simulation data to realize the closed-loop test of the underwater vehicle control algorithm and software logic.

[0023] Through the above-mentioned underwater vehicle hardware-in-the-loop simulation method based on Python / QT / C, build a control system, a hardware-in-the-loop simulation system, and a host computer, and connect the control system, the hardware-in-the-loop simulation system, and the host computer through network cables, CAN boxes, and serial port 422. Send tasks through the host computer, the control system generates control instructions according to the task instructions, and the hardware-in-the-loop simulation system performs model calculation after receiving the control instructions and outputs the depth, attitude, position, speed, and angular velocity information of the underwater vehicle. Transmit the attitude and speed angular velocity calculated by the model to the simulated inertial navigation device for inertial navigation device simulation and then output the simulated inertial navigation data, and then send the simulated inertial navigation data to the control system through serial port 422; transmit the depth information calculated by the model to the depth sensor simulation device, then output the simulated depth and send the simulated depth to the control system through the CAN bus. After receiving the simulated inertial navigation data and simulated depth data, the control system generates control instructions and sends them to the steering gear, thruster, and variable buoyancy adjustment device, and the actuator responds to the instructions and sends the actuator state to the hardware-in-the-loop simulation system in real time to form a hardware-in-the-loop simulation closed loop.

[0024] Next, reference will be made to Figures 1 to 8 to describe each step of the above-mentioned underwater vehicle hardware-in-the-loop simulation method based on Python / QT / C in the exemplary embodiment in more detail.

[0025] In step S101, establish a six-degree-of-freedom kinematic and dynamic model of the underwater vehicle and design an underwater vehicle control algorithm.

[0026] Specifically, based on Newton's law and the rigid body kinematic analysis method, build a six-degree-of-freedom kinematic and dynamic model; wherein, the six-degree-of-freedom kinematic and dynamic model includes an inertia matrix, a Coriolis force and centripetal force matrix, a damping force matrix, a restoring force matrix, and velocity vector parameters; Design an underwater vehicle control algorithm to achieve closed-loop regulation of depth, heading, roll, and speed; among them, the underwater vehicle control algorithm includes a depth control algorithm, a heading control algorithm, a roll control algorithm, and a speed control algorithm.

[0027] More specifically, first, according to the rigid body kinematics analysis method and the Newton's laws of motion, analyze the motion trend of the underwater vehicle (the relationship between the acting force and the motion), and thus establish the six-degree-of-freedom kinematics and dynamics model of the underwater vehicle as follows: (1) Where: is the inertia matrix, is the Coriolis force and centripetal force matrix, is the damping force matrix, is the restoring force matrix, is the velocity vector, is the control input, is the position vector, is the kinematic transformation matrix.

[0028] Design the corresponding depth, heading, roll, and speed control algorithms as follows: (2) (3) Where: is imaginary, is the desired depth, is the actual depth, is the pitch angle, is the pitch angular velocity, , and are the depth adjustment coefficient, the pitch angle adjustment coefficient, and the pitch angular velocity adjustment coefficient respectively; is the virtual vertical rudder angle, is the desired heading angle, is the actual heading angle, is the heading angular velocity, and are the heading adjustment coefficient and the heading angular velocity adjustment coefficient respectively; is the virtual differential rudder angle, is the roll angle, is the roll angular velocity, and are the roll angle adjustment coefficient and the roll angular velocity adjustment coefficient respectively; is the desired rotational speed, is the seawater density, and are the propeller rotor related wake coefficients respectively, is the length of the vehicle, $v$ is the actual speed of the vehicle, $v_d$ is the desired speed, $C_d$ is the drag coefficient, $K$ is the adjustable coefficient for speed control.

[0029] In step S102, a communication protocol is designed; specifically, the communication protocol includes network communication, CAN bus communication, and serial port 422 communication.

[0030] Specifically, the communication protocol includes: a network communication protocol is adopted between the upper computer and the control system; a CAN bus communication protocol is adopted between the control system and the steering gear, the thruster, the gravity buoyancy adjustment device, and the depth sensor; a serial port 422 communication protocol is adopted between the control system and the inertial navigation device.

[0031] More specifically, it is stipulated that network communication is carried out between the upper computer and the control computer, that is, tasks are sent through the network, and the task parameters include task type, target depth, target heading, target speed, and task duration; it is stipulated that the control computer communicates with the bow and stern steering gears, the gravity buoyancy adjustment device, the thruster, and the depth sensor through CAN communication, that is, these actuators and sensors carry out information interaction through the CAN bus; it is stipulated that the control computer communicates with the inertial navigation through the serial port 422. After receiving the task parameters, as well as the depth information of the depth sensor and the attitude angle, attitude angular velocity, and linear velocity of the inertial navigation, the control computer calculates the command rudder angle and rotational speed according to formulas (2) and (3), and sends them to the steering gear, the thruster, and the gravity buoyancy adjustment device actuator to execute the command.

[0032] In step S103, based on the six-degree-of-freedom model and the communication protocol, a hardware-in-the-loop simulation system is constructed using the Python language; specifically, the hardware-in-the-loop simulation system includes an underwater vehicle dynamics model, a sensor simulation module, and a data communication module.

[0033] Specifically, a hardware-in-the-loop simulation program is written in the Python language, and its core functions include the following aspects: 1) Kinematics and dynamics models of the underwater vehicle: The simulation program simulates the motion characteristics of the vehicle in a complex underwater environment, including changes in linear velocity and angular velocity, and the dynamic evolution of attitude and position, by establishing accurate kinematics and dynamics models as shown in formula (1).

[0034] 2) Physical simulation of the inertial navigation and depth sensor: By modeling the measurement principles of the inertial navigation (INS) and the depth sensor, the simulation program generates inertial navigation data (such as attitude angle, angular velocity, linear velocity) and depth data consistent with the actual device. This part also supports adding environmental noise and sensor drift simulation to further improve the authenticity of the simulation.

[0035] 3) Data Sending and Receiving Module: The simulation program conducts data interaction with the control computer and the actuators through a predefined communication protocol. Among them, the attitude angle, linear velocity, angular velocity, and depth information are packed according to the agreed frame structure and sent to the control computer through the serial port (RS422) and the CAN bus; meanwhile, the simulation program receives the actuator feedback data from the control computer in real time for updating the state of the dynamic model and monitoring the simulation process.

[0036] In step S104, based on the underwater vehicle control algorithm and communication protocol, a control system is constructed using the C language; among them, the control system is used to generate control instructions and realize data interaction with the actuators.

[0037] Specifically, a software program for the control system is written in the C language, and its functional modules include: 1) Control Algorithm Module: Implements the closed-loop control algorithms for the attitude, position, and depth of the vehicle to ensure the stability and accuracy of the vehicle in complex environments.

[0038] 2) Data Communication Module: Follows the communication protocol to conduct efficient data exchange with the simulation program and actual devices. Specifically, it includes receiving the analog data of the inertial navigation and depth sensors through the serial port, sending the control instructions to the steering gear, thruster, and buoyancy adjustment device in a specified format, and processing the feedback data from the actuators in real time.

[0039] 3) Instruction Parsing Module: Receives the task parameters, types, and safety instructions sent by the upper computer and converts them into specific control logics to drive the vehicle to execute the predetermined tasks.

[0040] In step S105, the upper computer is constructed using QT for task parameter distribution and simulation monitoring.

[0041] Specifically, the upper computer software is written using the QT software, and it includes the following functional modules: 1) Task Planning and Parameter Setting: The user inputs the task parameters (such as target depth, target position, and navigation speed), task types (such as hovering, cruising, and landing on the seabed), and safety parameters (such as maximum speed and attitude angle limit) through a friendly graphical interface.

[0042] 2) Real-time Monitoring and Status Display: Real-time displays the status information of the vehicle, such as attitude, position, depth, and speed. The user can dynamically observe the task progress through the interface and adjust the control parameters.

[0043] 3) Data Transmission and Storage: Through the network cable connection, the task instructions are sent to the control computer, and at the same time, the operating status of the vehicle is recorded as a log for subsequent analysis and optimization.

[0044] In step S106, the control system, the hardware-in-the-loop simulation system, the host computer, the actuators and the sensors are connected through network cables, CAN buses and serial port 422 to form a closed-loop simulation system. The host computer issues task instructions, the control system generates control signals to drive the actuators, and the hardware-in-the-loop simulation system calculates the model in real time and feeds back simulation data to realize the closed-loop test of the underwater vehicle control algorithm and software logic.

[0045] Specifically, as Figure 2 shown, the control computer, the hardware-in-the-loop simulation computer and the host computer are connected through network cables, CAN boxes and MOXA boxes. The host computer issues tasks, and the control computer generates control instructions according to the task instructions. After receiving the control instructions, the hardware-in-the-loop simulation computer performs model calculation and outputs the depth, attitude, position, speed and angular velocity information of the underwater vehicle. The attitude and speed angular velocity obtained from the model calculation are transmitted to the simulated inertial navigation device for inertial navigation device simulation and then the simulated inertial navigation data is output. Then, the simulated inertial navigation data is sent to the control computer through serial port 422. The depth information obtained from the model calculation is transmitted to the depth sensor simulation device, and then the simulated depth is output and sent to the control computer through the CAN bus. After receiving the simulated inertial navigation data and simulated depth data, the control computer generates control instructions and sends them to the steering gear, thruster and variable buoyancy adjustment device. The actuators respond to the instructions and send the actuator status to the hardware-in-the-loop simulation computer in real time, thus forming a hardware-in-the-loop simulation closed loop.

[0046] In a specific embodiment, the task type is set as the waypoint tracking task, the target depth is 100 m, and the three target waypoints are (102.03°E, 24.04°N), (102.06°E, 24.00°N), (102.00°E, 24.00°N) respectively. During the navigation process, the changes of data such as depth, longitude and latitude, rudder angle, attitude, and speed are as Figures 2 to 7 shown.

[0047] It can be seen from Figure 3 that the waypoint tracking effect is good, waypoint tracking can be achieved, and it automatically turns to the next waypoint when it is 150 m away from the target, and anchors and surfaces when the task ends.

[0048] It can be seen from Figure 4 that during the waypoint tracking process, the depth control is stable. Only when turning to the next waypoint, due to the coupling of attitude change and depth, a small amount of depth drop occurs. When the attitude stabilizes, the depth control resumes stability.

[0049] Figure 5 The following is the actual steering data of the steering gear of the actuator during the navigation process. Only at the initial stage of entering the water and when turning to the next waypoint, a large rudder angle is used to achieve rapid maneuvering.

[0050] Figure 6 and Figure 7 shows the changes in the attitude angle and attitude angular velocity during navigation. From the heading angle change curve, it can be seen that the vehicle's heading tracking is stable, and the roll angle and pitch angle curves both maintain near 0 during steady-state navigation, indicating that the vehicle's navigation attitude is stable.

[0051] Figure 8 shows the linear velocities of the vehicle in three directions during the mission. During normal navigation tasks, the vehicle mainly focuses on the forward velocity. From the forward velocity curve, it can be seen that the speed is stable during steady-state navigation. During a turning maneuver, due to the depth drop and attitude changes, the vehicle's forward velocity slightly increases. When the vehicle's maneuvering state returns to stability, the speed stabilizes at the desired speed.

[0052] Figure 3 、 Figure 6 、 Figure 7 and Figure 8 The hardware-in-the-loop simulation results of verify the control effects of the depth, attitude, and speed control algorithms. At the same time, they also verify the correctness of the hardware-in-the-loop simulation software process and the reliability of the navigation control system software. It lays a foundation for the actual navigation test of the control software and the underwater vehicle.

[0053] Through the above-mentioned underwater vehicle hardware-in-the-loop simulation method based on Python / QT / C software and hardware in the loop, a control system, a hardware-in-the-loop simulation system, and a host computer are constructed. The control system, the hardware-in-the-loop simulation system, and the host computer are connected through a network cable, a CAN box, and a serial port 422. The host computer issues tasks, and the control system generates control commands according to the task instructions. After receiving the control commands, the hardware-in-the-loop simulation system performs model calculation and outputs the depth, attitude, position, speed, and angular velocity information of the underwater vehicle. The attitude and speed angular velocity obtained from the model calculation are transmitted to the simulated inertial navigation device for inertial navigation device simulation and then the simulated inertial navigation data is output. Then, the simulated inertial navigation data is sent to the control system through the serial port 422. The depth information obtained from the model calculation is transmitted to the depth sensor simulation device, and then the simulated depth is output and sent to the control system through the CAN bus. After receiving the simulated inertial navigation data and the simulated depth data, the control system generates control commands and sends them to the steering gear, thruster, and variable buoyancy adjustment device. The actuator responds to the commands and sends the actuator state to the hardware-in-the-loop simulation system in real time, thus forming a hardware-in-the-loop simulation closed loop.

[0054] It should be understood that the orientation or positional relationships indicated by terms such as "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. in the above description are based on the orientation or positional relationships shown in the drawings. They are only for the convenience of describing the embodiments of the present disclosure and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be construed as a limitation to the embodiments of the present disclosure.

[0055] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present disclosure, the meaning of "a plurality" is two or more unless otherwise specifically defined.

[0056] In the embodiments of the present disclosure, unless otherwise clearly specified and limited, terms such as "mounted", "connected", "coupled", "fixed", etc. shall be construed in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium, and it may be the internal communication of two elements or the interaction relationship between two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present disclosure can be understood according to specific circumstances.

[0057] In the embodiments of the present disclosure, unless otherwise clearly specified and limited, the first feature being "on" or "under" the second feature may include the direct contact between the first and second features, or may include the situation where the first and second features are not in direct contact but in contact through additional features therebetween. Moreover, the first feature being "above", "over" and "on top of" the second feature includes that the first feature is directly above and obliquely above the second feature, or merely indicates that the horizontal height of the first feature is higher than that of the second feature. The first feature being "under", "beneath" and "underneath" the second feature includes that the first feature is directly below and obliquely below the second feature, or merely indicates that the horizontal height of the first feature is lower than that of the second feature.

[0058] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification.

[0059] Other embodiments of the present disclosure will be readily apparent to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure, which follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the appended claims.

Claims

1. A semi-physical simulation method for underwater vehicles based on Python / QT / C hardware-in-the-loop, characterized in that: The method includes: Establish the six-degree-of-freedom kinematic and dynamic model of the underwater vehicle and design the underwater vehicle control algorithm; Design communication protocols; communication protocols include network communication, CAN bus communication and serial port 422 communication; Based on the six-degree-of-freedom model and communication protocol, a semi-physical simulation system is constructed using Python language; among them, the semi-physical simulation system includes underwater vehicle dynamics model, sensor simulation module and data communication module; Based on the underwater vehicle control algorithm and communication protocol, the control system is constructed using C language; the control system is used to generate control instructions and realize data interaction with the actuator; Use QT to build a host computer for task parameter distribution and simulation monitoring; The control system, semi-physical simulation system, host computer, actuators and sensors are connected via network cables, CAN bus and serial port 422 to form a closed-loop simulation system. The host computer issues task instructions, the control system generates control signals to drive the actuators, and the semi-physical simulation system solves the model in real time and feeds back simulation data to achieve closed-loop testing of the underwater vehicle control algorithm and software logic.

2. According to claim 1, the underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop is characterized in that: The steps of establishing the six-degree-of-freedom kinematic and dynamic model of the underwater vehicle and designing the control algorithm of the underwater vehicle include: Based on Newton's law and rigid body kinematics analysis method, a six-degree-of-freedom kinematics and dynamics model is constructed; the six-degree-of-freedom kinematics and dynamics model includes inertia matrix, Coriolis force and centripetal force matrix, damping force matrix, restoring force matrix and velocity vector parameters; An underwater vehicle control algorithm is designed to achieve closed-loop regulation of depth, heading, roll and speed; the underwater vehicle control algorithm includes a depth control algorithm, a heading control algorithm, a roll control algorithm and a speed control algorithm.

3. The underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop according to claim 1 is characterized in that: The communication protocol specifically includes: A network communication protocol is used between the host computer and the control system; The CAN bus communication protocol is used between the control system and the steering gear, thruster, gravity and buoyancy adjustment device and depth sensor; The serial port 422 communication protocol is used between the control system and the inertial navigation unit.

4. According to claim 1, the underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop is characterized in that: The semi-physical simulation system also includes: The physical simulation module of the inertial navigation device is used to generate attitude, angular velocity and linear velocity simulation data; A physical simulation module of a depth sensor, used to generate depth simulation data; Actuator state feedback receiving module, used for closed-loop simulation iteration.

5. The underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop according to claim 1 is characterized in that: The control system includes: A control algorithm module is used to generate control instructions for the steering gear, thruster and weight-buoyancy adjustment device according to the simulation data; The data analysis module is used to process the communication data from sensors and semi-physical simulation systems.

6. The underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop according to claim 1 is characterized in that: The operation process of the closed-loop simulation system includes: The semi-physical simulation system receives control instructions and solves the model, outputting attitude, speed and depth simulation data; The simulation data is converted into analog signals through the sensor simulation module and fed back to the control system; The control system generates new control instructions based on the feedback data and drives the actuator to complete the closed-loop response.

7. The underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop according to claim 1 is characterized in that: The actuators include bow and stern steering gears, thrusters and weight-buoyancy adjustment devices, and the sensors include depth sensors and inertial navigation devices.

8. The underwater vehicle semi-physical simulation method based on Python / QT / C hardware-in-the-loop according to claim 1 is characterized in that: The host computer supports mission parameter configuration, including waypoint coordinates, target depth, mission duration and safety threshold.

Citation Information

Patent Citations

  • SINS / CNS / GPS Combined navigation semi-entity copying system

    CN100476853C

  • Strapdown intertial / celestial combined navigation semi-material emulation system

    CN1330936C