|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools |
Rating:
|
Display Modes |
|
#25
|
|||
|
|||
|
Re: Unexpected results from Encoder::GetRate()
Quote:
Congrats 67/177/294 In the same mapping style, it translates to: A(falling) B(high)...................set Backward state A(falling) B(low) ...................set Forward state A(rising) B(low) Backward........decrement A(rising) B(high) Forward.........increment This works well to prevent edge oscillation error counts since it requires a B transition to count also. Kevin used the single interrupt scheme on the first two encoder channels and this two interrupt scheme on the three and four channels. He had the foresight to know that sometimes you need fewer interrupts with high velocity encoders and more interrupts with high precision distance encoders. Note to Joe H: For your 1x, I don't like your algorithm because the count oscillates when stuck with an oscillating A edge over a BHigh or Blow state. I believe this can really aggravate the GetRate() noise. Code:
Count = (ARising | AFalling) & ((BHigh & UpRisingEdge) | (BLow & UpFallingEdge)) CountUp = Count & !(BHigh ^ DownRisingEdge ^ ARising) CountDown = Count & (BHigh ^ DownRisingEdge ^ ARising) CountUp = BHigh&ARising CountDown = Bhigh&!Arising --> Bhigh&Afalling if counting. You count up or down on the A edge transition if Bhigh so you oscillate between +1 and -1 increments. My 1x non-oscillating scheme and Kevin's will not do this. Mine will allow a single proper count in the normal direction and no change on the oscillatory reversal. Kevin's will not allow any count until B changes sign. Last edited by vamfun : 17-04-2010 at 20:44. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |