Eric wrote:Can you please explain this line?
Code: Select all
if (BaroPID < -200) // reach the ground.
And if the quad is descending with a high speed, will this value be reached in the air and it disarm?
BTW, why it is -200 here?
Can you please help me to calculate a safe BaroPID value to used here? I do not want the quad to disarm in the air.
Hi,
yes. As you can see in code, in failsafe output throttle =1450 + BaroPID. If BaroPID is -200, then throttle output will be 1250. (so there is a negative bias in the calculation for most setups). That is far too small for stable descending.
With this I wanted to have a condition wich only depends on altitude not anything else (ie. landing on a tree. you can't trust in acc value because of resonances/movement but if the delay is too high, your copter will crash itself and also burn some ESCs or motors during struggling in the tree)
But with this condition, once copter can't descend anymore because of an obstruction, it'll stop.
Regarding to BaroPID, why 200? If you check this calculation:
Code: Select all
//P int16_t error16 = constrain(AltHold - EstAlt, -300, 300); applyDeadband(error16, 10); //remove small P parametr to reduce noise near zero position BaroPID = constrain((conf.P8[PIDALT] * error16 / 100), -150, +150); //I errorAltitudeI += error16 * conf.I8[PIDALT]/50; errorAltitudeI = constrain(errorAltitudeI,-30000,30000); BaroPID += (errorAltitudeI / 500); //I in range +/-60
-200 BaroPID will mean copter is at least 150-200 cm higher than target altitude (it is even more because ot negative bias). If you copter is in the air, there isn't any reason why it would be 2m higher than the target with low RPM unless it is alreadyBR Adrian on the ground. The only possible explanation is that desired vario is far too high. But my personal experience is that 150-200 cm/s is the highest vario most copter can reach without wobbling of death.
Regarding to fast descend. If you are on a flat field without any obstackles, than it is a good idea! But once there are small hillsides, etc. Than you will not know how far is the landing area is from the copter. And you will maybe still descending with high speed and hit ie. a roof... Anyway, I'll thinking on it how to handle this question. Maybe a define for user choice...
When using sonar to determine how far the ground is than it would be great to have a fast descending period.