Underwater robot attitude control method and device, and underwater robot
By using the dual-loop control mechanism of the PID attitude control algorithm and the PWM modulated signal closed-loop feedback adjustment algorithm on the underwater robot, the problem of response lag in the traditional PID control algorithm is solved, and fast and accurate attitude control is achieved, which improves the attitude stability and response speed of the underwater robot.
Patent Information
- Application Number
- CN202510706386.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-05
AI Technical Summary
In the existing attitude control methods of underwater robots, the traditional PID control algorithm has lagged response, resulting in the problem of imbalance of the robot when the posture changes.
The dual-loop control mechanism of PID attitude control algorithm and PWM modulated signal closed-loop feedback adjustment algorithm is adopted to obtain sensing data through the attitude sensor group for solution, combine the genetic algorithm to optimize the PID parameters, and use the nonlinear compensation model to adjust the PWM duty cycle to achieve accurate control of the underwater robot.
The response speed and accuracy of attitude control are accelerated, and the attitude stability and control accuracy of underwater robots under sudden interference are improved.
Smart Images

Figure CN120595834A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of robot control technology, and in particular to a method and device for controlling the posture of an underwater robot, and an underwater robot. Background Art
[0002] With the development of science and technology, underwater robots are often used to detect underwater environments or underwater objects. During the operation of underwater robots, the posture of the underwater robots is controlled by obtaining relevant sensor signals.
[0003] Current posture control is usually implemented using traditional PID control algorithms. This control algorithm usually has a certain response lag, especially for sudden posture changes, its response will be even more delayed, and may even cause the robot to become unbalanced. Summary of the Invention
[0004] The embodiments of the present application provide a method and device for controlling the posture of an underwater robot, and an underwater robot, so as to accelerate the response speed of posture control.
[0005] In a first aspect, an embodiment of the present application provides a method for controlling the posture of an underwater robot, wherein the underwater robot is provided with a posture sensor group, and the method includes:
[0006] Acquire the sensor data of the attitude sensor group, and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot;
[0007] Obtain the target posture output by the underwater robot's controller, and input the target posture and posture into a pre-set PID posture control algorithm to obtain the initial control signal for each motor of the underwater robot;
[0008] Input the initial control signal into the pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation, and obtain the compensated control signal of each motor;
[0009] The control signals of each motor are used to control the corresponding motor of the underwater robot to achieve the control of the posture of the underwater robot.
[0010] In a second aspect, an embodiment of the present application provides a device for controlling the posture of an underwater robot, wherein the underwater robot is provided with a posture sensor group, and the device includes:
[0011] The attitude calculation module is used to obtain the sensor data of the attitude sensor group and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot;
[0012] The attitude processing module is used to obtain the target attitude output by the underwater robot's controller and input the target attitude and attitude into the pre-set PID attitude control algorithm to obtain the initial control signal for each motor of the underwater robot;
[0013] The attitude compensation module is used to input the initial control signal into the pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, and obtain the compensated control signal of each motor;
[0014] The posture control module is used to control the corresponding motors of the underwater robot using the control signals of each motor to achieve control of the posture of the underwater robot.
[0015] In a third aspect, an embodiment of the present application provides an underwater drone, comprising:
[0016] one or more processors;
[0017] a storage device for storing one or more programs,
[0018] When one or more programs are executed by one or more processors, the one or more processors implement the underwater robot posture control method provided in any embodiment of the present application.
[0019] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for controlling the posture of an underwater robot as provided in any embodiment of the present application.
[0020] The technical solution of the embodiment of the present application obtains sensor data from a posture sensor group and performs posture calculation based on the sensor data to obtain the current posture of the underwater robot; obtains the target posture output by the underwater robot's controller and inputs the target posture and posture into a pre-set PID posture control algorithm to obtain initial control signals for each motor of the underwater robot; inputs the initial control signals into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation to obtain the compensated control signals for each motor; and uses the control signals of each motor to control the corresponding motor of the underwater robot to achieve posture control of the underwater robot. Based on this, the dual-loop control mechanism of the PID posture control algorithm and the PWM modulation signal closed-loop feedback adjustment algorithm can effectively accelerate the response speed and accuracy of posture control. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A flow chart of a method for controlling the posture of an underwater robot provided in Example 1 of the present application;
[0022] Figure 2A schematic diagram of the structure of a control device for the posture of an underwater robot provided in Example 2 of the present application;
[0023] Figure 3 This is a schematic diagram of the structure of an underwater drone provided in Example 3 of the present application. DETAILED DESCRIPTION
[0024] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are intended only to illustrate the present application and are not intended to limit the present application. It should also be noted that, for ease of description, the accompanying drawings only illustrate portions of the present application, not all of the structures.
[0025] Example 1
[0026] Figure 1 This is a flow chart of the method for controlling the posture of an underwater robot provided in Example 1 of the present application, as shown in FIG. Figure 1 As shown, the control method of the underwater robot posture provided in this embodiment can be implemented in the controller of the underwater robot, and specifically may include:
[0027] Step 101: Acquire sensor data from a posture sensor group, perform posture calculation based on the sensor data, and obtain the current posture of the underwater robot.
[0028] In this step, the attitude sensor group may include a variety of high-precision sensors deployed at key parts of the underwater robot, such as an inertial measurement unit (IMU), a depth sensor, an underwater camera, and a speed sensor.
[0029] Among them, the inertial measurement unit (IMU) is used to collect the robot's acceleration and angular velocity data in real time, providing basic information for posture calculation; the depth sensor uses a pressure sensor to accurately measure the robot's depth to assist in analyzing the balance between buoyancy and gravity; the underwater camera serves as a visual sensor to capture images of the surrounding environment, helping to identify targets and locate reference points; at the same time, a speed sensor is installed on the motor drive shaft to monitor the motor speed in real time, providing data support for establishing a dynamic coupling model of motor response characteristics and posture changes.
[0030] Once the sensor data from each of the aforementioned sensors is acquired, a solution can be performed. To improve solution accuracy, this sensor data can be preprocessed, such as by filtering. Specifically, the sensor data can be filtered to remove noise and outliers. For IMU data, complementary filtering or Kalman filtering algorithms can be used to fuse accelerometer and gyroscope data to improve the accuracy of attitude information. Image data collected by the visual sensor can be preprocessed with image enhancement and noise reduction to facilitate subsequent feature extraction and analysis.
[0031] The filtered sensor data is then fused to obtain sensor fusion data; the sensor fusion data is then used to calculate the current posture of the underwater robot.
[0032] It should be noted that when performing sensor data fusion, the Kalman filter algorithm can be used to perform noise reduction and fusion on the filtered sensor data to obtain sensor fusion data.
[0033] Specifically, the fusion process is mainly realized by the observation noise covariance matrix, which can be divided into the prediction stage, the update stage and the collaborative fusion stage.
[0034] In the prediction phase, the current state prior estimate x^k|k-1 = Fx^k-1 is predicted based on the previous state estimate x^k-1 and the state transition matrix F, and the state covariance matrix Pk|k-1 = FPk-1FT+Q is updated. This step uses the robot's dynamic model and the previous state information to make a preliminary prediction of the current state.
[0035] In the update phase, when the sensor layer collects new measurement data (such as IMU data, depth sensor data, etc.), the data processing layer compares the measured value zk with the predicted observation value Hx^k|k-1 and calculates the measurement residual ek=zk-Hx^k|k-1. Then, according to the Kalman gain formula Kk=Pk|k-1HT(HPk|k-1HT+R)-1
[0036] The Kalman gain is calculated to adjust the weight between the predicted value and the measured value. Finally, the state estimate x^k = x^k|k-1 + Kkek and the state covariance matrix Pk = (I-KkH)Pk|k-1 are updated to obtain a more accurate estimate of the current state.
[0037] During the fusion phase, the observation noise covariance matrix R is adjusted for each sensor type based on its measurement characteristics and noise level. For example, for high-precision IMU sensors, the observation noise covariance is appropriately reduced; for visual sensors that are more susceptible to environmental influences, the observation noise covariance is dynamically adjusted based on environmental conditions. The Kalman filter algorithm fuses data from multiple sensors, fully leveraging the strengths of each sensor, suppressing noise interference, and improving the accuracy and reliability of attitude calculations.
[0038] In addition, the process of using sensor fusion data to perform attitude calculation can refer to the relevant technology of using sensor data to perform attitude calculation, which will not be repeated here.
[0039] Step 102: Obtain the target posture output by the controller of the underwater robot, and input the target posture and posture into a preset PID posture control algorithm to obtain initial control signals for each motor of the underwater robot.
[0040] In this step, the controller outputs the desired target posture based on the acquired environment and path planning. This is the posture that the underwater robot needs to achieve. This target posture can be used as the desired input for the PID posture control algorithm.
[0041] It should be noted that the Kp, TI, and TD parameters in the PID attitude control algorithm in this step can be optimized using a genetic algorithm. Specifically, a genetic algorithm is used to construct an optimization model at the algorithm's decision layer, using attitude error (e.g., mean square error (MSE)) as the fitness function. The three PID parameters Kp, TI, and TD are encoded, simulating the selection, crossover, and mutation operations used in biological evolution to search for the optimal solution in the parameter space.
[0042] After each iteration, the fitness value is calculated based on the posture data fed back by the sensor layer after the power drive layer controls the motor operation, and the population is continuously evolved until the PID parameter combination that minimizes the posture error is found, thereby achieving the control accuracy requirements in the energy consumption-stability optimization function.
[0043] It should be noted that this embodiment sets up a dual-loop control mechanism. The outer loop is the PID attitude control algorithm in this step, which is used to control the overall attitude of the underwater robot, and the inner loop is the PWM modulation signal closed-loop feedback adjustment algorithm in step 103, which is used to control the speed and / or torque of the motor.
[0044] In order to further enhance the flexible coordination of dual-loop control, this embodiment can establish a dynamic weight distribution model for dual-loop coordination, and adjust the weight ratio of the inner and outer loop control instructions in real time according to the robot's task requirements, operating status and environmental conditions.
[0045] When the robot performs delicate manipulation tasks (such as underwater sampling and target recognition), the weight of the outer loop on posture control is increased to ensure the accuracy of the overall posture; when encountering sudden strong interference (such as violent water flow impact), the weight of the inner loop is increased to quickly stabilize the motor speed / torque and restore the robot's posture.
[0046] The dynamic adjustment of weights is completed by the algorithm decision layer based on preset rules and real-time data calculations, realizing flexible coordination of dual-loop control.
[0047] Step 103: Input the initial control signal into a pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation, to obtain a compensated control signal for each motor.
[0048] In this step, the initial control signal includes the initial control sub-signal corresponding to each motor. When compensation is performed, for the initial control sub-signal of any motor, it is determined whether the initial control sub-signal of the motor meets the low-speed operation judgment condition; if so, the duty cycle of the initial control signal is adjusted using the nonlinear compensation model in the PWM modulation signal closed-loop feedback adjustment algorithm to obtain the control signal of each motor after compensation; if not, the initial control sub-signal is determined as the control signal of each motor after compensation.
[0049] Among them, if the motor speed corresponding to the initial control sub-signal is less than or equal to the preset speed threshold, it is determined that the initial control sub-signal of the motor meets the low-speed operation determination condition; if the motor speed corresponding to the initial control sub-signal is greater than the preset speed threshold, it is determined that the initial control sub-signal of the motor does not meet the low-speed operation determination condition.
[0050] It should be noted that the aforementioned nonlinear compensation model is used to characterize the nonlinear relationship between the PWM duty cycle and the actual speed of the motor.
[0051] Specifically, a nonlinear PWM modulation compensation algorithm can be developed. Based on the nonlinear characteristics of the motor when running at low speed, a nonlinear model of the PWM duty cycle and the actual speed of the motor is established, combined with the integral separation PID control algorithm, the PWM duty cycle can be dynamically adjusted to improve the low-speed control accuracy.
[0052] In addition, in order to realize the millisecond-level synchronous compensation algorithm for multi-motor collaborative control, a high-precision clock synchronization mechanism and error monitoring module can be used to ensure that each motor controller can start synchronously when receiving the control signal, and adjust the motor operating parameters in real time to ensure the consistency of multi-motor collaborative work.
[0053] In this step, a closed-loop feedback regulation mechanism for the PWM modulation signal is established. The actual motor output torque, speed, and other data are fed back to the modulator through the sensor layer and compared with the target value. If there is a deviation, the modulator adjusts the PWM signal parameters (such as duty cycle and frequency) in real time based on the size and direction of the deviation. By combining the overall posture control requirements of the outer loop with the motor speed / torque control feedback of the inner loop, the PWM modulation strategy is dynamically optimized to ensure precise motor control and maintain robot posture stability even under extreme operating conditions.
[0054] Step 104: Use the control signals of the motors to control the corresponding motors of the underwater robot to achieve control of the posture of the underwater robot.
[0055] In this step, for any motor, the motor is driven using a corresponding control signal and a preset motor driver and power amplifier.
[0056] It should be noted that high-performance motor drivers and power amplifiers can be used to ensure stable and reliable drive current to meet the motor's operating requirements under different operating conditions. At the same time, precise control of the motor's direction and speed can be achieved. Through the rational layout of the thrusters, the required thrust and torque can be generated, enabling precise adjustment of the underwater robot's posture.
[0057] In this embodiment, sensor data from a posture sensor group is acquired and a posture solution is performed based on the sensor data to determine the underwater robot's current posture. A target posture output by the underwater robot's controller is acquired and the target posture and posture are input into a pre-set PID posture control algorithm to obtain initial control signals for each motor of the underwater robot. The initial control signals are then input into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, resulting in compensated control signals for each motor. The control signals for each motor are then used to control the corresponding motor of the underwater robot to achieve posture control of the underwater robot. This dual-loop control mechanism, utilizing both a PID posture control algorithm and a PWM modulation signal closed-loop feedback adjustment algorithm, can effectively accelerate the response speed and accuracy of posture control.
[0058] Example 2
[0059] Figure 2 This is a schematic diagram of the structure of a control device for the posture of an underwater robot provided in the second embodiment of the present application. The control device for the posture of an underwater robot provided in the embodiment of the present application can execute the control method for the posture of an underwater robot provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. The device can be implemented in software and / or hardware, such as Figure 2 As shown, the underwater robot posture control device specifically includes: a posture solving module 201, a posture processing module 202, a posture compensation module 203, and a posture control module 204.
[0060] The attitude calculation module is used to obtain the sensor data of the attitude sensor group and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot;
[0061] The attitude processing module is used to obtain the target attitude output by the underwater robot's controller and input the target attitude and attitude into the pre-set PID attitude control algorithm to obtain the initial control signal for each motor of the underwater robot;
[0062] The attitude compensation module is used to input the initial control signal into the pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, and obtain the compensated control signal of each motor;
[0063] The posture control module is used to control the corresponding motors of the underwater robot using the control signals of each motor to achieve control of the posture of the underwater robot.
[0064] In this embodiment, sensor data from a posture sensor group is acquired and a posture solution is performed based on the sensor data to determine the underwater robot's current posture. A target posture output by the underwater robot's controller is acquired and the target posture and posture are input into a pre-set PID posture control algorithm to obtain initial control signals for each motor of the underwater robot. The initial control signals are then input into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, resulting in compensated control signals for each motor. The control signals for each motor are then used to control the corresponding motor of the underwater robot to achieve posture control of the underwater robot. This dual-loop control mechanism, utilizing both a PID posture control algorithm and a PWM modulation signal closed-loop feedback adjustment algorithm, can effectively accelerate the response speed and accuracy of posture control.
[0065] Example 3
[0066] Figure 3 This is a schematic diagram of the structure of an underwater drone provided in Example 3 of this application, such as Figure 3 As shown, the underwater drone includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in the underwater drone can be one or more. Figure 3 In the figure, a processor 310 is used as an example; the processor 310, memory 320, input device 330 and output device 340 in the underwater drone can be connected via a bus or other means. Figure 3 The bus connection is taken as an example.
[0067] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the underwater robot posture control method in the embodiment of the present invention. The processor 310 executes the software programs, instructions, and modules stored in the memory 320 to execute various functional applications and data processing of the underwater drone, that is, to implement the above-mentioned underwater robot posture control method:
[0068] Acquire the sensor data of the attitude sensor group, and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot;
[0069] Obtain the target posture output by the underwater robot's controller, and input the target posture and posture into a pre-set PID posture control algorithm to obtain the initial control signal for each motor of the underwater robot;
[0070] Input the initial control signal into the pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation, and obtain the compensated control signal of each motor;
[0071] The control signals of each motor are used to control the corresponding motor of the underwater robot to achieve the control of the posture of the underwater robot.
[0072] In this embodiment, sensor data from a posture sensor group is acquired and a posture solution is performed based on the sensor data to determine the underwater robot's current posture. A target posture output by the underwater robot's controller is acquired and the target posture and posture are input into a pre-set PID posture control algorithm to obtain initial control signals for each motor of the underwater robot. The initial control signals are then input into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, resulting in compensated control signals for each motor. The control signals for each motor are then used to control the corresponding motor of the underwater robot to achieve posture control of the underwater robot. This dual-loop control mechanism, utilizing both a PID posture control algorithm and a PWM modulation signal closed-loop feedback adjustment algorithm, can effectively accelerate the response speed and accuracy of posture control.
[0073] Furthermore, the initial control signal includes an initial control sub-signal corresponding to each motor;
[0074] The initial control signal is input into the pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, and the compensated control signals of each motor are obtained, including:
[0075] For an initial control sub-signal of any motor, determining whether the initial control sub-signal of the motor meets a low-speed operation determination condition;
[0076] If the conditions are met, the duty cycle of the initial control signal is adjusted using the nonlinear compensation model in the PWM modulation signal closed-loop feedback regulation algorithm to obtain the compensated control signals of each motor.
[0077] If not, the initial control sub-signal is determined as the control signal of each motor after compensation.
[0078] Furthermore, determining whether the initial control sub-signal of the motor meets the low-speed operation determination condition includes:
[0079] If the motor speed corresponding to the initial control sub-signal is less than or equal to the preset speed threshold, it is determined that the initial control sub-signal of the motor meets the low-speed operation determination condition;
[0080] If the motor speed corresponding to the initial control sub-signal is greater than the preset speed threshold, it is determined that the motor's initial control sub-signal does not meet the low-speed operation determination condition.
[0081] Furthermore, the attitude is calculated based on the sensor data to obtain the current attitude of the underwater robot, including:
[0082] Filtering the sensor data and fusing the filtered sensor data to obtain sensor fusion data;
[0083] The current posture of the underwater robot is calculated using sensor fusion data.
[0084] Furthermore, the filtered sensor data is fused to obtain sensor fusion data, including:
[0085] The Kalman filter algorithm is used to perform noise reduction and fusion on the filtered sensor data to obtain sensor fusion data.
[0086] Furthermore, the control signals of the motors are used to control the corresponding motors of the underwater robot, including:
[0087] For any motor, the corresponding control signal and the preset motor driver and power amplifier are used to drive the motor.
[0088] Furthermore, a nonlinear compensation model is used to characterize the nonlinear relationship between the PWM duty cycle and the actual speed of the motor.
[0089] Memory 320 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function; the data storage area may store data generated based on the terminal's usage. Furthermore, memory 320 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state memory device. In some instances, memory 320 may further include memory remotely located relative to processor 310. Such remote memory may be connected to the underwater drone via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0090] Example 4
[0091] The fourth embodiment of the present application further provides a storage medium containing computer-executable instructions. When the computer-executable instructions are executed by a computer processor, they are used to execute a method for controlling the posture of an underwater robot. The method includes:
[0092] Acquire the sensor data of the attitude sensor group, and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot;
[0093] Obtain the target posture output by the underwater robot's controller, and input the target posture and posture into a pre-set PID posture control algorithm to obtain the initial control signal for each motor of the underwater robot;
[0094] Input the initial control signal into the pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation, and obtain the compensated control signal of each motor;
[0095] The control signals of each motor are used to control the corresponding motor of the underwater robot to achieve the control of the posture of the underwater robot.
[0096] In this embodiment, sensor data from a posture sensor group is acquired and a posture solution is performed based on the sensor data to determine the underwater robot's current posture. A target posture output by the underwater robot's controller is acquired and the target posture and posture are input into a pre-set PID posture control algorithm to obtain initial control signals for each motor of the underwater robot. The initial control signals are then input into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, resulting in compensated control signals for each motor. The control signals for each motor are then used to control the corresponding motor of the underwater robot to achieve posture control of the underwater robot. This dual-loop control mechanism, utilizing both a PID posture control algorithm and a PWM modulation signal closed-loop feedback adjustment algorithm, can effectively accelerate the response speed and accuracy of posture control.
[0097] Furthermore, the initial control signal includes an initial control sub-signal corresponding to each motor;
[0098] The initial control signal is input into the pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, and the compensated control signals of each motor are obtained, including:
[0099] For an initial control sub-signal of any motor, determining whether the initial control sub-signal of the motor meets a low-speed operation determination condition;
[0100] If the conditions are met, the duty cycle of the initial control signal is adjusted using the nonlinear compensation model in the PWM modulation signal closed-loop feedback regulation algorithm to obtain the compensated control signals of each motor.
[0101] If not, the initial control sub-signal is determined as the control signal of each motor after compensation.
[0102] Furthermore, determining whether the initial control sub-signal of the motor meets the low-speed operation determination condition includes:
[0103] If the motor speed corresponding to the initial control sub-signal is less than or equal to the preset speed threshold, it is determined that the initial control sub-signal of the motor meets the low-speed operation determination condition;
[0104] If the motor speed corresponding to the initial control sub-signal is greater than the preset speed threshold, it is determined that the motor's initial control sub-signal does not meet the low-speed operation determination condition.
[0105] Furthermore, the attitude is calculated based on the sensor data to obtain the current attitude of the underwater robot, including:
[0106] Filtering the sensor data and fusing the filtered sensor data to obtain sensor fusion data;
[0107] The current posture of the underwater robot is calculated using sensor fusion data.
[0108] Furthermore, the filtered sensor data is fused to obtain sensor fusion data, including:
[0109] The Kalman filter algorithm is used to perform noise reduction and fusion on the filtered sensor data to obtain sensor fusion data.
[0110] Furthermore, the control signals of the motors are used to control the corresponding motors of the underwater robot, including:
[0111] For any motor, the corresponding control signal and the preset motor driver and power amplifier are used to drive the motor.
[0112] Furthermore, a nonlinear compensation model is used to characterize the nonlinear relationship between the PWM duty cycle and the actual speed of the motor.
[0113] Of course, the storage medium containing computer-executable instructions provided in an embodiment of the present application is not limited to the above method operations, and its computer-executable instructions can also execute related operations in the underwater robot posture control method provided in any embodiment of the present application.
[0114] Through the above description of the implementation methods, those skilled in the art can clearly understand that the present application can be implemented with the help of software and necessary general-purpose hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer's floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0115] It is worth noting that in the embodiment of the above-mentioned search device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.
[0116] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of the present application. The scope of the present application is determined by the scope of the appended claims.
Claims
1. A method for controlling the posture of an underwater robot, characterized in that: The underwater robot is provided with a posture sensor group, and the method comprises: Acquiring sensor data from the attitude sensor group, and performing attitude calculation based on the sensor data to obtain the current attitude of the underwater robot; Obtaining a target posture output by a controller of the underwater robot, and inputting the target posture and the posture into a preset PID posture control algorithm to obtain an initial control signal for each motor of the underwater robot; Inputting the initial control signal into a pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation to obtain a compensated control signal for each motor; The control signals of the motors are used to control the corresponding motors of the underwater robot, so as to realize the control of the posture of the underwater robot.
2. The method according to claim 1, characterized in that The initial control signal includes an initial control sub-signal corresponding to each motor; Inputting the initial control signal into a pre-established PWM modulation signal closed-loop feedback regulation algorithm for compensation to obtain the compensated control signal of each motor includes: For an initial control sub-signal of any motor, determining whether the initial control sub-signal of the motor meets a low-speed operation determination condition; If the conditions are met, the duty cycle of the initial control signal is adjusted using the nonlinear compensation model in the PWM modulation signal closed-loop feedback adjustment algorithm to obtain a compensated control signal for each motor; If not, the initial control sub-signal is determined as the control signal of each motor after compensation.
3. The method according to claim 2, characterized in that The determining whether the initial control sub-signal of the motor meets the low-speed operation determination condition includes: If the motor speed corresponding to the initial control sub-signal is less than or equal to a preset speed threshold, it is determined that the initial control sub-signal of the motor meets the low-speed operation determination condition; If the motor speed corresponding to the initial control sub-signal is greater than a preset speed threshold, it is determined that the initial control sub-signal of the motor does not meet the low-speed operation determination condition.
4. The method according to claim 1, wherein The performing posture calculation according to the sensor data to obtain the current posture of the underwater robot includes: Filtering the sensor data, and fusing the filtered sensor data to obtain sensor fusion data; The sensor fusion data is used to calculate the current posture of the underwater robot.
5. The method according to claim 4, characterized in that The step of fusing the filtered sensor data to obtain sensor fusion data includes: The Kalman filter algorithm is used to perform noise reduction and fusion on the filtered sensor data to obtain sensor fusion data.
6. The method according to claim 1, characterized in that The controlling of the corresponding motors of the underwater robot by using the control signals of the motors includes: For any motor, the motor is driven using the corresponding control signal and a preset motor driver and power amplifier.
7. The method according to claim 2, characterized in that The nonlinear compensation model is used to characterize the nonlinear relationship between the PWM duty cycle and the actual speed of the motor.
8. A control device for the posture of an underwater robot, characterized in that: The underwater robot is provided with a posture sensor group, and the device includes: An attitude calculation module is used to obtain the sensor data of the attitude sensor group and perform attitude calculation based on the sensor data to obtain the current attitude of the underwater robot; a posture processing module, configured to obtain a target posture output by a controller of the underwater robot, and input the target posture and the posture into a preset PID posture control algorithm to obtain an initial control signal for each motor of the underwater robot; A posture compensation module is used to input the initial control signal into a pre-established PWM modulation signal closed-loop feedback adjustment algorithm for compensation, thereby obtaining a compensated control signal for each motor; The posture control module is used to control the corresponding motors of the underwater robot using the control signals of the motors to achieve control of the posture of the underwater robot.
9. An underwater drone, characterized in that: The underwater drone comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method for controlling the posture of the underwater robot as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for controlling the posture of an underwater robot as described in any one of claims 1 to 7 is implemented.