Gathiyo / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Barometer Rate computation #278

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Arducoper AC2?
Version 2.0.50Beta from git 2011/11/05
I noticed a the copteer was not keeping altitude correctly so I looked into the 
code of "arducopter.pde":

// calc the vertical accel rate
int temp_alt    = (barometer._offset_press - barometer.RawPress) << 1; // invert 
and scale
baro_rate   = (temp_alt - old_baro_alt) * 10;
old_baro_alt    = temp_alt;
--------------------------------
I think it sould be 

// calc the vertical accel rate
int temp_alt    = (barometer._offset_press - barometer.RawPress) << 1; // invert 
and scale
baro_rate   = (temp_alt - old_baro_alt) * 10;
old_baro_alt    = baro_rate;

Original issue reported on code.google.com by syl20.mm@gmail.com on 5 Nov 2011 at 1:21

GoogleCodeExporter commented 8 years ago
Thanks, 

I think it's correct as is. baro_rate is the climb rate in cm/s. old_baro_alt 
is the altitude in cm.
Jason

Original comment by jasonshort on 5 Nov 2011 at 6:32

GoogleCodeExporter commented 8 years ago

Original comment by jasonshort on 6 Nov 2011 at 3:41