View Full Version : Trouble with spike and camera
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
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
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
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
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
we have an M1013 Camera but it doesnt have a rotational focus on the front.
Greg McKaskle
19-02-2013, 04:54
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
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
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.
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
...we don't understand what the "visible" means...
I'm sorry, I don't know what you are referring to.
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
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).
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
Here's one way, ignore the name given to it.
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/RelaySolenoidExample.jpg
Here's one way, ignore the name given to it.
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/RelaySolenoidExample.jpg
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
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.
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/attachment.php?attachmentid=14122&d=1361311627
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
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.
http://www.chiefdelphi.com/forums/data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHcAAADeCAIAAAC ISAj7AAAGHElEQVR4nO2cUZLjKgxFWd3bVm9w9sT7iBMwSAJju GBzT7kyHgpLcEyApJM4T8bjZjdgC2gZAS0joGUEtIyAlhHQMgJ aRkDLCJ5t2Q2mWzt7BZqCc877UQctH9Aygp/l7JmuWVvY8n8K3nvnEEeN5aLQR1qGKb5jOR7aRqF+V6Za7pW+S L3lfMawVcaFK1rulbuGO2M58Z7fknUtt+SI9p5X96E3LRuF61o uhwvDJJSI57XtGzYvi3XmW476Fh6zPqfnlZa1Ra/S8s1jFctRx+T+5236lMSjOx/p5/rCvqJoeSg1cmqoDRSbzc+9aTkpsbNkN88+uomQGoO1LA6u+rFs 1BFzaamlyi+17JV5uZdlO7WYYhCTLevV2le/ttQ7WvZzdnKjWNdyd2gZQZvl+PnUvFGbY3nicUlEsiRoy3JFr2 nZFJEsBsZSYfYa/qpkTQwR4ianeFVDtapQvQJN4VUzxrJcXf3sqyqDN/BOy6sFp2VEcFpGBKdlRHBaRgSnZURwWkYEf7zloXRrZ69AxICW EdAyAlpGQMsIaBkBLSOgZQS0jICWEdAyAlpGQMsIaBkBLSOgZQ S0jICWEdAyAlpGQMsIaBkBLSOgZQS0jICWEdAyAlpGQMsIHmn5 KR/1DA3uHh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JDfowGD4q5DpDiIhvk92jA0+kTE1 2a/v0vB/B6NAeSYTjxjgP0eDYBlmkvy0gOdHZxvIlP8HqmnZN0NWkZAywi qLPOH5W7SbtkDv3b5dBotj27Wj30tj25TzKaWW3JEG9Wrm9YdL ZfDhXe8Qol4Xtu+3SyHa1x4PMWShFZa1ha9vSyHC5T+5wY/JfHozkf6ub6wr9jIsvcns/m5Ny0nJXaW7OZtY1kcXPVj2agj5tJSP5fLlr0yL/eybKd+KC2W9Wrtq9/N1IvT07LnTk6hs+Xu0DKC7SxPPJ4OLSN4fg+eAC0joGUEtIyAl hHQMgJaRkDLCGgZAS0joGUEtIyAlhHQMgJaRkDLCGgZwf+b+TD VXhr7YAAAAABJRU5ErkJggg==
we got the spike working!
now we need help with the camera -> we need to set it up for targetting.
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
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
We tried that and it doesn't work..
Greg McKaskle
20-02-2013, 07:16
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
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.