|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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.
![]() |
|
#2
|
||||
|
||||
|
Re: Encoder Help
Quote:
You need to wire an encoder to your motor controller, and then read that encoder, usually from that motor controller. |
|
#3
|
|||||
|
|||||
|
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! |
|
#4
|
||||
|
||||
|
Re: Encoder Help
Quote:
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 |
|
#5
|
|||||
|
|||||
|
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.
|
|
#6
|
||||
|
||||
|
Re: Encoder Help
Quote:
![]() |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
||||
|
||||
|
Re: Encoder Help
Quote:
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 Last edited by euhlmann : 30-01-2017 at 11:50. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|