Go to Post Whoooo, just got my wheels from AM! Sometimes it's cool to live in Indiana. - IndySam [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-01-2012, 16:40
Ty Tremblay's Avatar
Ty Tremblay Ty Tremblay is offline
Robotics Engineer
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Alton NH
Posts: 841
Ty Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond repute
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.
__________________

Last edited by Ty Tremblay : 14-01-2012 at 16:41. Reason: Clarification
  #2   Spotlight this post!  
Unread 14-01-2012, 17:10
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
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;
    }
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #3   Spotlight this post!  
Unread 14-01-2012, 17:25
Ty Tremblay's Avatar
Ty Tremblay Ty Tremblay is offline
Robotics Engineer
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2004
Location: Alton NH
Posts: 841
Ty Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond reputeTy Tremblay has a reputation beyond repute
Re: Sensing RPM with the kit encoder.

Thanks for the code. Im just asking if the FPGA can keep up with the speed that the counts will come in from a 3000 rpm shaft.
__________________
  #4   Spotlight this post!  
Unread 14-01-2012, 17:58
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,100
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Sensing RPM with the kit encoder.

Quote:
Originally Posted by Ty Tremblay View Post
Thanks for the code. 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

  #5   Spotlight this post!  
Unread 14-01-2012, 18:10
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,835
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:10.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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