Understanding and using quadrature encoders - The Byte Sized Engineer | DigiKey

  Рет қаралды 8,243

DigiKey

DigiKey

Күн бұрын

Пікірлер: 15
@earthlightsmusic2743
@earthlightsmusic2743 10 ай бұрын
This is a good beginning. The ultimate is where your ISR handles a change of state on either input A or input B, so you get the maximum possible resolution of encoder position.
@f-s-r
@f-s-r 10 ай бұрын
That's surprinsingly easy and very clever. Great explanation!!
@shashikantsingh6555
@shashikantsingh6555 2 ай бұрын
Wow!! This is so far the best explanantion for encoders
@parkesdj
@parkesdj 10 ай бұрын
Great video very clearly explained. I have a question though. If you are using CHANGE to trigger the interrupt, won’t it double count because you will trigger on both the rising and falling edges.
@paulz8750
@paulz8750 10 ай бұрын
Great video. Wish I'd seen it sooner. Just like you, I've spent days too, looking at everything else thinking the problem is elsewhere.
@bob_mosavo
@bob_mosavo 10 ай бұрын
Thanks, Zack 👍
@larrybud
@larrybud 10 ай бұрын
Great stuff!
@danielatbasementtech
@danielatbasementtech 10 ай бұрын
Very clearly explained ... great lesson.
@JonathanRansom
@JonathanRansom 10 ай бұрын
I need to play with some encoders. Great video!
@saddle1940
@saddle1940 10 ай бұрын
Watch out, the code doesn't miss pulses, it can now add phony pulses. Lots of jobs with quadrature encodered motors need to halt and hold position, but if yours bounces back and forward on the single interrupt edge, you may miss it being a pulse opposite to the last one. The best way to do this is to interrupt on one line, then change the interrupt to the other line. That way you can bounce up and down on one line, but after the first change, it will ignore it. You only look at the stable, non-interrupt input. The code should be: On an interrupt on line A, record the state of line B and change the active interrupt to line B. On an interrupt on line B, record the state of line A and change the active interrupt to line A. The recorded AB states tell you the rotation direction at each interrupt. Had many problems with software interrupted quadrature counting on long lead screws that "ring" (rotationally vibrate) as they hit a physical end stop or work piece.
@JonitoFischer
@JonitoFischer 10 ай бұрын
There are microcontrollers that have a dedicated peripheral to handle your quadrature encoder without handling gpio interrupts and checking pin state manually.
@SweSausage
@SweSausage 9 ай бұрын
Very good video, thank you
@jeremiahbullfrog9288
@jeremiahbullfrog9288 10 ай бұрын
Don't you also need to use an atomic_block to prevent the ISR from updating the long variable in the middle of trying to read it in the main loop? ...or does the arduino framework handle this autmotically?
@DanielSimu
@DanielSimu 10 ай бұрын
I'm confused about the comment that it's a bad idea to use mechanical switches. Aren't most basic dial encoders (the ones you typically turn by hand) operated somewhat like this? (but with contacts instead of bumps) Also, as for magnetic encoders, what's the benefit of using a quadrature encoder when it's also cheap and effective to read absolute position using a diametric magnet?
@LubosMedovarsky
@LubosMedovarsky 10 ай бұрын
Simply put, mechanical contacts make sparks, which translates to chaotic sequence of ones and zeros. This erroneous state is then interpreted incorrectly as missed counts and incorrect direction. Engineers prefer being sure instead.
477 Use the very attractive new ATTINY chips for your projects
14:34
Andreas Spiess
Рет қаралды 213 М.
This Component solves "All" Motor Problems?! (Motor Encoder) EB#58
11:34
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 11 МЛН
How Many Balloons To Make A Store Fly?
00:22
MrBeast
Рет қаралды 199 МЛН
How to use rotary encoders
14:12
FriendlyWire
Рет қаралды 43 М.
Forget WiFi! This Wireless Method is WAY Better?
12:14
GreatScott!
Рет қаралды 703 М.
HACKED!: Using an HDD Motor as a Rotary Encoder?!
8:21
GreatScott!
Рет қаралды 1,5 МЛН
Modeling and Simulation of Advanced Amateur Rockets
17:10
Lafayette Systems
Рет қаралды 142 М.
Magnetic rotary encoder vs stepper motor accuracy
5:41
Matthias random stuff
Рет қаралды 154 М.
How to use encoders (Optical, Hall Effect, Quadrature)
20:44
Will Donaldson
Рет қаралды 113 М.
Inside a cheap set of eBay digital calipers
23:32
bigclivedotcom
Рет қаралды 689 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19