13年6个月前IP:未同步
541040
7楼
回 4楼(bolide) 的帖子
应该是任意时间的绝对定高误差100m
MS5611的相对误差小于10cm

上一个万户3号使用的气压开伞程序
原作者Shadow_Swirl大神,论坛ID = clyce
在万户3项目中使用,经过本人修改


attachment icon APPALT.rar 16.46KB RAR 44次下载

void appalt_init(void);
//start pressure altimeter controlled parachute
void appalt_set_zero(void);
//set relative altitude to zero
void appalt_set_pressure(uint32_t p);// p is pressure in Pa
//input current pressure data
void appalt_set_callback(void (*f)(void));
//set parachute open function callback

核心代码:
void appalt_set_pressure(uint32_t p) {
    int pprev;
    pprev = pres;
    if ((p <= MAX_PRES) && (p >= MIN_PRES) ) {
        pres = p;
    }
    if (pres_not_setted) {pres_not_setted = 0;}
    if (p > pprev) {
        falling += 1;
    } else {
        falling = 0;
    }
    if (falling >= falling_count_th) {
        get_alt();
        if (altitude <= alt_limit) {
            // code to open the parachute
            if(f_open_parachute)
                (*f_open_parachute)();
        }
    }
}
评论
文号 / 541040

万流景仰
名片发私信
学术分 12
总主题 379 帖总回复 8283 楼拥有证书:进士 学者 机友
注册于 2008/10/11 20:04:00最后登录 2026/10/12 22:44:46
主体类型:个人
所属领域:无
认证方式:手机号
IP归属地:0

个人简介

Cubesat

笔记
{{note.content}}
{{n.user.username}}
{{fromNow(n.toc)}} {{n.status === noteStatus.disabled ? "已屏蔽" : ""}} {{n.status === noteStatus.unknown ? "正在审核" : ""}} {{n.status === noteStatus.deleted ? '已删除' : ''}}
  • 编辑
  • 删除
  • {{n.status === 'disabled' ? "解除屏蔽" : "屏蔽" }}
我也是有底线的