diff --git a/.DS_Store b/.DS_Store index 5a0bd69..007954b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/RLS_V1.0/.DS_Store b/RLS_V1.0/.DS_Store index 77c40f2..180a988 100644 Binary files a/RLS_V1.0/.DS_Store and b/RLS_V1.0/.DS_Store differ diff --git a/RLS_V1.0/R2Home_PCB_V0.1/R2Home_PCBV1.zip b/RLS_V1.0/R2Home_PCB_V0.1/Archive_V1.zip similarity index 100% rename from RLS_V1.0/R2Home_PCB_V0.1/R2Home_PCBV1.zip rename to RLS_V1.0/R2Home_PCB_V0.1/Archive_V1.zip diff --git a/RLS_V1.0/R2Home_PCB_V0.1/PCB_R2HomeV2.zip b/RLS_V1.0/R2Home_PCB_V0.1/PCB_R2HomeV2.zip new file mode 100644 index 0000000..c78dbcd Binary files /dev/null and b/RLS_V1.0/R2Home_PCB_V0.1/PCB_R2HomeV2.zip differ diff --git a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino index 75e333f..bd6f159 100644 --- a/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino +++ b/RLS_V1.0/R2Home_SOFTWARE_V1.01/R2Home_OBC_V1.01/R2Home_OBC_V1.01.ino @@ -21,6 +21,7 @@ #define dep_alt 100 // m above ground #define vup 1.5 // m/s #define vdown 2 // m/s +#define gps_freq 5 // Hz #define time_out 300 @@ -230,7 +231,7 @@ void setup() { Serial.begin(115200); Serial5.begin(57600); - gpset(57600, 5, 2, 1, 0); // baud, Hz, mode, nmea, cog filter (0 = Off, 1 = On) + gpset(57600, gps_freq, 2, 1, 0); // baud, Hz, mode, nmea, cog filter (0 = Off, 1 = On) rx.begin(); @@ -396,17 +397,18 @@ void datacmpt() { if (new_cog == true) { - raterror = getangle((last_errHome+180),(errHome+180))*5; raterror = rs.reading(raterror); - ratecog = getangle(prev_cog_b,gps.course.deg())*5; ratecog = rc.reading(ratecog); - next_cog = (int(gps.course.deg() + (ratecog/2))%360); + raterror = getangle((last_errHome+180),(errHome+180))*gps_freq ; raterror = rs.reading(raterror); + ratecog = getangle(prev_cog_b,gps.course.deg())*gps_freq; ratecog = rc.reading(ratecog); float PIDsum = ((NKp*errHome)+(NKd*raterror)); - cmd_mult = (0.09999996 + (1 - 0.09999996)/(1 + pow(((abs(ratecog))/49.54231),24.26521))); cmd_mult = mult.reading(cmd_mult*1000); cmd_mult = (cmd_mult/1000); - cmdHome = PIDsum*cmd_mult ; + //cmd_mult = (0.09999996 + (1 - 0.09999996)/(1 + pow(((abs(ratecog))/49.54231),24.26521))); cmd_mult = mult.reading(cmd_mult*1000); cmd_mult = (cmd_mult/1000); + + cmd_mult = 1; + cmdHome = PIDsum*cmd_mult ; //if (TinyGPSPlus::distanceBetween(gps.location.lat(),gps.location.lng(),lat_B,lon_B)<5) { cmdHome = 180; } - if (vspeed<-4) { spiral = true; } + if (vspeed<-5) { spiral = true; } if (vspeed>-3) { spiral = false; } if (spiral == true) { cmdHome = 0; }