FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

STUPID AXIS Camera

ok guys,

I got pretty much the entire program written and it was working beautifully.  Then I came back the next day to make sure everything was a go, my camera wasnt working.  The green light is on and i have tried resetting it.  there is no picture on my front panel therefore my code wont work.  I tried using the setup axis camera icon and it said it was successful.  So i plugged it back in.  still no image on the front panel.  I reset the camera. nothing.  Plz help me resolve this issue.

Also, how do i run a motor for a certain time?

also i think one of my jaguars is broken. the light comes on but the motor wont turn. i know its not then motor. any suggestions?

0 Kudos
Message 1 of 5
(9,863 Views)

Please remember that FIRST promotes "Gracious Professionalism"; you're more likely to get a helpful answer if you avoid using "STUPID" as the first word in your post.

It's possible for a Jaguar to fail; if you can swap in a different Jaguar and everything works then the Jaguar is probably the problem.  Before you do that, though, check your wiring and make sure you haven't accidentally cut or disconnected one of the wires to your motor.  Maybe you just have a loose connection.

In general if you want to run a motor for a limited amount of time, use a shift register inside a while loop.  When you first turn on the motor, write the current millisecond timer value to the shift register.  Each following time through the loop subtract the shift register value from the current timer value and compare that difference (using Less Than or Greater Than) to the amount of time for which you want the motor on.  You can wire the boolean output of Less Than directly to your motor on/off function.  If that doesn't make sense, post your code with your attempt.

I don't have any experience with the camera, so no ideas there.  The only thing that's coming to mind is that if you're using the basic robot framework, perhaps the "Enable Vision" switch on the front panel is off (the default position).  If you'll be using the camera all the time, you may want to turn on the switch and make on the default by right-clicking on the switch and choosing Data Operations -> Make Current Value Default.  Good luck!

0 Kudos
Message 2 of 5
(3,087 Views)

Okay,

SOrry about the header, i was just very frustrated.

I think i did this right.  Eventually what  I want to do is wire this to make it controlled by a button.  Tell me what you think.

0 Kudos
Message 3 of 5
(3,087 Views)

Your timer VI doesn't look like it will work the way you want; did you test it?  You can test many VIs without needing to connect to your control system.  Remove the motor control functions from your VI and put an indicator on the front panel that shows if the motor is on or off, then run it.  Before running you'll probably need to right-click in the lower left corner of your block diagram window and choose "Main Application Instance" so that your VI will run on your computer and not on the cRIO.

You should use the Tick Count function to determine the elapsed time, rather than using loop iterations.  You'll probably want to make this a subVI (a function inside of your overall program), so you should open and close the motor reference outside of the timer VI and pass the motor reference into it.  Better yet, don't put any of the motor functions in your subVI to make testing easier.  Instead, when you place this VI as a subVI, connect your output indicator to the motor on/off function.  If you place this VI as a subVI inside a larger loop, you'll need to change your timer so that the while loop only executes once per call (connect a constant true to the while loop stop condition).  Don't wire an initial value to the shift register outside the loop so that the shift register will keep the same value from one call to the next; this is known as an "uninitialized shift register" and is a key LabVIEW concept.

You don't need a case structure; the Select function (in the Comparison palette) should be sufficient for your Timer.

0 Kudos
Message 4 of 5
(3,087 Views)

Did you get your timer working?  Here's one possible implementation, along with a simple VI to test it.

Timer.png

Download All
0 Kudos
Message 5 of 5
(3,087 Views)