Go to Post Rules are after all rules. They don't have to make sense. - ChrisH [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
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 04-02-2017, 16:23
DIyer5465 DIyer5465 is offline
Registered User
FRC #5465
 
Join Date: Feb 2017
Location: Chandler
Posts: 4
DIyer5465 is on a distinguished road
E4T Encoder Help

We are having issues getting values from our am-3132 (E4T) encoder, connected to our ToughBox Mini with Dual CIM input.

We currently have it wired as follows:
Orange Wire --> DIO 5 / 5V
Brown Wire --> DIO 5 / GND
Yellow Wire (Channel B) --> DIO 5 / S
Blue Wire (Channel A) --> DIO 6* / S

*Nothing is wired to GND or 5V

Code (Java):

Encoder enc = new Encoder(5,6); //robotInit()
enc.reset() //robotInit()

enc.getDistance(); //teleopPeriodic()

So far we have tried:
  1. Switching the DIO ports used
  2. Swapping Channel A and B wires
  3. Reading DIO ports using get() --> We found DIO 5 oscillates between true/false when the wheels are turning, DIO 6 stays constant false

Is there something we're overlooking?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2017, 16:30
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Leadership
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 369
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: E4T Encoder Help

Is this in a looping section of your code (like teleop periodic)? If so, you're calling reset every time before you get your distance, so it gets reset to zero every time.

Also, what do you mean nothing is wired to GND and 5v? It's clearly being powered as you can tell it's oscillating.
__________________

F4 Network Website Designer

2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead
Beginning FIRST Volunteer

Moderator on the FIRSTwiki
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2017, 20:43
DIyer5465 DIyer5465 is offline
Registered User
FRC #5465
 
Join Date: Feb 2017
Location: Chandler
Posts: 4
DIyer5465 is on a distinguished road
Re: E4T Encoder Help

Reset is called during robotInit only. Calling getDistance() is the only thing that's done during looping teleop

DIO 5 has 5V, GND, and Signal wired. DIO 6 only has signal wired, see response #6 in https://www.chiefdelphi.com/forums/s...d.php?t=133263

A little more info we discovered: the encoder values oscillate between 0 and 0.25 when the motors are moving and stay constant at 0 when they aren't moving. Does that help clear things up?
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2017, 21:03
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,770
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: E4T Encoder Help

Quote:
Originally Posted by Bkeeneykid View Post
..what do you mean nothing is wired to GND and 5v?
+1 ? WT?
__________________

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
  #5   Spotlight this post!  
Unread 04-02-2017, 21:15
Donut Donut is offline
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,314
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
Re: E4T Encoder Help

Are you setting the other parameters for the encoder? For getDistance() to make sense you need to set number of pulses per revolution (I think 360 for the E4T), I don't know what it defaults to. The screen steps detail this:
http://wpilib.screenstepslive.com/s/...or-other-shaft

Also try checking the outputs of get() or getRaw() from the encoder object (not the DIO object). These should give raw encoder counts rather than a distance.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present
Reply With Quote
  #6   Spotlight this post!  
Unread 05-02-2017, 10:37
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 887
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: E4T Encoder Help

Quote:
Originally Posted by DIyer5465 View Post
Reset is called during robotInit only. Calling getDistance() is the only thing that's done during looping teleop

DIO 5 has 5V, GND, and Signal wired. DIO 6 only has signal wired, see response #6 in https://www.chiefdelphi.com/forums/s...d.php?t=133263

A little more info we discovered: the encoder values oscillate between 0 and 0.25 when the motors are moving and stay constant at 0 when they aren't moving. Does that help clear things up?
Oscillating like that means one of the two signal wires is not connected properly. We had a similar issue and it turned out to be the crimp was on insulation and not on the conductive bit of the wire.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #7   Spotlight this post!  
Unread 05-02-2017, 10:39
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 887
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: E4T Encoder Help

Quote:
Originally Posted by GeeTwo View Post
+1 ? WT?
This is standard for this sort of encoder. They made a cable that goes to two three pin pwm connections, so one cable provides power and ground to the encoder and the second connection is needed only for the second signal wire.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2017, 14:03
Bkeeneykid's Avatar
Bkeeneykid Bkeeneykid is offline
#wheatcoastneatcoast
AKA: Devin Keeney
FRC #1982 (Cougar Robotics); Season Long Fantasy FIRST (F3)
Team Role: Leadership
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Lenexa, Kansas
Posts: 369
Bkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud ofBkeeneykid has much to be proud of
Re: E4T Encoder Help

So from what I can tell, your DIO 6 (channel B) seems to be disconnected. Connect up a multimeter (or a oscilloscope if you're feeling fancy) and see if you can get a signal anywhere on the wire (at the connector to the encoder, solder joint to the board). From there you can figure out which portion you need to replace.
__________________

F4 Network Website Designer

2010-2012: A Whole Buncha FLL Teams; Team Spirit, Gracious Professionalism Award winner
2015-Current: FRC 1982, Captain, Electrical Lead
Beginning FIRST Volunteer

Moderator on the FIRSTwiki
Reply With Quote
  #9   Spotlight this post!  
Unread 07-02-2017, 22:21
DIyer5465 DIyer5465 is offline
Registered User
FRC #5465
 
Join Date: Feb 2017
Location: Chandler
Posts: 4
DIyer5465 is on a distinguished road
Re: E4T Encoder Help

Thanks for the suggestions everyone. Unfortunately, nothing we tried solved the problem. The encoder still inconsistently oscillates between 0-n*0.25 where n is the number of ticks/rev set in the code.

Here's what we tried:
  1. Resoldering the connections to eliminate any possibility of faulty wiring
  2. Setting the ticks/revolution in the code among other parameters specified in WPI Screensteps
  3. Switching the wiring to see if the oscillation jumped pins (it did)
  4. Reading the raw output of the encoder

Sadly, nothing we tried got us usable values from the encoder. I guess this means our encoder itself is busted. My advice for anyone reading this thread in the future is to be extra careful when assembling the optical encoders and avoid touching the sensor as much as possible. Thanks again for the help!
Reply With Quote
  #10   Spotlight this post!  
Unread 07-02-2017, 22:49
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 887
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: E4T Encoder Help

Quote:
Originally Posted by DIyer5465 View Post
Thanks for the suggestions everyone. Unfortunately, nothing we tried solved the problem. The encoder still inconsistently oscillates between 0-n*0.25 where n is the number of ticks/rev set in the code.

Here's what we tried:
  1. Resoldering the connections to eliminate any possibility of faulty wiring
  2. Setting the ticks/revolution in the code among other parameters specified in WPI Screensteps
  3. Switching the wiring to see if the oscillation jumped pins (it did)
  4. Reading the raw output of the encoder

Sadly, nothing we tried got us usable values from the encoder. I guess this means our encoder itself is busted. My advice for anyone reading this thread in the future is to be extra careful when assembling the optical encoders and avoid touching the sensor as much as possible. Thanks again for the help!
did you use all the little spacer tools when installing the encoder to the shaft? alignment is very important. it's also easy to damage the little glass disk. Also verify the cover of the encoder is fully snapped down, one of my students failed to fully snap it down once, and the difference is subtle (you should hear two clicks when installing).

if you take the cover off (carefully) and post a picture (in focus), we can look to see if it looks an installation error.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
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 19:57.

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