3_Indoor fixed-point control under the condition of Lidar SLAM mapping of competition drones - zero-based learning competition drones with building block programming

        According to the control at the angle level that only relies on attitude self-stabilization, it is impossible to avoid the deviation of the horizontal position of the UAV. It is necessary to add an additional horizontal position and speed controller on the basis of attitude control to realize the control of the UAV. Fixed-point control, in which the output of the position-velocity controller is the desired motion acceleration . It is necessary to convert the desired acceleration into the desired attitude inclination according to the dynamic relationship of the multi-rotor UAV. The relevant mapping relationship is shown in line 66 of the function control_poshold.c.

        The position-velocity controller determines the angle expectations in the horizontal pitch and roll directions in the attitude controller. The root of adjusting the attitude to realize the speed and position control of the UAV is that the attitude inclination directly determines the acceleration of the horizontal motion of the UAV . By changing the acceleration of the UAV, the speed and position of the UAV can be changed.

 

 

The novice can understand the inner-layer attitude controller as the actuator of the outer-loop position-speed controller         without mastering the dynamic relationship of the UAV. When the user is developing the UAV, most of the time The task flow and control logic are designed at the level of position and speed control .

void Horizontal_Control_VIO(uint8_t force_brake_flag)

        When the parameter force_brake_flag is 1, it means that the current position is forcibly locked as the hover point. According to the coordinate relationship in the first lecture, we know that the position and speed control of the UAV under the conditions of SLAM mapping are completed in the EN coordinate system, and the EN coordinate It is determined by the position and nose orientation of the aircraft at the initial moment of SLAM mapping. Therefore, when the aircraft is placed at the take-off point and the nose is facing forward at the time of initial SLAM mapping , the schematic diagram of the equivalent navigation coordinate system EN is as follows.

 

 

        Taking the basic questions of the 2021 National Electric Competition as an example, the user takes the take-off point as the origin, establishes an equivalent navigation coordinate system EN, and lists the coordinates of the center point of each small block in the area to be sown, and the aircraft uses these coordinate points as The flight waypoints are traversed in turn, and when each small block is reached, the visual module (Raspberry Pi OPENCV, OPENMV, K210, etc.) is used to identify the color of the area directly below the aircraft, and decide whether the laser pointer is on or off. Under the premise of high-precision position output of lidar SLAM mapping, it becomes irrelevant whether the cross of the take-off point and the A-mark of the seeding entrance in the original title are detected or not. To do this part of the detection and align the drone with the sign below, you can refer to the color block tracking example in the visual demo. The workload of this part can be ignored.

        In the above case, traversing the position of waypoints one by one is realized by position control under SLAM mapping conditions. In the next lecture, we will encapsulate altitude control and fixed-point control under SLAM mapping conditions , and finally form a navigation control function . , the user uses the navigation control function and the basic automatic flight support function to realize the three-dimensional position control of the aircraft.

void Horizontal_Navigation(float x,float y,float z,uint8_t nav_mode,uint8_t frame_id)

Related new function introduction video link: Deep Open Source - NC360 Competition UAV Platform Promotional Video_bilibili_bilibili

Guess you like

Origin blog.csdn.net/u011992534/article/details/123762394