View Full Version : Obtaining Velocity from an encoder
As far as I know, the WPI robotics library still has a glitch in that it cannot calculate the velocity from more than one encoder. So, I want to write manual code to calculate velocity.
Is the code in the picture sufficient, or should I be doing some averaging or some other way to get rid of noise? Note that it is just a quick mod of the example code.
Is the code in the picture sufficient, or should I be doing some averaging or some other way to get rid of noise?
It depends on what you intend to do with the rate signal.
As far as I know, the WPI robotics library still has a glitch in that it cannot calculate the velocity from more than one encoder. So, I want to write manual code to calculate velocity.
Have you cast your vote here (http://www.chiefdelphi.com/forums/showpost.php?p=1059874&postcount=6) yet ?
http://www.chiefdelphi.com/forums/showpost.php?p=1024424&postcount=54 (http://www.chiefdelphi.com/forums/showpost.php?p=1024424&postcount=54\) got me through the 2011 season. It patches the bug in LV by not using the broken channels.
Also - You can change the direction of shift registers by right-clicking and hitting "change direction", to make it go from left->right instead of left<-right (just a neatness tip)
plnyyanks
28-05-2011, 22:38
Also - You can change the direction of shift registers by right-clicking and hitting "change direction", to make it go from left->right instead of left<-right (just a neatness tip)
I think you mean turning the feedback nodes into feedforward nodes (they do the same thing, they just have reversed input/output positions). Shift registers are something different (the nodes on the outside of the while loop that passes data between iterations)
I think you mean turning the feedback nodes into feedforward nodes (they do the same thing, they just have reversed input/output positions).
It's misleading to use the term "feedforward node" to describe this.
It's a Z-1 operator.
Feedforward (http://www.eng.auburn.edu/users/jzw0001/chen4170/Chapter_15.pdf) has a different meaning in control theory.
Thank you, apalrd for showing me that workaround. That'll do. And thanks, the left->right feedback is much neater.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.