Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3882

Automation, sensing and robotics • Re: Rotary encoder issues

$
0
0
Thanks. Just looked over the Pico and decided to go with the Pico H with no wifi. Now to get it ordered and figure out how do set everything up. Communicating between the RPi 4 and the Pico will be an interesting adventure as I have not coded anything like that.

Just to make sure that I understand, the Pico won't miss pulses from the encoder as it doesn't run multitasking, right?

As for the expected pulse rate, the rate will vary but it shouldn't exceed ~1200 pulses/second.
...
Otherwise, an Arduino or Pi Pico would be a good choice. Cheap, deterministic, easy to use. You could keep a running total of the encoder position and supply it on request from the host, or send a message each time it changes.

It would also be worth doing a quick back-of-an-envelope calculation of the expected pulse rate, given it's a 600 pulse encoder and the input will be turning at some rate. It helps put bounds on the problem, and whether a proposed solution will actually work.
The answer is "it depends", or "maybe". You'll have to experiment. If you write something in C you'll have very little overhead. If you are using interrupts you should have little latency, but polling might also be sufficiently fast, especially if you have nothing else to do.

Communication back to the host can be via usb serial, depending on how often you want to report. Or some other technique.

Statistics: Posted by ame — Wed Sep 11, 2024 12:55 am



Viewing all articles
Browse latest Browse all 3882

Trending Articles