I was easily able to implement parachutes from the jsbsim/ball_chute example. In this example there is the parachute external_force, which is added to the FDM .xml file. Then there is the script I developed which uses a combination of JSB properties, that were suggested by Levi, to automatically deploy a drogue and main braking parachute in sequence. All three conditions must be met for each parachute to deploy. For the drogue chute to deploy, either of the two rear wheels [number 1] or [number 2] must be touching the ground, the speed above 100 kts, and the throttle position = 0 (Off). For the main braking chute to deploy, the front wheel [number 0] must be touching the ground, speed above 100 kts, throttle = 0. I find this works very well, but you can experiment with what works best for you. Implement this on any aircraft you like, add as many parachutes are you like. I don't have a joystick, and have rarely been able to successfully land aircraft in OT using the keyboard. As soon as I tried with the parachutes, I landed perfectly three times in a row. The drogue chute is meant to stabilize the aircraft before the main braking chute is deployed. I figured that the back wheels touching would be best for the drogue, and as soon as the front wheel hits the ground the main chute deploys. That fraction of a second delay works far better than the main parachute deploying without the drogue. Instead of front wheel contact, you could use a delay timer instead. I found this works best. Remember you have to throttle all the way to 0% right before touching down to deploy chutes. This is so they don't deploy during take off or taxi.
The only thing left is I still need to figure out how to make the chutes only deploy once. Currently you can deploy the parachutes and land, take-off and do it again. This is not realistic and must be corrected. In a more advanced OT flight sim, maybe you would have to taxi to the hanger before you would get new parachutes.
EDIT: You can add another 'and' operator (&&) to the if statement for the main chute, so that it is dependent on the drogue chute to open. This way, if the front wheel touches down, the main chute does not deploy. Like so:
//Deploy Main Braking Parachute (Drogue opened)
var front_wheel_gnd = (jsb['gear/unit[0]/compression-ft']);
var drogue_chute = (jsb['fcs/parachute2_reef_pos_norm']);
if (front_wheel_gnd > 0.05 && vel_kts > 100 && throttle_pos == 0.0 && drogue_chute == 1){
var deploy2 = 1;
}
Or likewise, make it so the main chute only deploys when all three wheels are touching the ground. Like so:
//Deploy Main Braking Parachute (Drogue opened + three point touch down)
var front_wheel_gnd = (jsb['gear/unit[0]/compression-ft']);
var left_wheel_gnd = (jsb['gear/unit[1]/compression-ft']);
var right_wheel_gnd = (jsb['gear/unit[2]/compression-ft']);
var drogue_chute = (jsb['fcs/parachute2_reef_pos_norm']);
if (front_wheel_gnd > 0.05 && left_wheel_gnd > 0.05 && right_wheel_gnd > 0.05 && vel_kts > 100 && throttle_pos == 0.0 && drogue_chute == 1){
var deploy2 = 1;
}
Enjoy!
Best regards,
Uriah George
.js Script:
//Automatically Deployed Parachute
var wheel_gnd = (jsb['gear/unit[1]/compression-ft'] + jsb['gear/unit[2]/compression-ft']);
var vel_kts = jsb['velocities/vc-kts'];
var throttle_pos = jsb["fcs/throttle-cmd-norm[0]"];
//Deploy Drouge Parachute
if (wheel_gnd > 0.1 && vel_kts > 100 && throttle_pos == 0.0){
var deploy1 = 1;
}
if (deploy1 == 1){
jsb['fcs/parachute2_reef_pos_norm']=1;
}
//Deploy Main Braking Parachute
var front_wheel_gnd = (jsb['gear/unit[0]/compression-ft']);
if (front_wheel_gnd > 0.05 && vel_kts > 100 && throttle_pos == 0.0){
var deploy2 = 1;
}
if (deploy2 == 1){
jsb['fcs/parachute_reef_pos_norm']=1;
}
if (throttle_pos > 0){
jsb['fcs/parachute_reef_pos_norm']=0;
jsb['fcs/parachute2_reef_pos_norm']=0;
}
if (jsb['fcs/parachute_reef_pos_norm'] == 1.0 && vel_kts < 15) {
jsb['fcs/parachute_reef_pos_norm']=0;
}
if (jsb['fcs/parachute2_reef_pos_norm'] == 1.0 && vel_kts < 15) {
jsb['fcs/parachute2_reef_pos_norm']=0;
}
//Manually Deployed Parachute NOT WORKING WITH AUTO MODE!!!
// jsb['fcs/parachute_reef_pos_norm']=jsb['fcs/speedbrake-cmd-norm'];
////Debug
this.log_inf(jsb['gear/unit[0]/compression-ft']);
this.log_inf(jsb['gear/unit[1]/compression-ft']);
this.log_inf(jsb['gear/unit[2]/compression-ft']);
this.log_inf(jsb['gear/unit[3]/compression-ft']);
this.log_inf("Parachute: " + jsb['fcs/parachute_reef_pos_norm']);
this.log_inf("Drogue Chute: " + jsb['fcs/parachute2_reef_pos_norm']);
this.log_inf("Velocity KTS: " + jsb['velocities/vc-kts']);
this.log_inf("Vel. True KTS: " + jsb['velocities/vtrue-kts']);
this.log_inf("Throttle: " + jsb["fcs/throttle-cmd-norm[0]"]);
.xml FDM external_force for parachutes:
<external_reactions>
<!-- "Declare" the reefing term -->
<property>fcs/parachute_reef_pos_norm</property>
<property>fcs/parachute2_reef_pos_norm</property>
<force name="parachute" frame="WIND">
<function>
<product>
<property>aero/qbar-psf</property>
<property>fcs/parachute_reef_pos_norm</property>
<value> 1.0 </value> <!-- Full drag coefficient -->
<value> 400.0 </value> <!-- Full parachute area -->
</product>
</function>
<!-- The location below is in structural frame (x positive
aft), so this location describes a point 1 foot aft
of the origin. In this case, the origin is the center. -->
<location unit="FT">
<x>25</x>
<y>0</y>
<z>0</z>
</location>
<!-- The direction describes a unit vector. In this case, since
the selected frame is the WIND frame, the "-1" x component
describes a direction exactly opposite of the direction
into the wind vector. That is, the direction specified below
is the direction that the drag force acts in. -->
<direction>
<x>-1</x>
<y>0</y>
<z>0</z>
</direction>
</force>
<force name="parachute2" frame="WIND">
<function>
<product>
<property>aero/qbar-psf</property>
<property>fcs/parachute2_reef_pos_norm</property>
<value> 1.0 </value> <!-- Full drag coefficient -->
<value> 40.0 </value> <!-- Full parachute area -->
</product>
</function>
<!-- The location below is in structural frame (x positive
aft), so this location describes a point 1 foot aft
of the origin. In this case, the origin is the center. -->
<location unit="FT">
<x>30</x>
<y>0</y>
<z>0</z>
</location>
<!-- The direction describes a unit vector. In this case, since
the selected frame is the WIND frame, the "-1" x component
describes a direction exactly opposite of the direction
into the wind vector. That is, the direction specified below
is the direction that the drag force acts in. -->
<direction>
<x>-1</x>
<y>0</y>
<z>0</z>
</direction>
</force>
</external_reactions>