Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Add MOE Bit disable for Motor Outputs in Hardfault #184

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

Gfcello
Copy link
Member

@Gfcello Gfcello commented May 31, 2022

Description

Add MOE (Main Output Enable) bit disable into hardfault handler for tim1 and tim3 that control motors.

https://uwarg-docs.atlassian.net/wiki/spaces/ZP/pages/2064286344/Hardfault+Shutdown

Testing

Requires test on hardware by initiating a hardfault while motors are enabled.

Documentation

https://uwarg-docs.atlassian.net/wiki/spaces/ZP/pages/2064286344/Hardfault+Shutdown

Merge Checklist:

  • The changes have been well commented, particularly in hard-to-understand areas.
  • The code has been tested on hardware, either by me or someone else.
  • Comprehensive unit tests have been made for this change
  • Corresponding changes to documentation have been created and links to this documentation are provided within the pull request.
  • The changes generate no new warnings and compile and run; A screenshot of a successful compile message is attached to the bottom of this PR.

@Gfcello Gfcello requested a review from antholuo May 31, 2022 01:23
Copy link
Member

@antholuo antholuo left a comment

Choose a reason for hiding this comment

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

As long as we get someone to test this before we fly (either by accident or on purpose), it's fine by me.

Copy link
Contributor

@upadhyaydhruv upadhyaydhruv left a comment

Choose a reason for hiding this comment

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

Great work! Now we need to find a way for you to test and simulate a hardfault. I'm requesting changes for now since we need to test system reset, but otherwise it looks good to test. Lets discuss hardfault triggering after the meeting today


// Shut down outputs here
__HAL_TIM_MOE_DISABLE(&htim1);
__HAL_TIM_MOE_DISABLE(&htim3);
Copy link
Contributor

Choose a reason for hiding this comment

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

great! Is there any way we can run a restart() function to reset the MCU possible? Would help us recover if its flying at a relatively high altitude. Try looking into nvic_systemreset() maybe.

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

Successfully merging this pull request may close these issues.

3 participants