作者:敬昇文军3546 | 来源:互联网 | 2023-10-12 12:14
文章目录代码分析MotorControl()控制流程图代码分析MotorControl()casePROCESS_31:{int16_tthr_temp;这里的定高标志在Mo
代码分析
MotorControl()
case PROCESS_31:
{int16_t thr_temp;if(ALL_flag.height_lock) {thr_temp &#61; pidHeightRate.out &#43; (Remote.thr -1000); }else {thr_temp &#61; Remote.thr - 1000; }if(Remote.thr<1020) {MOTOR1 &#61; MOTOR2 &#61; MOTOR3 &#61; MOTOR4 &#61; 0;break;}MOTOR1 &#61; MOTOR2 &#61; MOTOR3 &#61; MOTOR4 &#61; LIMIT(thr_temp,0,900); MOTOR1 &#43;&#61; &#43; pidRateX.out - pidRateY.out - pidRateZ.out; MOTOR2 &#43;&#61; &#43; pidRateX.out &#43; pidRateY.out &#43; pidRateZ.out; MOTOR3 &#43;&#61; - pidRateX.out &#43; pidRateY.out - pidRateZ.out; MOTOR4 &#43;&#61; - pidRateX.out - pidRateY.out &#43; pidRateZ.out;
}
break;
控制流程图