Go to Post I don't know if the WPILibrary has a FluxCapacitor.vi in it. - DavidGitz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #24   Spotlight this post!  
Unread 30-04-2010, 02:59
vamfun vamfun is offline
Mentor :Contol System Engineer
AKA: Chris
FRC #0599 (Robodox)
Team Role: Engineer
 
Join Date: Jan 2009
Rookie Year: 2003
Location: Van Nuys, California
Posts: 182
vamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of lightvamfun is a glorious beacon of light
Send a message via AIM to vamfun
Re: Unexpected results from Encoder::GetRate()

Quote:
Originally Posted by Alan Anderson View Post
I have no idea what you're trying to say here.
Here is pseudo simulation code that I would write to illustrate the error amplification
Code:
Param: 
T = edge oscillation period
A  = edge oscillation amplitude
dt = T/20,  sample rate small enough to measure oscillation
variables: 
t = time,
x = encoder input
y = encoder output
x_dot = encoder input rate 
y_dot= encoder output rate

Run Simulation:
while(t < runtime){

Encoder input movement:

x = A*sin(2*pi*t/T); Small oscillation movement , A < 1 to be on same edge.

x_dot = A*2*pi/T*cos(2*pi*t/T)

Encoder output change when x is centered on a threshold:

If(x > 0 ) {y = .5 }   //sample
else {y = -.5 }

y_dot = (y-y_last)/dt   //Derive simple rate 
y_last = y;
t= t + dt;
}
Expected Results:
The output amplitude will oscillate between -.5 and .5

The amplitude ratio y/x = .5/A.

peak |y_dot| = 1/dt,

average |y_dot| = 2/dt/(20)= 2/T Average over oscillation period



Then (avg |y_dot|)/(x_dot amplitude) = 1/(A*pi)
(this is slightly less than my .5/A approximation.)
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
[BB] An unexpected change in plans yodameister General Forum 22 01-12-2009 21:26
Inconsistent reading from encoder get rate rwood359 National Instruments LabVIEW and Data Acquisition 5 13-01-2009 19:10
Results from Drexel, thanks from 365. archiver 2001 1 24-06-2002 02:44
Results from GLR? archiver 2001 0 24-06-2002 02:44
results from regionals archiver 2000 0 23-06-2002 22:31


All times are GMT -5. The time now is 14:10.

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