r212: level trim for ADCACC broken?

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
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

r212: level trim for ADCACC broken?

Post by Hamburger »

Hi,
while trying to catchup on changes I found this code change in MultiWii.pde:

Code: Select all

357-  accZero[PITCH]++;writeParams();
 357+ accZero[PITCH]+=acc_1G/100;writeParams();


I think this does not work for acc_1G < 100, right?
But in sensors.pde for ADCACC:

Code: Select all

 acc_1G = 75;

HTH, Hamburger

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

Re: r212: level trim for ADCACC broken?

Post by Alexinparis »

right ;)
I wanted a way to normalize the same amount of trim between different accelerometers.
I forgot this case.
A simple way would consist in assuring that acc_1G is systematically > 100.
Here, a x2 for analogical acc would do the job.
float variables are not an option here.

User avatar
Hamburger
Posts: 2578
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: r212: level trim for ADCACC broken?

Post by Hamburger »

got it.
I understand your intentions, sounds good to keep behaviour in sync across sensors.
I understand about floats.
sorry it requires extra code per #define or max() for this one special case though.
Cheers.

Post Reply