inav icon indicating copy to clipboard operation
inav copied to clipboard

controlrate_profile = 3 does not set control profile to 3.

Open thespova opened this issue 1 month ago • 11 comments

PLEASE MAKE SURE YOU READ AND UNDERSTAND THE SOCIAL MEDIA SUPPORT CHANNELS. QUESTIONS ABOUT FLASHING, CONFIGURING, PILOTING MAY BE CLOSED WITHOUT FURTHER INTERACTION.

Please double-check that nobody reported the issue before by using search in this bug tracker. For Bug-Reports, please use the following template and provide as much information as possible. Bug-Reports that don't follow the template, might be closed unanswered. If you are not sure if you found a bug, ask for further input in the community channels or open a Github discussion.

PLEASE DELETE THE TEXT ABOVE AFTER READING AND UNDERSTANDING IT


Current Behavior

Steps to Reproduce

  1. set a battery profile to have controlrate_profile = 3
  2. change to that battery profile

Expected behavior

I expect battery profiles to change the control profile to 3 as it does with other controlrate_profile settings.

Suggested solution(s)

Make controlrate_profile = 3 change control_profile to 3 like it does with 1 and 2

Additional context

Note: controlrate_profile = 0 has the same problem as 3. Only 1 & 2 work.


  • FC Board name and vendor: Holybro kakute H7 v1.2
  • INAV version string: version

INAV/KAKUTEH7 8.0.1 Mar 28 2025 / 09:55:48 (ae47bcba)

GCC-13.2.1 20231009

thespova avatar Nov 11 '25 03:11 thespova

Flashed to the oldest version available for my FC and confirmed the same issue existed before name profile change to controlprofile.

Same bug on

version

INAV/KAKUTEH7 7.1.1 May 6 2024 / 11:53:57 (dd91a871)

GCC-10.3.1 20210824 (release)

thespova avatar Nov 11 '25 03:11 thespova

I really have no idea what im looking at but my best guess is the " MAX_CONTROL_RATE_PROFILE_COUNT" in https://github.com/iNavFlight/inav/blob/master/src/main/fc/settings.yaml.

Since it has 4 settings it looks like default,1,2,3 or 0,1,2,3 Unlike battery_profile and control_profile that appear to only have 3 options of 1,2,3. my best guess at least. I wish I could be more help.

thespova avatar Nov 11 '25 04:11 thespova

I really have no idea what im looking at but my best guess is the " MAX_CONTROL_RATE_PROFILE_COUNT" in https://github.com/iNavFlight/inav/blob/master/src/main/fc/settings.yaml.

Yeah there's a line that needs to be fixed that uses that. I'm going to send you a hex to test in a little bit.

Most of the places it's used, the code subtracts 1 from the profile number to get a profile index 0-2. There's a spot where that's not done right.

sensei-hacker avatar Nov 11 '25 04:11 sensei-hacker

Please test this build. Thanks. https://drive.google.com/file/d/19r3cXjpNZMyH-NDxXng25hPmitL1EnT5/view?usp=sharing

sensei-hacker avatar Nov 11 '25 05:11 sensei-hacker

controlrate_profile should probably be changed to control_profile too for consistency. It must have been missed when the profile group names were made more correct a while back.

MrD-RC avatar Nov 11 '25 08:11 MrD-RC

I really have no idea what im looking at but my best guess is the " MAX_CONTROL_RATE_PROFILE_COUNT" in https://github.com/iNavFlight/inav/blob/master/src/main/fc/settings.yaml.

Since it has 4 settings it looks like default,1,2,3 or 0,1,2,3 Unlike battery_profile and control_profile that appear to only have 3 options of 1,2,3. my best guess at least. I wish I could be more help.

No, that looks fine to me. It is saying that the highest number for control_profiles is 3. That could be 0..3 (in this case), -20..3, or 2..3 etc. There are only 3 control_profiles. So this is correct.

MrD-RC avatar Nov 11 '25 08:11 MrD-RC

Most of the places it's used, the code subtracts 1 from the profile number to get a profile index 0-2. There's a spot where that's not done right.

Let me guess. In the auto assignment of control_profile when battery_profile is changed 🤣

MrD-RC avatar Nov 11 '25 08:11 MrD-RC

Verified this is working on the bench in the configurator gui and in the cli with @sensei-hacker's firmware version. Also confirmed on the goggles with actually changing various batteries not plugged in to usb. All seems to be working with this firmware file.

Is this build off a nightly or any reason I should not fly with this firmware until this fix becomes part of the release version?

thespova avatar Nov 11 '25 10:11 thespova

controlrate_profile should probably be changed to control_profile too for consistency. It must have been missed when the profile group names were made more correct a while back.

That would make things a lot less confusing when setting this up.

thespova avatar Nov 11 '25 11:11 thespova

@sensei-hacker have you submitted a PR for this?

MrD-RC avatar Nov 15 '25 12:11 MrD-RC

Fixed by https://github.com/iNavFlight/inav/pull/11118

sensei-hacker avatar Nov 15 '25 16:11 sensei-hacker