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

add paralized mode; detect FC alive #117

Merged
merged 10 commits into from
Apr 17, 2023

Conversation

ligenxxxx
Copy link
Member

@ligenxxxx ligenxxxx commented Apr 6, 2023

### Failsafe mode
- When vtx is captured into failsafe mode, vtx is automatically set to 0mw.
- When vtx is in failsafe mode, power on switch and other remote control operations for vtx will be invalid.
- When vtx captures exiting failsafe mode, vtx is automatically set to the power value that was not 0mw last time.
All the above are valid when boot_0mw enable is enabled.

Known problem:
If failsafe is switched on and off quickly in a very short time (less than 1 second), RF settings may fail. This may be caused by some state refreshes being too slow.
I think failsafe mode is not necessary for VTX. If it is forced to be implemented, it may cause users to control the power very complicated, so I decided to remove it.

Paralized mode

  • Only valid when team_race is mode1.
  • If the FC paralized mode is turned on, the VTX will turn off the RF and go to sleep until repower.
  • the VTX will turn off the RF and go to sleep until repower when FC uart_tx doesn't ouptut to vtx.
  • During which time the blue led will blink rapidly.

A beta FC FW is needed here. https://github.com/betaflight/betaflight/suites/12066455915/artifacts/634884164

- When vtx is captured into failsafe mode, vtx is automatically set to 0mw.
- When vtx is in failsafe mode, power on switch and other remote control operations for vtx will be invalid.
- When vtx captures exiting failsafe mode, vtx is automatically set to the power value that was not 0mw last time.
All the above are valid when boot_0mw enable is enabled.
If the paralized mode is turned on, the VTX will turn off the RF and go to sleep until it is powered on again, and the blue led will flash rapidly again during the re-power.
@lesharodin
Copy link

So when Flight Controller is in a FailSafe state vtx would go to 0mw, why? Is it optional or would be default behaviour of vtx?

@ligenxxxx
Copy link
Member Author

So when Flight Controller is in a FailSafe state vtx would go to 0mw, why? Is it optional or would be default behaviour of vtx?

This only works when Boot 0MW is on. Mainly it is convenient for team race.

@ligenxxxx ligenxxxx changed the title add failsafe & paralized mode add paralized mode; detect FC alive Apr 10, 2023
Copy link

@john-k3nnedy john-k3nnedy left a comment

Choose a reason for hiding this comment

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

This change makes me nervous given that I occasionally have the OSD stop updating mid-flight. I'd assume this might trigger a vtx_paralized()?


if (seconds - fc_lst_rcv_sec > 2) {
if (TEAM_RACE)
vtx_paralized();

Choose a reason for hiding this comment

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

Should this actually be terminal, i.e. requiring re-power or could we make it a recoverable situation?

@ligenxxxx
Copy link
Member Author

ligenxxxx commented Apr 12, 2023

This change makes me nervous given that I occasionally have the OSD stop updating mid-flight. I'd assume this might trigger a vtx_paralized()?

  • In team_race mode, the communication between fc and vtx must be maintained, otherwise vtx RF cannot be woken up.
  • In team_race mode,, the uart that originally communicated normally loses connection suddenly, VTX will think that FC is faulty, and VTX will turn off RF at this time.

@john-k3nnedy
Copy link

john-k3nnedy commented Apr 12, 2023

This change makes me nervous given that I occasionally have the OSD stop updating mid-flight. I'd assume this might trigger a vtx_paralized()?

  • In team_race mode, the communication between fc and vtx must be maintained, otherwise vtx RF cannot be woken up.
  • In team_race mode,, the uart that originally communicated normally loses connection suddenly, VTX will think that FC is faulty, and VTX will turn off RF at this time.

Yeah I get that, but it seems risky — normally the FC shouldn’t crash mid-flight and if the connection gets interrupted for some other reason you’ll lose video.

My team mates and I had a couple of times that the OSD stopped updating mid-flight. I suspect the VTX might turn off then with this change, which means I’d not only lose OSD, but also video.

@ligenxxxx
Copy link
Member Author

ligenxxxx commented Apr 12, 2023

This change makes me nervous given that I occasionally have the OSD stop updating mid-flight. I'd assume this might trigger a vtx_paralized()?

  • In team_race mode, the communication between fc and vtx must be maintained, otherwise vtx RF cannot be woken up.
  • In team_race mode,, the uart that originally communicated normally loses connection suddenly, VTX will think that FC is faulty, and VTX will turn off RF at this time.

Yeah I get that, but it seems risky — normally the FC shouldn’t crash mid-flight and if the connection gets interrupted for some other reason you’ll lose video.

My team mates and I had a couple of times that the OSD stopped updating mid-flight. I suspect the VTX might turn off then with this change, which means I’d not only lose OSD, but also video.

  • I think I've fixed the OSD stop updating issue in v1.1.0.
  • This is only for team race.

@john-k3nnedy
Copy link

  • I think I've fixed the OSD stop updating issue in v1.1.0.

I’ll keep an eye on it, but I was definitely running 1.1.0 or higher.

  • This is only for team race.

I know, we’ll be at Mayhem!

@ligenxxxx
Copy link
Member Author

ligenxxxx commented Apr 14, 2023

  • I think I've fixed the OSD stop updating issue in v1.1.0.

I’ll keep an eye on it, but I was definitely running 1.1.0 or higher.

  • This is only for team race.

I know, we’ll be at Mayhem!

For people with different needs, I plan to add multiple options for team race, OFF/MODE1/MODE2.

  • TEAM_RACE MODE1
    • Enable vtx paralyzed().
  • TEAM_RACE MODE2
    • Disable vtx_paralyzed().
    • If VTX does not detect FC serial port during initialization, it will open RF.

@ligenxxxx
Copy link
Member Author

ligenxxxx commented Apr 14, 2023

#117 (comment)

  • Beta FC FW is not a correct firmware, please do not use it.
  • Obtaining FC paralyzed is temporarily blocked, and I haven't figured out how to obtain it correctly.

@ligenxxxx ligenxxxx merged commit a5e769d into hd-zero:main Apr 17, 2023
@lesharodin
Copy link

@ligenxxxx maybe you could make smth like this:
IF TEAM_RACE = OFF
PIT_MODE = default pitmode behaviour
IF TEAM_RACE = MODE1
PIT_MODE = 0MW
Then we can use pitmode + paralize from bf modes to power off vtx and paralize quad, without reading paralizy state from fc to vtx, beacuse it will be in pit and paralized anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants