Page 1 of 4 1234 LastLast
Results 1 to 10 of 34

Thread: Grayhill encoder gives different speed

  1. #1
    Rwood359 Guest

    Default Grayhill encoder gives different speed

    We installed an idler wheel with a Grayhill R61128 encoder. We also have the USDigital encoders on super shifters.
    Running straight with little of no slippage on the drive wheels, we get the same distance values from encoder get for all encoders. However, in 4x mode the Grayhill reads about double the USDigital speed. If I change to 2X, the speed error doubles. If I change to 1X mode the speed error about doubles again.
    The USDigital are on DIO 1-4. The Grayhill is on DIO 5&6.
    If one of the signals were missing, would it cause this kind of problem?
    Does anyone have any suggestions as to what is causing this problem?

  2. #2
    Join Date
    Sep 2008
    Location
    National Instruments: Austin, TX
    Posts
    445

    Default Re: Grayhill encoder gives different speed

    What language are you using (I'm guessing LabVIEW since you can use 1x and 2x)? Is there a difference in the number of counts per rotation or counts per linear distance on the floor? Are you using a different scaling factor? Are you enabling averaging on any of the encoders? What is the maximum pulse rate (pulses per second) coming from each of the encoders (is it close to the limits of the I/O)?

    If one of the signals was missing, the distance would not work at all.

  3. #3
    Rwood359 Guest

    Default Re: Grayhill encoder gives different speed

    Quote Originally Posted by Joe Hershberger View Post
    What language are you using (I'm guessing LabVIEW since you can use 1x and 2x)? Is there a difference in the number of counts per rotation or counts per linear distance on the floor? Are you using a different scaling factor? Are you enabling averaging on any of the encoders? What is the maximum pulse rate (pulses per second) coming from each of the encoders (is it close to the limits of the I/O)?

    If one of the signals was missing, the distance would not work at all.
    Yes, I'm using LV.
    The USDigital has 250 counts/Rev, the Grayhill has 128.
    The distance scaling factor for the USDigital is (6.08*PI)/250, for the Grayhill it is (6.08*PI)/128. I believe that I have averaging set to 4 for both.
    The USDigital is rated at 0-30000 cycles per second. The Grayhill is rated at 300 RPM which would reduce to 5 RPS or 640 cycles per second.
    The Grayhill is rated lower, but I am seeing the difference at low speeds that don't come near the limit. If we were exceeding the limit, wouldn't the distance be different?
    That's what's confusing, the distance for both is within a couple of inches out of 150-160 inches.

  4. #4
    Rwood359 Guest

    Default Re: Grayhill encoder gives different speed

    Some new information.
    We are alternating between the correct speed and double speed. It appears to have the correct speed for one revolution of the idler wheel then double the correct speed for one revolution.
    I looked at the signals from the both types of encoder on a scope and they are clean.
    I tried reading the DI using DIO get to generate a waveform for the DI.
    It seems like I am undersampling so the waveform is not correct.
    If anyone has a sample of how to display the waveform from a DI, please post it.
    Thanks

  5. #5
    Join Date
    Sep 2008
    Location
    National Instruments: Austin, TX
    Posts
    445

    Default Re: Grayhill encoder gives different speed

    Quote Originally Posted by Rwood359 View Post
    Some new information.
    We are alternating between the correct speed and double speed. It appears to have the correct speed for one revolution of the idler wheel then double the correct speed for one revolution.
    I looked at the signals from the both types of encoder on a scope and they are clean.
    I tried reading the DI using DIO get to generate a waveform for the DI.
    It seems like I am undersampling so the waveform is not correct.
    If anyone has a sample of how to display the waveform from a DI, please post it.
    Thanks
    Have you tried playing around with the averaging? Does it have any effect on the behavior you are seeing? To you get the same alternating behavior in all 3 decoding modes? When you say one revolution, do you actually mean there is a sharp change in the reported rate after every 128 counts of the counter?

    If you want to get a digital waveform and your signal is pretty fast, then you probably need to use DMA (not available in the library yet)... if it is pretty slow, you could plot it using interrupts and the timestamps they record.

  6. #6
    Rwood359 Guest

    Default Re: Grayhill encoder gives different speed

    Quote Originally Posted by Joe Hershberger View Post
    Have you tried playing around with the averaging? Does it have any effect on the behavior you are seeing? To you get the same alternating behavior in all 3 decoding modes? When you say one revolution, do you actually mean there is a sharp change in the reported rate after every 128 counts of the counter?

    If you want to get a digital waveform and your signal is pretty fast, then you probably need to use DMA (not available in the library yet)... if it is pretty slow, you could plot it using interrupts and the timestamps they record.
    I haven't played with averaging, I'll try it - but I don't expect it to change anything. We put the robot on a table and looked at the Grayhill output signals on a analog scope. They looked pretty clean although the motors weren't running. I'll try it tomorrow with the motors running to see if that induces any noise.
    We are running at a speed that gives a little less than 1 RPS steady state no wheel slip. We put a piece of tape on the idler wheel that has the Grayhill encoder. The USDigital encoders give a steady 4.xx inches per second. They Grayhill alternates between 4.xx and 9-10 IPS every revolution of the idler wheel, based on visual observation of the tape (one rev low value next rev high value). At the end of the run, both encoders say that we have traveled the same distance (160-170 inches) within 2-5 inches.
    I'm going to disable the code for the USDigital encoders so that only the Grayhill is running to see if there is some kind of interaction.
    At that speed, we are running at about 4 ms per count. Could we sample at that rate on the cRIO?
    Alternately, I have a NI USB 6009 that NI supplied sometime ago. Can I use it running on a PC to sample the DI and use a DO to indicate when the speed changed to see if there is any change in the input signals? Is there a VI that I could use for that purpose?

  7. #7
    Join Date
    Sep 2008
    Posts
    586

    Default Re: Grayhill encoder gives different speed

    You don't happen to have the index pulse hooked up anywhere, do you?
    Team 330 beta tester

  8. #8
    Rwood359 Guest

    Default Re: Grayhill encoder gives different speed

    Quote Originally Posted by jross View Post
    You don't happen to have the index pulse hooked up anywhere, do you?
    I made a mistake about the part number. It is the 4 pin 61K128, not the 5 pin 61R128.

  9. #9
    Rwood359 Guest

    Default Re: Grayhill encoder gives different speed

    I don't know if it is meaningful or not, but I put a probe on the encoder devref and I saw instances of both EncoderIndex and CounterIndex being shown as Invalid. I went back and ran the Encoder example VI and it shows CounterIndex Invalid.
    Also, if I change between 1X, 2X, and 4X modes, the distance traveled is consistent, but the rate changes between modes. I thought that the FPGA was compensating for the mode.

  10. #10
    Join Date
    Sep 2008
    Location
    National Instruments: Austin, TX
    Posts
    445

    Default Re: Grayhill encoder gives different speed

    Quote Originally Posted by Rwood359 View Post
    I'm going to disable the code for the USDigital encoders so that only the Grayhill is running to see if there is some kind of interaction.
    At that speed, we are running at about 4 ms per count. Could we sample at that rate on the cRIO?
    Alternately, I have a NI USB 6009 that NI supplied sometime ago. Can I use it running on a PC to sample the DI and use a DO to indicate when the speed changed to see if there is any change in the input signals? Is there a VI that I could use for that purpose?
    Disabling the other one sounds like a good idea. At 4ms per count I would expect that you could connect the digital inputs to interrupts and timestamp the edges.

    The 6009 could measure the signals fast enough if you use the analog inputs instead of the digital inputs. On that device, the analog inputs are far faster than the digital inputs.

Page 1 of 4 1234 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •