Go to Post ...the hardest part of engineering is communication. - EricVanWyk [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
  #27   Spotlight this post!  
Unread 28-04-2010, 04:09
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
When the interrupt occurs is not related to when the program wants to know what the decoded position value is. Even though there might be perfect certainty at that instant, at the time the value is actually used the certainty is not guaranteed.
I agree, the error can be any value [0 to 1] when the program wants the data, and this is exactly why I qualify my statements to the interrupt time.

I think we all understand the problems associated with quantization and my characterization of the error is perhaps clouding the discussion a bit too much.

So here is a thumbnail of the problem:
The two algorithms simply take the high road or the low road to rectify the count on a return trip. Taking the low road (joe) rectifies the count immediately on start of return, where the high road(chris) delays rectification until the return trip is completed. Joe's leads, mine lags. Joe's conveys directional sense by creating a high but erroneous initial rate, mine does not. Joe's lead hurts if the return never occurs because of a reversal. Mine gets in trouble if the return occurs quickly since I delay the rectification count ,however, if there is a reversal, mine then creates a smoother transition since I never changed direction.
Mine creates delay which makes control more difficult. It creates a control dead zone of +_ 1 count.

The problems occur in both algorithms because we are trying to describe position and speed states with one variable. At the initial reversal, joe's is good at showing direction at the expense of accurate position. Mine is good at position, but lousy at direction.
The quadrature encoder gives us access to the B channel which allows us to know both position and direction on a same edge reversal. I'm thinking about creating a GetState() which outputs the position ,direction and speed states at the edge event. I suspect this would be close to using joes GetDistance(), GetRate() output pair , but slightly different algorithms.
I'll post more when I've done a little more thinking.








Quote:
Are you basing your preference for the "hysterical" scheme on naive rate calculations? You can put that concern aside, as the FPGA does not produce the rate spikes you were worried about.
Hmmm, I thought Joe's actual algorithm showed that differentiated GetDistance() outputs would be a problem with an oscillating edge and that the GetRate() would not. The naive rate calculations are used in the WPI PID routines so teams would have to be careful to source the rate from the GetRate() rather than the error function fed to the PID routine.

How did you guys use Kevin's type encoder algorithm that solved the oscillating edge problem? Was the encoder information used in a closed loop controller? Doesn't that algorithm use a "hysterical" scheme?
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