Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed LPS25HB_I2C LSM9DS1 PIDcontroller LoopTicker GPSUBX_UART_Eigen SBUS_without_mainfile MedianFilter Eigen UsaPack solaESKF_Eigen Vector3 CalibrateMagneto FastPWM
Diff: servo.cpp
- Revision:
- 62:ef10fd919f7b
- Parent:
- 61:c05353850017
- Child:
- 66:e5afad70fdd8
--- a/servo.cpp Thu Jun 03 11:28:13 2021 +0000
+++ b/servo.cpp Wed Jun 09 07:50:18 2021 +0000
@@ -11,6 +11,7 @@
rc[i] = 0.65f * mapfloat(float(sbus.getData(i)),368,1680,-1,1) + (1.0f - 0.65f) * rc[i]; // mapped input
}
}
+ //pc.printf("rc:%f\r\n",rc[1]);
// 自身の位置に応じてエレベータ舵角を決定する
float deobj = 0.0f;
@@ -34,8 +35,8 @@
float pitchobj = objgain * deobj;
//ゲインの係数をrc8で変更
- float gaincoef = ((rc[7]+1.0f)/2*0.9)+0.1;
- pitchPID.setGain(6.36*gaincoef, 10.6*gaincoef,0.0);
+ float gaincoef = 1.0;
+ pitchPID.setGain(6.36*gaincoef, 10.6*gaincoef*0.0f,0.0);
pitchratePID.setGain(0.9540*gaincoef,0.0,0.0);
pitchPID.setProcessValue(rpy.y);
pitchratePID.setProcessValue(gyro.y);