Go to Post Teams must bring their own water. Water must consist of a low viscosity and at it's maximum width must not be larger than 12 in. - Bkeeneykid [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 25-01-2017, 15:50
Team5709 Team5709 is offline
Registered User
FRC #5709
 
Join Date: Jan 2015
Location: Michigan
Posts: 24
Team5709 is an unknown quantity at this point
Encoder Help

Hello everyone! I was wondering how I would use encoders to figure out how far our robot would drive in autonomous? A big thanks in advance for those who are willing to help.
Reply With Quote
  #2   Spotlight this post!  
Unread 25-01-2017, 16:31
TylerHarmon's Avatar
TylerHarmon TylerHarmon is offline
Registered User
no team
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Westminster, CO
Posts: 25
TylerHarmon is an unknown quantity at this point
Re: Encoder Help

Quote:
Originally Posted by Team5709 View Post
Hello everyone! I was wondering how I would use encoders to figure out how far our robot would drive in autonomous? A big thanks in advance for those who are willing to help.
You need to provide more information and be more specific. You should ask a question like this: "With a CANTalon SRX, how can I use a Hall Effect Two Channel Encoder (am-2816a) to read a velocity?"

You need to wire an encoder to your motor controller, and then read that encoder, usually from that motor controller.
Reply With Quote
  #3   Spotlight this post!  
Unread 25-01-2017, 17:04
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,014
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Encoder Help

With a general question, you get a general answer.

The encoder delivers a fixed and known number of pulses per revolution. If you have a 200 pulse-per-revolution encoder, for example, each time the shaft to which it is mounted turns one revolution, your RoboRIO will see 200 pulses.

If you then calculate how far your robot goes in one revolution - Pi is your friend here - you can then measure distance by counting pulses. This is known as Odometry.

Many encoders have a second "orthagonal" output, which can be used to determine the direction of rotation.

Also be aware that some encoders do not output pulses, but instead a variable voltage or some other 'thing' - and we're not discussing those kinds of encoders here.

Good luck!
__________________

I am N2IRZ - What's your callsign?
Reply With Quote
  #4   Spotlight this post!  
Unread 25-01-2017, 17:20
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,102
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: Encoder Help

Quote:
Originally Posted by Team5709 View Post
Hello everyone! I was wondering how I would use encoders to figure out how far our robot would drive in autonomous? A big thanks in advance for those who are willing to help.
Answer these questions and you may get more detailed help:


what is the part number of the encoders

how are the encoders wired [roboRio or SRX]

where are the encoders mounted

what is the gear ratio between encoder and wheel

what kind of drivetrain are you using

what is wheel diameter

what model motor controllers are you using

are you using PWM or CAN bus


Reply With Quote
  #5   Spotlight this post!  
Unread 25-01-2017, 17:32
GeeTwo's Avatar
GeeTwo GeeTwo is online now
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,687
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 Help

If you haven't made any of the decisions yet about what encoders to use and need help with THAT, knowing the specifics of your gearbox (make and model type stuff) as well as the other things Ether mentioned that you DO know will help in getting those answers.
__________________

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
  #6   Spotlight this post!  
Unread 25-01-2017, 19:02
TylerHarmon's Avatar
TylerHarmon TylerHarmon is offline
Registered User
no team
 
Join Date: Jan 2016
Rookie Year: 2014
Location: Westminster, CO
Posts: 25
TylerHarmon is an unknown quantity at this point
Re: Encoder Help

Quote:
Originally Posted by Ether View Post
Answer these questions and you may get more detailed help:


what is the part number of the encoders

how are the encoders wired [roboRio or SRX]

where are the encoders mounted

what is the gear ratio between encoder and wheel

what kind of drivetrain are you using

what is wheel diameter

what model motor controllers are you using

are you using PWM or CAN bus


Exactly! This information is important to solving the problem that you have. Jumping headfirst into a problem like "How can I make the robot drive 5 feet with encoders" can be daunting, so you should break it down into simpler pieces first
Reply With Quote
  #7   Spotlight this post!  
Unread 30-01-2017, 09:07
Team5709 Team5709 is offline
Registered User
FRC #5709
 
Join Date: Jan 2015
Location: Michigan
Posts: 24
Team5709 is an unknown quantity at this point
Re: Encoder Help

Encoder: Encoder Kit AMT103-V (fc17-033)

they will be wired into the RoboRio. They are mounted on the out put shaft of the drive gear boxes. one on the left and one on the right. There is no gear ratio because its on the out put shaft and not on the motor it self. We are gonna be using arcade drive. The wheels are the 6 inch wheels (http://www.andymark.com/HiGrip-Wheel...?1=1&CartID=0). The motor controllers we are using are the 2015 Talon KOP controllers and those are using PWM.
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2017, 11:46
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 377
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Encoder Help

Quote:
Originally Posted by Team5709 View Post
Encoder: Encoder Kit AMT103-V (fc17-033)

they will be wired into the RoboRio. They are mounted on the out put shaft of the drive gear boxes. one on the left and one on the right. There is no gear ratio because its on the out put shaft and not on the motor it self. We are gonna be using arcade drive. The wheels are the 6 inch wheels (http://www.andymark.com/HiGrip-Wheel...?1=1&CartID=0). The motor controllers we are using are the 2015 Talon KOP controllers and those are using PWM.
Check out the screensteps reference: http://wpilib.screenstepslive.com/s/...or-other-shaft

And check out how to configure your encoder's pulses per revolution on the datasheet, page 4 http://www.cui.com/product/resource/amt10.pdf
Keep "maximum rpm" in mind when choosing a value. Choose the highest number of ticks that fits your intended rpm for the best accuracy.

Then you can get distance like this
Code:
Encoder enc = // create encoder as per screensteps
int ticksPerRev = // what you set them to
double diameter = 6.0; // inches
double distancePerRev = diameter * Math.PI;
enc.setDistancePerPulse(distancePerRev / ticksPerRev);

// later
double currentDistance = enc.getDistance(); // in inches
Edit: I'm unfamiliar with the 2015 KOP, but if those are Talon SRX controllers, you're a lot better off using CAN than PWM, because you can connect the encoders directly to Talons for high rate PID control.
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org

Last edited by euhlmann : 30-01-2017 at 11:50.
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:15.

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