Disclosure of Invention
The invention aims to provide a mobile robot navigation control method based on GPS positioning, which is easy to realize and is suitable for experimental teaching in colleges and universities.
The technical solution for realizing the purpose of the invention is as follows: a mobile robot navigation control method based on GPS positioning comprises the following steps:
step 1, acquiring the current positioning of a robot, a direction angle of a robot head and the positioning of a target point;
step 2, calculating an included angle between a connecting line of the robot and a horizontal axis according to the current positioning and the target point positioning of the robot, and calculating motor operation parameters by combining a direction angle of a robot head;
step 3, driving the motor to rotate positively and negatively within a set time according to the motor operation parameters;
and 4, repeating the steps 2 and 3 until the robot reaches the range of the target point threshold value.
As a specific embodiment, the positioning information in step 1 includes longitude and latitude information.
As a specific implementation manner, in step 2, a specific method for calculating the operation parameters of the motor is as follows:
step 2.1, abstracting a two-wheel differential motion mobile robot system into a system consisting of wheels and a robot body, and establishing a first-order continuous robot dynamics model as follows:
wherein x and y are respectively longitude coordinate and latitude coordinate of the mobile robot, and u
1Is a differential amount of displacement of the mobile robot, u
2Is the differential quantity of the angle of the robot, theta is the direction angle of the head of the robot (namely, the east direction is the positive direction of the X axis, the head of the robot forms an included angle with the positive direction of the X axis, the angle directly measured by the gyroscope is the included angle between the head of the robot and the north direction, and the measured angle is added with the included angle
I.e., the azimuth angle);
step 2.2, calculating an included angle between a connecting line and a horizontal axis according to the current positioning and target point positioning connecting line of the robot, and determining the relation between the state space of the target position and the current position;
angle theta between connecting line and horizontal axis*Comprises the following steps:
θ*=atan2(y*-y,x*-x)
wherein, (x, y) is the current positioning coordinate of the robot, (x)*,y*) Positioning coordinates for the target point;
the relationship between the state space of the target position and the current position is:
(k is an arbitrary coefficient other than 0)
Wherein q islA state space of the target position, expressed as longitude x including the coordinates of the target point1And latitude y1A column vector of (a);
let Δ1=x1-x,Δ2=y1-y, working up the above formula yields:
in this case, u can be obtained by the above-mentioned series of analyses1,u2The results are as follows:
u1,u2through the design of a controller, u is respectively aligned1Is used as the engineering tangent u2Obtaining two values w after proportional operation1,w2:
Wherein k is1、k2Selecting a value which is a constant other than 0 according to the actual situation;
step 2.3, calculating the motion state parameter omega of the left motor and the right motor1、Ω2:
Obtaining by solution:
in step 3, as a specific embodiment, the direction of the motor rotation depends on the sign of the motor operation parameter, positive sign is positive, negative sign is negative, and the motor rotation speed depends on the value of the motor operation parameter and is an integral multiple of the motor operation parameter.
As a specific embodiment, in step 4, the target point threshold range is a circular area with the target point as a center and the threshold as a radius.
Compared with the prior art, the invention has the following remarkable advantages: the invention simplifies the experimental process, only needs to complete point-to-point navigation control, does not need to plan a path in advance, and improves the timeliness of robot navigation.
Detailed Description
The invention is further illustrated by the following examples in conjunction with the accompanying drawings.
As shown in fig. 1, the navigation control method of the mobile robot based on GPS positioning includes the following steps:
step 1, the main control board receives positioning information (longitude and latitude) of a target point through the wireless communication module, reads current positioning (precision and latitude) and a direction angle of a robot head sent by the positioning module, and stores the current positioning information and the current positioning information. As shown in fig. 1, the method specifically comprises the following steps:
step 1-1, knowing the accurate positioning information of a point, selecting the accurate positioning information as a target point, and sending the point information to a main control board through a wireless communication module after a control terminal inputs the point information, wherein the point information is stored by the main control board and is convenient to use next time.
And step 1-2, the GPS sensor acquires the current positioning longitude and latitude of the mobile robot by using a built-in positioning algorithm and sends the current positioning longitude and latitude to the high-precision attitude measurement module through serial port communication. The attitude measurement module measures the included angle between the head of the robot and the horizontal axis by using a gyroscope built in the attitude measurement module (the angle directly measured by the actual gyroscope is the included angle between the head of the robot and the north direction, and the included angle is added
I.e., the heading angle), and the heading angle and the positioning information are fused through programming and then sent to the main control board through I2C communication, and the main control board receives and stores the information.
And 2, after receiving and storing the information, the mobile robot main control board uses a navigation control algorithm to calculate and obtain the operating parameters of the two motors, stores the operating parameters and sends the operating parameters to the next stage. As shown in fig. 2, the method specifically includes the following steps:
and 2-1, obtaining coordinates of a target point, coordinates of a starting point and a direction angle of the head of the robot by the main control board, calculating an included angle between a connecting line of the target point and the starting point and a horizontal axis by using a mathematical formula, and storing data information.
Step 2-2, the data are processed by a navigation control algorithm based on the unicycle tracking control theory, and a group of proper running parameters omega of the left motor and the right motor are calculated and obtained1、Ω2And storing the obtained product; as shown in fig. 2, the mobile robot navigation control algorithm stepsThe method comprises the following steps:
step 2-2-1, firstly abstracting a two-wheel differential motion mobile robot system into a system consisting of wheels and a robot body, and establishing a first-order continuous robot dynamics model as follows:
wherein x and y are respectively longitude coordinate and latitude coordinate of the mobile robot, and u
1Is a differential amount of displacement of the mobile robot, u
2Is the differential quantity of the angle of the robot, theta is the direction angle of the head of the robot (namely, the east direction is the positive direction of the X axis, the head of the robot forms an included angle with the positive direction of the X axis, the angle directly measured by the gyroscope is the included angle between the head of the robot and the north direction, and the measured angle is added with the included angle
I.e., the azimuth angle);
let the current location (x, y) and target point location (x) of the mobile robot*,y*) The included angle theta between the connecting line of the two points and the horizontal axis can be obtained*Comprises the following steps:
θ*=atan 2(y*-y,x*-x)
wherein, (x, y) is the current positioning coordinate of the robot, (x)*,y*) Positioning coordinates for the target point;
the relationship between the state space of the target position and the current position is:
(k is a coefficient other than 0)
Wherein q islThe state space representing the target position, i.e. the coordinates of the target point, is represented as containing the coordinates of the target point, i.e. longitude x1And latitude y1A column vector of (a);
let Δ1=x1-x,Δ2=y1-y, the above formula being arranged to yield:
in this case, u can be obtained by the above-mentioned series of analyses1,u2The results are as follows:
u1,u2respectively designing u by a controller1Is used as the engineering tangent u2Obtaining two values w after proportional operation1,w2:
Wherein k is1、k2Is a constant not equal to 0, and can be taken out according to stability theory, simulation debugging and field experiment multiple times of debugging1=50,k2The experimenter can also select a proper value according to the actual situation;
step 2-2-3, referring to the Unicycle Tracking Control theory mentioned in the Fuzz Logic Tracking Control for the Unicycle Mobile Robots, the motion state parameter omega of the left and right motors can be obtained1、Ω2And w1、w2The relationship of (a) is as follows:
obtaining by solution:
the parameter value of the motor running state can be obtained by the formula, and the coefficient of the formula is also related to the radius of the wheels of the robot and the wheel track between two wheelsThe number should be
The multiple of the coefficient is 3 according to the actual situation of the used mobile robot during the experiment, so that the robot can stably run in the navigation process;
and 3, after receiving the operation parameters sent by the main control board through the analog signals, the motor driving chip controls the motor to rotate and rotate, so that the motor operates. As shown in fig. 3, when the mobile robot drives the motor, it is first determined whether to obtain the motor operation parameters, and after it is determined that the motor driving chip is written in the operation parameters by the main control board, the following steps are performed:
step 3-1, decomposing the numerical value of the motor operation parameter into two parts, wherein the positive sign and the negative sign respectively represent the positive rotation and the negative rotation of the motor, and the absolute value of the numerical value represents the rotating speed of the motor;
and 3-2, the motor driving chip starts to control the left motor and the right motor to operate according to the specified rotating speed and rotating direction, and the mobile robot starts to advance, retreat, turn left, turn right and turn on site to advance towards the specified target point. Five target points are specified, and the simulation effect of the robot navigation control algorithm is shown in FIG. 4.
Step 4, in the moving process of the robot, the current positioning coordinate, the direction angle, the two-point connecting line and the horizontal included angle of the robot are constantly changed, the main controller continuously updates the motion state of the motor at 1ms delay intervals by using a navigation control algorithm, timely adjusts the operation of the mobile robot, completes the navigation control task of the robot, and continuously sends real-time positioning information of the robot to the control terminal in the moving process, and the method specifically comprises the following steps:
and 4-1, the robot moves along a straight line, the current positioning coordinate, the direction angle and the included angle between the connecting line of the robot and the target point and the horizontal axis are continuously changed, at the moment, the operation parameters of the motor need to be updated and calculated at a time delay interval of 1ms, the step 2-3 is repeated, and the operation direction of the robot is timely adjusted to be close to the target point.
And 4-2, when the mobile robot enters a tiny circle domain with the target point as the center of a circle and epsilon (a self-defined minimum value) as the radius, the main control board sends a stop signal to the motor until the main control board receives the next target point sent by the control terminal, and the steps 1,2 and 3 are repeated.
And 4-3, the mobile robot sends real-time positioning and direction angle information to the control terminal through the wireless communication module in the target operation process, and the terminal accurately and numerically clearly observes whether the robot reaches a target point, so that a reliable basis is ensured for completing the experiment. After the control terminal receives the data, the data are stored, and a running route and a direction angle change diagram of the robot from any point to a target point along with time can be drawn by software.