Rotary encoder wrong direction sign at high speed rotation (STM32F405RG) #7147
Replies: 1 comment
-
Posted at 2019-07-11 by Robin Wed 2019.07.10 Hi @feanir, While I have no experience with encoders or this module I am unable to provide a definitive answer to what is going on. It is possible that pull-up resistors are required, it could be the choice of encoder you have is not compatible with the code module. But, looking at the Encoder module code, link at top of reference page, there is only one function. As a suggestion, simply copy-n-paste that function into your code, removing the module require statement, add a liberal amount of Posted at 2019-07-11 by hungryforcodes Rotary encoders for whatever reason seem to be problematic on the ESP32 and ESP8266. Maybe because "setWatch" uses polling instead of interrupts? I'm not sure. At least your setup is not crashing as it did for me. http://forum.espruino.com/conversations/332965/#comment14722654 You could try different pins. This could at least improve the situation. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-07-10 by feanir
Hi guys!
I'm trying to use Encoder lib to get rotation direction from my wheels encoders (https://wiki.dfrobot.com/Micro_DC_Motor_with_Encoder-SJ01_SKU__FIT0450).
At small speed it's okay and returns correct value. But when I'm trying to rotate wheel a little bit faster Encoder lib starting to print an opposite direction sign.
What am I doing wrong? Please, help me figure it out.
Looks like this at slow speed
1
1
1
1
1
1
And this at higher speed
-1
-1
1
-1
1
-1
-1
-1
Beta Was this translation helpful? Give feedback.
All reactions