Go to Post I used to wonder if the FRC staff would read the CD game hint posts and just laugh to themselves..now I know they do. - rachelholladay [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2017, 22:35
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 517
tomy has a spectacular aura abouttomy has a spectacular aura about
Encoder Question

My team wants to use an encoder to keep track of their shooter. We are using command based java this year. If we are using a gear tooth counter on a digital input, how would we calculate the DistancePerPulse? We are using a 40 tooth gear. There is no gear reduction. All help appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2017, 00:03
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,770
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Encoder Question

Sorry, but I'm not at all sure what you're trying to ask here. In the first place, why are you using a gear if there's no gear reduction? (I can think of one reason, but it's not likely as the question is phrased.) Or do you mean that you are measuring teeth on the bull gear (that is, the output gear of the shooter)?

You are trying to calculate "distance per pulse". There are no lengths in your question, so whatever you're asking, there is not enough info. What is the effective moment arm/radius of your shooter?

---------------------------------------------------------------------------------------

OK, trying to put together something reasonable: You are counting teeth on the last (output end) gear in your shooter, which is rotating at the same speed as a wheel X inches in diameter. The circumference of that wheel is πX inches. The distance that the edge of the wheel moves per pulse (assuming one pulse per tooth) is πX/40. If there are p pulses per tooth, that becomes πX/40p.

If my assumptions aren't right, please post the corrections so we can help out.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2017, 06:55
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 517
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Encoder Question

Sorry for being vague. Yes we are planning on using a 40 tooth bull gear on the output shaft of the shooter. The wheels of the shooter are 4 inch diameter. We need to calculate the rpm. We haven't used encoders before. We are also wondering what would change if we used a 20 tooth gear vs a 40 tooth gear.
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2017, 07:10
YairZiv's Avatar
YairZiv YairZiv is offline
Registered User
FRC #5951 (Makers Assemble)
Team Role: Programmer
 
Join Date: Oct 2016
Rookie Year: 2016
Location: Tel Aviv, Israel
Posts: 41
YairZiv is an unknown quantity at this point
Re: Encoder Question

Quote:
Originally Posted by tomy View Post
Sorry for being vague. Yes we are planning on using a 40 tooth bull gear on the output shaft of the shooter. The wheels of the shooter are 4 inch diameter. We need to calculate the rpm. We haven't used encoders before. We are also wondering what would change if we used a 20 tooth gear vs a 40 tooth gear.
Well, the simplest way to check your distance per pulse is finding out how many pulses you get in one rotation (using the encoder to print how many pulses you've passed through in the SmartDashboard or something like that). Then use 1 / theNumberYouGot as the distance per pulse.
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2017, 07:27
EmileH's Avatar
EmileH EmileH is offline
#dontbelarge
AKA: Emile Hamwey
FRC #1058 (The PVC Pirates) & SLFF (NE Way You Want It)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2011
Location: New England
Posts: 551
EmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant futureEmileH has a brilliant future
Re: Encoder Question

What type of Motor Controller are you using? If you're wiring your encoder into the Talon SRX, you can call YOUR_TALON_OBJECT.getSpeed() to get the RPM of the sensor.
__________________
2016-present: High School Student, FRC 1058 PVC Pirates

Reply With Quote
  #6   Spotlight this post!  
Unread 30-01-2017, 07:55
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 517
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Encoder Question

Quote:
Originally Posted by YairZiv View Post
Well, the simplest way to check your distance per pulse is finding out how many pulses you get in one rotation (using the encoder to print how many pulses you've passed through in the SmartDashboard or something like that). Then use 1 / theNumberYouGot as the distance per pulse.
Ok that makes sense but how we figure that into rpm? We would have pulses per rotation.

Quote:
Originally Posted by EmileH View Post
What type of Motor Controller are you using? If you're wiring your encoder into the Talon SRX, you can call YOUR_TALON_OBJECT.getSpeed() to get the RPM of the sensor.
We are using a talon srx but we are not using an encoder. We are using a gear tooth sensor.
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2017, 08:10
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,770
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Encoder Question

Quote:
Originally Posted by tomy View Post
Ok that makes sense but how we figure that into rpm? We would have pulses per rotation.
Figure out how many pulses per minute (ppm), and divide by the number of pulses per rotation (ppr) to get rotations per minute (rpm). For example, if you get 160 ppr, and count 40 pulses in 10 ms, then you would have 60 (sec/min) * 100 (10 ms/sec) *40 (pulses/10 ms) =240,000 ppm and 240,000 ppm / 160 ppr = 1500 rpm.

Quote:
Originally Posted by tomy View Post
We are using a talon srx but we are not using an encoder. We are using a gear tooth sensor.
If it's counting gears as they rotate, it's an encoder. Encoders can be magnetic, optical, proximity, mechanical, or any other consistent means of detecting a fractional rotation or motion.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.

Last edited by GeeTwo : 30-01-2017 at 08:12. Reason: removed blank lines
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2017, 08:12
tomy tomy is offline
Registered User
FRC #3038 (I.C.E. Robotics)
Team Role: Mentor
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Stacy, Minnesota
Posts: 517
tomy has a spectacular aura abouttomy has a spectacular aura about
Re: Encoder Question

Quote:
Originally Posted by GeeTwo View Post
Figure out how many pulses per minute (ppm), and divide by the number of pulses per rotation (ppr) to get rotations per minute (rpm). For example, if you get 160 ppr, and count 40 pulses in 10 ms, then you would have 60 (sec/min) * 100 (10 ms/sec) *40 (pulses/10 ms) =240,000 ppm and 240,000 ppm / 160 ppr = 1500 rpm.



If it's counting gears as they rotate, it's an encoder. Encoders can be magnetic, optical, proximity, mechanical, or any other consistent means of detecting a fractional rotation or motion.
Thanks for the info. Would we have to use the talon SRx in cAN mode or in pwm mode if we hook it up that way. Also would we still have to set the distance per pulse.
Reply With Quote
  #9   Spotlight this post!  
Unread 30-01-2017, 08:18
GeeTwo's Avatar
GeeTwo GeeTwo is offline
Technical Director
AKA: Gus Michel II
FRC #3946 (Tiger Robotics)
Team Role: Mentor
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Slidell, LA
Posts: 3,770
GeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond reputeGeeTwo has a reputation beyond repute
Re: Encoder Question

Quote:
Originally Posted by tomy View Post
Thanks for the info. Would we have to use the talon SRx in cAN mode or in pwm mode if we hook it up that way. Also would we still have to set the distance per pulse.
If you connect the encoder to the Talon SRX inputs, you will need to use CAN. If you connect the encoder to roboRIO inputs, you can use either PWM or CAN.

I have not done any coding using the SRX internals, sorry.
__________________

If you can't find time to do it right, how are you going to find time to do it over?
If you don't pass it on, it never happened.
Robots are great, but inspiration is the reason we're here.
Friends don't let friends use master links.
Reply With Quote
  #10   Spotlight this post!  
Unread 30-01-2017, 13:02
ozrien's Avatar
ozrien ozrien is online now
Omar Zrien
AKA: Omar
no team
Team Role: Mentor
 
Join Date: Sep 2006
Rookie Year: 2003
Location: Sterling Heights, MI
Posts: 559
ozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond reputeozrien has a reputation beyond repute
Re: Encoder Question

Gear tooth sensors are supported.

See Section 17.1.4. EncRise (a.k.a. Rising Counter) in the Talon SRX Software Reference Manual for reference to gear-tooth sensor.

See Talon SRX User's Manual for wiring.
Reply With Quote
Reply


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 13:16.

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