CUAV RTK initial experience and feelings

Record the experience of using RTK for UAV positioning and operation

1. RTK positioning settings

The RTK produced and released by CUAV is used. The model is C9P. At present, this product has been taken off the shelves, and the new C9PS is on the market.
It doesn't need too many settings. After the flight controller is connected to RTK (including the ordinary GPS module), it needs to be re-set before it can be used.
The lines that RTK needs to connect to the flight control include GPS and UART4, and also need a data transmission to connect to TEMP1; the ground station is connected to the usb of the flight control and data transmission, and the QGC software needs to be opened to perform RTK positioning.

二、MAVROS

After opening, you can use mavros to read the ROS topic of the drone, which is based on the mavlink protocol.
Looking at the local_position topic, you can see that the coordinates are still quite stable, but during the test, the height deviation is relatively large, which will be discussed later.
However, in the process of using the communication.py code of XTDrone to communicate, the originally OK code reported an error, showing that frame 0 of NED is not supported. The solution is to set a target address after starting the program, otherwise the default NED target coordinate setting is not supported in RTK.

3. Positioning height

In the RTK actual measurement, the accuracy of the horizontal position can reach within 2cm, and the conversion is ±1cm, which is the accuracy of cm level.
However, the height jitter and error are relatively large. During the test today (December 21, 2022), the height error reached nearly 2m. In the previous several errors, the error also reached 1m. Ask the seller and say this is a normal margin of error.
I also think it is normal, GPS is quite accurate for horizontal accuracy, but for height measurement, it even reaches more than ten meters. RTK can reach a few meters is already very good. In addition, the altitude is also measured based on the barometer inside the flight controller. Since the air pressure measured by the barometer has a relatively large range of changes, the value changes greatly under changes in temperature and wind speed. One of the reasons for the larger error in the test height today is the relatively high wind speed.
Solved: see the content below the fourth point.

4. Highly integrated method

What currently comes to mind is highly complementary using other methods. The first is the ranging module: ultrasonic or laser. It can ensure that the height measurement is performed when the height is not so high (considering that the outdoor test does not need to be so high, and this height error can be ignored after the height is high). In the test, the scene needs to be considered. For example, our current test is on an outdoor lawn. Whether there will be a large error in laser ranging for such an irregular surface needs to be considered.

  1. First of all, see if you can directly use the internal method of PX4 for fusion, (digging)
  2. Using another method of writing a program, the height has little influence on the offboard control of PX4, and even an external program can be written to generate a new height data for subsequent measurement. But this method may not be as flexible as the above method, and the above method is preferred.
  3. Resolved: In the height fusion setting (EKF_HEIGHT) in QGC, the default barometer is still used, but the accuracy of the barometer will be poor in windy conditions. After modifying to GPS, you can use the height of RTK, and the accuracy is not bad.

5. Multi-UAV RTK

Preliminary test: It can realize high-precision positioning of one RTK base station and three RTK mobile stations at the same time, and maintain high precision after moving back and forth many times.
Notes on setting: Since RTK needs data transmission, it also needs a data transmission base station and 3 data transmission mobile stations. If nothing is set, QGC will cause garbled characters. The settings include: ①The transmission target address of the fixed data transmission mobile station is the data transmission base station, which is broadcast by default, which affects other channels; be able to distinguish.
Problems encountered: The relative positions of multiple drones will not be reflected. Their initial coordinates are all their own, and the initialization is not necessarily 0, and they may float to far and high places. Therefore, in the follow-up, this problem needs to be solved.
Possible methods: First, the initial position of the drones needs to be placed reasonably to ensure that their physical coordinates are clear. Secondly, it is necessary to ensure that the coordinates of the drones have been stabilized. The coordinates of each drone may not be stable immediately. Finally, the relative offset is resolved programmatically.

6. Altitude changes in multi-UAV RTK tests

Actual UAV test situation: Due to the above, the height positioning of the UAV has been modified to GPS, which is the height provided by RTK. In the test of a single UAV, the UAV can be tested normally and maintain a relatively stable state at the horizontal position and height. However, in the test of the three UAVs, the main UAV (one of them) took off at a target height of 2m, but it would rush to a height of 8m, but the height data showed that it was only increased by 2m. will land. The other two UAVs have more or less serious problems with height data deviation.
Guess 1: RTK altitude positioning is not very good. It is good luck that a drone successfully flies.
Guess 2: In the case of multiple UAVs in RTK, the data transmission and communication capabilities of the ground station are limited, and frame loss will cause data errors.
Guess 3: The altitude coordinates of multiple drones are confused, and the ground station did not send the altitude data separately.
Guess 4: ~
This is one of the pictures, the coordinates of the Z axis during the flight in the picture, because the Z axis is positive downward, it looks reversed. It can be seen that the Z-axis target point has not changed, but at 40s, the measured Z-axis height drops (that is, the drone is flying down as measured by the sensor), and the drone flies up in order to maintain the altitude . It is conceivable that due to unknown problems, the Z-axis altitude obtained by the sensor keeps decreasing (it does not actually drop), and the drone increases the accelerator to maintain the altitude, resulting in the actual altitude constantly rising. At the end the z target point suddenly becomes 1, which is a bit hard to understand.
insert image description here

7. The causes and solutions of the above problems

Reason: After consulting customer service and analysis, it may be that the RTK data volume is large and the data transmission performance used is not enough, resulting in insufficient positioning data sent to the UAV, resulting in large deviations in UAV positioning accuracy. In the subsequent test process, after using only two drones, the positioning problem of the drones was solved, further verifying the cause of the above problems.
Follow-up: Consider whether to remove QGC data other than the necessary data of RTK to reduce the load, so that the three UAVs can also locate and work normally.

8. After the drone MAVLINK_SYS_ID is set to other, it cannot connect with mavros

Problem: In the test of two drones, the second drone cannot be controlled by mavros, and there are problems of unable to arm and switch offboard, while the remote control is normally controlled. Looking at the topic data, I found the problem:
insert image description here
the problem is that connected is false.
Solution: By checking the px4.launch file, it is found that one of the parameters needs to be modified accordingly, and it can be changed to 2, or set in roslaunch:
roslaunch mavros px4.launch tgt_system:=2
insert image description here

9. Continue to test the positioning flight of three drones

To sum up, 2 UAVs have been tested so far, using RTK positioning, and flying normally under the control of the onboard computer offboard. Need to continue to increase the number of drones to 3 for testing.
Test results: When there were three drones, the serious problem of positioning jitter continued to occur, and it was determined that the RTK could not work normally due to insufficient data transmission and communication capabilities. The digital transmission is only 200bps, even the more expensive digital transmissions do not exceed 300, because they are designed for long distance. For this reason, wifi data transmission can be considered, the following are reference materials:

  1. csdn tutorial: https://blog.csdn.net/u013181595/article/details/90313964
  2. PX4 official tutorial: https://docs.px4.io/main/en/telemetry/telemetry_wifi.html
    You can use ESP8266 or esp32, if the communication ability is insufficient, you can consider the esp32 version with external antenna. Note that there are mainly the following points: 1. It can be set to STA mode, and they can be connected to the router, so that one-to-many communication can be performed; 2. Fixed ground station ip, fixed target address of UAV data transmission, to prevent network occupation ; 3. To prevent communication interference between the onboard computer and wifi data transmission.

X. Summary

  1. If the ground station is connected to multiple drones, MAVLINK_SYS_ID needs to be set separately to ensure that QGC can distinguish each drone.
  2. After the above modification, the mavros command also needs to be modified accordingly, tat_system:=n is modified to the corresponding ID, so that the onboard computer can be connected normally.
  3. QGC communicates with multiple drones, and the data transmission mode is 1-to-many. It is necessary to modify the sending address of the mobile terminal data transmission to the address of the ground terminal data transmission, instead of the default broadcast transmission. The ground station data transmission is not modified to broadcast transmission, ensuring The communication is not interfered by other channels.
  4. After using RTK, the altitude positioning source of the UAV can be modified from the barometer to GPS, which can further improve the altitude positioning accuracy.
  5. During the test, please wait for the RTK initialization to succeed before testing.

11. WiFi data transmission assisted RTK

The above problem is that the transmission rate of data transmission is insufficient, which leads to the failure of RTK positioning. Therefore, it can be realized by using WiFi data transmission and cheap ESP8266 module according to the official tutorial and blog .

  1. Download the official bin file and burn through the online webpage . Note that esp01s is powered by 3.3V, and the flight controller provides 5V pins. It is recommended to use ESP-15F. In addition, if there is a problem, you can short G2-GND to reset.
  2. The link corresponds to wifi, and it is still in AP mode at this time. Modify the corresponding data and change to STA mode: you
    insert image description here
    can also set it in QGC:
    insert image description here
  1. The baud rate: 57600 is the default baud rate of telem1 and uart4 interface; 921600 is the default baud rate of telem2.
  2. Among them, telem1 is enabled by default, and others need to be set in QGC to enable:
    insert image description here
  3. Optimization: The above blog said that the target IP of the ground station needs to be set to prevent the WIFI digital transmission broadcast data from occupying the bandwidth. Continue to see how to set it.
  4. Increase data transmission communication capability: The default communication capability of 57600bps is limited, which can be modified to 921600. Modifications include:
    1) Open the data transmission ip address, enter the settings, and modify it to 921600.
    insert image description here
    2) Modify qgc parameters, including wifi bridge, telem1 baud rate, mav baud rate
    insert image description here
    insert image description here
    insert image description here

Guess you like

Origin blog.csdn.net/Hot_Ant/article/details/128401479