Please forgive me if this is obvious,  but I havnt seen any explanation around.

 

I've been having a really bad time getting altitude hold to work.  Sonar is set up properly and very well shielded.  No matter what I do,  the altitude seems to sink to the ground or take off into the air slowly.

 

Is there more to it than tuning the controller?  What exactly does CH7_OPTION - CH7_SET_HOVER do?  Do I need to set a hover value for the controller to base the altitude hold on?

 

Anyone have any tips?

Tags: Alt, CH7_OPTION, CH7_SET_HOVER, Hold

Views: 161

Reply to This

Replies to This Discussion

IF you configure ch7 to set hover, it will set hovering throttle for the copter.  Adjust your throttle manually until the copter neither descends or ascends, then switch ch7 high for a short time (1s should do fine).  The copter will now use this value as basic hoover value.

If you don't do this, the copter will use the throttle position when althold is engaged as basic value.  So if you engage althold while ascending or descending, it won't be very good and the copter may have trouble keeping altitude.  In any case, you should avoid engaging althold when the copter is descending or ascending.  At least that's what I've read quite a while ago.  I haven't checked this in current code, so don't shoot me if I'm wrong or if it has been changed meanwhile.

You do have your baro covered with a piece of cotton or open cell foam, right ?

If you look at your logs, what are the readings of baro and sonar like ?

The alt hold code works as follows : 

if baro altitude > 10 meter => sonar is disregarded and the whole sonar calculation is not executed. Baro only.

between 6-10 meter => sonar is calculated in for 0%, baro is calculated in for 100%

between 4-6 meters => sonar is gradually mixed in with baro : sonar % increases and baro % decreases with altitude going down.

under 4 meters => sonar is calculated for 100%, baro for 0%

 

This means that, even if you are at 1m altitude, you copter will disregard sonar and descend if baro reads erronously 11m.  It will disregard sonar reading, think it is at 11m altitude and descend to get back to 1m altitude.

You can find the code near the bottom of arducopter.pde in the static void update_altitude() function definition. Values in the code are in centimeters.

 

if(baro_alt < 1000)

{

scale = (sonar_alt - 400) / 200;

scale = constrain(scale, 0, 1);

current_loc.alt = ((float)sonar_alt * (1.0 - scale)) + ((float)baro_alt * scale) + home.alt;

}

else

{ current_loc.alt = baro_alt + home.alt; }

 

Mission planner only displays GPS altitude if I'm correct, no baro or sonar altitude.  If you wanna check baro and sonar operation, check the onboard logs and plot them.

 

Jumping from 1-4 very rapidly doesn't sound right and is probably interference.  Place your sonar well away from esc's and cables.  Do you have pulsing motors also ?  If so, then interference is most likely your problem.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service