|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Problem with quadrature encoder
I just got his from one of my programmers who is playing with encoders. Can anyone provide some guidance after reading the description below?
Gotta problem... We have used encoders for various things this year. In each of these cases we have used the encoders to measure position. Just the angle of something. The encoders also have a "rate" pin on them. It tells us how fast something is spinning which is what we need for traction control. We have noted that that the encoder, when measuring "rate", measures zero after a short time of working correctly. In other words, we spin the wheel, the rate pin shows a velocity, and then after a short distance, the rate pin no longer measures velocity (it shows zero). Then once we stop the wheel, and start spinning it again, the rate will be measured correctly again for a short distance before falling to zero. We found a usfirst thread on this that is a month or so old. It says that an encoder in quadrature (4x) mode (which is what we have), will do this but if you use the "averaging option" of 1x or 2x it will be fine. We don't see this. It breaks reliably no mater what averaging we use. It also says this will be fixed in the next cRIO update. It's not. Thanks in advance! |
|
#2
|
||||
|
||||
|
Re: Problem with quadrature encoder
Steve,
Your post is confusing as to when you are referencing the physical encoder and when you are referencing the encoder vi, yada, yada... That being said, I assume that you are referencing the LabVIEW software... I would suggest that your programming team load the "encoder example" project and look at how the "minimum rate" control to the "encoder: config timer" vi affects the functionality... Regards, Mike |
|
#3
|
|||
|
|||
|
Re: Problem with quadrature encoder
Thanks, Mike! I. I'll see if I can get your suggestion worked on, as well as trying to get more precise language in case I need to send something back out to you all. Appreciate the help.
|
|
#4
|
|||
|
|||
|
Re: Problem with quadrature encoder
Definitely compare to the example. The bug by the way is only present with 4x encoding with no averaging. 4x works with as little as 2 pts of averaging and 1x and 2x work with or without. Work of course has to include the behavior of the minimum rate parameter, and for that the docs help and the example should drive it home.
Greg McKaskle |
|
#5
|
||||||
|
||||||
|
Re: Problem with quadrature encoder
I think you found this bug: http://forums.usfirst.org/showpost.p...5&postcount=34
|
|
#6
|
|||
|
|||
|
Re: Problem with quadrature encoder
Thanks Mike, Greg and Joe. My programmers think it's something to do with the FPGA counters. We're using 128 bit grayhills, but we've seen the same results when we were using ultrasonics earlier in the season:
quote from progammer "With the Ultrasonics in particular I used several methods. Whenever I used the FPGA counters, things broke. These are the same counters the encoders use and we are getting similar dysfunction." Also, we loaded the out of the box 'encoder example' and this is the result: "so I just loaded up the example out of the box. It broke the same way, no matter what the averaging and minimum sample settings." any thoughts? |
|
#7
|
|||||
|
|||||
|
Re: Problem with quadrature encoder
Does the 4x bug affect C++ code as well, or is this strictly a LabView issue?
|
|
#8
|
|||
|
|||
|
Re: Problem with quadrature encoder
Both. Seems to be the timer, I think, in the FPGA
|
|
#9
|
|||
|
|||
|
Re: Problem with quadrature encoder
Quote:
Greg McKaskle |
|
#10
|
|||
|
|||
|
Re: Problem with quadrature encoder
Thanks, Greg. I did all that research too to discover the same in these threads, so was surprised to have my programmer say it could happen in both. How about the fact that we also got 'zeroing' when playing with ultrasonics? Does that tell you anything? I'm wondering if we aren't getting a battery voltage number as a divisor (like in the analog input issues discussed in a thread for WPI libs.)?
|
|
#11
|
|||
|
|||
|
Re: Problem with quadrature encoder
I'm not going to be much help until Monday as I'm at a regional. The latest head slap with C++ libs and unique to those had to do with synchronization that wasn't enabled. I believe that was what caused the analogs to mix channels and confuse channel data if polled too often. I think it would occasionally cause other symptoms.
Is anyone else able to reproduce the issue, and do you have any insight into a workaround or root cause? Greg McKaskle |
|
#12
|
|||
|
|||
|
Re: Problem with quadrature encoder
Thanks, Greg. Hope you get a chance to breather once in a while at the competition - I know our NI guy at Trenton (I'm embarrassed to say I forget his name) was instrumental in helping tons of teams deconstruct and solve all kinds of challenges.
Do you think the issue that arose with analog could possible also happen similarly with the digital inputs? I'm afraid I know too little about this part of our work to really be able to think as critically as would be useful here! |
|
#13
|
|||||
|
|||||
|
Re: Problem with quadrature encoder
Quote:
However, due to the manner in which the length of the "most recent" pulse is used to determine the rate, the fact that the encoder pulse widths are asymmetric leads to significant rate errors when using 2x and 4x pulse decoding. Accordingly, I personally would suggest using 1x decoding when using the encoders for rate measurement. A few people are working on a software workaround to the pulse asymmetry issue by averaging a greater number of periods, which has achieved some improvement, but not as much as expected. (See http://forums.usfirst.org/showthread.php?t=12218 for further discussion.) |
|
#14
|
|||||
|
|||||
|
Re: Problem with quadrature encoder
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help Programming a Quadrature Encoder | programmr | Programming | 17 | 20-06-2008 10:40 |
| Quadrature shaft encoder source | billbo911 | Kit & Additional Hardware | 7 | 06-01-2008 19:52 |
| Encoder Problem | DustinB_3 | Programming | 22 | 03-01-2007 20:42 |
| Turning a gear-tooth sensor into a quadrature output encoder | Jared Russell | Programming | 4 | 18-01-2006 22:19 |
| Strange Encoder Problem | AIBob | Electrical | 3 | 20-02-2005 22:20 |