Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Electrical (http://www.chiefdelphi.com/forums/forumdisplay.php?f=53)
-   -   Optical sensor for use with retroflective tape (http://www.chiefdelphi.com/forums/showthread.php?t=111502)

Ether 23-01-2013 09:33

Re: Optical sensor for use with retroflective tape
 
Quote:

Originally Posted by apalrd (Post 1217646)
We had a 4-line disc with very uneven dark/light spacing and not terribly accurate angular spacing, but if we setup the counter to average 12 samples then any phase error between the lines would cancel out and we got a really nice clean signal.

If you had only 4 pulses per rev, why would you need 12 samples to average out the spacing error? Or am I misinterpreting your intended meaning?



fovea1959 29-01-2013 08:45

Re: Optical sensor for use with retroflective tape
 
Lightfoot26: recommendation for a part number?

fovea1959 29-01-2013 09:01

Re: Optical sensor for use with retroflective tape
 
Quote:

In the past on our crab modules, we have used standard LED/photo transistor devices from Digikey. We manufactured a stamped plate that mounted to the side of the wheel.
...and Al, do you recall the part number?

Ether 29-01-2013 09:15

Re: Optical sensor for use with retroflective tape
 
Quote:

Originally Posted by apalrd (Post 1217646)
We had a 4-line disc with very uneven dark/light spacing and not terribly accurate angular spacing, but if we setup the counter to average 12 samples then any phase error between the lines would cancel out and we got a really nice clean signal.

With 4 pulses per rev, you need only 4-sample averaging to completely cancel out the jitter due to the inaccuracy of the pulse spacing.

Increasing it to 12 helps to further cancel out the jitter due to the 6.5us resolution due to the rate at which the FPGA looks for pulses.



sanddrag 29-01-2013 10:06

Re: Optical sensor for use with retroflective tape
 
Can the cRio process fast enough to read something like a standard 250 count encoder at 7200 RPM? I'm just curious.

Ether 29-01-2013 10:43

Re: Optical sensor for use with retroflective tape
 
Quote:

Originally Posted by sanddrag (Post 1223835)
Can the cRio process fast enough to read something like a standard 250 count encoder at 7200 RPM? I'm just curious.

AIUI, the 250 CPR encoder has 500 edge transitions (rising+falling) per channel per rev. At 7200 RPM, that would be 7200/60*500 = 60,000 edges/sec which is acceptable because the FPGA polls each channel for edges at 153KHz.

If you do decide to use a 250 CPR encoder at 7200 RPM to measure shooter wheel speed, you don't need both channels since you'll always be going in the same direction.

You can use the Counter class with only one channel of the encoder.

If you use the GetPeriod() method of the Counter class, you will get up to 1400 RPM peak-to-peak jitter due to the 153KHz FPGA polling rate if you don't use the FPGA's built-in averaging capability.

In C++ or Java WPILib, you can make a small modification to counter.cpp (or counter.java) to tell the FPGA to return the elapsed time between the most recent N+1 rising edges (N<127), and WPILib will divide that by N, effectively averaging. If you set N to 125 for example, you'll be averaging over half a revolution and should get a nice clean signal with jitter approx 11 RPM p-p.




All times are GMT -5. The time now is 06:11.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi