data (accel or quat) go not up to 200 Hz,they reach max 15Hz

By tchsu , 11 October 2012

Hi,
looking at a log of my data (i used quaternions and acceleration in world axes), it comes out that the output value stays the same for 4 times (if i put 30 Hz) or 15 times (if i put 200 Hz), which results in fact in a very lower frequency. Are you aware of that?

guy_mcilroy

13 years 5 months ago

Depending on which control you are using, you may be adjusting the serial transmission rate rather than the FIFO buffer. Can you explain which HW / SW platform you are using, as well as which api function you are using to control the data rate?

phpbb Post ID
21450

gobandit

13 years 5 months ago

i have a similar using the eMPL v4.1

i changed the

state.fifo_ms = 50 (1000)


to

state.fifo_ms = 10


and set the

inv_set_fifo_rate(1)



but the buffer fills up faster and all values are double.

what must be changed to get the data faster from the sensor?


+ where can i change the dmp sample rate (200Hz) if fount "SetSampleStepSizeMs()" in the Spec. but this function doesn´t exist
phpbb Post ID
21453

guy_mcilroy

13 years 5 months ago

The DMP rate is fixed at 200 Hz and can’t be adjusted. If you need faster data rates, then you can pull raw data and use your own sensor fusion algorithm. Typically, you’ll only need higher data rates for the most demanding applications, where you’d probably want your own fusion algorithms anyway.

The rate you can modify is the rate at which the DMP calculated quaternion (and raw) values are updated into the FIFO buffer, with inv_set_fifo_rate().

There's an example in the MotionFit SDK download:

if (state.fifo_ms == 200) { /*if was 5Hz, set to 10 Hz */
inv_set_fifo_rate(19);
state.fifo_ms = 100;
} else if (state.fifo_ms == 100) { /*if was 10Hz, set to 20 Hz */
inv_set_fifo_rate(9);
state.fifo_ms = 50;
} else if (state.fifo_ms == 50) { /* if was 20Hz, set to 5 Hz */
inv_set_fifo_rate(39);
state.fifo_ms = 200;
}

phpbb Post ID
21456

gobandit

13 years 5 months ago

ok that made some problems clear.

but if i want to update just the accel for excample with 500Hz , can i use eMPL_update_data() for this? or is that just for fusion values?

at this point now, i havent any idea what must be changed to become a higher count of accel data.

phpbb Post ID
21459

tchsu

13 years 5 months ago

we set the fifo state at 5 milliseconds, and the fifo rate to 200Hz and 200HZ (as explained in the table) with these commands :


inv_set_fifo_rate(0);
state.fifo_ms=5;

from the log we do get a 200Hz data update flow but quaternions and accelerations really change once every 10 to 14 updates, so we get the same vectors 10 to 14 times in a row...

phpbb Post ID
21462

gobandit

13 years 5 months ago

tried it now simply as possible


while (i < 1000)
{
eMPL_update_data();
inv_get_accel(data);

i++;
}


so i get 1000 values in ca 700 -800ms.

but here the same. The values are just updateing ech 15 - 20 ms ....
how can i increase this rate ...

i tried is like youngeng but this makes it not better.
phpbb Post ID
21468

guy_mcilroy

13 years 5 months ago

200 Hz data is possible given a platform with sufficient MIPS, or for either raw data, or 6 axis fused quaternion, as it is reported directly from the MPU device. It's just an issue with the lower processing power of the typical 8 / 16 bit microcontroller. eMPL will cap the data rate at 200 Hz. For 1kHz Accel data, you can not run eMPL, you would have to set the rates, and access the data register with the provided I2C functions. This is definitely possible on the MotionFit SDK platform on MSP430.

phpbb Post ID
21471

tchsu

13 years 5 months ago

well, to be honest the problem of repetitive data happends as well with 30 Hz. How do you explain that? Any way to give us a more "direct" support (i might send you my source code), since it is written everywhere that 30 Hz acquiring is possible, though I do not see that happen..

phpbb Post ID
21474

gobandit

13 years 5 months ago

ok today i will test it what happend if i set the sensors to 6 axis and if that makes it not better i will implement the accel to my own.

i will report.

edit1:


....
ts = 0;
last_send = 0;

inv_set_fifo_rate(1);
state.fifo_ms = 10;

printf("Start: n");
msp430_get_clock_count(&timestamp);
while (i < 200) {

msp430_get_clock_count(&ts);

if (ts > 1)))
continue;

msp430_get_clock_count(&last_send);

if (eMPL_update_data())
continue;

inv_get_quaternion(data);
value = data[1];
i++;

}
msp430_get_clock_count(&last_update);
last_update = last_update - timestamp;
printf("Stop: %ldn ############n", last_update);

//print: value


this just gets 200 values and prints me the data + the time it had needed to get the data.

im using just 6 axis but the quaternion did't come with 100hz. in my opinion the data is even slower....
phpbb Post ID
21477

guy_mcilroy

13 years 4 months ago

A new version of the MotionFit Software (5.1) has been released, we recommend that you upgrade to the latest version.

For the previous release, the fused data is retrieved in a polling method. inv_set_fifo_rate() will set the rate at which the 9 axis fusion algorithm is calculated, while State.fifo_ms will control how quickly the data is retrieved. If the calculation can’t keep up, then grabbing the data every 10 ms will result in duplicate data. You can reduce the computation time by lowering rate the quaternion is calculated, or reduce the time you are grabbing data on the microcontroller.

To set the data rate to 100 Hz, for example, you would program this:

State.fifo_ms = 10
inv_set_fifo_rate(2);

The new application operates with an interrupt driven method, that is set to a default 50 Hz value. This rate can be modified.

phpbb Post ID
21480
phpbb Topic ID
14766