Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Sensing RPM with the kit encoder. (http://www.chiefdelphi.com/forums/showthread.php?t=100198)

Ty Tremblay 14-01-2012 16:40

Sensing RPM with the kit encoder.
 
Can the CRio keep up with the counts from the kit encoder if it's on a shaft rotating at 2500-3000 rpm? I'd like to run a velocity PID on our shooter. IIRC, the kit encoder doesn't have an indicator pulse, meaning you'd have to count all of the pulses. However, I don't know how many PPR the kit encoder has.

davidthefat 14-01-2012 17:10

Re: Sensing RPM with the kit encoder.
 
Code:

private double[] getRPM()
    {
        double rpm[] = new double[2];                                              //Declares an array of integers which the function will return.
        currentTime = time.get();                                                  //Sets currentTime to the time calculatged from FPGA
        rpm[0] = leftEncoder.getRaw() * 16666666.666666 / currentTime;              //dAngle*(60000000us/360deg)/dTime = RPM
        rpm[1] = rightEncoder.getRaw() * 16666666.666666 / currentTime;            //dAngle*(60000000us/360deg)/dTime = RPM
        leftEncoder.reset();                                                        //Resets the left wheel encoder.
        rightEncoder.reset();                                                      //Resets the right wheel encoder.
        time.reset();                                                              //This resets the timer.
        return rpm;
    }


Ty Tremblay 14-01-2012 17:25

Re: Sensing RPM with the kit encoder.
 
Thanks for the code. :p Im just asking if the FPGA can keep up with the speed that the counts will come in from a 3000 rpm shaft.

Ether 14-01-2012 17:58

Re: Sensing RPM with the kit encoder.
 
Quote:

Originally Posted by Ty Tremblay (Post 1105497)
Thanks for the code. :p Im just asking if the FPGA can keep up with the speed that the counts will come in from a 3000 rpm shaft.

https://decibel.ni.com/content/message/12523#12523


Mark McLeod 14-01-2012 18:10

Re: Sensing RPM with the kit encoder.
 
The US Digital KOP encoders are 360 CPR.
They are rated at 10,000 max RPM

At 1X the cRIO will keep up.


All times are GMT -5. The time now is 15:24.

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