Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StratoBlimp - changes to SITL code with focus on lift #26920

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Tools/autotest/param_metadata/param.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,24 +115,25 @@ def has_param(self, pname):
'dB' : 'decibel' ,
# compound

'kB' : 'kilobytes' ,
'MB' : 'megabyte' ,
'kB' : 'kilobytes' ,
'MB' : 'megabyte' ,
'm.m/s/s' : 'square meter per square second',
'deg/m/s' : 'degrees per meter per second' ,
'm/s/m' : 'meters per second per meter' , # Why not use Hz here ????
'mGauss/A': 'milligauss per ampere' ,
'mAh' : 'milliampere hour' ,
'mAh' : 'milliampere hour' ,
'A/V' : 'ampere per volt' ,
'm/V' : 'meters per volt' ,
'gravities': 'standard acceleration due to gravity' , # g_n would be a more correct unit, but IMHO no one understands what g_n means
'octal' : 'octal' ,
'RPM' : 'Revolutions Per Minute',
'kg' : 'kilograms',
'kg' : 'kilograms' ,
'kg/m/m' : 'kilograms per square meter', # metre is the SI unit name, meter is the american spelling of it
'kg/m/m/m': 'kilograms per cubic meter',
'litres' : 'litres',
'Ohm' : 'Ohm',
'N' : 'Newtons',
'm^3' : 'cubic meters' , # metre is the SI unit name, meter is the american spelling of it
'litres' : 'litres' ,
'Ohm' : 'Ohm' ,
'N' : 'Newtons' ,
}

required_param_fields = [
Expand Down
43 changes: 30 additions & 13 deletions libraries/SITL/SIM_StratoBlimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,15 @@ const AP_Param::GroupInfo StratoBlimp::var_info[] = {
// @Description: drag on X axis
AP_GROUPINFO("DRAG_FWD", 5, StratoBlimp, drag_fwd, 0.27),

// @Param: DRAG_SIDE
// @DisplayName: drag in sidewards direction
// @Description: drag on Y axis
AP_GROUPINFO("DRAG_SIDE", 16, StratoBlimp, drag_side, 0.5),

// @Param: DRAG_UP
// @DisplayName: drag in upward direction
// @Description: drag on Z axis
AP_GROUPINFO("DRAG_UP", 6, StratoBlimp, drag_up, 0.1),
AP_GROUPINFO("DRAG_UP", 6, StratoBlimp, drag_up, 0.4),

// @Param: MOI_YAW
// @DisplayName: moment of inertia in yaw
Expand All @@ -87,10 +92,10 @@ const AP_Param::GroupInfo StratoBlimp::var_info[] = {
AP_GROUPINFO("ALT_TARG", 10, StratoBlimp, altitude_target, 20000),

// @Param: CLMB_RT
// @DisplayName: climb rate
// @Description: climb rate
// @DisplayName: target climb rate
// @Description: target climb rate
// @Units: m/s
AP_GROUPINFO("CLMB_RT", 11, StratoBlimp, climb_rate, 5),
AP_GROUPINFO("CLMB_RT", 11, StratoBlimp, target_climb_rate, 5),

// @Param: YAW_RT
// @DisplayName: yaw rate
Expand All @@ -114,7 +119,18 @@ const AP_Param::GroupInfo StratoBlimp::var_info[] = {
// @DisplayName: weathervaning offset
// @Description: center of drag for weathervaning
// @Units: m
AP_GROUPINFO("WVANE", 15, StratoBlimp, center_of_drag, 2),
AP_GROUPINFO("WVANE", 15, StratoBlimp, center_of_drag, 0.3),

// @Param: ENV_VOL
// @DisplayName: envelope volume
// @Description: volume of the envelope when full
// @Units: m^3
AP_GROUPINFO("ENV_VOL", 17, StratoBlimp, envelope_volume, 1545),

// @Param: FLR
// @DisplayName: free lift ratio
// @Description: amount of free lift generated by helper balloons, as a proportion of vehicle mass
AP_GROUPINFO("FLR", 18, StratoBlimp, free_lift_ratio, 0.12),

AP_GROUPEND
};
Expand Down Expand Up @@ -201,14 +217,15 @@ float StratoBlimp::get_lift(float altitude)
// start with neutral buoyancy
float lift_accel = GRAVITY_MSS;

// assume lift will equal drag at the given climb rate
float climb_accel = 0.5 * air_density * sq(climb_rate) * drag_up;

// ramp down lift as we approach target alt
lift_accel += linear_interpolate(climb_accel, 0,
altitude,
altitude_target-1000, altitude_target);

// add helper balloon if it's still attached
if (helper_balloon_attached) {
// the helper balloon adds an amount of lift based on free lift ratio
lift_accel += GRAVITY_MSS*free_lift_ratio;
// detach helper balloon if the target altitude has been reached
if (altitude >= altitude_target) {
helper_balloon_attached = false;
}
}
return mass * lift_accel;
}

Expand Down
6 changes: 5 additions & 1 deletion libraries/SITL/SIM_StratoBlimp.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ class StratoBlimp : public Aircraft {
float EAS2TAS;
float drag_yaw;
bool released;
bool helper_balloon_attached = true;

AP_Float mass;
AP_Float helium_mass;
AP_Float arm_length;
AP_Float motor_thrust;
AP_Float drag_fwd;
AP_Float drag_side;
AP_Float drag_up;
AP_Float altitude_target;
AP_Float climb_rate;
AP_Float target_climb_rate;
AP_Float turn_rate;
AP_Float motor_angle;
AP_Float yaw_rate_max;
Expand All @@ -78,6 +80,8 @@ class StratoBlimp : public Aircraft {
AP_Float moi_pitch;
AP_Float center_of_lift;
AP_Float center_of_drag;
AP_Float envelope_volume;
AP_Float free_lift_ratio;
};

}
Expand Down
Loading