LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt Request

 
It is Noah Yang of Texas A&M studying under Dr. Zourntos for Senior Design class(ELEN405).  I have couple of questions about Interrupt Request(IRQ) as we embark working on the brain.
The board we are given is a PCI-7831R, so we would have them in the PC to program and then we can have it startup running the program that we  develop when it gets power.  we can then provide the 5V to the board and it will work on the robot. We need some more specific way to do that.
According to the FPGA Module Training Website at

[broken link removed]

If you see the Lesson 6 Powerpoint slide, there is some explanation about generating a physical interrupt FROM FPGA TO THE HOST.
Unfortunately, we will attach our brain(PCI-7831R) on the autonomous robot, not in the pc, but we would have it in the pc when programming, hence I don't think we will have Host VI for the window/pc unless we test the the brain of the robot by monitoring its operation on pc.
We hope that MAIN PROGRAM(running to the beacon target) in the FPGA VI should Acknowledge the interrupt(obstacle detection, avoidance, jump back to the main program) from the FPGA VI, itself. And then, FPGA can wait for interrupt to be acknowledged. Lastly, IRQ is cleared by the FPGA.
If that is impossible to have WAIT ON IRQ in the FPGA VI without a HOST VI, I wish to learn how to build our own code(from the scratch) acting like this kind of IRQ as an alternative.
 
For the reference, our brief algorithm is followed.
==========================================================================
MAIN PROGRAM:
  *rushing to the target(signaling 5kHz sound) based on Microphone sensor.
  *Interrupt 1 (When Obstacle is detected at 2 feet away)
  *Interrupt 2 (crash, when bumper sensor is rising edge triggered)
  *End the program when the robot gets to the target
--------------------------------------------------------------------------
INTERRUPT 1:
   *stop
   *Select direction by comparison of two voltage from two Ultrasonic
    sensors
   *turn until both sensors have above-threshold voltage
   *go straight 2.5 feet
   *return to the begining of the MAIN PROGRAM
--------------------------------------------------------------------------
INTERRUPT 2:
   *stop
   *step back by 1 feet
   *choose direction
   *return to the main program
--------------------------------------------------------------------------
==========================================================================

Thanks.
Noah

-----------------------------------------------------------
Noah Haewoong Yang
Electrical Engineering
Dwight College of Engineering
Texas A&M University
801 Spring Loop 2506
College Station, TX 77840
Tel: 979-997-1145
AIM: maroonsox12
I am the proudest member of Fightin' Texas Aggie Class of 05. WHOOP!
-----------------------------------------------------------
0 Kudos
Message 1 of 2
(3,561 Views)

Hi Noah,

Your best bet here sounds like a state machine based architecture, which will allow your FPGA VI to handle the various conditions internally, without need to generate an external interrupt.  IRQ's in the context of a LabVIEW program are sent from the FPGA to a Windows or Real Time host VI, where it is processed by the operating system and sent to the VI for processing.  If the only control hardware on your robot is the FPGA board, then you won't need to explicitly generate these interrupts since there would be no computer with an operating system to receive them.  Instead, if you have a state machine architecture (case structure inside a while loop, with a different case for each state and a shift register to store the next state), you can have the FPGA VI handle everything internally. 

While we cannot develop your code for you, the basic structure for your algorithm could be as follows:

Move state- move towards target and check sensors for obstacle.  If no obstacle, next state is move state.  If obstacle 2 feet away, next state is Obstacle.  If crash, next state is Crash.  If target reached, next state is end.

Obstacle state- handle interrupt 1 code from algorithm (this will require multiple states).  When done, set next state back to the move state

Crash state - handle interrupt 2 code (may require multiple states).  Next state is move state.

End state - Done.

Of course, this is a highly simplified example, but you can see the basic structure.  There are many examples of using a state machine architecture, including a design template that comes with LabVIEW that you can modify to suit your needs. 

Cheers,

Matt Pollock
National Instruments
Message 2 of 2
(3,538 Views)