small angles 25deg alternative solution

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

small angles 25deg alternative solution

Postby timecop » Sun Sep 29, 2013 11:48 pm

How about replacing current version that uses unfiltered acc data with something like this?
https://code.google.com/p/afrodevices/s ... ail?r=415#
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: small angles 25deg alternative solution

Postby Alexinparis » Mon Sep 30, 2013 11:28 pm

I take it :)
Alexinparis
 
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: small angles 25deg alternative solution

Postby timecop » Mon Sep 30, 2013 11:54 pm

> #define ACCZ_25deg (uint16_t)(ACC_1G * cos(3.1415927/180*25))
On tarduino, you probably just wanna precalculate the cos(25) part as 0.90631 or something, leaving a clear comment where it came from (cos(theta) of accZ)
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: small angles 25deg alternative solution

Postby scrat » Tue Oct 01, 2013 12:06 pm

So this means that quad must be almost flat when powering or?
scrat
 
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: small angles 25deg alternative solution

Postby timecop » Tue Oct 01, 2013 12:54 pm

This is optimization for old feature that's been present since long time ago. It doesn't change any functionality.
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: small angles 25deg alternative solution

Postby Mis » Mon Oct 07, 2013 5:50 pm

But this optimisation is buggy.
If the copter is upside down, the f.SMALL_ANGLES_25 is 1, but should be 0.

Propper code (remove abs):
Code: Select all
  if ((int16_t)EstG32.A[2] > ACCZ_25deg)
    f.SMALL_ANGLES_25 = 1;
  else
    f.SMALL_ANGLES_25 = 0;
Mis
 
Posts: 203
Joined: Fri Apr 01, 2011 12:23 am

Re: small angles 25deg alternative solution

Postby timecop » Tue Oct 08, 2013 2:18 am

I just noticed same problem yesterday as I was holding copter fully upside down.
Time to fix :)
timecop
 
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm


Return to Software development

Who is online

Users browsing this forum: No registered users and 4 guests