main
YohanHadji 2022-04-10 09:53:25 +02:00
rodzic afaaa01c9c
commit 8ef9cc8b13
4 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ void cmpt_weight_gain() {
int total_weight = SYSTEM_WEIGHT+PAYLOAD_WEIGHT;
total_weight = constrain(total_weight, 500, 1500);
SERVO_MAX_M_W = map(total_weight, 500, 1500, 2000, 1500);
SERVO_MAX_C_W = map(total_weight, 500, 1500, 1750, 1250);
SERVO_MAX_C_W = map(total_weight, 500, 1500, 1750, 1350);
}
else {
SERVO_MAX_M_W = SERVO_MAX_M_DEF;
@ -43,8 +43,8 @@ void cmpt_pressure_gain(float pressure_ratio) {
if (millis()-time_gain>1000) {
time_gain = millis();
if (AUTO_GAIN_PRESSURE) {
SERVO_MAX_M = map((SERVO_MAX_M_W-1000)/pressure_ratio, 0, 1000, 1000, 2000);
SERVO_MAX_C = map((SERVO_MAX_M_W-1000)/pressure_ratio, 0, 1000, 1000, 2000);
SERVO_MAX_M = constrain(map((SERVO_MAX_M_W-1000)/pressure_ratio, 0, 1000, 1000, 2000), 1250, 2000);
SERVO_MAX_C = constrain(map((SERVO_MAX_M_W-1000)/pressure_ratio, 0, 1000, 1000, 2000), 1250, 2000);
}
else {
SERVO_MAX_M = SERVO_MAX_M_W;

Wyświetl plik

@ -111,7 +111,7 @@ void newfile() {
dataFile = SD.open(namebuff, FILE_WRITE);
delay(10);
if (dataFile) {
dataFile.println("time (ms), Packet_Count (text), Mode (text), Initialised (text), Deployed (text), Wing_Opened (text), GPS_Ok (text), COG_Ok (text), Spiral (text), FailSafe (text), Vbatt (V), Loop_rate (Hz), GPS-date, GPS-time, lat (deg), lon (deg), alt (m), CoG (deg), Speed (m/s), Sat_in_use (text), HDOP (text), Position_Age (text), Fix_type (text), Baro_Alt (m), Pressure (hpa), Baro_Vspeed (m/s), Altitude (m), Merged_Vspeed (m/s), Baro_Weight, GPS_Weight, Baro_Vspeed_AVG (m/s), GPS_Vspeed_AVG (m/s), VDOWN (m/s), SetPoint_Home (deg), Err_Home (deg), LatB (deg), LonB (deg), WaypointNumber (text), Distance (m), Ch 0 (us), Ch 1 (us), Ch 2 (us), Ch 3 (us), Ch 4 (us), Ch 5 (us), Ch 6 (us), PWM_L (us), PWM_R (us), PWM_D (us), PWM_X (us), MAX_M_W, MAX_C_W, MAC_M, MAX_C");
dataFile.println("time (ms), Packet_Count (text), Mode (text), Initialised (text), Deployed (text), Wing_Opened (text), GPS_Ok (text), COG_Ok (text), Spiral (text), FailSafe (text), Vbatt (V), Loop_rate (Hz), GPS-date, GPS-time, lat (deg), lon (deg), alt (m), CoG (deg), Speed (m/s), Sat_in_use (text), HDOP (text), Position_Age (text), Fix_type (text), Baro_Alt (m), Pressure (hpa), Baro_Vspeed (m/s), Altitude (m), Merged_Vspeed (m/s), Baro_Weight, GPS_Weight, Baro_Vspeed_AVG (m/s), GPS_Vspeed_AVG (m/s), VDOWN (m/s), SetPoint_Home (deg), Err_Home (deg), LatB (deg), LonB (deg), WaypointNumber (text), Distance (m), Waypoint Radius (m), Ch 0 (us), Ch 1 (us), Ch 2 (us), Ch 3 (us), Ch 4 (us), Ch 5 (us), Ch 6 (us), PWM_L (us), PWM_R (us), PWM_D (us), PWM_X (us), MAX_M_W, MAX_C_W, MAC_M, MAX_C");
dataFile.close();
}
if (CONFIG_FILE_SV) {

Wyświetl plik

@ -58,8 +58,9 @@ String control_text() {
String lon_B_text = String(current_waypoint.longitude,5);
String waypoint_text = String(waypoint_number);
String waypoint_distance = String(TinyGPSPlus::distanceBetween(gps.location.lat(),gps.location.lng(),current_waypoint.latitude,current_waypoint.longitude));
String waypoint_threshold = String(current_waypoint.radius);
return setPoint_Home_text+","+errHome_text+","+lat_B_text+","+lon_B_text+","+waypoint_text+","+waypoint_distance;
return setPoint_Home_text+","+errHome_text+","+lat_B_text+","+lon_B_text+","+waypoint_text+","+waypoint_distance+","+waypoint_threshold;
}
String nav_text() {

Wyświetl plik

@ -40,7 +40,7 @@ void cmpt_fusion() {
pressure_percentage = (ps_p.reading((pressure_baro / (baro_set*100.0))*100.0)/100.0) ;
pressure_percentage = constrain(pressure_percentage, 5, 100);
baro_alt_weight = pressure_percentage;
baro_alt_weight = pressure_percentage*pressure_percentage;
baro_vspeed_weight = pressure_percentage*pressure_percentage;
double h_dop = gps.hdop.value();