Ctrl Algo

advertisement
POLAR CO-ORDINATE POSITIONING
SYSTEM FOR UNMANNED VEHICLE
(Control Logic and Algorithm)
Automatic Positioning Mode:
Thumb Rules in Practical Implementation:
 When the co-ordinates of the final position are given to the vehicle,
the routine of the vehicle is such that it can only move the required
distance in the forward direction and turn only in the anticlockwise
direction using differential drive by left-handed system.
 The co-ordinate system also follows only the left-handed system.
 In all the consecutive routines, the final position of the vehicle in a
given routine becomes the initial position of the vehicle for the next
routine. Hence,
r1, t1 – initial co-ordinates with respect to the centre.
r2, t2 – final co-ordinates with respect to the centre.
 The calculation of distances and angles to be handled by the vehicle
involve usage of triangles and trigonometric ratios. So, in all the
calculations, the following conventions are followed,
x, y, z – The three sides of the triangle formed.
X, Y, Z – The angles opposite to the three sides (i.e., X is the
angle opposite to the side x, etc.)
So, for a given routine, as a standard,
x= r2 (final position radius w.r.t centre)
z= r1 (initial position radius w.r.t centre)
y= distance which the vehicle must physically move in
order to reach final position from initial position.
X= Internal angle of the triangle formed at the initial
vehicle position.
Y= Internal angle of the triangle formed at the centre
point (given by t1~t2).
Z= Internal angle of the triangle formed at the final
vehicle position.
 The vehicle is designed to orient itself in the direction of the centre
point after it reaches final position at the end of each routine. Thus, it
homes itself in the direction of base.
 In order to have a valid initial position, by default we make the
vehicle travel to a point (20, 90) where r is in cm and t is in degrees.
After this routine, any value of r, t may be fed into the vehicle.
Cases involved in the positioning of the unmanned vehicle:
There are 4 cases involved overall depending only on the angle difference
between initial and final positions i.e., t1~t2:
i. t1~t2=0 deg. (there is no change in angle but only in the distance)
ii. t1~t2=180 deg. (the two points are opposite to each other)
iii. t1~t2<180 deg.
iv. t1~t2>180 deg.
i. t1~t2=0 deg:
In this case, two sub-cases arise:
a)
r1<r2:
Assuming that vehicle is already pointing towards the centre at P1,
Distance to be moved = r2-r1
Angle turn at P1 = 180 deg
Orientation turn at P2 = 180 deg.
b)
r1>r2:
Distance to be moved = r1-r2
Angle turn at P1= Orientation turn at P2= 0 deg.
ii. t1~t2=180 deg:
Distance to be moved = r1+r2
Angle turn at P1=0 deg.
Orientation turn at P2= 180 deg.
iii. t1~t2<180 deg:
Two sub-cases arise,
a)
t1<t2:
Here, Y= t2-t1; x=r2; z=r1
b)
Distance to be moved y= (x^2+z^2-2*x*z*cos Y)^0.5
y/sin Y=z/sin Z, Z= inv sin(z*sinY/y)
X=180-(Z+Y)
Angle turn at P1=360-X
Orientation turn at P2= X+Y
t1>t2:
Here, Y= t1-t2; x=r2; z=r1
Distance to be moved y= (x^2+z^2-2*x*z*cos Y)^0.5
y/sin Y=z/sin Z, Z= inv sin(z*sinY/y)
X=180-(Z+Y)
Angle turn at P1=X
Orientation turn at P2= 360-(X+Y)
iv. t1~t2>180 deg:
Two sub-cases arise,
a)
t1<t2:
Here, Y= 360-(t2-t1); x=r2; z=r1
Distance to be moved y= (x^2+z^2-2*x*z*cos Y)^0.5
y/sin Y=z/sin Z, Z= inv sin(z*sinY/y)
X=180-(Z+Y)
Angle turn at P1=X
Orientation turn at P2= 360-(X+Y)
b)
t1>t2:
Here, Y= 360-(t1-t2); x=r2; z=r1
Distance to be moved y= (x^2+z^2-2*x*z*cos Y)^0.5
y/sin Y=z/sin Z, Z= inv sin(z*sinY/y)
X=180-(Z+Y)
Angle turn at P1=360-X
Orientation turn at P2= X+Y
Hence, it is observed that all the possible cases are covered.
Download