Possible Bug?

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
User avatar
mgros
Posts: 90
Joined: Thu Jan 20, 2011 12:32 am

Possible Bug?

Post by mgros »

In the new IMU.cpp in MultiWii_Shared i think there is a bug in line 286

line says:

Code: Select all

    cosZ = EstG.V.Z / ACC_1G * 100.0f; 


Should not it be?:

Code: Select all

    cosZ = EstG16.V.Z / ACC_1G * 100.0f;


Only fails compilling with

Code: Select all

 #define THROTTLE_ANGLE_CORRECTION


Hope help you.

User avatar
mgros
Posts: 90
Joined: Thu Jan 20, 2011 12:32 am

Re: Possible Bug? WARNING

Post by mgros »

ATTENTION, do not compile with

Code: Select all

 #define THROTTLE_ANGLE_CORRECTION
option , malfunction in the speed of the motors.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Possible Bug?

Post by Alexinparis »

Hi,
Good catch, just fixed.
EstG16.V.Z / ACC_1G * 100.0f; => you need to isolate (ACC_1G * 100.0f) otherwise EstG16.V.Z / ACC_1G is evaluated first and is mostly 0.

User avatar
mgros
Posts: 90
Joined: Thu Jan 20, 2011 12:32 am

Re: Possible Bug?

Post by mgros »

Thanks Alex!

User avatar
mgros
Posts: 90
Joined: Thu Jan 20, 2011 12:32 am

Re: Possible Bug? NOT SOLVED

Post by mgros »

i have added parenthesis and the motor problem still exist

Compiling with THROTTLE_ANGLE_CORRECTION results OK, but the power in motors jumps from idle to near max moving the throttle stick (not lineal).

Probably the 40 value should be reduced.

Post Reply