|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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. |
|
#2
|
||||
|
||||
|
Re: Obtaining Velocity from an encoder
Quote:
Quote:
|
|
#3
|
|||||
|
|||||
|
Re: Obtaining Velocity from an encoder
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) |
|
#4
|
|||||
|
|||||
|
Re: Obtaining Velocity from an encoder
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)
|
|
#5
|
||||
|
||||
|
Re: Obtaining Velocity from an encoder
Quote:
It's a Z-1 operator. Feedforward has a different meaning in control theory. Last edited by Ether : 29-05-2011 at 00:49. |
|
#6
|
|||
|
|||
|
Re: Obtaining Velocity from an encoder
Thank you, apalrd for showing me that workaround. That'll do. And thanks, the left->right feedback is much neater.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|