Go to Post My calculations indicate that the game will involve pouring large areas of concrete and waiting for it to dry. Field reset should be interesting. - DampRobot [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 28-05-2011, 09:19
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
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.
Attached Thumbnails
Click image for larger version

Name:	encoderVelocityLABView.png
Views:	97
Size:	38.5 KB
ID:	10730  
  #2   Spotlight this post!  
Unread 28-05-2011, 09:28
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Obtaining Velocity from an encoder

Quote:
Originally Posted by Jogo View Post
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 ?



  #3   Spotlight this post!  
Unread 28-05-2011, 09:40
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
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)
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #4   Spotlight this post!  
Unread 28-05-2011, 22:38
plnyyanks's Avatar
plnyyanks plnyyanks is offline
Data wins arguments.
AKA: Phil Lopreiato
FRC #1124 (The ÜberBots), FRC #2900 (The Mighty Penguins)
Team Role: College Student
 
Join Date: Apr 2010
Rookie Year: 2010
Location: NYC/Washington, DC
Posts: 1,114
plnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond reputeplnyyanks has a reputation beyond repute
Re: Obtaining Velocity from an encoder

Quote:
Originally Posted by apalrd View Post
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)
__________________
Phil Lopreiato - "It's a hardware problem"
Team 1124 (2010 - 2013), Team 1418 (2014), Team 2900 (2016)
FRC Notebook The Blue Alliance for Android
  #5   Spotlight this post!  
Unread 29-05-2011, 00:02
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,101
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Obtaining Velocity from an encoder

Quote:
Originally Posted by plnyyanks View Post
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.


Attached Thumbnails
Click image for larger version

Name:	Z-1.png
Views:	32
Size:	3.4 KB
ID:	10732  

Last edited by Ether : 29-05-2011 at 00:49.
  #6   Spotlight this post!  
Unread 29-05-2011, 15:19
Jogo Jogo is offline
Registered User
FRC #0353 (Pobots)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2007
Location: NY
Posts: 83
Jogo is on a distinguished road
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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:51.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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