Go to Post If there are no top tier teams, then who do we look up to for inspiration? - artdutra04 [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 07-02-2010, 06:43
LinuxArchitect LinuxArchitect is offline
Registered User
AKA: George Boyce
FRC #0053 (Cow Abductors)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Greenbelt MD
Posts: 78
LinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to all
sensor interrupts for kick mechanism

Can someone point me to sample code for using interrupts rather than polling sensor inputs, expecially in labview? Or is there VI code that I can't find for supporting something like a force sensor to detect touches? I assume I need to use the Interrupt open/wait/close VIs but I'd love to see an example of how to fit them into the existing framework.

How are other teams implementing a sensor for knowing a ball is in position for their kicking mechanism?
  #2   Spotlight this post!  
Unread 07-02-2010, 10:05
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,753
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: sensor interrupts for kick mechanism

I think what you are asking for is an asynchronous notification that a trigger condition has occurred. While this could technically be done as interrupts, it most likely doesn't need to be, and is far more extensible if done differently.

I'll discuss the slower and safer approach first, then I'll tell you what I know about the interrupt capabilities.

If you are looking for ball contact, you can probably use a periodic loop to poll either a digital or analog. You should find lower overhead with preregistering the analog trigger values and simply reading the state of the trigger -- the FPGA will do the level comparison for you.

Anyway, you can set up an independent polling loop using either a regular LV loop with a wait of say 5ms, or you can use a Timed loop. If using the timed loop you can even specify a timing source such as the microsecond clock. Be sure to measure the overhead of reading trigger state, digitals, and the like as if you set up the polling loop to run too quickly, you'll use lots of CPU. Again, my guess is that a trigger poll of 5 to 20ms is probably plenty fast and will cost very little in CPU. To communicate the poll results back to the rest of the program such as the teleop, you can use a simple global, an RT FIFO, etc.

To actually use interrupts, the LV Utilities palette contains an Interrupt Open, Wait, and Close. Wire up the appropriate device references and trigger conditions. I couldn't find an example showing the interrupt usage, but it didn't look that difficult. Make a loop that Waits for the interrupt and it seems like it will return each time the FPGA raises the interrupt or when the timeout occurs. From what I read, you should definitely read the documentation so that you can control the program reset, otherwise you may wind up locking things up from time to time.

Ask more detailed questions if needed.
Greg McKaskle
  #3   Spotlight this post!  
Unread 07-02-2010, 11:00
LinuxArchitect LinuxArchitect is offline
Registered User
AKA: George Boyce
FRC #0053 (Cow Abductors)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Greenbelt MD
Posts: 78
LinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to allLinuxArchitect is a name known to all
Re: sensor interrupts for kick mechanism

I think using an analog trigger is the answer. I had seen the example but forgot about it. Thanks for the reminder!
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
Interrupts, Interrupts, and more Interrupts! dcbrown Programming 14 06-03-2008 23:12
Cable for forklift mechanism scottcook Technical Discussion 8 19-01-2008 13:51
White Paper Discuss: Interrupts for Dummies CD47-Bot Extra Discussion 5 29-01-2005 03:24
Hints for the Edu Interrupts JimWright949 Programming 0 02-12-2003 02:01
Sensor or no Sensor For Autonomous mode Kyle1010 Programming 14 22-01-2003 13:10


All times are GMT -5. The time now is 21:24.

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