OCCRA
Go to Post Between reading the Manual, Q&A, Team Updates, the Blog, and Chief Delphi, you can be one of the most valuable members of any team. - Gregor [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 12-03-2008, 01:04 AM
Nameless Nameless is offline
Registered User
FRC #0074
 
Join Date: May 2008
Location: Holland, MI
Posts: 4
Nameless is an unknown quantity at this point
Interrupt on driver station digital input

Is it possible to attach an interrupt to a digital input on the driver station? I would like to use an encoder as an input device, and I don't believe there is any other way use them than with interrupts. I looked through the WPILib beta 5 code and didn't see anything about driver station interrupts in DriverStation.h/cpp and FRCComm.h.

If this isn't possible, I'm considering using a microprocessor to take in the encoder readings, keep track of the encoder offset, and output that as a PWM signal to the driver station analog input. For example, if the encoder is turned halfway around, the microprocessor would send a 50% PWM to the driver station. Would this work correctly? Also, does the driver station have a power source I could use? (As I understand it, external power is not allowed.)

For the visual people:
  #2   Spotlight this post!  
Unread 12-03-2008, 07:35 AM
Kevin Sevcik's Avatar
Kevin Sevcik Kevin Sevcik is offline
(Insert witty comment here)
FRC #0057 (The Leopards)
Team Role: Mentor
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Houston, Texas
Posts: 4,146
Kevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond reputeKevin Sevcik has a reputation beyond repute
Send a message via AIM to Kevin Sevcik Send a message via Yahoo to Kevin Sevcik
Re: Interrupt on driver station digital input

You can't interrupt on the digital inputs on the DS. If you're using a very coarse encoder (4-8 cycles per revolution) you might be able to manage it by simply sampling it every data packet from the DS... If it isn't turned too fast.

That said, if you're only interested in the angular position of the encoder is there any reason you can't use a plain old potentiometer to do this? There's stopless potentiometers if you need it to roll over, or multi-turn ones if you need a couple of turns. Expending all that effort to turn an encoder into just a potentiometer seems a little... excessive.
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.

Lone Star Regional Troubleshooter
  #3   Spotlight this post!  
Unread 12-03-2008, 09:07 AM
EricVanWyk EricVanWyk is offline
Registered User
no team
 
Join Date: Jan 2007
Rookie Year: 2000
Location: Boston
Posts: 1,597
EricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond reputeEricVanWyk has a reputation beyond repute
Send a message via AIM to EricVanWyk
Re: Interrupt on driver station digital input

Quote:
Originally Posted by Nameless View Post
Is it possible to attach an interrupt to a digital input on the driver station? I would like to use an encoder as an input device, and I don't believe there is any other way use them than with interrupts. I looked through the WPILib beta 5 code and didn't see anything about driver station interrupts in DriverStation.h/cpp and FRCComm.h.

If this isn't possible, I'm considering using a microprocessor to take in the encoder readings, keep track of the encoder offset, and output that as a PWM signal to the driver station analog input. For example, if the encoder is turned halfway around, the microprocessor would send a 50% PWM to the driver station. Would this work correctly? Also, does the driver station have a power source I could use? (As I understand it, external power is not allowed.)

For the visual people:

You would have to put a low pass filter on your PWM signal for the analog input to read it properly. If you post the specific frequency you will be duty cycle modulating, we can help you design the filter. It won't be much more than an RC network or two.

There is a 5V power supply on the DS that you can use, it is set up just like the DSC.
  #4   Spotlight this post!  
Unread 12-03-2008, 09:51 AM
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,304
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Interrupt on driver station digital input

I'd transplant the encoder out of a USB joystick into the mechanical controls, while keeping the encoder attached electrically to the original processing hardware.

Last edited by Tom Bottiglieri : 12-03-2008 at 09:53 AM.
  #5   Spotlight this post!  
Unread 12-03-2008, 10:12 AM
Tom Line's Avatar
Tom Line Tom Line is offline
Don't lay blame. Fix probems.
FRC #1718 (The Fighting Pi)
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1999
Location: Armada, Michigan
Posts: 3,104
Tom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond reputeTom Line has a reputation beyond repute
Re: Interrupt on driver station digital input

Has anyone cracked open the Attack 3's? We've drilled them to mount them, but we didn't break them open. Is the "thumb wheel" on the base an encoder, or a potentiometer?
  #6   Spotlight this post!  
Unread 12-03-2008, 10:48 AM
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,977
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: Interrupt on driver station digital input

You can also buy encoders with an analog interface, like the US Digital MA3. http://www.usdigital.com/products/en...ary/shaft/ma3/
  #7   Spotlight this post!  
Unread 12-03-2008, 05:54 PM
willson.thomas willson.thomas is offline
Registered User
FRC #1595
 
Join Date: Feb 2008
Location: Spokane, WA
Posts: 50
willson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nicewillson.thomas is just really nice
Re: Interrupt on driver station digital input

Quote:
Originally Posted by Nameless View Post
Is it possible to attach an interrupt to a digital input on the driver station? I would like to use an encoder as an input device, and I don't believe there is any other way use them than with interrupts. I looked through the WPILib beta 5 code and didn't see anything about driver station interrupts in DriverStation.h/cpp and FRCComm.h.

If this isn't possible, I'm considering using a microprocessor to take in the encoder readings, keep track of the encoder offset, and output that as a PWM signal to the driver station analog input. For example, if the encoder is turned halfway around, the microprocessor would send a 50% PWM to the driver station. Would this work correctly? Also, does the driver station have a power source I could use? (As I understand it, external power is not allowed.)
Have we been allowed to create custom processing circuits and attach them to the OI in past years?

Quote:
Portable computing devices
must not be connected to joystick input ports on the Operator Interface.
Where do they draw the line?
__________________
Team Leader
Team 1595
  #8   Spotlight this post!  
Unread 12-03-2008, 11:03 PM
Nameless Nameless is offline
Registered User
FRC #0074
 
Join Date: May 2008
Location: Holland, MI
Posts: 4
Nameless is an unknown quantity at this point
Re: Interrupt on driver station digital input

Ah, my fear was right about the lack of interrupts. Thanks for the ideas, everyone. I didn't know about the 'portable computing devices' rule, and that definitely invalidates my workaround idea.

However, the stopless potentiometers and analog/absolute encoders look interesting. I've heard of stopless potentiometers before... do they come that way, or do they have to be modified to become limitless?
  #9   Spotlight this post!  
Unread 12-04-2008, 07:31 AM
Ken Streeter's Avatar
Ken Streeter Ken Streeter is offline
Let the MAYHEM begin!
FRC #1519 (Mechanical Mayhem)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Team: Milford, NH; Me: Bedford, NH
Posts: 508
Ken Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond reputeKen Streeter has a reputation beyond repute
Re: Interrupt on driver station digital input

Quote:
Originally Posted by Joe Ross View Post
You can also buy encoders with an analog interface, like the US Digital MA3. http://www.usdigital.com/products/en...ary/shaft/ma3/
Our team used the US Digital MA2 and MA3 on the robot each of the past two years with excellent results. They are small, extremely accurate, reliable, durable, and have no "dead spot" like a stopless potentiometer. I would highly recommend these for applications where "continuous rotation" is needed.

That said, I have never used the MA2 or MA3 on a Driver Station, but they should work just fine!
__________________
Ken Streeter - Team 1519 - Mechanical Mayhem (Milford Area Youth Homeschoolers Enriching Minds)
2015 NE District Winners with 195 & 2067, 125 & 1786, 230 & 4908, and 95 & 1307
2013 World Finalists & Archimedes Division Winners with 33 & 469
2013 & 2012 North Carolina Regional Winners with teams 435 & 4828 and 1311 & 2642
2011, 2010, 2006 Granite State Regional Winners with teams 175 & 176, 1073 & 1058, and 1276 & 133
Team 1519 Video Gallery - including Chairman's Video, and the infamous "Speed Racer!"
  #10   Spotlight this post!  
Unread 12-04-2008, 03:55 PM
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 6,041
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: Interrupt on driver station digital input

Quote:
Originally Posted by Joe Ross View Post
You can also buy encoders with an analog interface, like the US Digital MA3. http://www.usdigital.com/products/en...ary/shaft/ma3/
I agree, whatever you were trying to do with an incremental encoder on the controls side could probably be done with an absolute encoder with an analog output, or probably even a continuous pot.

I imagine the code would be simple enough to just check the value each cycle and compare it to previous to get the "distance traveled".

Big Caveat, It's been forever since I really sat down and programmed.
__________________
2x1 and 2x2 1/16" wall tubing for sale!

Need help? Check out 973 Remote Assistance and Mentorship Program.

2017 "World Champions"
2014 Galileo Champions
2011 World Champions
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Securing the Driver Station? Madison FRC Control System 16 12-16-2008 02:05 AM
driver station doesn't see robot nickmagus Programming 4 11-29-2008 10:58 PM
2009 Driver Station Dimensions noxryan FRC Control System 5 11-27-2008 08:02 PM
pic: The new driver station Billfred Extra Discussion 28 04-23-2008 07:07 PM
size of driver playing station 663.keith Technical Discussion 1 01-11-2005 12:23 PM


All times are GMT -5. The time now is 01:00 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi