Sunteți pe pagina 1din 3

Three Wheel Simultaneous Translation And Rotation

Introduction: Three wheel chassis are used widely For matlab modelling, we found the inverse of the
in robotic locomotion. Major advantage of three coefficient matrix and found the values of f1, f2 and
wheel chassis is their holonomic motion. They can f3 directly by matrix multiplication.
turn in 360 degrees and can move straight along
format long
any given direction. Our objective was to produce z=[40;98;40];%[ax,ay,angular velocity]
r=1;%For Increasing Range
rotational motion while the chassis translates along
a given straight path. Matlab/Octave was used for T=zeros(360*r,1);
V=zeros(360*r,1);
mathematical analysis. A=zeros(360*r,1);
E=zeros(360*r,1);
for a=0:360*r
Mathematical Analysis: We have the equation in m=[-sind(a) 0 0];
terms of the forces f1, f2 & f3 of wheel 1, 2 & 3 l=[cosd(a) 0 0];
x=[cosd(a) cosd(120+a) cosd(240+a);-sind(a) -
respectively of the accelerations in X and Y sind(120+a) -sind(240+a);1 1 1];
y=inv(x);
directions and angular velocity of the chassis as, t=y*z;
n=m*t;
𝑎𝑥 = cos⁡(𝛼1). 𝑓1 + ⁡cos⁡(𝛼2). 𝑓2 + cos⁡(𝛼3). 𝑓3
p=l*t;
A(a+1, 1) = a;
𝑎𝑦 = sin⁡(𝛼1). 𝑓1 + ⁡sin⁡(𝛼2). 𝑓2 + sin⁡(𝛼3). 𝑓3 T(a+1, 1) = n;
E(a+1, 1) = p;
V(a+1, 1) = sqrt(n^2+p^2);
ω = 𝑓1 + ⁡𝑓2 + 𝑓3 %plot(A,T,'yo',A,E,'ro');
end
where, 𝛼1, 𝛼2⁡𝑎𝑛𝑑⁡𝛼3 are: a=0;
W=zeros(360*r,1);
𝛼1: 𝑎𝑛𝑔𝑙𝑒⁡𝑜𝑓⁡𝑡ℎ𝑒⁡𝑟𝑒𝑓𝑒𝑟𝑒𝑛𝑐𝑒⁡𝑤ℎ𝑒𝑒𝑙⁡𝑤𝑖𝑡ℎ⁡𝑋 − 𝑎𝑥𝑖𝑠 Q=zeros(360*r,1);
S=zeros(360*r,1);
O=zeros(360*r,1);
𝛼2 = 𝛼1 + 120 for a=0:360*r
m=[0 -cosd(30+a) 0];
l=[0 -sind(30+a) 0];
α3= α1+240
x=[cosd(a) cosd(120+a) cosd(240+a);-sind(a) -
Thus, we can write these equations to give values of sind(120+a) -sind(240+a);1 1 1];
y=inv(x);
f1, f2 and f3 required to move the chassis with I=y*z;
n=m*I;
acceleration ax and ay in the X and Y directions. p=l*I;
S(a+1, 1) = a;
For that, we need to convert the above equations in W(a+1, 1) = n;
O(a+1, 1) = p;
matrix form and find the inverse of the coefficient Q(a+1, 1) = sqrt(n^2+p^2);
matrix. end

N=zeros(360*r,1);
U=zeros(360*r,1);
S=zeros(360*r,1);
P=zeros(360*r,1);
for a=0:360*r
m=[0 0 cosd(330+a)];
l=[0 0 sin(330+a)];

x=[cosd(a) cosd(120+a) cosd(240+a);-sind(a) -


sind(120+a) -sind(240+a);1 1 1];
y=inv(x);
I=y*z;
n=m*I;
p=l*I;
S(a+1, 1) = a;
N(a+1, 1) = n;
P(a+1, 1) = p;
This is the inverse of the coefficient matrix. U(a+1, 1) = sqrt(n^2+p^2);
%plot(A,U,'mo')
end
Using this matrix, we framed the equations for our %subplot(2,1,1);
arduino code which give us forces required. %plot(A,T,'ro',A,E,'mo',S,W,'go',S,O,'yo',S,N,'bo'
,S,P,'k');
%plot(A,V,'ro',S,Q,'yo',S,U,'mo');
for a=0:360*r
Sx = zeros(360*r,1); float f3 = 0;
Sy = zeros(360*r,1);
a = 0; float f1x = 0;
A = zeros(360*r,1);
res = zeros(360*r,1);
float f2x = 0;
Sx = T(a+1,1) + W(a+1,1) + N(a+1,1);
Sy = E(a+1,1) + O(a+1,1) + P(a+1,1); float f3x = 0;

end
float pwm1 = (f1/53)*100;
a = 0;
A = zeros(360*r,1);
val = zeros(360*r, 1); float pwm2 = (f2/53)*100;

for a=0:360*r float pwm3 = (f3/53)*100;


A(a+1, 1) = a;
val(a+1,1) = atand(Sy/Sx);
res(a+1,1) = sqrt(Sx^2+Sy^2);

end void setup()


%subplot(2,1,2);
%plot(A,Sx,'ro',A,Sy,'mo'); {
Sx and Sy are the net displacements of the chassis
Serial.begin(115200);
in X and Y direction.

// Initialize MPU6050

while(!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G))

Serial.println("Could not find a valid MPU6050 sensor, check wiring!");

delay(500);

This is the graph of forces against angle. Red represents f1, while f2 and }
f3 are represented by green and blue colours respectively.
pinMode(9, OUTPUT);
Arduino code: pinMode(10, OUTPUT);

#include <Wire.h>
pinMode(11, OUTPUT);

#include <MPU6050.h>
pinMode(2, OUTPUT);

#include <math.h>
digitalWrite(2, HIGH);

MPU6050 mpu;
// Calibrate gyroscope. The calibration must be at rest.

// If you don't want calibrate, comment this line.

//Timers
mpu.calibrateGyro();

unsigned long timer = 0;

float timeStep = 0.01;


// Set threshold sensivty. Default 3.

// If you don't want use threshold, comment this line or set 0.

// Pitch, Roll and Yaw values


mpu.setThreshold(3);

float pitch = 0;
}

float roll = 0;

float yaw = 0;
void loop()

float a = (yaw*3.14)/180;
{

float d = 0;
timer = millis();

float f1 = 0;

float f2 = 0;
// Read normalized values made which could show that the motion is
Vector norm = mpu.readNormalizeGyro(); as per our needs.
2. When tested on ground, the chassis would
go as per our expectations but when there
// Calculate yaw was a change in directions, the motion went
wrong and the chassis traced curved path.
yaw = yaw + norm.ZAxis * timeStep;
Exact reason couldn’t be found but we
a = (yaw*3.14)/180; believe that it was due to the jerk exerted
by the switching wheel which disturbed the
d = (sin(a+2.0933)-sin(a))*cos(a+2.0933) + (sin(a)-
sin(a+4.1866))*cos(a+4.1866) + (sin(a+4.1866)-sin(a+2.0933))*cos(a) ; mpu readings.
3. The chassis was operated on 3 motors of
f1x = 40*(sin(a+4.1866)-sin(a+2.0933)) + 60*(cos(a+4.1866)-cos(a-
2.0933)) + 40*(cos(a+4.1966)*sin(a+2.0933) -
equal rpm. There was no feedback available
cos(a+2.0933)*sin(a+4.1866)); for speed control of motors. Eventhough the
motors were near about equal, the exact
f1 = f1x/d;
result was not possible. This is because the
f2x = 40*(sin(a)-sin(a+4.1866)) + 60*(cos(a)-cos(a-4.1966)) + pwm was based on the value of forces and
40*(cos(a)*sin(a+4.1866) - cos(a+4.1866)*sin(a));
forces at regular intervals approached
f2 = f2x/d; minima which made the pwm negligible for
motors after a certain value. Thus, at a
f3x = 40*(sin(a+2.0933)-sin(a)) + 60*(cos(a+2.0933)-cos(a)) +
40*(cos(a+2.0933)*sin(a) - cos(a)*sin(a+2.0933));
certain point, the motors weren’t running
even when they were expected to run.
f3 = f3x/d; 4. The length of the arms of the chassis was a
pwm1 =20 + abs((f1/53)*100); little long which resulted in slower rotation
of the chassis for a given value of ω.
pwm2 =20 + abs((f2/53)*100);
Status of the project:
pwm3 =20 + abs((f3/53)*100);

if(yaw>=120) INCOMPLETE (on hold).

pwm1=0;

pwm2=0;

pwm3=0;

analogWrite(9,pwm1);

analogWrite(10,pwm2);

analogWrite(11,pwm3);

// Wait to full timeStep period

delay((timeStep*1000) - (millis() - timer));

MPU6050.h library was used to interface mpu with


arduino.

Problems faced :

1. Though the graphical analysis seemed fairly


accurate, there was no such simulation

S-ar putea să vă placă și