Go to Post Those teams with too much pride will hinder their alliance. Know your strengths and weaknesses and be honest about them. - Andy Brockway [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 18-02-2015, 10:39
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Encoder

I am needing to know what encoders do we need to buy to put them on the drive train and how would be connect them and program them be have never used them before.
Reply With Quote
  #2   Spotlight this post!  
Unread 18-02-2015, 11:34
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
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

Quote:
Originally Posted by nfusselman1 View Post
I am needing to know what encoders do we need to buy to put them on the drive train and how would be connect them and program them be have never used them before.
Describe your drivetrain in detail (e.g. mecanum or H drive or skidsteer, what gearboxes, etc etc) and what you want the encoders to do for you.


Reply With Quote
  #3   Spotlight this post!  
Unread 18-02-2015, 12:20
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Encoder

As @Ether said, more details would be appreciated. I programmed the encoders for my team this year but my experience is limited.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2015, 12:26
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

we have the gearbox drive train with the AM14U2 Drive System. (We only use one motor on each side if that helps)
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2015, 12:28
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Encoder

What do you use for speed control (talons, victors, jaguars) and what kind of wheels do you have?
Reply With Quote
  #6   Spotlight this post!  
Unread 18-02-2015, 12:32
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

Talons
Reply With Quote
  #7   Spotlight this post!  
Unread 18-02-2015, 12:33
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

and the regular kit weals (tile)
Reply With Quote
  #8   Spotlight this post!  
Unread 18-02-2015, 12:34
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Encoder

My team uses jaguars, but the code might be similar. What language do you program in?
Reply With Quote
  #9   Spotlight this post!  
Unread 18-02-2015, 12:35
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

java
Reply With Quote
  #10   Spotlight this post!  
Unread 18-02-2015, 12:45
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Encoder

What our electrical team did was they wired optical encoders onto the axel and into the jag. Inside of the DriveTrain subsystem, I called a method on each of the jags to inform them that they have encoders. That portion of code looked like this:
Quote:
rightFront.setPercentMode(CANJaguar.kQuadEncoder, encoderCounts);
Below that, I enabled encoder control on each of the jags:
Quote:
rightFront.enableControl();
I was then able to use the encoders in other programs.

I wouldn't know without looking at the javadocs, but if I were to make an educated guess I would say that setting up encoders would be similar to this but with talons instead of jaguars.
Reply With Quote
  #11   Spotlight this post!  
Unread 18-02-2015, 12:47
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

ok what kind of encoders did you get and how did you attach them.
Reply With Quote
  #12   Spotlight this post!  
Unread 18-02-2015, 12:51
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 112
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: Encoder

What do you plan to use the encoders for? Making sure both wheels turn at the same speed or are you using it for finding out how far you have driven?
Reply With Quote
  #13   Spotlight this post!  
Unread 18-02-2015, 12:56
legts legts is offline
Autonomous Queen
FRC #2399 (The Fighting Unicorns)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2012
Location: Ohio
Posts: 73
legts is an unknown quantity at this point
Re: Encoder

We used optical encoders, I'd have to ask the electrical folks for more details. I'm working on incorporating them into autonomous mode.
Reply With Quote
  #14   Spotlight this post!  
Unread 18-02-2015, 12:56
nfusselman1 nfusselman1 is offline
Registered User
FRC #4076
 
Join Date: Jan 2015
Location: Justin TX
Posts: 26
nfusselman1 is an unknown quantity at this point
Re: Encoder

both but mainly distance.
Reply With Quote
  #15   Spotlight this post!  
Unread 18-02-2015, 13:53
nickmcski nickmcski is offline
Registered User
AKA: Nicholas McCurry
FRC #1482 (Grandin Ghosts)
Team Role: Alumni
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Canada
Posts: 112
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: Encoder

These are the encoders our team purchased http://www.andymark.com/product-p/am-0180.htm and they are working extremely well for us. One thing we want to try is wiring them directly up to our talons (You can only do this if you have the talon SRX's).

If you cant wire them up to the talons then wire them up to the roboRIO, our team accomplished this by cutting up 2 unneeded PWM cables. We wired the cables like so:


(This image is not mine, I just found it online)

Then we programmed them link this
Code:
	Encoder encoderleft; //Declare the encoders so they are accessible in all methods 
	Encoder encoderright;

	public void robotInit() {
		encoderleft = new Encoder(0, 1); //Initalize the encoder, A channel is plugged into DIO 0, B channel DIO 1.
		encoderright = new Encoder(2, 3);

		encoderleft.setDistancePerPulse(0.11); //did some math to calculate that for 1 pulse the robot moved 0.11 of an inch (Will be different for other robots) 
		encoderright.setDistancePerPulse(0.11);
	}

	public void autonomousPeriodic() {
		double distance = (encoderleft.getDistance() + encoderright.getDistance()) /2; //Find the distance robot has travled based off of the average of the 2 encoders. 
		


		//Code to make your robot move off of the encoder values here
	}
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:01.

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