View Single Post
  #1   Spotlight this post!  
Unread 22-02-2010, 11:31
mikeppalmer mikeppalmer is offline
Registered User
FRC #1798
 
Join Date: Dec 2007
Location: Tucson, Arizona
Posts: 3
mikeppalmer is an unknown quantity at this point
Using Interrupts or DMA or timing to control digital I/O switch

Task:

We are trying to kick a ball with a revolving drum, driven by a toughbox from andymark and a CIM motor. We are using an Allied Electronics Infrared Optical Switch as a digital I/O. This I/O has a resolution of about 1ms pulses.

Problem:

We have written code to stop our Jaguar driving the CIM / toughbox when the beam of light is detected. Note: There is a hole in our drum for the light to pass through.

What Happens:

When we run the code, we are seeing that the switch is detected every other rotation of our drum. So it seems that lab view is running to slow to accurately pick it up.

The way our code works is, there are two routines in tele-op. One to fire, which is a button press and a set motor value to the jaguar. The second routine is to reposition, which is currently driven by a button press, with a series of case structures.

Any recommendations will be helpful. I can post our code in a few hours.
Any ideas would be helpful.

Another quick question.... is there a way to use labview to set a flag. Say, I want a button press, to turn a switch "on" and then a routine would run, and another boolean var, like a digital I/O or switch would turn off this routine.

Thanks in advance for your help!
Reply With Quote