PLUS+1 Software > Displays

Transform encoder pulses!

(1/2) > >>

I need help to transform a rotary encoder pulses of 250 pulses per revolution in linear length.
anyone have an example of how to do this?


I would try to trigger on rising edge and simply add the calculated distance from imp to imp (Pi * diameter / imps per rev) . I use a similar function in one of my projects and modified it like I think it should work (not compiled or tested).

Uploaded with

good day

tools are digital transition and does not compile with input frequency

I may be not getting something here, but you shouldn't have a freqency signal when using encoder inputs. It's a simple digital one. If pin 8 is set to T, that it's a ground activated input. That's it.
I also don't fully understand the 'linear' part. Are you talking about some sort of a 'what distance has the encoder traveled while turning 1 step'? If so than count the steps, divide them by 250 and than multiply them by 2*pi*R  ;D

Or maybe you're reffering to Quax's example. Whell the thing here is that ... it's an example. It's not a solution for YOUR problem. It's one of his. :)
You just have to mingle with it to get your own solution. It's not that hard. :)

Rafal is right. Which Pin on which Display do you want to use and what kind of signal do you have from your rotary encoder?
My excample works, if you connect it to a MF input and create a toggling signal with a compare component (e.g. "your" 0 line is at 0.5V, just compare the voltage input with 500(mV) and connect it to my "frq_in".
Your calculation is excatly, what I did in my excample, just using the diameter instead of the radius and multiplying with 314 instead of pi because of the extraordinaly good floating point performance of Plus1


[0] Message Index

[#] Next page

Go to full version