着陸wait版9/16

Dependencies:   HCSR04_2 MPU6050_2 mbed SDFileSystem3

Fork of Autoflight2018_17 by 航空研究会

Files at this revision

API Documentation at this revision

Comitter:
TUATBM
Date:
Mon Sep 17 06:40:41 2018 +0000
Parent:
14:bbd5ff31fb67
Commit message:
trim,max,min pwm?????????

Changed in this revision

config/falfalla.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r bbd5ff31fb67 -r 43427b0241d9 config/falfalla.h
--- a/config/falfalla.h	Sun Sep 16 11:17:50 2018 +0000
+++ b/config/falfalla.h	Mon Sep 17 06:40:41 2018 +0000
@@ -44,20 +44,11 @@
 
 
 #if NUMBER_FALFALLA == 1    //1号機
-
-const int16_t Trim_Falfalla[4] = {0,14,-100,-10};
-const float ExpMax_Falfalla[4] = {100,115,100,89};
-const float ExpMin_Falfalla[4] = {100,47,100,110};
 const int8_t Reverce_falfalla[4] = {1,-1,1,1};   //Nutral:1 , Reverce:-1
 
 #elif NUMBER_FALFALLA == 2  //2号機
-
-const int16_t Trim_Falfalla[4] = {0,12,0,2};    //rewrite -100
-const float ExpMax_Falfalla[4] = {100,115,100,103};
-const float ExpMin_Falfalla[4] = {100,97,100,97};
 const int16_t Reverce_falfalla[4] = {1,-1,1,-1};   //Nutral:1 , Reverce:-1
 
-
 #endif
 
 
diff -r bbd5ff31fb67 -r 43427b0241d9 main.cpp
--- a/main.cpp	Sun Sep 16 11:17:50 2018 +0000
+++ b/main.cpp	Mon Sep 17 06:40:41 2018 +0000
@@ -108,10 +108,6 @@
 const int16_t lengthdivpwm = 320; 
 const int16_t changeModeCount = 6;
 
-const float trim[4] = {Trim_Falfalla[0],Trim_Falfalla[1],Trim_Falfalla[2],Trim_Falfalla[3]};
-const float expMax[4] = {ExpMax_Falfalla[0],ExpMax_Falfalla[1],ExpMax_Falfalla[2],ExpMax_Falfalla[3]};
-const float expMin[4] = {ExpMin_Falfalla[0],ExpMin_Falfalla[1],ExpMin_Falfalla[2],ExpMin_Falfalla[3]};
-const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
 
 SBUS sbus(PA_9, PA_10); //SBUS
 
@@ -150,10 +146,23 @@
 static OutputStatus output_status = Manual;
 OperationMode operation_mode = StartUp;
 BombingMode bombing_mode = Takeoff;
+
 static int16_t autopwm[8] = {1500,1500,1180,1500,1392,1500};
+
+//1号機
 static int16_t trimpwm[6] = {1500,1500,1180,1500,1392,1600};
 int16_t maxpwm[6] = {1820,1820,1820,1820,1820,1820};
 int16_t minpwm[6] = {1180,1180,1180,1180,1180,1180};
+const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
+
+//2号機
+/*
+static int16_t trimpwm[6] = {1500,1500,1180,1500,1392,1600};
+int16_t maxpwm[6] = {1820,1820,1820,1820,1820,1820};
+int16_t minpwm[6] = {1180,1180,1180,1180,1180,1180};
+const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
+*/
+
 int16_t oldTHR = 1000;
 
 int16_t g_AIL_L_Ratio_rightloop = 0.5;
@@ -207,11 +216,9 @@
 void Output_PWM(int16_t pwm[6]);    //pwmをサーボへ出力
 
 //シリアル割り込み
-void SendSerial();   //1文字きたら送り返す
-void SendArray();
 void getSF_Serial();
 float ConvertByteintoFloat(char high, char low);
-void ISR_Serial_Rx();
+
 
 //SD設定
 int GetParameter(FILE *fp, const char *paramName,char parameter[]);
@@ -416,11 +423,6 @@
 }
 
 void Init_PWM(){
-    for (uint8_t i = 0; i < 6; ++i){
-        trimpwm[i] = 1500 + (int16_t)(lengthdivpwm * (trim[i]/100));
-        maxpwm[i] = 1500 + (int16_t)(lengthdivpwm * (expMax[i]/100));
-        minpwm[i] = 1500 - (int16_t)(lengthdivpwm * (expMin[i]/100));
-    }
     pc.printf("PWM initialized\r\n");
 }