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 MatrixMath LPS25HB_I2C LSM9DS1 Matrix2 PIDcontroller LoopTicker SBUS_without_mainfile UsaPack solaESKF_wind Vector3 CalibrateMagneto FastPWM
Diff: global.cpp
- Revision:
- 107:78e6f7bee68e
- Parent:
- 106:36458fb9b5b7
- Child:
- 108:e582f8bd4729
--- a/global.cpp Wed Mar 02 09:23:39 2022 +0000
+++ b/global.cpp Mon Mar 07 09:16:40 2022 +0000
@@ -22,8 +22,12 @@
// control
FastPWM servo(PE_9);
+FastPWM rudServo(PE_11);
+FastPWM motor1(PE_13);
+FastPWM motor2(PA_6);
PID pitchPID(5.0, 0,0, PID_dt); // rad
PID pitchratePID(0.5, 0.0, 0.0, PID_dt); // rad/s
+PID yawratePID(5.0, 0.0, 0.0, PID_dt); // rad/s
solaESKF eskf;
int itowVEL_log = 0;
@@ -42,6 +46,8 @@
// elevator
float de;
float deobj;
+float dr;
+float drobj;
// position
Matrix SensorAlignmentAG(3,3);
@@ -68,9 +74,11 @@
//const int pixel_x = 35;
//const int pixel_y = 35;
-int out1, out2;
-float scaledServoOut[1] = {0.0f};
-float servoOut[1] = {1500.0f};
+float scaledServoOut[2] = {0.0f,0.0f};
+float servoOut[2] = {1500.0f,1500.0f};
+
+float scaledMotorOut[2] = {-1.0f,-1.0f};
+float motorOut[2] = {1000.0f,1000.0f};
int calibrationFlag = 0;
int pos_tail = 0; // 0:left 1:center 2:right