-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
Implement assisted autorotation for Heli’s #22871
base: master
Are you sure you want to change the base?
Changes from 1 commit
99adf3e
18df15c
9147f2f
9b09716
4c9e076
e31ea19
4053ff8
079c189
321bb44
9dcec13
006a3b6
3959534
e7887eb
a9e2c26
ed8d1aa
6cfd4bb
aa3d54a
af175b9
4ce4e2c
5549244
1aba9ad
b61eee3
b2fe6a3
ee2dff7
71c92af
651e3f7
9aece05
e314f5c
e3fa52d
26659ad
93ddcc4
e153490
ea61936
afff5a1
0887aff
ee06b79
9214267
c2b8589
ee7b895
a42288d
29c2d35
ad64639
f101a21
61c6e60
0798ca6
ba3fbaf
a1b0725
3384684
64829ac
72553f7
7fddf29
bbebd62
a895d15
aaee063
9e110c9
7fd07b4
533e202
6547e24
6f3eff1
2cde571
241959e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -231,6 +231,9 @@ void AC_Autorotation::init(AP_MotorsHeli* motors, float gnd_clear) { | |||||
// Store the ground clearance on the lidar sensor for use in touch down calculations | ||||||
_ground_clearance = gnd_clear; | ||||||
|
||||||
// reset on ground timer | ||||||
_time_on_ground = 0; | ||||||
|
||||||
// initialize radar altitude estimator | ||||||
init_est_rangefinder_alt(); | ||||||
} | ||||||
|
@@ -423,10 +426,9 @@ void AC_Autorotation::initial_flare_estimate(void) | |||||
float des_spd_fwd = _param_target_speed * 0.01f; | ||||||
calc_flare_alt(-_est_rod, des_spd_fwd); | ||||||
|
||||||
// Initialize sink rate monitor and flare/touchdown bools | ||||||
// Initialize sink rate monitor and flare bools | ||||||
_flare_complete = false; | ||||||
_flare_update_check = false; | ||||||
_touchdown_complete = false; | ||||||
_avg_sink_deriv = 0.0f; | ||||||
_avg_sink_deriv_sum = 0.0f; | ||||||
_index_sink_rate = 0; | ||||||
|
@@ -696,19 +698,28 @@ void AC_Autorotation::touchdown_controller(void) | |||||
// Update forward speed for logging | ||||||
_speed_forward = calc_speed_forward(); // (cm/s) | ||||||
|
||||||
_collective_out = constrain_value((_p_coll_tch.get_p(_desired_sink_rate - _current_sink_rate))*0.01f + _ff_term_hs, 0.0f, 1.0f); | ||||||
col_trim_lpf.set_cutoff_frequency(_col_cutoff_freq); | ||||||
_ff_term_hs = col_trim_lpf.apply(_collective_out, _dt); | ||||||
if(_current_sink_rate < 10.0 && _radar_alt<=_ground_clearance && !_touchdown_complete){ | ||||||
// Check to see if we think the aircraft is on the ground | ||||||
if(_current_sink_rate < 10.0 && _radar_alt<=_ground_clearance && _time_on_ground == 0){ | ||||||
_time_on_ground = AP_HAL::millis(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you could |
||||||
_touchdown_complete = true; | ||||||
} | ||||||
float now = AP_HAL::millis(); | ||||||
if((now - _time_on_ground) > MIN_TIME_ON_GROUND && _touchdown_complete){ | ||||||
//on ground, collective can be bottomed now | ||||||
_collective_out = 0; | ||||||
|
||||||
// Use a timer to get confidence that the aircraft is on the ground. | ||||||
// Note: The landing detector uses the zero thust collective as an indicator for being on the ground. The touch down controller will have | ||||||
// driven the collective high to cushion the landing so the landing detector will not trip until we drive the collective back to zero thrust and below. | ||||||
if ((_time_on_ground > 0) && ((AP_HAL::millis() - _time_on_ground) > MIN_TIME_ON_GROUND)) { | ||||||
// On ground, smoothly lower collective to just bellow zero thrust, to make sure we trip the landing detector | ||||||
float desired_col = _motors_heli->get_coll_mid() * 0.95; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs changed to use H_COL_LAND_MIN instead of zero thrust collective, since the landing detector looks for "motors->get_below_land_min_coll()" |
||||||
_collective_out = _collective_out*0.9 + desired_col*0.1; | ||||||
|
||||||
} else { | ||||||
_collective_out = constrain_value((_p_coll_tch.get_p(_desired_sink_rate - _current_sink_rate))*0.01f + _ff_term_hs, 0.0f, 1.0f); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
col_trim_lpf.set_cutoff_frequency(_col_cutoff_freq); | ||||||
_ff_term_hs = col_trim_lpf.apply(_collective_out, _dt); | ||||||
} | ||||||
|
||||||
set_collective(HS_CONTROLLER_COLLECTIVE_CUTOFF_FREQ); | ||||||
|
||||||
// Smoothly scale the pitch target back to zero (level) | ||||||
_pitch_target *= 0.95f; | ||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ms?