4.2 autorotation#3
Conversation
| SCHED_TASK(auto_trim, 10, 75, 30), | ||
| #if RANGEFINDER_ENABLED == ENABLED | ||
| SCHED_TASK(read_rangefinder, 20, 100, 33), | ||
| SCHED_TASK(read_rangefinder, 100, 100, 33), |
There was a problem hiding this comment.
I don't think we will get away with a straight change to 100 Hz. I think the best we can hope for is to make this a param value that defaults to 20.
| { | ||
| _current_rpm = get_rpm(true); | ||
| if ((_param_head_speed_set_point - _current_rpm) >=0){ | ||
| _rpm_decay = constrain_float((_param_head_speed_set_point - _current_rpm)/400.0f, 0.0f, 1.0f); |
| float pitch_vel2 = MIN(fabsf(pitch_vel), 2000); | ||
| pilot_yaw_rate = ((float)pilot_roll/1.0f) * (1.0f - (pitch_vel2 / 5000.0f)) * g2.acro_y_rate; //****THIS NEEDS FIXED***** | ||
|
|
||
| roll_vel = constrain_float(roll_vel, -560.0f, 560.0f); |
There was a problem hiding this comment.
We shouldn't hard code constrains. We also don't need to. The user defined input shaping will be done in the attitude control library
| float pitch_vel = vel.y * ahrs.sin_yaw() + vel.x * ahrs.cos_yaw(); // body pitch vel | ||
|
|
||
| // gain scheduling for yaw | ||
| float pitch_vel2 = MIN(fabsf(pitch_vel), 2000); |
There was a problem hiding this comment.
I would really like to try the weather vaneing library for doing the coordinated turns. Would reduce this code and minimise duplication.
There was a problem hiding this comment.
yes, this was to do some testing of the control logic. Having the nose aligned onto velocity vector would be a great improvement both for avoiding sideslip during glide and for precise skid aligning during landing.
| _hs_decay = ((_initial_rpm/g2.arot.get_hs_set_point()) - HEAD_SPEED_TARGET_RATIO) / AUTOROTATE_ENTRY_TIME; | ||
|
|
||
| //set motors to idle | ||
| copter.ap.motor_interlock_switch = false; |
There was a problem hiding this comment.
This looks like a big no no to me. We should not be setting the interlock from the code. Why do we need to do this anyway?
There was a problem hiding this comment.
this is specific for ICE in case of "real" emergency. It is safer to have the ECU set to throttle-off position in case of in-flight shutdown/flameout.
| _accel_target = _vel_p ; | ||
|
|
||
| // filter correction acceleration | ||
| _accel_target_filter.set_cutoff_frequency(10.0f); |
There was a problem hiding this comment.
Don't think we should be hard coding filters. Depends very much on the users setup as to what cutt offs should be set.
| _accel_target = _accel_out_last + _accel_max; | ||
| } else if (_accel_target < _accel_out_last - _accel_max) { | ||
| _accel_target = _accel_out_last - _accel_max; | ||
| } |
There was a problem hiding this comment.
nit pick: can just use a constrain here
| _control_output = constrain_float( _rsc_arot_bailout_pct/100.0f , 0.0f, 0.4f); | ||
| _control_output = constrain_float( _ext_gov_arot_pct/100.0f , 0.0f, 0.4f); | ||
| if(!_autorotating){ | ||
| gcs().send_text(MAV_SEVERITY_CRITICAL, "Autorotation"); |
There was a problem hiding this comment.
Don't think we should be doing this at the motors level. This should be up at vehicle level
| _rotor_ramp_output = _rotor_runup_output; | ||
| if (_use_bailout_ramp){ | ||
| if(!_bailing_out){ | ||
| gcs().send_text(MAV_SEVERITY_CRITICAL, "bailing_out"); |
There was a problem hiding this comment.
Again, not sure this is a motors level thing. We should put this stuff up in heli. Also not MAV_SEVERITY_CRITICAL
| _tail_rotor.use_bailout_ramp_time(_heliflags.enable_bailout); | ||
| if (_tail_type == AP_MOTORS_HELI_SINGLE_TAILTYPE_DIRECTDRIVE_VARPIT_EXT_GOV) { | ||
| _tail_rotor.set_autorotation_flag(_heliflags.in_autorotation); | ||
| _tail_rotor.use_bailout_ramp_time(_heliflags.enable_bailout); |
There was a problem hiding this comment.
Surely we don't need to change tail rotor ramp? It should not have spooled down
There was a problem hiding this comment.
I think the tail type is not right here. The spool down for tail motors should happen only for the direct drive fixed pitch.
c179b89 to
17677f1
Compare
1f5c641 to
f5e9ba7
Compare
bnsgeyer
left a comment
There was a problem hiding this comment.
My first round of reviews. Looked mainly at files changed in the Arducopter folder. Will provide follow on reviews for the remaining files.
There was a problem hiding this comment.
Is it ok that the autorotate mode is set every time this method is ran. I'm guessing the set_mode method just ignores this since the mode is already set?
There was a problem hiding this comment.
would this orientation always be ROTATION_PITCH_270 for downward facing? This sounds like it could be setup specific?
There was a problem hiding this comment.
I think it is always ROTATION_PITCH_270 for downward facing rangefinders ( RNGFNDx_ORIENT = 25)
There was a problem hiding this comment.
It would be good that you put a comment in here that explains what is being done in this logic for whether it is a hover autorotation or not.
There was a problem hiding this comment.
Why is Dt being set here? Why not initialize the library with Dt? just wondering if we need to set Dt on every cycle. Could put dt as a argument for the update_forward_speed_controller.
There was a problem hiding this comment.
Dt is passed to the Update_hs_glide_controller here. Seems like Dt should be passed in initially and then it doesn't need to be here.
bnsgeyer
left a comment
There was a problem hiding this comment.
Finished my review. Once we have addressed my comments then I will put in a PR and get randy involved
There was a problem hiding this comment.
ENABLE param has the wrong DisplayName
Need to discuss parameter names
consistency with abbreviation for Bail out in names (BAIL vs BLOUT)
consistent with abbreviating Target with other libraries (TGT vs TARG)
T_TO_G maybe this should be TIME_GND
FW_V_FF maybe this should be FWD_VEL_FF
FW_V_P maybe this should be FWD_VEL_P
AS_ACC_MAX maybe this should be FWD_ACC_MAX (we get 16 char so this would be 16 with the AROT_)
There was a problem hiding this comment.
This is not allowed. the Run up timer must count down to allow rotor rundown on the ground to judge when it is safe to disarm.
There was a problem hiding this comment.
why is this set here and also in the if statement below. I need to understand when this needs to be used. Is this covering practice autorotations. I guess if it is a bailout then yes. So are we assuming that the DDVP will have the tail rotor shutdown during practice autorotation?
There was a problem hiding this comment.
This follows the original implementation, I don't thinkf DDVP tail rotor should be shut down in autorotation (whether practice or autonomous), directional control shall always be allowed.
The only case in which tail rotor should be shutdown is DDFP, as it relies on main rotor torque to achieve control in both directions
dbe9afc to
5d361bd
Compare
3805b6f to
2b458fb
Compare
* Update SIM_StratoBlimp.cpp * Update SIM_StratoBlimp.h
Allows me to see combined changes without putting a PR against the Ardupilot repo