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

[EXPERIMENTAL] Feature/jamming protection #180

Draft
wants to merge 6 commits into
base: v0.20.1
Choose a base branch
from

Conversation

damosvil
Copy link
Contributor

@damosvil damosvil commented Oct 13, 2023

WARNING. NOT FOR PRODUCTION USE.
This pr is created to have a space to test jamming protection feature.

How it works
Jamming protection engages when throttle is above 33% and RPM is over 3500. It disengages when throttle is lower or equal to 33%. If jamming protection is engaged and RPM goes below 2800 the ESC disables and triggers an startup process after 100ms. All throttle values are calculated for 14 pole motors.

How it was tested
It has been tested in the workbench with the PSU set to 8V 5A.
In kwads (several flights with snap rolls and flips).

With no jamming protection
In the image below it can be seen that the voltage in PSU drops in 0.20.1 with no jamming protection.
imagen

With jamming protection
In the image below it can be seen that the voltage in PSU barely drops in 0.20.1 with jamming protection.
imagen

damosvil and others added 4 commits October 10, 2023 19:25
…N_THROTTLE_THRESHOLD in t1 int

Otherwise enable it if period <= JAMMING_PROTECTION_PERIOD_HI_ENGAGE
If enabled force a full resync if period <= JAMMING_PROTECTION_PERIOD_LO_RESYNC

JAMMING_PROTECTION_THROTTLE_THRESHOLD       EQU     55h ; 33% throttle
JAMMING_PROTECTION_PERIOD_LO_RESYNC         EQU     8h ; 2857rpm disable esc if protection is enabled
JAMMING_PROTECTION_PERIOD_HI_ENGAGE         EQU     7h ; 3500rpm engage jamming protection
…t being reversed (turtle mode)

Restored default DEFAULT_PGM_SAFETY_ARM setting
@damosvil damosvil self-assigned this Oct 13, 2023
@damosvil damosvil linked an issue Oct 13, 2023 that may be closed by this pull request
@damosvil
Copy link
Contributor Author

@hyp0dermik-code I have tested this in my workbench with the PSU set to 8V 5A.
Please, when possible could you give it a try and check when the PSU trigger the over current protection?

@stylesuxx
Copy link
Contributor

I would prefer to add this to a later version - 0.21.x preferably, and not to a bugfix version. This is too much of a change IMHO.

@damosvil damosvil added this to the v0.22.0 milestone Oct 13, 2023
@damosvil
Copy link
Contributor Author

damosvil commented Oct 13, 2023

Totally agree. I slated It for now to 0.22.

Edit: also converted to draft

@hyp0dermik-code
Copy link
Contributor

hyp0dermik-code commented Oct 13, 2023

@hyp0dermik-code I have tested this in my workbench with the PSU set to 8V 5A. Please, when possible could you give it a try and check when the PSU trigger the over current protection?

Can you confirm the test conditions:
0.20.1 @ 8v 5a trips the current protection when jammed
0.20.1IR1 @ 8v 5a does not trip current protection when jammed

Is this what I should be testing?

@damosvil
Copy link
Contributor Author

@hyp0dermik-code yes

@damosvil damosvil marked this pull request as draft October 14, 2023 12:53
@damosvil damosvil requested a review from stylesuxx October 14, 2023 12:53
@damosvil
Copy link
Contributor Author

damosvil commented Oct 14, 2023

0.20.1 XR1 Test:

  • 0603-17000kv motors 1s 65mm - ok
  • 0702-28500kv motors 1s 65mm - ok
  • 0702-32500kv motors 1s 65mm - ok
  • 1303-5500kv motors 3s 3inch - unexpected behavior, false positives

- Throttle > 33%
- RPM > 4000
- 24 consecutive eturns
@damosvil
Copy link
Contributor Author

damosvil commented Oct 16, 2023

v0.20.1_XR2.zip

0.20.1 XR2 Test:

  • 0702-32500kv motors 1s 65mm - ok
  • 0702-28500kv motors 1s 65mm - ok
  • 1303-5500kv motors 3s 3inch - ok
  • 1103-11000kv motors 2s 85mm - ok
  • 0802-20000kv motors 1s 65mm - ok
  • 0802-19000kv motors 1s 65mm - ok

@stylesuxx
Copy link
Contributor

stylesuxx commented Oct 17, 2023

I've been running this on a couple of 1S whoops - 0802, different KV's and had no issues. BUT, I am wondering if we could/should introduce motor poles as a setting and change thresholds accordingly, or if there are values that would be a good approximation for both (12 & 14 pole) variants? Or maybe hide it behind a "Micro motor jamming protection" setting?

@damosvil
Copy link
Contributor Author

damosvil commented Oct 17, 2023

I've been running this on a couple of 1S whoops - 0802, different KV's and had no issues. BUT, I am wondering if we could/should introduce motor poles as a setting and change thresholds accordingly, or if there are values that would be a good approximation for both (12 & 14 pole) variants? Or maybe hide it behind a "Micro motor jamming protection" setting?

With props motors spin at 45000rpm as much, so the code tries to take advantage of the low end part of rpm that cannot allow the kwad to fly to enable the protection. I think that there is no exact number of rpm but approximate ones so for now I would like to make the code as exact rpm agnostic as possible.

@stylesuxx
Copy link
Contributor

I think that there is no exact number of rpm but approximate ones so for now I would like to make the code as exact rpm agnostic as possible.

Perfect, sounds good to me.

@damosvil
Copy link
Contributor Author

0.20.1 XR2 seems to be working fine on my side. Please, could you try it and report back?

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

Successfully merging this pull request may close these issues.

Improve stall protection
3 participants