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

REBOOT_REQUIRED flag to cms power options, unified confirm page options #9518

Merged
merged 1 commit into from Mar 1, 2020

Conversation

asizon
Copy link
Member

@asizon asizon commented Feb 26, 2020

Added REBOOT_REQUIRED flag to all Power options in cms for changes to take efect. Also unified all CONFIRM pages options with YES and NO.

{ "V METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_voltageMeterSource, VOLTAGE_METER_COUNT - 1, voltageMeterSourceNames }, 0 },
{ "I METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_currentMeterSource, CURRENT_METER_COUNT - 1, currentMeterSourceNames }, 0 },
{ "V METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_voltageMeterSource, VOLTAGE_METER_COUNT - 1, voltageMeterSourceNames }, REBOOT_REQUIRED },
{ "I METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_currentMeterSource, CURRENT_METER_COUNT - 1, currentMeterSourceNames }, REBOOT_REQUIRED },
Copy link
Member

Choose a reason for hiding this comment

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

Do all of these really need a reboot?

Copy link
Member Author

Choose a reason for hiding this comment

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

No sorry, I mainly thought that they affected to real time current/voltage reads, but that is not the case.

Copy link
Member

Choose a reason for hiding this comment

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

Can you please point out what reference to batteryConfig()->voltageMeterSource and batteryConfig()->vbatmaxcellvoltage means that a reboot is required for changes to them to take effect?

The reality is that we are trying to move away from any settings changes requiring a reboot - most of them have been refactored to not require a reboot, and we should try to not muddy the waters by adding required reboots for settings that don't need them.

Copy link

Choose a reason for hiding this comment

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

@mikeller Hi i noticed this update in 4.1.5 betaflight Target: TMOTORF7
Manufacturer: TMTR
Version: 4.1.5
Binary: betaflight_4.1.5_STM32F7X2.hex
Date: 16-03-2020 16:50

I am not sure if this is related, but i posted an issue .. WHat happens is Battery readings freeze as soon as quad is armed, readings dont happen i can only see the original battery level. If i unplug battery and re-plug i will only then see the new updated batt levels, again if i re-arm the quad voltage meters freeze again. please help me as i am close to damaging lipos. I use the T-Motor HD F7 Stack and 55a 4in1 32bit esc + DJI system

@asizon
Copy link
Member Author

asizon commented Feb 27, 2020

@mikeller definitely VBAT CLMAX also need a reboot because it aplies on first boot, I need to change it.

mikeller
mikeller previously approved these changes Feb 27, 2020
{ "V METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_voltageMeterSource, VOLTAGE_METER_COUNT - 1, voltageMeterSourceNames }, 0 },
{ "I METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_currentMeterSource, CURRENT_METER_COUNT - 1, currentMeterSourceNames }, 0 },
{ "V METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_voltageMeterSource, VOLTAGE_METER_COUNT - 1, voltageMeterSourceNames }, REBOOT_REQUIRED },
{ "I METER", OME_TAB, NULL, &(OSD_TAB_t){ &batteryConfig_currentMeterSource, CURRENT_METER_COUNT - 1, currentMeterSourceNames }, REBOOT_REQUIRED },
Copy link
Member

Choose a reason for hiding this comment

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

Can you please point out what reference to batteryConfig()->voltageMeterSource and batteryConfig()->vbatmaxcellvoltage means that a reboot is required for changes to them to take effect?

The reality is that we are trying to move away from any settings changes requiring a reboot - most of them have been refactored to not require a reboot, and we should try to not muddy the waters by adding required reboots for settings that don't need them.

@asizon
Copy link
Member Author

asizon commented Feb 29, 2020

@mikeller So maybe we should check vmaxcellvoltage outside of CMS? The truth is that I am not able to understund the code of these parameters, I rely on direct tests in cms, when I modify vmax for example by lowering it to 300 nothing changes until I apply Reboot, it is when it detects the vmax voltage and it gives me low warning battery, same for voltageMeterSource.

@mikeller
Copy link
Member

@asizon:

I rely on direct tests in cms, when I modify vmax for example by lowering it to 300 nothing changes until I apply Reboot

Not sure what you mean by this - maybe you can try describing this as a bug:

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

I hope this can clarify it @mikeller
Describe the bug
Reboot needed when I try to change VBAT CLMAX param

To Reproduce
Put 4s full battery , reduce default 430 CLMAX value to 330 value and check save and exit. The battery status is not affected, it still shows Battery Full.

Expected behavior
When you change the value of clmax to 330 which is a value lower than the maximum of my battery it should show Low battery and flickers in the voltage, it only does so if reboot is applied.

@mikeller
Copy link
Member

mikeller commented Mar 1, 2020

Put 4s full battery , reduce default 430 CLMAX value to 330 value and check save and exit. The battery status is not affected, it still shows Battery Full.

I do not quite understand where it shows 'battery full'. Can you please be a bit more precise and specify what 'it' is, and maybe supply a screenshot / image of 'it'?

When you change the value of clmax to 330 which is a value lower than the maximum of my battery it should show Low battery and flickers in the voltage, it only does so if reboot is applied.

Not sure what you mean to achieve by setting the maximum cell voltage to 3.3V, to my knowledge there is no battery used in RC racing that has a cell voltage when full of 3.3V. What you are looking at after the reboot is a warning message because you have horribly misconfigured your craft, and the cell count detection was broken by it. There is no need for a 'fix', instead you should stop using utterly incorrect settings, and instead correctly configure your hardware.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

I really don't know how much this is used, I just run this test to verify that the changes only came into effect when the flight controller was rebooted, here a sample image:

CLMAX 330 without reboot:
batteryfull

CLMAX 330 REBOOT aplies:
landnow

@mikeller
Copy link
Member

mikeller commented Mar 1, 2020

Can you again specify what variables you think were only changed after the reboot and point them out in the code?

For what I understand is that you are using CMS to set absurdly wrong values, like a 'maximum cell voltage' that is ~1 V lower than the actual cell voltage. For this situation there is no 'expected behaviour', as this is so far outside of what the firmware was designed to support that it will behave completely errorneous.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

OK @mikeller , now I begin to understand you, this applies before reboot, in the reboot other factors are applied that are incompatible with those absurd values. Sorry for this mixunderstunding.

Only for voltage/current meter source

Add flag to vbat clmax

Clmax flag revert
@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

Removed CLMAX flag and rebased!

@mikeller
Copy link
Member

mikeller commented Mar 1, 2020

@asizon: batteryConfig()->voltageMeterSource is the same - I could not find a single reference for its use that is exclusive to the initialisation, so I don't think it needs to require a reboot.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

@mikeller for batteryConfig()->voltageMeterSource reboot is needed only when we want to use ESC SENSOR as voltage meter source.

@mikeller
Copy link
Member

mikeller commented Mar 1, 2020

@asizon:

for batteryConfig()->voltageMeterSource reboot is needed only when we want to use ESC SENSOR as voltage meter source.

Are you sure? I do not have a test setup for this now, but to my recollection switching to / from ESC_SENSOR as the voltage meter source works without a reboot if the ESC_SENSOR feature is enabled and a port for it is configured.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

Yes im sure, I tried it now, port configured, bidir disabled and esc_sensor enabled, setup voltage meter source to None, when I set to esc_sensor and save and exit it continues in 0.00v,only take efect after reboot and shows real voltage. For ADC meter source it works as expected.

@asizon
Copy link
Member Author

asizon commented Mar 1, 2020

Also verified it now in configurator to make sure that ESC_SENSOR is already well configured by cms and working properly.

@mikeller
Copy link
Member

mikeller commented Mar 1, 2020

Heh, good point. If it is set to 'NONE' to start with it will not start the voltage monitor task.

@mikeller mikeller merged commit 86b81ba into betaflight:master Mar 1, 2020
mikeller added a commit that referenced this pull request Mar 1, 2020
REBOOT_REQUIRED flag to cms power options, unified confirm page options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants