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.

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;
    }

Thanks for the code. :stuck_out_tongue: Im just asking if the FPGA can keep up with the speed that the counts will come in from a 3000 rpm shaft.

*
*

The US Digital KOP encoders are 360 CPR.
They are rated at 10,000 max RPM

At 1X the cRIO will keep up.