This commit is contained in:
Zan
2024-05-09 14:05:30 -07:00
parent 93d72079dd
commit cfa8289330
2074 changed files with 21518 additions and 11 deletions

View File

@@ -0,0 +1,14 @@
s=10 Kp=0.3 Ki=0.01 Kd=4 t=3 m=1000 g=1/m p=0 goto1+:Approach>0
r=:RFD e=r-s d=e-p i+=e/(d-g) i/=2 o=Kp*e+Ki*i+Kd*d p=e r*=r<m
z/=:Approach*r*(d*d>g+e*e>1) :FcuForward=o/t :FcuBackward=-o*t goto2
:Approach=0 :FcuForward=0 :FcuBackward=0 goto1
// PID approach uses a proportional-integal-derivative controller to
// output FCU values appropriate to the distance and current speed.
// It has several tunables:
// s (setpoint) the distance we want to get to
// Kp (proportional) how much we factor in our current distance
// Ki (integral) factor of how long we've been at our distance
// Kd (derivative) factor of prediction of where we'll be in future
// t (thrust diff) account for disparity in forward/rev thrust power
// CREDIT TO WHITESTRAKE

View File

@@ -0,0 +1,2 @@
This is the MutleyX Approach script you find on TriFin and other ships
Needs a rangefinder and approach button.

View File

@@ -0,0 +1,17 @@
// Approach ahead - Mutleyx
:Approach=0 :range=0 od=0 oa=0
a=:Approach ifa!=oa thenoa=a :range=a end goto3+a
d=:RangeAhead ifd!=500thengoto6end
:FcuForward=0 :FcuBackward=0 goto3
ifd>15 and d<20thengoto9end
done=0 cd=17.5-d dx=od-cd od=cd adj=-(cd-4.5*dx) goto15
:FcuForward=0 :FcuBackward=0
done++ ifdone>10then:Approach=0end
goto2*:Approach+2
ifadj>d thenadj=d end :FcuForward=0 :FcuBackward=0
ifadj<0then:FcuBackward=-adj*0.5else:FcuForward=adj*0.25end
if:Approach thengoto4elsegoto9end