Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate delayed output signals using video feed after image is processed?

The signals must also be delayed as the actuators will initialize after the image is out of the frame. I am relatively new to labview but have automated inspection, vision builder, as well as LABview. I have configured a pass/ fail off of a single image but I am stuck at this point... any tips?

0 Kudos
Message 1 of 15
(5,621 Views)

Hi jalarid,

 

Could you please provide more details on exactly what it is you're trying to set up?

 

1. What hardware are you using to send your output signal?

2. What is this signal delayed relative to? What occurence in your application is triggering an output signal?

3. Is this signal related to the pass/fail of a single image that you already have set up? Is this programmed in LabVIEW or VBAI?

 

If you can give more details on exactly what you're implementing I will be able to give better suggestions.

 

Thanks!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 2 of 15
(5,601 Views)

1. If it is possible I was hoping to use my laptop as part of the system to send the signal... but I was told I could possibly use the cRIO processor we have at school.

2. When a "pass" is achieved I am trying to delay the output enable by a certain amount of pixels that have passed since the image passed out of the region of interest.

3. As of right now I have the image processing set up through a VBAI...

 

Some background I am trying to design a system that can mount to the rear end of a tractor to automate an on farm process. The apparatus will have a camera set up a couple of feet in front of an actuator that needs to be enabled when a certain set of conditions are met. This is also my first time designing a system this complex or using any form of machine vision... I have some basic experience using sensors and programming but nothing this complex. Thank you for your help!

0 Kudos
Message 3 of 15
(5,555 Views)

Hi jalarid,

 

What sort of signal do you need to enable the actuator? Your laptop may be able to be part of the system, but you'll need some hardware that's capable of sending out the right analog or digital signal to the device. If you have a module for the cRIO that can send out the right type of signal, that could work but might require programming in LabVIEW.

 

What type of camera are you using, and how is it being controlled? There are steps in VBAI that can be used to send out signals. For example, Generate Pulse (Vision RIO), Generate Pulse (NI-IMAQ), or Read/Write I/O (NI-DAQmx), which can all be found in the Communicate tab. The function you can use will depend on what hardware you're controlling to send this signal.

 

Should this image be moving at a constant rate? There is a Delay function in the Use Additional Tools that can set a specific time delay before the next step. This would be the simplest way to create a delayed signal. Otherwise, could you give more details on the conditions you're meeting? For example, are you detecting a certain shape or color?

 

Thanks!

 

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 4 of 15
(5,542 Views)

I have done systems similar to this.  We used an encoder to track position.  We recorded the position of the encoder when the image was taken.  If the conditions were satisfied, we added a fixed offset to the encoder position and sent it to a second routine.  This routine would pulse the output when the encoder reached the new position.  This eliminated any issues with changing speeds.

 

This is very easy to do with a cRIO, and not too bad with a PC if the motion is fairly slow.  I don't think I would use Vision Builder, though.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 15
(5,538 Views)

Emily,

 

just for the preliminary processing to see if the program could even distinguish what I wanted too I used a USB 3.0 webcam... is this encoder additional software or hardware that I need or can I do that through Labview and the cRIO processor... depending on how quickly the image can be processed I was hoping to have the MPH of the tractor be anywhere between 1 to 4 mph...

 

the signal I wish to send needs to enable the trasmission of voltage to the actuator.

 

and i modified the camera so that It makes it easier for labview to distinguish plants... anyway when a circle of a certain diameter of can be made from the "brighter" pixels I was hoping that could trigger the delayed EN signal I mentioned earlier.

 

Bruce,

 

Do I need additional software/ hardware to be able to do this or could I do this with just labview or cRIO?

 

but yes I agree that an encoder would probably be a better tool than a timer if there are any fluctuations in speed... field conditions are never perfect!

 

thx alot for your help guys!!

 

Joe

Cal Poly San Luis Obispo

0 Kudos
Message 6 of 15
(5,530 Views)

The encoder is hardware that gives you feedback on the rotation of the wheel.  You would need the encoder and some sort of hardware to read it.  For the cRIO, the 9411 works well.  You might be able to get the speed a different way, by reading a throttle signal, speedometer signal, or some other signal related to speed.  You would also need the ability to output the signal you need, which would probably be a digital output module.  For software, you would need to be able to program the cRIO (or PC if you go that route - you could use cDAQ with it for the modules).  To program a cRIO you need LabVIEW, the RT module and the FPGA module.  Costwise, the PC solution would probably be cheaper.  It would be fairly easy to do on the PC if updating a few times a second is adequate.  If you need msec resolution, the cRIO will probably be necessary.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 15
(5,524 Views)

Hi jalarid,

 

BruceAmmons has some great suggestions. An encoder would be good, but you would need to purchase the encoder and the hardware to read it. You could also measure pixel differences, but that would be more complicated to set up. I think the main thing you need to figure out now is what you'll use to send a signal to the actuator. This will probably need to be a digital output module, but you should look at the specifications of your actuator for more information on what signal is required. Once you have this you could test with a time delay, or using pixel location first to see how well it behaves. If this doesn't fit your specifications, you may also need to buy an encoder and the hardware to read it.

 

Good luck!

Emily C
Applications Engineer
National Instruments
0 Kudos
Message 8 of 15
(5,514 Views)

Bruce do you know how much an encoder as well as the software to read it would cost... as well as how I would go about setting the system up to work simultaneously with labview? Trying to work with the college budget here.

 

Emily, ideally the digital output module would simply enable the current to flow to the solenoids to open the valves of my hydraulically driven system. I am thinking that the current will run right off the alternator of a standard 12v or 24v tractor. I have not designed it yet.. But based off of the hydraulic capabilities of new tractors I am thinking that is the ideal driver for my system... However I am open to suggestions...

 

0 Kudos
Message 9 of 15
(5,498 Views)

The problem with the encoder is attaching it to your wheel.  It needs to rotate with the wheel.  For a tractor, you would need a very large encoder to attach to the axle.  That is why I suggested the possibility of other signals.  If you can tap into an existing signal it will be much easier and cheaper.  A cheap version of an encoder is gluing a magnet or something metal or reflective to a rotating component, then using a sensor to pick up a pulse every time it goes around.  The sensor would depend on the material attached to the rotating component.  This also would be difficult with a tractor because everything would get dirty or broken easily.

 

Software wise, it isn't too bad.  For each image, determine if the output should be on or off.  Based on speed or distance, determine when this should happen in the future.  Queue a message that has the time/distance and on/off state.  In a different loop, read each queued message, wait for that time/distance, and change the output.  You will need to put a time limit on things to prevent infinite waits due to zero velocity and stuff like that.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 10 of 15
(5,492 Views)