Go to Post It's better to be safe than sorry. - Dan Petrovic [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, 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: 107
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
  #2   Spotlight this post!  
Unread 18-02-2015, 16:13
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,574
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

Quote:
Originally Posted by nickmcski View Post
We wired the cables like so:


(This image is not mine, I just found it online)
The encoders should be connected to DIOs, not PWM ports!
__________________

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 18-02-2015, 16:24
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 GeeTwo View Post
The encoders should be connected to DIOs, not PWM ports!
Yes, I agree, that diagram can be misleading out of context. The "PWM" in the diagram refers to the use of PWM cable/connectors.

In context (i.e. on the web page where the diagram came from) it explicitly says to connect the cable to DIO ports.


Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2015, 17:41
Fauge7 Fauge7 is offline
Head programmer
FRC #3019 (firebird robotics)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Scottsdale
Posts: 195
Fauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to allFauge7 is a name known to all
Re: Encoder

is there any reason why i wouldnt get an accurate reading from the encoders?
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2015, 17:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 Fauge7 View Post
is there any reason why i wouldnt get an accurate reading from the encoders?
To avoid having two separate conversations about two unrelated questions in the same thread, it would be best if you started a new thread if your question is not related to the OP's question; and provide more detail about the problem you are experiencing.


Reply With Quote
  #6   Spotlight this post!  
Unread 19-02-2015, 15:28
NathanCJohnson's Avatar
NathanCJohnson NathanCJohnson is offline
Registered User
FRC #5517 (District 5517 The Engineers on Fire)
Team Role: Driver
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Burton, MI (USA)
Posts: 15
NathanCJohnson is an unknown quantity at this point
Re: Encoder

Quote:
Originally Posted by nickmcski View Post
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
	}
Does that encoder work with the 2015 KOP chassis gearboxes? The video tutorial on the item page shows a different gearbox, so I just want to make sure it works with the KOP one.

We should have added encoders a while ago before bag & tag, but since we didn't we will be adding them during the 6-hour robot access period the week of our first district event. Currently our autonomous modes are based on a timer which isn't very accurate or predictable.
Reply With Quote
  #7   Spotlight this post!  
Unread 19-02-2015, 15:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 NathanCJohnson View Post
Currently our autonomous modes are based on a timer which isn't very accurate or predictable.
What kind of drivetrain do you have?


Reply With Quote
  #8   Spotlight this post!  
Unread 19-02-2015, 21:55
NathanCJohnson's Avatar
NathanCJohnson NathanCJohnson is offline
Registered User
FRC #5517 (District 5517 The Engineers on Fire)
Team Role: Driver
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Burton, MI (USA)
Posts: 15
NathanCJohnson is an unknown quantity at this point
Re: Encoder

Quote:
Originally Posted by Ether
What kind of drivetrain do you have?
We're using the one that came in the Kit of Parts (http://www.andymark.com/AM14U2-p/am-14u2.htm). But we're using 6" traction wheels in the front and 6" omniwheels in the back (the middle wheels are the 4" wheels that came with the KOP drivetrain).
Reply With Quote
  #9   Spotlight this post!  
Unread 19-02-2015, 22:10
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 NathanCJohnson View Post
we're using 6" traction wheels in the front and 6" omniwheels in the back (the middle wheels are the 4" wheels that came with the KOP drivetrain).
Are you powering all 6 wheels? How?


Reply With Quote
  #10   Spotlight this post!  
Unread 19-02-2015, 23:53
NathanCJohnson's Avatar
NathanCJohnson NathanCJohnson is offline
Registered User
FRC #5517 (District 5517 The Engineers on Fire)
Team Role: Driver
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Burton, MI (USA)
Posts: 15
NathanCJohnson is an unknown quantity at this point
Re: Encoder

Quote:
Originally Posted by Ether View Post
Are you powering all 6 wheels? How?


Two CIM motors power the gearbox which moves the middle wheel. The front and rear wheels are powered by the middle wheel with belts. We use tank drive to actually drive and steer it.
Reply With Quote
  #11   Spotlight this post!  
Unread 19-02-2015, 23:56
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 NathanCJohnson View Post
Two CIM motors power the gearbox which moves the middle wheel. The front and rear wheels are powered by the middle wheel with belts.
You said the middle wheels are 4" and the front/back are 6". Have you geared them in the proper 6:4 ratio so they are going the same tangential speed?


Reply With Quote
  #12   Spotlight this post!  
Unread 22-02-2015, 01:32
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,574
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

Quote:
Originally Posted by NathanCJohnson View Post
We're using the one that came in the Kit of Parts (http://www.andymark.com/AM14U2-p/am-14u2.htm). But we're using 6" traction wheels in the front and 6" omniwheels in the back (the middle wheels are the 4" wheels that came with the KOP drivetrain).
Quote:
Originally Posted by Ether View Post
You said the middle wheels are 4" and the front/back are 6". Have you geared them in the proper 6:4 ratio so they are going the same tangential speed?
Unless the chassis has been modified (drilled more holes) it isn't necessary. The center axle on the AM14U2 is only dropped 1/8". Since the corner wheels are 2" larger diameter, the 4" center wheels float 7/8" off the carpet. In effect, the 4" wheels are just a spacer for the belt sheaves.

We did something similar with our H-drive, though since we used 4" wheels on the corners, we cut the rubber off the center wheels so they would float.
__________________

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 : 22-02-2015 at 01:35.
Reply With Quote
  #13   Spotlight this post!  
Unread 22-02-2015, 08:52
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,043
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 GeeTwo View Post
the 4" center wheels float 7/8" off the carpet.
Except when going over the platform.


Reply With Quote
  #14   Spotlight this post!  
Unread 22-02-2015, 09:44
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,574
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

Quote:
Originally Posted by Ether View Post
Except when going over the platform.
Yes, that would be a literal speed bump.
__________________

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
  #15   Spotlight this post!  
Unread 19-02-2015, 16:12
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: 107
nickmcski has a spectacular aura aboutnickmcski has a spectacular aura aboutnickmcski has a spectacular aura about
Re: Encoder

Quote:
Originally Posted by NathanCJohnson View Post
Does that encoder work with the 2015 KOP chassis gearboxes? The video tutorial on the item page shows a different gearbox, so I just want to make sure it works with the KOP one.

We should have added encoders a while ago before bag & tag, but since we didn't we will be adding them during the 6-hour robot access period the week of our first district event. Currently our autonomous modes are based on a timer which isn't very accurate or predictable.
Our team didn't get the KOP drive train but on andymarks website they say that the KOP gearbox is compatible with the type of encoders I linked.

Here is the information about the gear box if you want to look at its specification for the encoders http://www.andymark.com/product-p/am-2598.htm
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 11:13.

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