Profile image

Could someone please help me with merging two funky expressions into one in a specific way...

1,955 Rakoval500k  1.9 years ago

I would like to merge the inputs of a my elevon with a rudder input in such a way that it would have Yaw/AngleOfSlip-related inputs of the upper expression, Pitch/Trim/aoa-related inputs of the elevon expression, and without a Roll-related inputs. Brake-related inputs can be the same as those of a basic "rudder" input.
this is the input of the right canted tail surface which is a slightly modified "rudder" expression from guyfolk's f-22 of 1.11

(abs(angleofslip)>90 & altitudeagl > 2 ? -1 : 1)*(clamp( pid(yaw, (yawrate/(10 + 20*clamp01(abs(yaw))) - clamp01(1-activate1)*angleofslip/(15))*clamp01(ias > 10),1.25,0,0.15), -1,1))*clamp(inverselerp(250,110, ias),0.2,1) + (vbrake*(0.4+(pitch*0.4))*clamp(inverselerp(250,100, ias),0.5,1))*(altitudeagl > 2.1 ? 1 : -1) - (clamp01(1-vbrake)*clamp01(angleofslip < 7 | altitudeagl <= 2.1)*clamp01(ias < 120)*clamp01(-pitch + clamp01(altitudeagl <= 3 & throttle > 0.7 & ! Vbrake)*0.8 + clamp01(1-activate1)*clamp01(altitudeagl > 2.1)*(angleofattack/25)))

this is the input of the right elevons

(abs(angleofslip)>120 & altitudeagl > 2 ? -1 : 1)*(clamp( pid(clamp(pitch, -1,0.4)*(vbrake & altitudeagl < 2.1 & gs < 65 & pitchangle < 1.5 ? 0 : 1) - roll*(vbrake & altitudeagl < 2.1 & gs < 65 & pitchangle < 1.5 ? 0 : 1) + clamp01(yaw)*clamp01(altitudeagl > 2.1)*clamp01(-angleofattack > 30), (pitchrate/(20 + 30*abs(pitch) + 50*clamp01(abs(pitch))*clamp01(activate1)) + (elevonr) + clamp01(-angleofattack > 30)*clamp01(altitudeagl > 2.1)*clamp(yawrate/30 + clamp01(1-activate1)*angleofslip/20 , -1,0) + clamp01(1-activate1)*abs(pitch)*clamp01(altitudeagl > 3 - clamp01(throttle < 0.6))*(angleofattack/(30 - 12*inverselerp(110,80, ias) )))*clamp01(ias > 10 & (clamp01(1-vbrake) | clamp01(altitudeagl > 2.1)) ),1.5,0,0.2) + sumpitch - clamp01(vbrake)*0.1*inverselerp(150,0, ias), -1,1)*clamp(inverselerp(250,110, ias),0.25,1) + vtrim/1.6) - (vbrake)*(altitudeagl < 2.1 & gs < 65 & pitchangle < 1.5 ? 1.25 : 0)

ElevonR variable expression:

clamp( Roll + clamp01(IAS > 10)*clamp01(AltitudeAgl > 2.1)*(RollRate/(100 + 140*abs(Roll)))  ,-1,1)

those tail surfaces are canted at 42 degrees from vertical.
Currently the canted tails of that plane use only an upper, "rudder" expression.

  • Log in to leave a comment
  • Profile image
    105k GuyFolk

    To quickly merge the code you can just put each rotator back to back, no need to read the code at all.
    And if you really want, just remove roll-related and yaw related code from elevons first and stick the rotator to the rudder rotator, just make sure it rotate on the same axis. (code that is not Pitch, aoa, pitch angle can be removed I think)
    Ps. I didn't read this code for ages, I'm as puzzling as you are right now lol.

    1.9 years ago
  • Profile image
    1,955 Rakoval500k

    @Guyfolk, greetings! These are based on those of your Raptor.

    1.9 years ago