You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This encoder driver uses the STM32 timer hardware to track the A/B impulses, which is much more efficient (and will support higher speeds) than the generic interrupt-based solution used by the standard encoder driver.
4
+
5
+
Big thank you to @conroy-cheers for originally contributing this code in pull request #114 to the simplefoc repository. Due its hardware-specific nature we moved the code to this drivers repository.
6
+
7
+
## Warning
8
+
9
+
This code has not been tested much! Use at your own risk, your milage may vary.
10
+
I have tested on: STM32F401CC/TIM4-PB6,PB7
11
+
12
+
## Hardware setup
13
+
14
+
The ABI signals of your encoder will have to be connected to the STM32 MCU in such a way that all signals are connected to the same timer. Consult your STM32 chip's datasheet for more information on which pins connect to which timer.
15
+
16
+
Not all of the timers support the encoder mode, so check the datasheet which timers can be used.
17
+
18
+
An excellent option can be to use the STM32CubeIDE software's pin assignment view to quickly check which pins connect to which timer.
19
+
20
+
Note that the index (I) pin is currently not used.
21
+
22
+
23
+
## Software setup
24
+
25
+
There is no need for interrupt functions or their configuration with this encoder class, so usage is quite simple:
0 commit comments