Go to Post A winning robot is the better robot, no matter how it was made or how much it cost. - Chris is me [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2017, 11:10
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Encoders aren't working?

We are using the EVO Shifter with [url="http://www.andymark.com/E4T-OEM-Miniature-Optical-Encoder-Kit-p/am-3132.htm"]E4T OEM Optical Encoders[/ur]. We've wired them to DIO 0-3 on the RIO. The power, ground, and A channel are wired to port 0 / 2 and the B channel is wired to port 1 / 3.

In our code, we are using them like this:
Code:
//RobotMap.java init()
rightDriveEncoder = new Encoder( 0, 1 );
Code:
//DriveWithJoystick.java execute()
SmartDashboard.putString("DB/String 0", "" + RobotMap.rightDriveEncoder.getRate() );
However, the dashboard *always* shows 0.0, no matter what we do. We have verified that the encoder is turning. If we change this to display DigitalInput for port 0, it always displays true.

Have we wired it incorrectly or is there something we should be doing in the code?
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2017, 11:17
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Re: Encoders aren't working?

Sorry, link didn't work out. It should be linked here.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-01-2017, 11:39
AustinShalit's Avatar
AustinShalit AustinShalit is offline
Registered User
AKA: אוסטין
no team (WPILib Suite Developer)
 
Join Date: Dec 2013
Rookie Year: 2008
Location: Los Angeles/Worcester/Israel
Posts: 152
AustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of lightAustinShalit is a glorious beacon of light
Re: Encoders aren't working?

Can you please post or PM me your entire robot program?
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 29-01-2017, 12:04
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Re: Encoders aren't working?

https://github.com/FRC-6420/SteamWorks
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2017, 09:11
beijing_strbow beijing_strbow is offline
Registered User
FRC #5968 (Cyborg Indians)
Team Role: Programmer
 
Join Date: Aug 2016
Rookie Year: 2016
Location: Kansas
Posts: 51
beijing_strbow is an unknown quantity at this point
Re: Encoders aren't working?

The encoder initialization in RobotMap is commented out right now (probably intentional, but just in case). Other than that, I would guess it's a wiring issue, because your code seems correct.

Side note: you probably want to check the bandwidth your camera stream uses. A 640x480 stream at 30 fps (I think that's what you have it at) is quite likely to consume too much bandwidth.
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2017, 14:13
MuskieProgramme MuskieProgramme is offline
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Re: Encoders aren't working?

Got to revisit the problem last night, started debugging things with a multimeter... turns out the person who wired the encoders had broken the encoder wire in several places by zip tying it in a bundle. I now have a good story to bring up whenever something's blamed on the programming
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 22:45.

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