Refresh rate

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download

Refresh rate

Postby Otatiaro » Mon Feb 07, 2011 1:11 pm

Hello,

I've read the sketch 1.6 and I'm wondering ... It seems the main loop time is recalculated each time :

Code: Select all
// Measure loop rate just afer reading the sensors
   currentTime = micros();
   cycleTime = currentTime - previousTime;


Do you know approx. what is the refresh rate on the real target board at 16MHz (for different configurations) ?

Regards,
Thomas.
Otatiaro
 
Posts: 2
Joined: Mon Feb 07, 2011 1:07 pm

Re: Refresh rate

Postby Alexinparis » Mon Feb 07, 2011 2:07 pm

Hi,

I's very dependent to the hardware choice.
It can be something between
- in the best case around 1.8ms (WMP only conf or ITG3200 with a I2C speed at 400kHz)
- in the worse case up to 6ms (WMP+NK in interleaving mode with the obligation to wait at least 3ms between each read)

- around 3.3ms with a genuine WMP only conf with I2C bus at 100kHz

With another ACC than NK, it depends also on the inclination because we use a fast approximation for low angles (around 1ms less)
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Refresh rate

Postby Otatiaro » Mon Feb 07, 2011 2:21 pm

Ok so it's between 555 and 111Hz (average 303Hz) ?

It seems pretty fast considering the heavy use of float type variables and the complexity of the algorithm ... at 16MIPS it's (average) 52800 clock cycles.
The float library must be very well tuned ;)

Regards,
Thomas.

PS : I'm French, "Alexinparis" refers to your location I suppose ?
Otatiaro
 
Posts: 2
Joined: Mon Feb 07, 2011 1:07 pm

Re: Refresh rate

Postby Alexinparis » Mon Feb 07, 2011 4:15 pm

Hi,

I try to avoid float variables when I can as the float are much more slower to compute than integers.
It's the key to keep the cycle time low, and to keep the code size small.
It's not always possible due to overflow risk or precision.

And yes, I'm french too, living in Paris
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm


Return to Software development

Who is online

Users browsing this forum: No registered users and 2 guests

cron