Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Obtaining Velocity from an encoder (http://www.chiefdelphi.com/forums/showthread.php?t=95392)

Jogo 28-05-2011 09:19

Obtaining Velocity from an encoder
 
1 Attachment(s)
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.

Ether 28-05-2011 09:28

Re: Obtaining Velocity from an encoder
 
Quote:

Originally Posted by Jogo (Post 1063958)
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.


Quote:

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 yet ?




apalrd 28-05-2011 09:40

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)

plnyyanks 28-05-2011 22:38

Re: Obtaining Velocity from an encoder
 
Quote:

Originally Posted by apalrd (Post 1063960)
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)

Ether 29-05-2011 00:02

Re: Obtaining Velocity from an encoder
 
1 Attachment(s)
Quote:

Originally Posted by plnyyanks (Post 1064028)
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 has a different meaning in control theory.



Jogo 29-05-2011 15:19

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.


All times are GMT -5. The time now is 23:28.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi