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

Tradheli-improvement to internal rotor speed governor #16534

Merged
merged 11 commits into from
Dec 15, 2021

Conversation

bnsgeyer
Copy link
Contributor

@bnsgeyer bnsgeyer commented Feb 6, 2021

This PR provides a significant enhancement to the internal rotor speed governor. It enables automatic spool up from ground idle to throttle unlimited. it also provides cool down period for internal combustion engines. Many thanks to Chris Olson (@MidwestAire) for his work on this and others who helped test it.

Copy link
Member

@MidwestAire MidwestAire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnsgeyer I noted the param macro index conflict with the SITL autorotation param. Otherwise the code looks intact after the rebase. Since the autothrottle logic is quite complicated I think it would be a good idea for me to build this and run it in a real helicopter before the PR is merged.
Thanks!

@MidwestAire
Copy link
Member

@bnsgeyer I ran this early this morning in one of my piston engine helicopters. As you are aware, the governor portion itself is not new, we have flown that for over a year. The main concern was the autothrottle sequencing, fault lockout, and integration with the spool logic in 4.1-dev. That functions perfectly after the rebase. So from a safety and functionality standpoint, this is good to go on my end for 4.1-dev. Works as I designed it to.

Copy link
Contributor

@MattKear MattKear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have offered a few comments. I hope it helps.

libraries/AP_Motors/AP_MotorsHeli_RSC.h Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.h Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.h Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.h Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
@rmackay9
Copy link
Contributor

rmackay9 commented Feb 8, 2021

The changes are all tradheli specific so I have no real concerns about this going in. Thanks to @Gone4Dirt for all the review comments as well.

@MidwestAire
Copy link
Member

@bnsgeyer I made some changes that addresses most of the comments here.

  1. I removed two constrain_floats that were not needed
  2. changed the governor's _control_output lower limit from a floating value to a hard limit
  3. added the governor_reset() function as suggested by Matt. This increased the lines of code in the cpp by one line. But removing the governor defaults from the header and getting rid of unnecessary comment lines in RSC.h reduced the size of the header by 10 lines.
  4. rearranged the params for the governor in alphabetical order by @param name and assigned a new eeprom slot for the rpm. Reduced the verbosity of the param descriptions.

This set of changes is in my branch. If it looks good to you I'll push it to the PR branch
MidwestAire@9cba692

Is it really necessary to have the defaults for the throttle curve as a #define in the header? Those could be moved to the AP_GROUPINFO in the cpp, as well, since they are never changed anyway.

Also, since this also intended as a general cleanup and overhaul of the RSC, function declarations are usually self-explanatory and re-commented in the C file where they are used. Could get rid of more unnecessary comment lines in the header and group other things, like the autorotation functions() and maybe the functions for rotor speeds under one comment line. Comments are fine, but when it starts getting too many of them, one for each declaration, it gets messy. I prefer how it was done at the bottom of the header in the public access specifier for the parameter assessors, it's a lot cleaner.

@bnsgeyer
Copy link
Contributor Author

@Gone4Dirt would like to get final approval from you for the changes I have implemented since your initial review. Most of it was addressing your comments. I did add a fix for a bug I found in the spool up logic of the governor. I also moved the cool down timer out of the governor to make it generic to all RSC Modes. Lastly I restored the governor range parameter. Chris had fixed this to -3/+2 %. I have had some feedback that in some cases this is too restrictive and causes the governor to fault.

Copy link
Contributor

@MattKear MattKear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not experienced with governers so cannot review how it works. Mostly trivial comments to tidy up. I find the autothrottle_run extremly hard to follow due to the number of nested if{}, but I can see that it would be difficult to pull that appart.

libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Show resolved Hide resolved
// @Range: 0 40
// @Param: GOV_TORQUE
// @DisplayName: Governor Torque Limiter
// @Description: Adjusts the engine's percentage of torque rise on autothrottle during ramp-up to governor speed. The torque rise will determine how fast the rotor speed will ramp up when rotor speed reaches 50% of the rotor RPM setting. The sequence of events engaging the governor is as follows: Throttle ramp time will engage the clutch and start the main rotor turning. The collective should be at feather pitch and the throttle curve set to provide at least 50% of normal RPM at feather pitch. The autothrottle torque limiter will automatically activate and start accelerating the main rotor. If the autothrottle consistently fails to accelerate the main rotor during ramp-in due to engine tune or other factors, then increase the torque limiter setting. NOTE: throttle ramp time and throttle curve should be tuned using MODE Throttle Curve before using MODE AutoThrottle
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what 'feather pitch' is. Is this common parlance in our community?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe he is referring to flat pitch or zero blade pitch angle. Not entirely sure though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MidwestAire could you provide some clarification on what you mean by feather pitch please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He means flat pitch or the collective pitch that is used for ground run. I will use flat pitch in the description. Are happy with that phrase?

libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
libraries/AP_Motors/AP_MotorsHeli_RSC.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@MattKear MattKear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bnsgeyer bnsgeyer merged commit afaff18 into ArduPilot:master Dec 15, 2021
@bnsgeyer bnsgeyer deleted the pr-new-governor branch March 30, 2022 03:17
@Hwurzburg Hwurzburg removed the WikiNeeded needs wiki update label Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants