forked from apache/nuttx-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/foc: protect control loop with critical section
If the controller frequency is high, system timer interrupts will eventually interrupt the controller function, thereby increasing the execution time. This may lead to skipping the control cycle, which negatively affects the control algorithm. With this option enabled, interrupts are disabled for the duration of the controller function execution. Here example results from CONFIG_EXAMPLES_FOC_PERF output for b-g431b-esc1 board with CONFIG_EXAMPLES_FOC_NOTIFIER_FREQ=10000: 1. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=n exec ticks=5258 nsec=30929 per ticks=21268 nsec=125105 2. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=y exec ticks=3428 nsec=20164 per ticks=19203 nsec=112958 The difference is ~12us!
- Loading branch information
1 parent
b85a5ed
commit a7024ae
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters