Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   solenoid with compressor vi (http://www.chiefdelphi.com/forums/showthread.php?t=81548)

Mark McLeod 07-02-2010 10:09

Re: solenoid with compressor vi
 
The pressure switch is built in to the Compressor vi.
On the Compressor Open, one of the inputs is a constant that specifies the DIO of the pressure switch.

In Begin.vi you should both Open & Start the compressor.

Here's an example.

kws4000 09-02-2010 16:14

Re: solenoid with compressor vi
 
Just a question pertaining to loops, which may have something to do with soleoids: wouldn't putting loops with "waituntil millisecond" control into the TELEOP subvi cause everything above it run slow, because it is already stuck inside a while loop on the Robot Main? :confused: A NI rep told me that loops run only as quickly as the slowest object inside them, wheter waiting for an answer or a timer.

Any facts here, with a diagram?

Thanks

Ziaholic 09-02-2010 16:28

Re: solenoid with compressor vi
 
Quote:

Originally Posted by kws4000 (Post 916493)
Just a question pertaining to loops, which may have something to do with soleoids: wouldn't putting loops with "waituntil millisecond" control into the TELEOP subvi cause everything above it run slow, because it is already stuck inside a while loop on the Robot Main? :confused: A NI rep told me that loops run only as quickly as the slowest object inside them, wheter waiting for an answer or a timer.

Any facts here, with a diagram?

Thanks

Yes, however, I'm not sure your question belongs in this thread ...

Putting a WAIT for anything more than 20msec will cause your Teleop watchdog to starve ... there's a relatively new thread in here that shows a way to put a 1-second wait into a state machine so you don't have to stall your Teleop. It involves the use of shift registers to employ some loop-to-loop memory so you can pick a time to exit without specifically "waiting" for that time to elapse. Here's a link ... there's a diagram in the last post ...

http://www.chiefdelphi.com/forums/sh...ad.php?t=82255

kws4000 09-02-2010 17:20

Re: solenoid with compressor vi
 
Thanks, I think.

Programming is hard! :yikes:

Greg McKaskle 09-02-2010 17:20

Re: solenoid with compressor vi
 
The NI Rep is correct. Stated differently, a loop in any of the languages in FRC will not begin again until everything in it has completed. In LV, some things in the loop are sequenced, and others can run in parallel, so the loop waits for the last element to finish.

If you want to run something inside teleop loop, such as was done in the other thread that counted for one second, use either a shift register or a feedback node to remember when the valve was opened, compare for each teleop and close when time and other conditions are right. If you want more precise timing, you can move it to a purely timed loop that isn't synched to the DS.

Greg McKaskle

kws4000 09-02-2010 17:55

Re: solenoid with compressor vi
 
go to LabView Question http://www.chiefdelphi.com/forums/sh...ad.php?t=82255 , post #8. find image of where I am at in solenoid programming, teleop subvi
solenoids are looped together to act at the same time(both side of 2 end 24v Festo) and then return

kws4000 10-02-2010 15:13

Re: solenoid with compressor vi
 
Hey,
Go to "LabVIEW Question", they answered me just fine.

Programming has so many ways of doing the same thing :yikes:

umangv620 12-02-2010 21:09

Re: solenoid with compressor vi
 
Quote:

Originally Posted by Mark McLeod (Post 915024)
The pressure switch is built in to the Compressor vi.
On the Compressor Open, one of the inputs is a constant that specifies the DIO of the pressure switch.

In Begin.vi you should both Open & Start the compressor.

Here's an example.

I got the air compressor working(compressor opens and starts in begin.vi), but it doesnt stop after reaching 120 psi.
In my code, i have the compressor get enabled state, in which i have a case structure connected to the the "enabled state" of the vi. If it is true, i turn the spike off, and if it is false, i turn the spike on.
Since when its true, the pressure switch should be closed, meaning that there is enough air in the pressure tank and that i need to stop air from going in, right?

However when deploying, the compressor does not stop. Am i doing something wrong?

Mark McLeod 13-02-2010 09:06

Re: solenoid with compressor vi
 
Quote:

Originally Posted by umangv620 (Post 918926)
In my code, i have the compressor get enabled state, in which i have a case structure connected to the the "enabled state" of the vi. If it is true, i turn the spike off, and if it is false, i turn the spike on.
Since when its true, the pressure switch should be closed, meaning that there is enough air in the pressure tank and that i need to stop air from going in, right?

However when deploying, the compressor does not stop. Am i doing something wrong?

You shouldn't be doing any of that. It interferes with the Compressor task.
The Compressor Start is running in the background watching the pressure switch and turning the Spike on & off.

You shouldn't have any code that tpuches the Relay or the DIO that the Compressor is now using.

Remove all that from Enabled State on.

umangv620 13-02-2010 12:18

Re: solenoid with compressor vi
 
Quote:

Originally Posted by Mark McLeod (Post 919145)
You shouldn't be doing any of that. It interferes with the Compressor task.
The Compressor Start is running in the background watching the pressure switch and turning the Spike on & off.

You shouldn't have any code that tpuches the Relay or the DIO that the Compressor is now using.

Remove all that from Enabled State on.

Ok, I removed that code. The only Air Compressor code I have opens it and starts it in the begin.vi and closes it in the finish.vi.
However, the pressure switch does not turn the spike on and off. The LED status was green for the duration of the air pumping.

On a sidenote, teleop keeps switching from teleop enabled to disabled. I have no clue what is causing this, and i wonder if it is affecting my deployment.

Edit: So we have confirmed that the Pressure Switch is working, but the spike is not turning off since the led next to relay 1 is green the entire time. Is this a programming error or what? Screenshots would help alot.

Mark McLeod 13-02-2010 14:00

Re: solenoid with compressor vi
 
The problem can be with the Pressure Switch or the code.
One test is to unplug the pressure switch while the compressor is running. If the Relay light goes out, then you have a bad pressure switch. If the Relay keeps going green, then I'd suspect a code problem.
Since the Spike is doing what the Digital Sidecar Relay LEDs are doing, then the wiring for that is working fine.

umangv620 13-02-2010 14:22

Re: solenoid with compressor vi
 
We unplugged the pressure switch while the compressor was running and the LED remained green, so it was a code problem?
I attached my Begin.vi, Robot Main.vi and Teleop.vi. Is the code wrong? The Spike, Compressor, and the Pressure Switch is apparently connected correctly.

Edit: Will upload code asap.... the Screenshots are too big for this forum.
Begin+Robot Main:
Teleop:

Mark McLeod 13-02-2010 17:31

Re: solenoid with compressor vi
 
Quote:

Originally Posted by umangv620 (Post 919365)
Edit: Will upload code asap.... the Screenshots are too big for this forum.

If you .zip them the forum accepts larger size .zip files.
Make sure they're jpegs.

umangv620 13-02-2010 18:09

Re: solenoid with compressor vi
 
Well, what is wrong with our code? Do you need to see anything else?
Problem: Joysticks dont work(will explain this later) and Air Compressor does not shut off(Spike doesnt turn off) after the pressure switch opens(its normally closed, and it does open after it reaches about 120 psi)

For Joysticks:
Joystick 1 sends a signal to the both jaguars and they go in opposite directions(1 Jaguar is green, the other is blinking red).
Joystick 2 randomly sends a signal to the jaguar on the right(usually orange, randomly goes blinking red or blinking green).

With the lightbulb on, We have confirmed that pushing joystick 1 forward and not pushing joystick 2 gives the value of -1 and 0 respectively. It works vice versa also. So there is a screw-up somewhere in tank drive where the signals get mixed together or something.

Mark McLeod 13-02-2010 18:20

Re: solenoid with compressor vi
 
I'd need to see your code to help much, but I don't see anything.
Are you using imageshack or something like that?
Those sites get block by our school and there's not even an indication that there is a picture in any of your posts.

Someone else will have to help with this problem...

P.S. When I get home I'll be able to see what you posted. That is if they ever let me out of this shop...


All times are GMT -5. The time now is 01:33.

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