Go to Post I'd just give you the URL, but then you wouldn't learn to look for yourself. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2014, 11:30
RedLight RedLight is offline
Registered User
no team
 
Join Date: Feb 2014
Location: Canada
Posts: 1
RedLight is an unknown quantity at this point
Encoder Trouble

We use Java and have Grayhill 63R encoders that do not work. We have checked the wiring and it is fine. The a and b signals are taking up 2 different channels, it has power and ground, and the wires are not broken. The constructor is :
driveLeftEncoder = new Encoder(3, 4, false, EncodingType.k4X);
We also remembered to start and reset it. When printing the values, the encoder always returns 0 for the get() method, .25 for the getDistance() method, 1 for getRaw(),and true or false at random for getDirection(). Unless we stop then start it, the rate is 0, and when we do it is a random value. Also without stopping and starting it, it always returns true for getStopped(). We are utterly confused as to what is wrong and would appreciate any help.
  #2   Spotlight this post!  
Unread 01-02-2014, 11:33
Sparkyshires Sparkyshires is offline
Registered User
AKA: Michael Shires
FRC #0384 (Sparky)
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2006
Location: Virginia
Posts: 226
Sparkyshires is an unknown quantity at this point
Re: Encoder Trouble

An issue that can easily get over looked is do you have your encoder reset inside a while function? And would you also mind posting your code?
__________________
"Measure with a micrometer, mark with chalk, cut with an axe."
  #3   Spotlight this post!  
Unread 01-02-2014, 11:54
sarangmittal's Avatar
sarangmittal sarangmittal is offline
Registered User
FRC #1683 (Techno Titans)
Team Role: Programmer
 
Join Date: Feb 2011
Rookie Year: 2011
Location: Atlanta GA
Posts: 20
sarangmittal is an unknown quantity at this point
Re: Encoder Trouble

Another thing crucial to getting Encoders to work is using the setDistancePerPulse() method.

You experimentally determine this constant by rolling the robot over a pre-determined distance, and recording the number of pulses from the get() method.

Then it's as easy as dividing distance by the number of pulses, and using the setDistancePerPulse() before getting the distance.

Hope this helps.

If this still doesn't work, maybe try posting the code, and we can look it over.
  #4   Spotlight this post!  
Unread 01-02-2014, 18:36
Michael U Michael U is offline
Programmer
FRC #2980
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Oak Harbor WA.
Posts: 15
Michael U is an unknown quantity at this point
Unhappy Encoder Trouble

For the past two weeks our team has tried to get our US Digital encoder working. We cannot read any values from the encoder at all. Our wiring is the same as this:


And our code is attached.

We have tried to test everything that we could think of. Please help us find what is wrong so we can get them working. Thank you very much for your help, we really appreciate it.
Attached Thumbnails
Click image for larger version

Name:	code.png
Views:	57
Size:	49.4 KB
ID:	16056  
  #5   Spotlight this post!  
Unread 01-02-2014, 18:49
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by Michael U View Post
For the past two weeks our team has tried to get our US Digital encoder working. We cannot read any values from the encoder at all. Our wiring is the same as this:


And our code is attached.

We have tried to test everything that we could think of. Please help us find what is wrong so we can get them working. Thank you very much for your help, we really appreciate it.
Are you really connecting the encoders to the DCS PWM outputs rather than the DIO?


  #6   Spotlight this post!  
Unread 01-02-2014, 18:57
geomapguy's Avatar
geomapguy geomapguy is offline
Centenary '18
AKA: Graham Maxwell
FRC #1818
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Alexandria, LA
Posts: 535
geomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud ofgeomapguy has much to be proud of
Re: Encoder Trouble

Quote:
Originally Posted by Ether View Post
Are you really connecting the encoders to the DCS PWM outputs rather than the DIO?


Maybe he meant PWM cable
__________________
The Cowboys - FIRST Robotics Team #1818 2015-
The Bolton Bear Bots - FIRST Robotics Team #3666 2011-204 (30-26-0)
2014 Oklahoma Regional - 20/62 (6-4-0), 5/62 in OPR
2014 Arkansas Regional - 14/39 (8-7-0, Quarterfinalists with 1706 and 1939), 24/39 in OPR
2013 Lone Star Regional Dean's List Finalist!
2013 Lone Star Regional - 22/57 (6-5-0), 17/57 in OPR
2012 Bayou Regional - 16/49 (6-5-0)
2011 Dallas Regional - 10/52 (4-2-5, #6 Alliance Captain, Quarterfinalists with 2948 and 3350)
  #7   Spotlight this post!  
Unread 01-02-2014, 18:58
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by geomapguy View Post
Maybe he meant PWM cable
I hope so. But that needs to be confirmed.


  #8   Spotlight this post!  
Unread 01-02-2014, 19:19
Michael U Michael U is offline
Programmer
FRC #2980
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Oak Harbor WA.
Posts: 15
Michael U is an unknown quantity at this point
Re: Encoder Trouble

Sorry for the confusion, we are connecting them via pwm cable to the "DIGITAL I/O" on the digital sidecar.
  #9   Spotlight this post!  
Unread 01-02-2014, 19:58
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by Michael U View Post
Sorry for the confusion, we are connecting them via pwm cable to the "DIGITAL I/O" on the digital sidecar.
Does your team have access to an oscilloscope, even a cheap one?



  #10   Spotlight this post!  
Unread 01-02-2014, 20:09
Michael U Michael U is offline
Programmer
FRC #2980
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Oak Harbor WA.
Posts: 15
Michael U is an unknown quantity at this point
Re: Encoder Trouble

Yes, we do own an oscilloscope.
  #11   Spotlight this post!  
Unread 01-02-2014, 20:14
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by Michael U View Post
Yes, we do own an oscilloscope.
Look at the output of the encoder(s). See if there's any signal coming out.

You may have to carefully strip the insulation of a small section of the signal wires.


  #12   Spotlight this post!  
Unread 01-02-2014, 20:25
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Encoder Trouble

Quote:
Originally Posted by Ether View Post
]You may have to carefully strip the insulation of a small section of the signal wires.
I was taught by an smart EE to use a scribe to poke through the insulation of the wire, then touch the probe to the scribe. Super easy, and the wire isn't exposed when you're done (you should still warp it in electrical tape afterward)

The same guy taught me to strip wire using small side cutters, another handy trick.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #13   Spotlight this post!  
Unread 01-02-2014, 21:02
Michael U Michael U is offline
Programmer
FRC #2980
Team Role: Programmer
 
Join Date: May 2013
Rookie Year: 2012
Location: Oak Harbor WA.
Posts: 15
Michael U is an unknown quantity at this point
Re: Encoder Trouble

We are getting signals from channel a and channel b. (it looks like a pwm signal)
  #14   Spotlight this post!  
Unread 01-02-2014, 21:31
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by apalrd View Post
I was taught by an smart EE to use a scribe to poke through the insulation of the wire, then touch the probe to the scribe.
Of course. Thank you. I suppose you could use a needle or a pin in a pinch.


  #15   Spotlight this post!  
Unread 01-02-2014, 21:33
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,125
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 Trouble

Quote:
Originally Posted by Michael U View Post
We are getting signals from channel a and channel b. (it looks like a pwm signal)
A and B should be in quadrature. Are they?


Closed Thread


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 02:38.

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