Go to Post Scout so that you're not in doubt! - Mark Pettit [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 23-01-2017, 21:34
FRCTeam2906's Avatar
FRCTeam2906 FRCTeam2906 is offline
Registered User
FRC #2906 (Sentinel Prime)
 
Join Date: Aug 2016
Rookie Year: 2008
Location: Spanaway Lake HS-Spanaway, WA
Posts: 10
FRCTeam2906 is an unknown quantity at this point
Encoder questions - using DIO ports

We are attempting to use different encoders through the DIO ports on our roboRIO for both our teleop and auto programs. We have never used these in the past. When we run our code the motor runs without stopping once it reaches the set value. Any help or examples are appreciated.

Thank you,
Team 2906
Reply With Quote
  #2   Spotlight this post!  
Unread 23-01-2017, 21:44
acastagna acastagna is offline
Registered User
FRC #1493
 
Join Date: Jan 2012
Location: Albany High School
Posts: 38
acastagna is an unknown quantity at this point
Re: Encoder questions - using DIO ports

It sounds like you are not setting your motor input back to zero when the target has been reached. You would need to post your code to say for sure.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-01-2017, 14:00
david.e.boles david.e.boles is offline
Bringer of Whales and Petunias
AKA: david476
FRC #5940 (BREAD)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2011
Location: San Francisco, CA
Posts: 30
david.e.boles is on a distinguished road
Re: Encoder questions - using DIO ports

Agreed, assuming you can tell that the encoders are working and being read properly. Code?
Reply With Quote
  #4   Spotlight this post!  
Unread 28-01-2017, 23:53
FRCTeam2906's Avatar
FRCTeam2906 FRCTeam2906 is offline
Registered User
FRC #2906 (Sentinel Prime)
 
Join Date: Aug 2016
Rookie Year: 2008
Location: Spanaway Lake HS-Spanaway, WA
Posts: 10
FRCTeam2906 is an unknown quantity at this point
Re: Encoder questions - using DIO ports

We have attempted to print the encoder values to the drivers station but they always return as 0, does bot matter if the motor is running or not.

Link to code: https://github.com/FRC2906/Practice

Please take a look and see what you can find asap!
Reply With Quote
  #5   Spotlight this post!  
Unread 29-01-2017, 09:05
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Encoder questions - using DIO ports

I don't see where you are outputting the encoder value, at first glance
Reply With Quote
  #6   Spotlight this post!  
Unread 29-01-2017, 13:45
FRCTeam2906's Avatar
FRCTeam2906 FRCTeam2906 is offline
Registered User
FRC #2906 (Sentinel Prime)
 
Join Date: Aug 2016
Rookie Year: 2008
Location: Spanaway Lake HS-Spanaway, WA
Posts: 10
FRCTeam2906 is an unknown quantity at this point
Re: Encoder questions - using DIO ports

I believe that is located on line 136 and 142 of our robot map
Reply With Quote
  #7   Spotlight this post!  
Unread 29-01-2017, 15:37
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Quote:
Originally Posted by FRCTeam2906 View Post
I believe that is located on line 136 and 142 of our robot map


Robot Map is only called once. You should output the data in something called periodically, like a command.
Reply With Quote
  #8   Spotlight this post!  
Unread 30-01-2017, 10:23
FRCTeam2906's Avatar
FRCTeam2906 FRCTeam2906 is offline
Registered User
FRC #2906 (Sentinel Prime)
 
Join Date: Aug 2016
Rookie Year: 2008
Location: Spanaway Lake HS-Spanaway, WA
Posts: 10
FRCTeam2906 is an unknown quantity at this point
Re: Encoder questions - using DIO ports

Ok thanks. So now we can see the values in the smart dashboard but how do we use it? If we want to run an auto command that does something like: "drive strait until the encoder value is gresater than 1000. What would it look like? A while, if or something else?
Reply With Quote
  #9   Spotlight this post!  
Unread 30-01-2017, 11:52
wlogeais wlogeais is offline
Registered User
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2016
Rookie Year: 2011
Location: Minnesota
Posts: 18
wlogeais is an unknown quantity at this point
Re: Encoder questions - using DIO ports

Take a look at File -> new -> Example Robot projects... -> GearsBot.

The relevant code is within the ...team...commands package, namely DriveStraight.java and the team-subsystem methods added to support it.
Reply With Quote
  #10   Spotlight this post!  
Unread 30-01-2017, 12:10
Joey1939's Avatar
Joey1939 Joey1939 is online now
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 143
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: Encoder questions - using DIO ports

Relevant PSA: https://github.com/Open-RIO/.gitignore
__________________


Reply With Quote
  #11   Spotlight this post!  
Unread 30-01-2017, 13:36
bobbysq bobbysq is online now
Registered User
FRC #4646 (Team ASAP)
Team Role: Leadership
 
Join Date: Apr 2016
Rookie Year: 2015
Location: Des Moines, IA
Posts: 326
bobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud ofbobbysq has much to be proud of
Re: Encoder questions - using DIO ports

Quote:
Originally Posted by Joey1939 View Post
Please. It'll keep the size of the repo down, and it'll make committing and pushing take a shorter amount of time since there's not as much to move over.

Unlike that gitignore though, we do keep our IDE files so it's easier to import into other Eclipse instances.
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 13:22.

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