Altitude hold problem

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
ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Altitude hold problem

Post by ashta »

In my Quad when i use
dev20110725, version, the altitude hold is working reasonably.
while when i use Multiwii 1.8 patch2, or Multiwii 1.9, it works but jumps up and down.
Attached pl find the screen shot of Mutiwi configurator with
1. dev20110725
2. Multiwii ver 1.8 patch2

pl note that with dev20110725 the ALT value displayed is 207.88
while with Multiwii ver 1.8 patch2/ 1.9 it is 864.20

My "debug 2" is always zero.

is this normal? or is this the reason why it is not working.

Also, i had to comment the line" Trusdted accelerometer" for the stable mode to work?

For altitude hold, does the " Trusted accelerometer" have to work? i do not think so since with dev20110725 it was reasonably working.

or with Multiwii 1.9, is there a systematic PID tuning required. Can some body give me a pointer for this.?


your kind help appreciated.
PA315662.JPG
PA315663.JPG

ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Re: Altitude hold problem

Post by ashta »

hello friends,
pl kindly reply to this problem of mine.
thanking you

kalle123
Posts: 106
Joined: Sun Oct 09, 2011 10:07 am

Re: Altitude hold problem

Post by kalle123 »

What sensors are you using ???

Tell a little about your hardware.

BR - KH

ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Re: Altitude hold problem

Post by ashta »

hello Kalle123,
I have made my own board. Attched pl find the Picture.
I use
ITG3200
BMA180
BMP085
HMC5883
1.5 K pull up for the I2C lines.
Level convereter
On board 5V and 3.3V regulator

No errors in Debug2 window with 1.9 SW

thanks a lot

ashta




kalle123 wrote:What sensors are you using ???

Tell a little about your hardware.

BR - KH
Attachments
P7125417.JPG

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Altitude hold problem

Post by timecop »

You shouldnt need untrusted acc (i.e TRUSTED_ACCZ commented OUT) on properly made hardware.
its only needed for failcases of people ghettoing up a bunch of crap breakout boards.
it should really be renamed to
#define MY_HARDWARE_IS_BROKEN
:)

ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Re: Altitude hold problem

Post by ashta »

but if i do not comment it, it is not stable when accelerometer is enabled.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Altitude hold problem

Post by timecop »

So your accZ decreases when you run motors and throttle up? (The only case for needing trusted accz).

ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Re: Altitude hold problem

Post by ashta »

yes. but pl give me some tips to make it work!
it was kind of working with the dev version dev20110725
and why is
" with dev20110725 the ALT value displayed is 207.88
while with Multiwii ver 1.8 patch2/ 1.9 it is 864.20"

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

Re: Altitude hold problem

Post by Alexinparis »

ashta wrote:yes. but pl give me some tips to make it work!
it was kind of working with the dev version dev20110725
and why is
" with dev20110725 the ALT value displayed is 207.88
while with Multiwii ver 1.8 patch2/ 1.9 it is 864.20"


Hi,
I remember I did some float to integer simplifications about alt calculation,
but the values are correct on my side.
There is probably something wrong somewhere...

However, the important thing is the accuracy of altitude variation, not the absolute value.

ashta
Posts: 14
Joined: Mon Mar 14, 2011 9:37 am

Re: Altitude hold problem

Post by ashta »

thanks Allex. i will try some PID tuning and will report

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Altitude hold problem

Post by timecop »

I noticed there was another change in bmp085 pressure calculation,

> b7 = ((uint32_t) (bmp085_ctx.up >> (8 - OSS)) - b3) * (50000 >> OSS);
in multiwii now

> b7 = ((uint32_t) bmp085_ctx.up - b3) * (50000 >> OSS);
in reference code from sparkfun or so

with the line1, i was getting 200k pascals as output of pressure_calculate (wrong)
with line2, i was correctly getting ~100k (I live at sea level).
I knew this because my hardware can just set a breakpoint inside bmp085_calculate and I knew the returned value. no idea how you can confirm the calculation on your board.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Altitude hold problem

Post by ziss_dm »

Hi,

This is probably because you did shift here:

Code: Select all

bmp085_ctx.up = ((((uint32_t)raw[0] << 16) | ((uint32_t)raw[1] << 8) | ((uint32_t)raw[2])) >> (8 - OSS));


;)

regards,
ziss_dm
Last edited by ziss_dm on Tue Dec 06, 2011 9:33 am, edited 1 time in total.

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Altitude hold problem

Post by timecop »

Oh, haha, good catch. So disregard that, I suck.

Post Reply