initial
This commit is contained in:
14
Reference/Approach/ApproachPID.yolol
Normal file
14
Reference/Approach/ApproachPID.yolol
Normal 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
|
||||
2
Reference/Approach/README.md
Normal file
2
Reference/Approach/README.md
Normal file
@@ -0,0 +1,2 @@
|
||||
This is the MutleyX Approach script you find on TriFin and other ships
|
||||
Needs a rangefinder and approach button.
|
||||
17
Reference/Approach/approach.yolol
Normal file
17
Reference/Approach/approach.yolol
Normal 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
|
||||
Reference in New Issue
Block a user