Interacting MPU-9150 via MATLAB

By rtbiscuit , 24 November 2012

Hello,

I have been working on collecting data from the MPU-9150 in MATLAB, however I am extremely confused with the data that I am receiving. Below is the code that I am using:

b=Bluetooth('BlueRadios',1);
fopen(b)
fprintf(b,'mfg'); % to receive the gyroscope values
dataexist=zeros(1); % to initiate an array to allow for vertical concatenation
for i = 1 : 1 : 100 % varying final index based on the desired number of values
data=fread(b);
datexist=vercat(data,dataexist);
end

This returns an array of 512*100 values. These values are all in 14 byte groups. From another discussion topic, we know that these 14 bytes include the most and least significant bytes. According to the Invensense specifications, supplemented with help from the other discussion topic, we know how to convert these values to Euler angles. This is done in a separate function, that searches for the [13,10] combination that signals the end of a 14-byte grouping. This is where our issues begin - the Euler angles that we get change only very slightly, despite wild and erratic movements of the gyroscope. I am at a loss as to what our issue could be - are we reading too slowly? Are we reading the data using bluetooth completely incorrectly? Are these Euler angles meant to represent actual positions, or is further computation required to reach this point?

Thanks in advance for your assistance!
Elizabeth & Greg

phpbb Topic ID
14874