Go to Post Calling the refs "zebras" is just fine. Just don't call 'em late for dinner (or visually impaired). - EricH [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
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 10-11-2016, 15:25
Ubspy Ubspy is offline
Registered User
FRC #2335
 
Join Date: Nov 2016
Location: Kansas City
Posts: 3
Ubspy is an unknown quantity at this point
Reading encoder values?

I'm having trouble reading values from the coders. When it goes forward I get increasing values for the .get() function (for the encoder). But when I reverse the motor everything the values stay the same, and when I go forward again they continue rising, and they all stay at 0 (I'm printing the get(), getRaw(), getDistance(), and getRate() values).

I don't know if it's wiring or coding, but my code only calls reset on the initialization of the subsystem (we're using java command based programming), so I don't know why it would be resetting.

For the wiring, I only have power going from one digital input, but I'm using 2 DIO ports for the signals.

Any ideas on how to reduce the get() when going in reverse?
Reply With Quote
  #2   Spotlight this post!  
Unread 10-11-2016, 16:26
Logan Byers Logan Byers is offline
Roaming Mentor & Referee
no team (Team Indiana)
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Indianapolis, IN
Posts: 339
Logan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud ofLogan Byers has much to be proud of
Re: Reading encoder values?

Definitely sounds like a wiring issue. Double check the signal wires for the encoder and the connection to the encoder itself.

Troubleshooting tip: switch the channels of the encoder. Does the encoder reading flip? If so, you may have a bad encoder. If it stays the same after switching the channels, you may have a bad DIO on the RoboRIO.
Reply With Quote
  #3   Spotlight this post!  
Unread 10-11-2016, 17:04
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,555
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: Reading encoder values?

We had a (homemade) encoder disk our rookie year which would only rotate one way; something caught it when going the other way.
__________________

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
  #4   Spotlight this post!  
Unread 13-11-2016, 19:33
Ubspy Ubspy is offline
Registered User
FRC #2335
 
Join Date: Nov 2016
Location: Kansas City
Posts: 3
Ubspy is an unknown quantity at this point
Re: Reading encoder values?

If we use DIO ports 0 and 1 it works fine, but DIO ports 2 and 3 don't seem to work as well.
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 17: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