Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Trouble with spike and camera (http://www.chiefdelphi.com/forums/showthread.php?t=113648)

hasin5 16-02-2013 12:24

Trouble with spike and camera
 
2 Attachment(s)
URGENT
We are a rookie team working on labview for the first time.

We are having trouble with the camera. We managed to get an image from the camera for a few seconds but it is really blurry. After a few seconds, the image just freezes and our camera does not update the image. Is it a problem with our code or our camera?

Also, we are having trouble with the spike. We are using the spike with our pneumatics to activate a piston. I am not sure how to word this but we are using a double solenoid with our spike...
After copying some examples that we found on the internet, we tested it but our spike does not sense any input.

Any help is greatly appreciated.

TogetherSword8 16-02-2013 14:13

Re: Trouble with spike and camera
 
Ok, sorry, but i dont know camera code very well, but i am an expert with solenoid code (it is very simple)

Your problem is that you need to control the solenoid through a relay (spike) or the pneumatics slot on your crio. there is an entire slot (9472) devoted to pneumatics, with a blue connector on top that on the side is labeled relay. Ill find a picture after i post this to help you out.

If you control it through a spike, then you are going to have to use relay in your code.

If you control it through solenoid (which is the 9472 slot) then it is your code, except you choose pneumatics board 1 in the other blue slot in the beginning. and your double solenoid needs to have a case structure. Ill make a code for you and post in here once i am done. It is a simple code, probably will take you 10 minutes since you already know where the solenoids are located.

TogetherSword8 16-02-2013 14:38

Re: Trouble with spike and camera
 
5 Attachment(s)
Here is the coding if you are using the 9472.

The slot third from the left is the 9472 with the connector in it. plug in the two pins into the top part, and your 12 volts (assuming you use 12 volt solenoids, if it is 24, connect the relay part of the solenoid slot to 24) and then the code should work.

If you cant get it to work, post a picture of your wiring and i will tell you what you did wrong.

Mark McLeod 16-02-2013 14:40

Re: Trouble with spike and camera
 
The Spike can only be used to control 12v solenoids.
The Solenoid Breakout can be used for either 12v or 24v solenoids, but you have to choose one voltage. It can't do both voltages at the same time.

The more typical Kit solenoid, like the double Festo, is a 24v solenoid.

Make sure which type you have.

Greg McKaskle 16-02-2013 17:25

Re: Trouble with spike and camera
 
For the camera, you don't mention what kind, but the 206 and M1013 have a black bezel on the front that rotates to focus it. You may try adjusting the size and framerate to lower the network usage.

Greg McKaskle

hasin5 19-02-2013 00:00

Re: Trouble with spike and camera
 
we have an M1013 Camera but it doesnt have a rotational focus on the front.

Greg McKaskle 19-02-2013 04:54

Re: Trouble with spike and camera
 
I don't have access to that camera, but page four of the manual calls the black ring the focus ring and states that it is a manual focus lens. It also says that it is preset and you don't need to adjust it unless the image is blurry.

If you post an image taken with the camera, I can give my opinion as to what is causing the blur.

Greg McKaskle

hasin5 19-02-2013 11:29

Re: Trouble with spike and camera
 
we're not using the 9472 port so we need to set up a relay.... can you help out with that?

Alan Anderson 19-02-2013 13:25

Re: Trouble with spike and camera
 
Quote:

Originally Posted by hasin5 (Post 1236310)
we're not using the 9472 port so we need to set up a relay.... can you help out with that?

There's a built-in LabVIEW example to tell you everything you need to know.

When you launch LabVIEW you should see the "FRC 2013 Getting Started" window. On the left side of that window are a number of tabs. Select the "Support" tab. One of the options is "Find FRC Examples..." Click it, and the example finder will open.

You want the Relay.lvproj example. It's in the "Actuators" subfolder under the "FRC Robotics" folder.

hasin5 19-02-2013 15:20

Re: Trouble with spike and camera
 
Hey, thanks for the great advice. We managed to access the relay file but we don't understand what the "visible" means... can you please elaborate on this?

Alan Anderson 19-02-2013 15:35

Re: Trouble with spike and camera
 
Quote:

Originally Posted by hasin5 (Post 1236465)
...we don't understand what the "visible" means...

I'm sorry, I don't know what you are referring to.

hasin5 19-02-2013 15:37

Re: Trouble with spike and camera
 
In the relay example, with in the case structure, there are two blocks that say visible.... What are those? And if you don't see that... Then what in general is in that case structure? -Its called the property node

Alan Anderson 19-02-2013 15:47

Re: Trouble with spike and camera
 
That case structure is only providing visual feedback on the example's front panel. It plays games with the LED indicator on the picture of the Spike so it can have more than two states. Don't worry about it, and certainly don't copy it to your code.

All you need are the Relay Open and a RefNum Set in Begin.vi, and a RefNum Get and a Relay Set in Teleop.vi (or wherever you need to set the state of the relay).

hasin5 19-02-2013 16:20

Re: Trouble with spike and camera
 
Quote:

Originally Posted by Alan Anderson (Post 1236480)
That case structure is only providing visual feedback on the example's front panel. It plays games with the LED indicator on the picture of the Spike so it can have more than two states. Don't worry about it, and certainly don't copy it to your code.

All you need are the Relay Open and a RefNum Set in Begin.vi, and a RefNum Get and a Relay Set in Teleop.vi (or wherever you need to set the state of the relay).

We would like to be able to set the spike so that it goes forward when we click a button and then it reverses when we release the button. How would we go about programming this?

Mark McLeod 19-02-2013 16:23

Re: Trouble with spike and camera
 
Here's one way, ignore the name given to it.

hasin5 19-02-2013 16:39

Re: Trouble with spike and camera
 
Quote:

Originally Posted by Mark McLeod (Post 1236498)
Here's one way, ignore the name given to it.

How do we create the "Forward" and "Reverse" for the Teleop.vi? We are getting a boolean input and output and we dont know what to replace it with.

Mark McLeod 19-02-2013 16:55

Re: Trouble with spike and camera
 
On the Relay Set, right-click on the input node and choose Create -> Constant
Then break the wire and drag and copy/paste it wherever you need to place it.

hasin5 19-02-2013 17:00

Re: Trouble with spike and camera
 
Quote:

Originally Posted by Greg McKaskle (Post 1236147)
I don't have access to that camera, but page four of the manual calls the black ring the focus ring and states that it is a manual focus lens. It also says that it is preset and you don't need to adjust it unless the image is blurry.

If you post an image taken with the camera, I can give my opinion as to what is causing the blur.

Greg McKaskle



Here is the camera image btw for the person wondering.... It also freezes randomly.

http://www.chiefdelphi.com/forums/at...2&d=1361311627

hasin5 19-02-2013 17:13

Re: Trouble with spike and camera
 
Quote:

Originally Posted by Mark McLeod (Post 1236511)
On the Relay Set, right-click on the input node and choose Create -> Constant
Then break the wire and drag and copy/paste it wherever you need to place it.

It expects us to put a boolean input (its orange - not blue) - therefore, we get an error when we connect it to the relay set.

Mark McLeod 19-02-2013 17:43

Re: Trouble with spike and camera
 
1 Attachment(s)
Start with a new Select and it will have several orange floating-point nodes and one green boolean node.
The first thing wired to an orange node will change all the nodes to that type color.


hasin5 19-02-2013 17:59

Re: Trouble with spike and camera
 
we got the spike working!

now we need help with the camera -> we need to set it up for targetting.

hasin5 19-02-2013 20:05

Re: Trouble with spike and camera
 
We had to restore our camera to factory settings and set it up again. Now it is not blurry, but we can not get an image to appear on the dashboard. Any ideas?

Greg McKaskle 19-02-2013 20:11

Re: Trouble with spike and camera
 
I suspect the data rate on the dashboard is updating and you need to click on the dashboard camera setting and low the frame rate or up the compression until the communication is within the limits the router is imposing.

Greg McKaskle

hasin5 19-02-2013 20:51

Re: Trouble with spike and camera
 
We tried that and it doesn't work..

Greg McKaskle 20-02-2013 07:16

Re: Trouble with spike and camera
 
Help me out with some symptoms, doesn't work isn't much to go on.

I assume you have a custom dashboard. If, open the diagram and probe some of the wires in vision to see what is running and what isn't. In particular, the Camera Read JPEG has an outer case structure, one for simulation, one real. On the real diagram, it reads from the camera and parses the string to convert the JPEG into an image. What is going on there?

If the Mbps indicator is not zero, the camera is talking back but the issue is more likely with the activation of the vision component on that computer. You can use the NI License manager to try and activate it, or you can uninstall the NIVision stuff and reinstall the DS update.

Greg McKaskle


All times are GMT -5. The time now is 22:54.

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